@cntrl-site/components 1.0.84 → 1.0.85

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.
Files changed (3) hide show
  1. package/dist/index.js +40 -40
  2. package/dist/index.mjs +5433 -5410
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),ai=require("react-dom");function Ep(e){return e.type==="object"&&e.version===1}const Mp="ControlSlider-module__wrapper___sHEkd",Ap="ControlSlider-module__hoverArrow___A-dOH",Fp="ControlSlider-module__sliderItem___QQSkR",Np="ControlSlider-module__sliderImage___9hRl-",_p="ControlSlider-module__arrow___05ghY",Wp="ControlSlider-module__arrowVertical___tBfVN",Hp="ControlSlider-module__nextArrow___-30Yc",Op="ControlSlider-module__arrowInner___aEra3",Dp="ControlSlider-module__arrowIcon___S4ztF",zp="ControlSlider-module__arrowImg___2dwJW",Bp="ControlSlider-module__mirror___brd6U",jp="ControlSlider-module__pagination___bicLF",Vp="ControlSlider-module__paginationInner___bT-P-",Gp="ControlSlider-module__paginationVertical___zYqKw",Xp="ControlSlider-module__paginationItem___nTRbk",qp="ControlSlider-module__dot___p1Qun",Up="ControlSlider-module__activeDot___LHFaj",Yp="ControlSlider-module__paginationInsideBottom___R3FWn",Kp="ControlSlider-module__paginationInsideTop___V-qb-",Zp="ControlSlider-module__paginationOutsideBottom___14w8D",Jp="ControlSlider-module__paginationOutsideTop___SCLqB",Qp="ControlSlider-module__paginationInsideLeft___yOBRZ",em="ControlSlider-module__paginationInsideRight___Rtt3o",tm="ControlSlider-module__paginationOutsideLeft___lahaw",nm="ControlSlider-module__paginationOutsideRight___EtuQa",im="ControlSlider-module__imgWrapper___UjEgB",om="ControlSlider-module__captionBlock___dJ6-j",rm="ControlSlider-module__captionTextWrapper___HFlpf",am="ControlSlider-module__captionText___uGBVc",sm="ControlSlider-module__active___WZK4G",lm="ControlSlider-module__withPointerEvents___t-18M",cm="ControlSlider-module__topLeftAlignment___zjnGM",dm="ControlSlider-module__topCenterAlignment___gD1xW",um="ControlSlider-module__topRightAlignment___NMapS",pm="ControlSlider-module__middleLeftAlignment___OnUrY",mm="ControlSlider-module__middleCenterAlignment___Tdkl0",gm="ControlSlider-module__middleRightAlignment___wEbfX",hm="ControlSlider-module__bottomLeftAlignment___cTP2-",fm="ControlSlider-module__bottomCenterAlignment___c54fB",ym="ControlSlider-module__bottomRightAlignment___kEwrz",vm="ControlSlider-module__clickOverlay___DZA28",xm="ControlSlider-module__contain___pLyq7",bm="ControlSlider-module__cover___KdDat",$t={wrapper:Mp,hoverArrow:Ap,sliderItem:Fp,sliderImage:Np,arrow:_p,arrowVertical:Wp,nextArrow:Hp,arrowInner:Op,arrowIcon:Dp,arrowImg:zp,mirror:Bp,pagination:jp,paginationInner:Vp,paginationVertical:Gp,paginationItem:Xp,dot:qp,activeDot:Up,paginationInsideBottom:Yp,paginationInsideTop:Kp,paginationOutsideBottom:Zp,paginationOutsideTop:Jp,paginationInsideLeft:Qp,paginationInsideRight:em,paginationOutsideLeft:tm,paginationOutsideRight:nm,imgWrapper:im,captionBlock:om,captionTextWrapper:rm,captionText:am,active:sm,withPointerEvents:lm,topLeftAlignment:cm,topCenterAlignment:dm,topRightAlignment:um,middleLeftAlignment:pm,middleCenterAlignment:mm,middleRightAlignment:gm,bottomLeftAlignment:hm,bottomCenterAlignment:fm,bottomRightAlignment:ym,clickOverlay:vm,contain:xm,cover:bm};function Sm(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&&Sm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var _l="(prefers-reduced-motion: reduce)",go=1,$m=2,Co=3,Ho=4,br=5,ea=6,sa=7,Cm={CREATED:go,MOUNTED:$m,IDLE:Co,MOVING:Ho,SCROLLING:br,DRAGGING:ea,DESTROYED:sa};function oi(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 Wd=setTimeout,Cs=function(){};function Wl(e){return requestAnimationFrame(e)}function ba(e,t){return typeof t===e}function sr(e){return!el(e)&&ba("object",e)}var Qs=Array.isArray,Hd=Jt(ba,"function"),wi=Jt(ba,"string"),Sr=Jt(ba,"undefined");function el(e){return e===null}function Od(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wr(e){return Qs(e)?e:[e]}function In(e,t){wr(e).forEach(t)}function tl(e,t){return e.indexOf(t)>-1}function ta(e,t){return e.push.apply(e,wr(t)),e}function Qn(e,t,n){e&&In(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){Qn(e,wi(t)?t.split(" "):t,!0)}function $r(e,t){In(t,e.appendChild.bind(e))}function nl(e,t){In(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function lr(e,t){return Od(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Dd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return lr(i,t)}):n}function Cr(e,t){return t?Dd(e,t)[0]:e.firstElementChild}var cr=Object.keys;function Xi(e,t,n){return e&&(n?cr(e).reverse():cr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function dr(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){e[i]=t[i]})}),e}function yi(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){Qs(n)?e[i]=n.slice():sr(n)?e[i]=yi({},sr(e[i])?e[i]:{},n):e[i]=n})}),e}function Hl(e,t){In(t||cr(e),function(n){delete e[n]})}function jn(e,t){In(e,function(n){In(t,function(i){n&&n.removeAttribute(i)})})}function kt(e,t,n){sr(t)?Xi(t,function(i,o){kt(e,o,i)}):In(e,function(i){el(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(wi(t)?Bn(i,t):kt(i,t)),n&&$r(n,i),i}function kn(e,t,n){if(Sr(n))return getComputedStyle(e)[t];el(n)||(e.style[t]=""+n)}function ur(e,t){kn(e,"display",t)}function zd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function En(e,t){return e.getAttribute(t)}function Ol(e,t){return e&&e.classList.contains(t)}function $n(e){return e.getBoundingClientRect()}function Ui(e){In(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bd(e){return Cr(new DOMParser().parseFromString(e,"text/html").body)}function Jn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jd(e,t){return e&&e.querySelector(t)}function il(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ei(e,t){Qn(e,t,!1)}function Ts(e){return e.timeStamp}function Ai(e){return wi(e)?e:e?e+"px":""}var Tr="splide",ol="data-"+Tr;function ir(e,t){if(!e)throw new Error("["+Tr+"] "+(t||""))}var $i=Math.min,la=Math.max,ca=Math.floor,pr=Math.ceil,fn=Math.abs;function Vd(e,t,n){return fn(e-t)<n}function na(e,t,n,i){var o=$i(t,n),r=la(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=$i(t,n),o=la(t,n);return $i(la(i,e),o)}function Ls(e){return+(e>0)-+(e<0)}function Is(e,t){return In(t,function(n){e=e.replace("%s",""+n)}),e}function rl(e){return e<10?"0"+e:""+e}var Dl={};function Tm(e){return""+e+rl(Dl[e]=(Dl[e]||0)+1)}function Gd(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);m?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,g])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){In(l,function(u){u&&In(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function r(){e.forEach(function(l){l[4]()}),oi(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Rs="ready",ri="move",Oo="moved",al="click",Xd="active",qd="inactive",Ud="visible",Yd="hidden",an="refresh",mn="updated",To="resize",Sa="resized",Kd="drag",Zd="dragging",Jd="dragged",wa="scroll",Zi="scrolled",Lm="overflow",sl="destroy",Qd="arrows:mounted",eu="arrows:updated",tu="pagination:mounted",nu="pagination:updated",ll="navigation:mounted",cl="autoplay:play",iu="autoplay:playing",dl="autoplay:pause",ul="lazyload:loaded",ou="sk",ru="sh",da="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Gd();function i(r,l){n.bind(t,wr(r).join(" "),function(d){l.apply(l,Qs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(sl,n.destroy),dr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function $a(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?$i((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return y();d=Wl(p)}}function v(R){R||g(),r=o()-(R?l*e:0),c=!1,d=Wl(p)}function y(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(R){e=R}function x(){return c}return{start:v,rewind:m,pause:y,cancel:g,set:f,isPaused:x}}function Im(e){var t=e;function n(o){t=o}function i(o){return tl(wr(o),t)}return{set:n,is:i}}function Rm(e,t){var n=$a(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Pm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Gd(),d=[];function c(){var g=n.mediaQuery==="min";cr(o).sort(function(f,x){return g?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(g?"min":"max")+"-width:"+f+"px)")}),p(r,_l),v()}function u(g){g&&l.destroy()}function p(g,f){var x=matchMedia(f);l.bind(x,"change",v),d.push([g,x])}function v(){var g=i.is(sa),f=n.direction,x=d.reduce(function(R,b){return yi(R,b[1].matches?b[0]:{})},{});Hl(n),m(x),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function y(g){matchMedia(_l).matches&&(g?yi(n,r):Hl(n,cr(r)))}function m(g,f,x){yi(n,g),f&&yi(Object.getPrototypeOf(n),g),(x||!i.is(go))&&e.emit(mn,n)}return{setup:c,destroy:u,reduce:y,set:m}}var Ca="Arrow",Ta=Ca+"Left",La=Ca+"Right",au=Ca+"Up",su=Ca+"Down",zl="rtl",Ia="ttb",Ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[au,La],ArrowRight:[su,Ta]};function km(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===zl&&!l?1:d===Ia?0:-1;return Ha[r]&&Ha[r][c]||r.replace(/width|left|right/i,function(u,p){var v=Ha[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===zl?1:-1)}return{resolve:i,orient:o}}var ti="role",bo="tabindex",Em="disabled",Mn="aria-",Lr=Mn+"controls",lu=Mn+"current",Bl=Mn+"selected",Tn=Mn+"label",pl=Mn+"labelledby",cu=Mn+"hidden",ml=Mn+"orientation",mr=Mn+"roledescription",jl=Mn+"live",Vl=Mn+"busy",Gl=Mn+"atomic",gl=[ti,bo,Em,Lr,lu,Tn,pl,cu,ml,mr],Gn=Tr+"__",Pi="is-",Oa=Tr,Xl=Gn+"track",Mm=Gn+"list",Ra=Gn+"slide",du=Ra+"--clone",Am=Ra+"__container",hl=Gn+"arrows",Pa=Gn+"arrow",uu=Pa+"--prev",pu=Pa+"--next",ka=Gn+"pagination",mu=ka+"__page",Fm=Gn+"progress",Nm=Fm+"__bar",_m=Gn+"toggle",Wm=Gn+"spinner",Hm=Gn+"sr",Om=Pi+"initialized",Yi=Pi+"active",gu=Pi+"prev",hu=Pi+"next",Ps=Pi+"visible",ks=Pi+"loading",fu=Pi+"focus-in",yu=Pi+"overflow",Dm=[Yi,Ps,gu,hu,ks,fu,yu],zm={slide:Ra,clone:du,arrows:hl,arrow:Pa,prev:uu,next:pu,pagination:ka,page:mu,spinner:Wm};function Bm(e,t){if(Hd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!lr(n,t);)n=n.parentElement;return n}var jm=5,ql=200,vu="touchstart mousedown",Da="touchmove mousemove",za="touchend touchcancel mouseup click";function Vm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,m,g;function f(){S(),G(),b()}function x(){o(an,R),o(an,f),o(mn,b),r(document,vu+" keydown",function(P){g=P.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Qn(l,fu,!!g)})}function R(P){var M=gl.concat("style");oi(u),ei(l,p),ei(y,v),jn([y,m],M),jn(l,P?M:["style",mr])}function b(){ei(l,p),ei(y,v),p=j(Oa),v=j(Xl),Bn(l,p),Bn(y,v),kt(l,Tn,n.label),kt(l,pl,n.labelledby)}function S(){y=D("."+Xl),m=Cr(y,"."+Mm),ir(y&&m,"A track/list element is missing."),ta(u,Dd(m,"."+Ra+":not(."+du+")")),Xi({arrows:hl,pagination:ka,prev:uu,next:pu,bar:Nm,toggle:_m},function(P,M){c[M]=D("."+P)}),dr(c,{root:l,track:y,list:m,slides:u})}function G(){var P=l.id||Tm(Tr),M=n.role;l.id=P,y.id=y.id||P+"-track",m.id=m.id||P+"-list",!En(l,ti)&&l.tagName!=="SECTION"&&M&&kt(l,ti,M),kt(l,mr,d.carousel),kt(m,ti,"presentation")}function D(P){var M=jd(l,P);return M&&Bm(M,"."+Oa)===l?M:void 0}function j(P){return[P+"--"+n.type,P+"--"+n.direction,n.drag&&P+"--draggable",n.isNavigation&&P+"--nav",P===Oa&&Yi]}return dr(c,{setup:f,mount:x,destroy:R})}var Lo="slide",Do="loop",Ir="fade";function Gm(e,t,n,i){var o=tn(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,m=p.i18n,g=p.pagination,f=p.slideFocus,x=c.Direction.resolve,R=En(i,"style"),b=En(i,Tn),S=n>-1,G=Cr(i,"."+Am),D;function j(){S||(i.id=u.id+"-slide"+rl(t+1),kt(i,ti,g?"tabpanel":"group"),kt(i,mr,m.slide),kt(i,Tn,b||Is(m.slideLabel,[t+1,e.length]))),P()}function P(){d(i,"click",Jt(l,al,U)),d(i,"keydown",Jt(l,ou,U)),r([Oo,ru,Zi],L),r(ll,K),y&&r(ri,T)}function M(){D=!0,o.destroy(),ei(i,Dm),jn(i,gl),kt(i,"style",R),kt(i,Tn,b||"")}function K(){var C=e.splides.map(function(O){var V=O.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");kt(i,Tn,Is(m.slideX,(S?n:t)+1)),kt(i,Lr,C),kt(i,ti,f?"button":""),f&&jn(i,mr)}function T(){D||L()}function L(){if(!D){var C=e.index;_(),z(),Qn(i,gu,t===C-1),Qn(i,hu,t===C+1)}}function _(){var C=k();C!==Ol(i,Yi)&&(Qn(i,Yi,C),kt(i,lu,v&&C||""),l(C?Xd:qd,U))}function z(){var C=W(),O=!C&&(!k()||S);if(e.state.is([Ho,br])||kt(i,cu,O||""),kt(il(i,p.focusableNodes||""),bo,O?-1:""),f&&kt(i,bo,O?-1:0),C!==Ol(i,Ps)&&(Qn(i,Ps,C),l(C?Ud:Yd,U)),!C&&document.activeElement===i){var V=c.Slides.getAt(e.index);V&&zd(V.slide)}}function $(C,O,V){kn(V&&G||i,C,O)}function k(){var C=e.index;return C===t||p.cloneStatus&&C===n}function W(){if(e.is(Ir))return k();var C=$n(c.Elements.track),O=$n(i),V=x("left",!0),se=x("right",!0);return ca(C[V])<=pr(O[V])&&ca(O[se])<=pr(C[se])}function w(C,O){var V=fn(C-t);return!S&&(p.rewind||e.is(Do))&&(V=$i(V,e.length-V)),V<=O}var U={index:t,slideIndex:n,slide:i,container:G,isClone:S,mount:j,destroy:M,update:L,style:$,isWithin:w};return U}function Xm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(an,m),o(an,y)}function y(){c.forEach(function(L,_){f(L,_,-1)})}function m(){D(function(L){L.destroy()}),oi(p)}function g(){D(function(L){L.update()})}function f(L,_,z){var $=Gm(e,_,z,L);$.mount(),p.push($),p.sort(function(k,W){return k.index-W.index})}function x(L){return L?j(function(_){return!_.isClone}):p}function R(L){var _=t.Controller,z=_.toIndex(L),$=_.hasFocus()?1:n.perPage;return j(function(k){return na(k.index,z,z+$-1)})}function b(L){return j(L)[0]}function S(L,_){In(L,function(z){if(wi(z)&&(z=Bd(z)),Od(z)){var $=c[_];$?nl(z,$):$r(u,z),Bn(z,n.classes.slide),M(z,Jt(r,To))}}),r(an)}function G(L){Ui(j(L).map(function(_){return _.slide})),r(an)}function D(L,_){x(_).forEach(L)}function j(L){return p.filter(Hd(L)?L:function(_){return wi(L)?lr(_.slide,L):tl(wr(L),_.index)})}function P(L,_,z){D(function($){$.style(L,_,z)})}function M(L,_){var z=il(L,"img"),$=z.length;$?z.forEach(function(k){l(k,"load error",function(){--$||_()})}):_()}function K(L){return L?c.length:p.length}function T(){return p.length>n.perPage}return{mount:v,destroy:m,update:g,register:f,get:x,getIn:R,getAt:b,add:S,remove:G,forEach:D,filter:j,style:P,getLength:K,isEnough:T}}function qm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,m=d.getAt,g=d.style,f,x,R;function b(){S(),r(window,"resize load",Rm(Jt(l,To))),o([mn,an],S),o(To,G)}function S(){f=n.direction===Ia,kn(p,"maxWidth",Ai(n.width)),kn(v,c("paddingLeft"),D(!1)),kn(v,c("paddingRight"),D(!0)),G(!0)}function G(U){var C=$n(p);(U||x.width!==C.width||x.height!==C.height)&&(kn(v,"height",j()),g(c("marginRight"),Ai(n.gap)),g("width",M()),g("height",K(),!0),x=C,l(Sa),R!==(R=w())&&(Qn(p,yu,R),l(Lm,R)))}function D(U){var C=n.padding,O=c(U?"right":"left");return C&&Ai(C[O]||(sr(C)?0:C))||"0px"}function j(){var U="";return f&&(U=P(),ir(U,"height or heightRatio is missing."),U="calc("+U+" - "+D(!1)+" - "+D(!0)+")"),U}function P(){return Ai(n.height||$n(y).width*n.heightRatio)}function M(){return n.autoWidth?null:Ai(n.fixedWidth)||(f?"":T())}function K(){return Ai(n.fixedHeight)||(f?n.autoHeight?null:T():P())}function T(){var U=Ai(n.gap);return"calc((100%"+(U&&" + "+U)+")/"+(n.perPage||1)+(U&&" - "+U)+")"}function L(){return $n(y)[c("width")]}function _(U,C){var O=m(U||0);return O?$n(O.slide)[c("width")]+(C?0:k()):0}function z(U,C){var O=m(U);if(O){var V=$n(O.slide)[c("right")],se=$n(y)[c("left")];return fn(V-se)+(C?0:k())}return 0}function $(U){return z(e.length-1)-z(0)+_(0,U)}function k(){var U=m(0);return U&&parseFloat(kn(U.slide,c("marginRight")))||0}function W(U){return parseFloat(kn(v,c("padding"+(U?"Right":"Left"))))||0}function w(){return e.is(Ir)||$(!0)>L()}return{mount:b,resize:G,listSize:L,slideSize:_,sliderSize:$,totalSize:z,getPadding:W,isOverflow:w}}var Um=2;function Ym(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(an,v),o([mn,To],m),(u=x())&&(g(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){Ui(c),oi(c),i.destroy()}function m(){var R=x();u!==R&&(u<R||!R)&&i.emit(an)}function g(R){var b=l.get().slice(),S=b.length;if(S){for(;b.length<R;)ta(b,b);ta(b.slice(-R),b.slice(0,R)).forEach(function(G,D){var j=D<R,P=f(G.slide,D);j?nl(P,b[0].slide):$r(r.list,P),ta(c,P),l.register(P,D-R+(j?0:S),G.index)})}}function f(R,b){var S=R.cloneNode(!0);return Bn(S,n.classes.clone),S.id=e.root.id+"-clone"+rl(b+1),S}function x(){var R=n.clones;if(!e.is(Do))R=0;else if(Sr(R)){var b=n[d("fixedWidth")]&&t.Layout.slideSize(0),S=b&&pr($n(r.track)[d("width")]/b);R=S||n[d("autoWidth")]&&e.length||n.perPage*Um}return R}return{mount:p,destroy:y}}function Km(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,m=t.Direction,g=m.resolve,f=m.orient,x=t.Elements,R=x.list,b=x.track,S;function G(){S=t.Transition,o([Ri,Sa,mn,an],D)}function D(){t.Controller.isBusy()||(t.Scroll.cancel(),P(e.index),t.Slides.update())}function j(O,V,se,ie){O!==V&&U(O>se)&&(L(),M(T($(),O>se),!0)),l(Ho),r(ri,V,se,O),S.start(V,function(){l(Co),r(Oo,V,se,O),ie&&ie()})}function P(O){M(z(O,!0))}function M(O,V){if(!e.is(Ir)){var se=V?O:K(O);kn(R,"transform","translate"+g("X")+"("+se+"px)"),O!==se&&r(ru)}}function K(O){if(e.is(Do)){var V=_(O),se=V>t.Controller.getEnd(),ie=V<0;(ie||se)&&(O=T(O,se))}return O}function T(O,V){var se=O-w(V),ie=y();return O-=f(ie*(pr(fn(se)/ie)||1))*(V?1:-1),O}function L(){M($(),!0),S.cancel()}function _(O){for(var V=t.Slides.get(),se=0,ie=1/0,N=0;N<V.length;N++){var de=V[N].index,X=fn(z(de,!0)-O);if(X<=ie)ie=X,se=de;else break}return se}function z(O,V){var se=f(p(O-1)-W(O));return V?k(se):se}function $(){var O=g("left");return $n(R)[O]-$n(b)[O]+f(u(!1))}function k(O){return n.trimSpace&&e.is(Lo)&&(O=co(O,0,f(y(!0)-v()))),O}function W(O){var V=n.focus;return V==="center"?(v()-c(O,!0))/2:+V*c(O)||0}function w(O){return z(O?t.Controller.getEnd():0,!!n.trimSpace)}function U(O){var V=f(T($(),O));return O?V>=0:V<=R[g("scrollWidth")]-$n(b)[g("width")]}function C(O,V){V=Sr(V)?$():V;var se=O!==!0&&f(V)<f(w(!1)),ie=O!==!1&&f(V)>f(w(!0));return se||ie}return{mount:G,move:j,jump:P,translate:M,shift:T,cancel:L,toIndex:_,toPosition:z,getPosition:$,getLimit:w,exceededLimit:C,reposition:D}}function Zm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,m=n.omitEnd,g=e.is(Do),f=e.is(Lo),x=Jt($,!1),R=Jt($,!0),b=n.start||0,S,G=b,D,j,P;function M(){K(),o([mn,an,da],K),o(Sa,T)}function K(){D=y(!0),j=n.perMove,P=n.perPage,S=U();var X=co(b,0,m?S:D-1);X!==b&&(b=X,l.reposition())}function T(){S!==U()&&r(da)}function L(X,ce,oe){if(!de()){var fe=z(X),Pe=w(fe);Pe>-1&&(ce||Pe!==b)&&(se(Pe),l.move(fe,Pe,G,oe))}}function _(X,ce,oe,fe){t.Scroll.scroll(X,ce,oe,function(){var Pe=w(l.toIndex(d()));se(m?$i(Pe,S):Pe),fe&&fe()})}function z(X){var ce=b;if(wi(X)){var oe=X.match(/([+\-<>])(\d+)?/)||[],fe=oe[1],Pe=oe[2];fe==="+"||fe==="-"?ce=k(b+ +(""+fe+(+Pe||1)),b):fe===">"?ce=Pe?C(+Pe):x(!0):fe==="<"&&(ce=R(!0))}else ce=g?X:co(X,0,S);return ce}function $(X,ce){var oe=j||(N()?1:P),fe=k(b+oe*(X?-1:1),b,!(j||N()));return fe===-1&&f&&!Vd(d(),c(!X),1)?X?0:S:ce?fe:w(fe)}function k(X,ce,oe){if(v()||N()){var fe=W(X);fe!==X&&(ce=X,X=fe,oe=!1),X<0||X>S?!j&&(na(0,X,ce,!0)||na(S,ce,X,!0))?X=C(O(X)):g?X=oe?X<0?-(D%P||P):D:X:n.rewind?X=X<0?S:0:X=-1:oe&&X!==ce&&(X=C(O(ce)+(X<ce?-1:1)))}else X=-1;return X}function W(X){if(f&&n.trimSpace==="move"&&X!==b)for(var ce=d();ce===u(X,!0)&&na(X,0,e.length-1,!n.rewind);)X<b?--X:++X;return X}function w(X){return g?(X+D)%D||0:X}function U(){for(var X=D-(N()||g&&j?1:P);m&&X-- >0;)if(u(D-1,!0)!==u(X,!0)){X++;break}return co(X,0,D-1)}function C(X){return co(N()?X:P*X,0,S)}function O(X){return N()?$i(X,S):ca((X>=S?D-1:X)/P)}function V(X){var ce=l.toIndex(X);return f?co(ce,0,S):ce}function se(X){X!==b&&(G=b,b=X)}function ie(X){return X?G:b}function N(){return!Sr(n.focus)||n.isNavigation}function de(){return e.state.is([Ho,br])&&!!n.waitForTransition}return{mount:M,go:L,scroll:_,getNext:x,getPrev:R,getAdjacent:$,getEnd:U,setIndex:se,getIndex:ie,toIndex:C,toPage:O,toDest:V,hasFocus:N,isBusy:de}}var Jm="http://www.w3.org/2000/svg",Qm="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",Er=40;function eg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,m=v,g=u.prev,f=u.next,x,R,b={};function S(){D(),o(mn,G)}function G(){j(),S()}function D(){var _=n.arrows;_&&!(g&&f)&&K(),g&&f&&(dr(b,{prev:g,next:f}),ur(m,_?"":"none"),Bn(m,R=hl+"--"+n.direction),_&&(P(),L(),kt([g,f],Lr,y.id),l(Qd,g,f)))}function j(){i.destroy(),ei(m,R),x?(Ui(v?[g,f]:m),g=f=null):jn([g,f],gl)}function P(){o([Ri,Oo,an,Zi,da],L),r(f,"click",Jt(M,">")),r(g,"click",Jt(M,"<"))}function M(_){p.go(_,!0)}function K(){m=v||xo("div",d.arrows),g=T(!0),f=T(!1),x=!0,$r(m,[g,f]),!v&&nl(m,y)}function T(_){var z='<button class="'+d.arrow+" "+(_?d.prev:d.next)+'" type="button"><svg xmlns="'+Jm+'" viewBox="0 0 '+Er+" "+Er+'" width="'+Er+'" height="'+Er+'" focusable="false"><path d="'+(n.arrowPath||Qm)+'" />';return Bd(z)}function L(){if(g&&f){var _=e.index,z=p.getPrev(),$=p.getNext(),k=z>-1&&_<z?c.last:c.prev,W=$>-1&&_>$?c.first:c.next;g.disabled=z<0,f.disabled=$<0,kt(g,Tn,k),kt(f,Tn,W),l(eu,g,f,z,$)}}return{arrows:b,mount:S,destroy:j,update:L}}var tg=ol+"-interval";function ng(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=$a(n.interval,e.go.bind(e,">"),P),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,m=n.autoplay,g,f,x=m==="pause";function R(){m&&(b(),y&&kt(y,Lr,u.track.id),x||S(),j())}function b(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(K){g=K.type==="mouseenter",D()}),n.pauseOnFocus&&r(v,"focusin focusout",function(K){f=K.type==="focusin",D()}),y&&r(y,"click",function(){x?S():G(!0)}),o([ri,wa,an],d.rewind),o(ri,M)}function S(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=g=x=!1,j(),l(cl))}function G(K){K===void 0&&(K=!0),x=!!K,j(),c()||(d.pause(),l(dl))}function D(){x||(g||f?G(!1):S())}function j(){y&&(Qn(y,Yi,!x),kt(y,Tn,n.i18n[x?"play":"pause"]))}function P(K){var T=u.bar;T&&kn(T,"width",K*100+"%"),l(iu,K)}function M(K){var T=t.Slides.getAt(K);d.set(T&&+En(T.slide,tg)||n.interval)}return{mount:R,destroy:d.cancel,play:S,pause:G,isPaused:c}}function ig(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(ul,Jt(d,!0)),o([Ri,mn,an],Jt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Cr(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ur(u,c?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var og=10,rg=600,ag=.6,sg=1.5,lg=800;function cg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Lo),m,g,f=1;function x(){o(ri,G),o([mn,an],D)}function R(P,M,K,T,L){var _=c();if(G(),K&&(!y||!p())){var z=t.Layout.sliderSize(),$=Ls(P)*z*ca(fn(P)/z)||0;P=d.toPosition(t.Controller.toDest(P%z))+$}var k=Vd(_,P,1);f=1,M=k?0:M||la(fn(P-_)/sg,lg),g=T,m=$a(M,b,Jt(S,_,P,L),1),l(br),r(wa),m.start()}function b(){l(Co),g&&g(),r(Zi)}function S(P,M,K,T){var L=c(),_=P+(M-P)*j(T),z=(_-L)*f;v(L+z),y&&!K&&p()&&(f*=ag,fn(z)<og&&R(u(p(!0)),rg,!1,g,!0))}function G(){m&&m.cancel()}function D(){m&&!m.isPaused()&&(G(),b())}function j(P){var M=n.easingFunc;return M?M(P):1-Math.pow(1-P,4)}return{mount:x,destroy:G,scroll:R,cancel:D}}var uo={passive:!1,capture:!0};function dg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,m=t.Media.reduce,g=t.Direction,f=g.resolve,x=g.orient,R=u.getPosition,b=u.exceededLimit,S,G,D,j,P,M=!1,K,T,L;function _(){l(y,Da,Cs,uo),l(y,za,Cs,uo),l(y,vu,$,uo),l(y,"click",w,{capture:!0}),l(y,"dragstart",Jn),o([Ri,mn],z)}function z(){var Z=n.drag;pe(!Z),j=Z==="free"}function $(Z){if(K=!1,!T){var le=Pe(Z);fe(Z.target)&&(le||!Z.button)&&(v.isBusy()?Jn(Z,!0):(L=le?y:window,P=c.is([Ho,br]),D=null,l(L,Da,k,uo),l(L,za,W,uo),u.cancel(),p.cancel(),U(Z)))}}function k(Z){if(c.is(ea)||(c.set(ea),r(Kd)),Z.cancelable)if(P){u.translate(S+oe(N(Z)));var le=de(Z)>ql,re=M!==(M=b());(le||re)&&U(Z),K=!0,r(Zd),Jn(Z)}else V(Z)&&(P=O(Z),Jn(Z))}function W(Z){c.is(ea)&&(c.set(Co),r(Jd)),P&&(C(Z),Jn(Z)),d(L,Da,k),d(L,za,W),P=!1}function w(Z){!T&&K&&Jn(Z,!0)}function U(Z){D=G,G=Z,S=R()}function C(Z){var le=se(Z),re=ie(le),Ie=n.rewind&&n.rewindByDrag;m(!1),j?v.scroll(re,0,n.snap):e.is(Ir)?v.go(x(Ls(le))<0?Ie?"<":"-":Ie?">":"+"):e.is(Lo)&&M&&Ie?v.go(b(!0)?">":"<"):v.go(v.toDest(re),!0),m(!0)}function O(Z){var le=n.dragMinThreshold,re=sr(le),Ie=re&&le.mouse||0,we=(re?le.touch:+le)||10;return fn(N(Z))>(Pe(Z)?we:Ie)}function V(Z){return fn(N(Z))>fn(N(Z,!0))}function se(Z){if(e.is(Do)||!M){var le=de(Z);if(le&&le<ql)return N(Z)/le}return 0}function ie(Z){return R()+Ls(Z)*$i(fn(Z)*(n.flickPower||600),j?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function N(Z,le){return ce(Z,le)-ce(X(Z),le)}function de(Z){return Ts(Z)-Ts(X(Z))}function X(Z){return G===Z&&D||G}function ce(Z,le){return(Pe(Z)?Z.changedTouches[0]:Z)["page"+f(le?"Y":"X")]}function oe(Z){return Z/(M&&e.is(Lo)?jm:1)}function fe(Z){var le=n.noDrag;return!lr(Z,"."+mu+", ."+Pa)&&(!le||!lr(Z,le))}function Pe(Z){return typeof TouchEvent<"u"&&Z instanceof TouchEvent}function xe(){return P}function pe(Z){T=Z}return{mount:_,disable:pe,isDragging:xe}}var ug={Spacebar:" ",Right:La,Left:Ta,Up:au,Down:su};function fl(e){return e=wi(e)?e:e.key,ug[e]||e}var Ul="keydown";function pg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(mn,m),o(mn,y),o(ri,f)}function y(){var R=n.keyboard;R&&(u=R==="global"?window:d,r(u,Ul,x))}function m(){l(u,Ul)}function g(R){p=R}function f(){var R=p;p=!0,Wd(function(){p=R})}function x(R){if(!p){var b=fl(R);b===c(Ta)?e.go("<"):b===c(La)&&e.go(">")}}return{mount:v,destroy:m,disable:g}}var or=ol+"-lazy",ia=or+"-srcset",mg="["+or+"], ["+ia+"]";function gg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Oo,Zi],p=[];function v(){n.lazyLoad&&(y(),o(an,y))}function y(){oi(p),m(),c?R():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(b){il(b.slide,mg).forEach(function(S){var G=En(S,or),D=En(S,ia);if(G!==S.src||D!==S.srcset){var j=n.classes.spinner,P=S.parentElement,M=Cr(P,"."+j)||xo("span",j,P);p.push([S,b,M]),S.src||ur(S,"none")}})})}function g(){p=p.filter(function(b){var S=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,S)?f(b):!0}),p.length||r(u)}function f(b){var S=b[0];Bn(b[1].slide,ks),l(S,"load error",Jt(x,b)),kt(S,"src",En(S,or)),kt(S,"srcset",En(S,ia)),jn(S,or),jn(S,ia)}function x(b,S){var G=b[0],D=b[1];ei(D.slide,ks),S.type!=="error"&&(Ui(b[2]),ur(G,""),d(ul,G,D),d(To)),c&&R()}function R(){p.length&&f(p.shift())}return{mount:v,destroy:Jt(oi,p),check:g}}function hg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,m=t.Direction.resolve,g=c.pagination,f=[],x,R;function b(){S(),o([mn,an,da],b);var T=n.pagination;g&&ur(g,T?"":"none"),T&&(o([ri,wa,Zi],K),G(),K(),r(tu,{list:x,items:f},M(e.index)))}function S(){x&&(Ui(g?Ii(x.children):x),ei(x,R),oi(f),x=null),i.destroy()}function G(){var T=e.length,L=n.classes,_=n.i18n,z=n.perPage,$=p()?u.getEnd()+1:pr(T/z);x=g||xo("ul",L.pagination,c.track.parentElement),Bn(x,R=ka+"--"+P()),kt(x,ti,"tablist"),kt(x,Tn,_.select),kt(x,ml,P()===Ia?"vertical":"");for(var k=0;k<$;k++){var W=xo("li",null,x),w=xo("button",{class:L.page,type:"button"},W),U=d.getIn(k).map(function(O){return O.slide.id}),C=!p()&&z>1?_.pageX:_.slideX;l(w,"click",Jt(D,k)),n.paginationKeyboard&&l(w,"keydown",Jt(j,k)),kt(W,ti,"presentation"),kt(w,ti,"tab"),kt(w,Lr,U.join(" ")),kt(w,Tn,Is(C,k+1)),kt(w,bo,-1),f.push({li:W,button:w,page:k})}}function D(T){y(">"+T,!0)}function j(T,L){var _=f.length,z=fl(L),$=P(),k=-1;z===m(La,!1,$)?k=++T%_:z===m(Ta,!1,$)?k=(--T+_)%_:z==="Home"?k=0:z==="End"&&(k=_-1);var W=f[k];W&&(zd(W.button),y(">"+k),Jn(L,!0))}function P(){return n.paginationDirection||n.direction}function M(T){return f[u.toPage(T)]}function K(){var T=M(v(!0)),L=M(v());if(T){var _=T.button;ei(_,Yi),jn(_,Bl),kt(_,bo,-1)}if(L){var z=L.button;Bn(z,Yi),kt(z,Bl,!0),kt(z,bo,"")}r(nu,{list:x,items:f},T,L)}return{items:f,mount:b,destroy:S,getAt:M,update:K}}var fg=[" ","Enter"];function yg(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 d(){r.forEach(function(g){g.destroy()}),oi(r)}function c(){d(),l()}function u(g,f){var x=tn(g);x.on(ri,function(R,b,S){f.go(f.is(Do)?S:R)}),r.push(x)}function p(){var g=tn(e),f=g.on;f(al,y),f(ou,m),f([Ri,mn],v),r.push(g),g.emit(ll,e.splides)}function v(){kt(t.Elements.list,ml,n.direction===Ia?"vertical":"")}function y(g){e.go(g.index)}function m(g,f){tl(fg,fl(f))&&(y(g),Jn(f))}return{setup:Jt(t.Media.set,{slideFocus:Sr(o)?i:o},!0),mount:l,destroy:d,remount:c}}function vg(e,t,n){var i=tn(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,uo)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=Ts(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;fn(p)>m&&y-r>g&&(e.go(v?"<":">"),r=y),c(v)&&Jn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var xg=90;function bg(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=xo("span",Hm),c=$a(xg,Jt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),kt(r,Gl,!0),d.textContent="…",o(cl,Jt(y,!0)),o(dl,Jt(y,!1)),o([Oo,Zi],Jt(p,!0)))}function p(m){kt(r,Vl,m),m?($r(r,d),c.start()):(Ui(d),c.cancel())}function v(){jn(r,[jl,Gl,Vl]),Ui(d)}function y(m){l&&kt(r,jl,m?"off":"polite")}return{mount:u,disable:y,destroy:v}}var Sg=Object.freeze({__proto__:null,Media:Pm,Direction:km,Elements:Vm,Slides:Xm,Layout:qm,Clones:Ym,Move:Km,Controller:Zm,Arrows:eg,Autoplay:ng,Cover:ig,Scroll:cg,Drag:dg,Keyboard:pg,LazyLoad:gg,Pagination:hg,Sync:yg,Wheel:vg,Live:bg}),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"},$g={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:zm,i18n:wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Cg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Wd(c)}return{mount:o,start:l,cancel:Cs}}function Tg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Jt(kn,l,"transition"),c;function u(){tn(e).bind(l,"transitionend",function(m){m.target===l&&c&&(v(),c())})}function p(m,g){var f=i.toPosition(m,!0),x=i.getPosition(),R=y(m);fn(f-x)>=1&&R>=1?n.useScroll?r.scroll(f,R,!1,g):(d("transform "+R+"ms "+n.easing),i.translate(f,!0),c=g):(i.jump(m),g())}function v(){d(""),r.cancel()}function y(m){var g=n.rewindSpeed;if(e.is(Lo)&&g){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&m>=x||f>=x&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:v}}var Lg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=Im(go),this.splides=[],this._o={},this._E={};var o=wi(n)?jd(document,n):n;ir(o,o+" is invalid."),this.root=o,i=yi({label:En(o,Tn)||"",labelledby:En(o,pl)||""},$g,e.defaults,i||{});try{yi(i,JSON.parse(En(o,ol)))}catch{ir(!1,"Invalid JSON")}this._o=Object.create(yi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;ir(l.is([go,sa]),"Already mounted!"),l.set(go),this._C=d,this._T=o||this._T||(this.is(Ir)?Cg:Tg),this._E=i||this._E;var c=dr({},Sg,this._E,{Transition:this._T});return Xi(c,function(u,p){var v=u(r,d,r._o);d[p]=v,v.setup&&v.setup()}),Xi(d,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,Om),l.set(Co),this.emit(Rs),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(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(go)?tn(this).on(Rs,this.destroy.bind(this,i)):(Xi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(sl),o.destroy(),i&&oi(this.splides),r.set(sa)),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})(),yl=Lg;yl.defaults={};yl.STATES=Cm;var Yl=[[Ri,"onMounted"],[Rs,"onReady"],[ri,"onMove"],[Oo,"onMoved"],[al,"onClick"],[Xd,"onActive"],[qd,"onInactive"],[Ud,"onVisible"],[Yd,"onHidden"],[an,"onRefresh"],[mn,"onUpdated"],[To,"onResize"],[Sa,"onResized"],[Kd,"onDrag"],[Zd,"onDragging"],[Jd,"onDragged"],[wa,"onScroll"],[Zi,"onScrolled"],[sl,"onDestroy"],[Qd,"onArrowsMounted"],[eu,"onArrowsUpdated"],[tu,"onPaginationMounted"],[nu,"onPaginationUpdated"],[ll,"onNavigationMounted"],[cl,"onAutoplayPlay"],[iu,"onAutoplayPlaying"],[dl,"onAutoplayPause"],[ul,"onLazyLoadLoaded"]];function vl(...e){return e.filter(Boolean).join(" ")}function ua(e){return e!==null&&typeof e=="object"}function Es(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Es(n,t[i]));if(ua(e)&&ua(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Es(e[o],t[o]))}return e===t}function Ig(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Rg(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 Ms(e,t){const n=e;return Rg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ua(i)?n[o]=Ms(ua(n[o])?n[o]:{},i):n[o]=i}),n}var Pg=({children:e,className:t,...n})=>s.createElement("div",{className:vl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),xl=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 yl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ms({},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&&!Es(this.options,e)&&(this.splide.options=e,this.options=Ms({},e));const t=this.getSlides();Ig(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){Yl.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:vl("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yl.map(r=>r[1])])},n?s.createElement(Pg,null,i):i)}},bl=({children:e,className:t,...n})=>s.createElement("li",{className:vl("splide__slide",t),...n},e);/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),Ct=require("classnames"),F=require("./panelAvailability-D8c7cdbu.js"),si=require("react-dom");function Ep(e){return e.type==="object"&&e.version===1}const Mp="ControlSlider-module__wrapper___sHEkd",Ap="ControlSlider-module__hoverArrow___A-dOH",Fp="ControlSlider-module__sliderItem___QQSkR",Np="ControlSlider-module__sliderImage___9hRl-",_p="ControlSlider-module__arrow___05ghY",Wp="ControlSlider-module__arrowVertical___tBfVN",Hp="ControlSlider-module__nextArrow___-30Yc",Op="ControlSlider-module__arrowInner___aEra3",Dp="ControlSlider-module__arrowIcon___S4ztF",zp="ControlSlider-module__arrowImg___2dwJW",Bp="ControlSlider-module__mirror___brd6U",jp="ControlSlider-module__pagination___bicLF",Vp="ControlSlider-module__paginationInner___bT-P-",Gp="ControlSlider-module__paginationVertical___zYqKw",Xp="ControlSlider-module__paginationItem___nTRbk",qp="ControlSlider-module__dot___p1Qun",Up="ControlSlider-module__activeDot___LHFaj",Yp="ControlSlider-module__paginationInsideBottom___R3FWn",Kp="ControlSlider-module__paginationInsideTop___V-qb-",Zp="ControlSlider-module__paginationOutsideBottom___14w8D",Jp="ControlSlider-module__paginationOutsideTop___SCLqB",Qp="ControlSlider-module__paginationInsideLeft___yOBRZ",em="ControlSlider-module__paginationInsideRight___Rtt3o",tm="ControlSlider-module__paginationOutsideLeft___lahaw",nm="ControlSlider-module__paginationOutsideRight___EtuQa",im="ControlSlider-module__imgWrapper___UjEgB",om="ControlSlider-module__captionBlock___dJ6-j",rm="ControlSlider-module__captionTextWrapper___HFlpf",am="ControlSlider-module__captionText___uGBVc",sm="ControlSlider-module__active___WZK4G",lm="ControlSlider-module__withPointerEvents___t-18M",cm="ControlSlider-module__topLeftAlignment___zjnGM",dm="ControlSlider-module__topCenterAlignment___gD1xW",um="ControlSlider-module__topRightAlignment___NMapS",pm="ControlSlider-module__middleLeftAlignment___OnUrY",mm="ControlSlider-module__middleCenterAlignment___Tdkl0",gm="ControlSlider-module__middleRightAlignment___wEbfX",hm="ControlSlider-module__bottomLeftAlignment___cTP2-",fm="ControlSlider-module__bottomCenterAlignment___c54fB",ym="ControlSlider-module__bottomRightAlignment___kEwrz",vm="ControlSlider-module__clickOverlay___DZA28",xm="ControlSlider-module__contain___pLyq7",bm="ControlSlider-module__cover___KdDat",$t={wrapper:Mp,hoverArrow:Ap,sliderItem:Fp,sliderImage:Np,arrow:_p,arrowVertical:Wp,nextArrow:Hp,arrowInner:Op,arrowIcon:Dp,arrowImg:zp,mirror:Bp,pagination:jp,paginationInner:Vp,paginationVertical:Gp,paginationItem:Xp,dot:qp,activeDot:Up,paginationInsideBottom:Yp,paginationInsideTop:Kp,paginationOutsideBottom:Zp,paginationOutsideTop:Jp,paginationInsideLeft:Qp,paginationInsideRight:em,paginationOutsideLeft:tm,paginationOutsideRight:nm,imgWrapper:im,captionBlock:om,captionTextWrapper:rm,captionText:am,active:sm,withPointerEvents:lm,topLeftAlignment:cm,topCenterAlignment:dm,topRightAlignment:um,middleLeftAlignment:pm,middleCenterAlignment:mm,middleRightAlignment:gm,bottomLeftAlignment:hm,bottomCenterAlignment:fm,bottomRightAlignment:ym,clickOverlay:vm,contain:xm,cover:bm};function Sm(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&&Sm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var _l="(prefers-reduced-motion: reduce)",go=1,$m=2,Co=3,Ho=4,br=5,ea=6,sa=7,Cm={CREATED:go,MOUNTED:$m,IDLE:Co,MOVING:Ho,SCROLLING:br,DRAGGING:ea,DESTROYED:sa};function ri(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 Wd=setTimeout,Cs=function(){};function Wl(e){return requestAnimationFrame(e)}function ba(e,t){return typeof t===e}function sr(e){return!el(e)&&ba("object",e)}var Qs=Array.isArray,Hd=Jt(ba,"function"),wi=Jt(ba,"string"),Sr=Jt(ba,"undefined");function el(e){return e===null}function Od(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function wr(e){return Qs(e)?e:[e]}function In(e,t){wr(e).forEach(t)}function tl(e,t){return e.indexOf(t)>-1}function ta(e,t){return e.push.apply(e,wr(t)),e}function ei(e,t,n){e&&In(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Bn(e,t){ei(e,wi(t)?t.split(" "):t,!0)}function $r(e,t){In(t,e.appendChild.bind(e))}function nl(e,t){In(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function lr(e,t){return Od(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Dd(e,t){var n=e?Ii(e.children):[];return t?n.filter(function(i){return lr(i,t)}):n}function Cr(e,t){return t?Dd(e,t)[0]:e.firstElementChild}var cr=Object.keys;function Xi(e,t,n){return e&&(n?cr(e).reverse():cr(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function dr(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){e[i]=t[i]})}),e}function vi(e){return Ii(arguments,1).forEach(function(t){Xi(t,function(n,i){Qs(n)?e[i]=n.slice():sr(n)?e[i]=vi({},sr(e[i])?e[i]:{},n):e[i]=n})}),e}function Hl(e,t){In(t||cr(e),function(n){delete e[n]})}function jn(e,t){In(e,function(n){In(t,function(i){n&&n.removeAttribute(i)})})}function kt(e,t,n){sr(t)?Xi(t,function(i,o){kt(e,o,i)}):In(e,function(i){el(n)||n===""?jn(i,t):i.setAttribute(t,String(n))})}function xo(e,t,n){var i=document.createElement(e);return t&&(wi(t)?Bn(i,t):kt(i,t)),n&&$r(n,i),i}function kn(e,t,n){if(Sr(n))return getComputedStyle(e)[t];el(n)||(e.style[t]=""+n)}function ur(e,t){kn(e,"display",t)}function zd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function En(e,t){return e.getAttribute(t)}function Ol(e,t){return e&&e.classList.contains(t)}function $n(e){return e.getBoundingClientRect()}function Ui(e){In(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Bd(e){return Cr(new DOMParser().parseFromString(e,"text/html").body)}function Jn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function jd(e,t){return e&&e.querySelector(t)}function il(e,t){return t?Ii(e.querySelectorAll(t)):[]}function ti(e,t){ei(e,t,!1)}function Ts(e){return e.timeStamp}function Ai(e){return wi(e)?e:e?e+"px":""}var Tr="splide",ol="data-"+Tr;function ir(e,t){if(!e)throw new Error("["+Tr+"] "+(t||""))}var $i=Math.min,la=Math.max,ca=Math.floor,pr=Math.ceil,fn=Math.abs;function Vd(e,t,n){return fn(e-t)<n}function na(e,t,n,i){var o=$i(t,n),r=la(t,n);return i?o<e&&e<r:o<=e&&e<=r}function co(e,t,n){var i=$i(t,n),o=la(t,n);return $i(la(i,e),o)}function Ls(e){return+(e>0)-+(e<0)}function Is(e,t){return In(t,function(n){e=e.replace("%s",""+n)}),e}function rl(e){return e<10?"0"+e:""+e}var Dl={};function Tm(e){return""+e+rl(Dl[e]=(Dl[e]||0)+1)}function Gd(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);m?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,g])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){In(l,function(u){u&&In(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function r(){e.forEach(function(l){l[4]()}),ri(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var Ri="mounted",Rs="ready",ai="move",Oo="moved",al="click",Xd="active",qd="inactive",Ud="visible",Yd="hidden",an="refresh",mn="updated",To="resize",Sa="resized",Kd="drag",Zd="dragging",Jd="dragged",wa="scroll",Zi="scrolled",Lm="overflow",sl="destroy",Qd="arrows:mounted",eu="arrows:updated",tu="pagination:mounted",nu="pagination:updated",ll="navigation:mounted",cl="autoplay:play",iu="autoplay:playing",dl="autoplay:pause",ul="lazyload:loaded",ou="sk",ru="sh",da="ei";function tn(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Gd();function i(r,l){n.bind(t,wr(r).join(" "),function(d){l.apply(l,Qs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,Ii(arguments,1))}return e&&e.event.on(sl,n.destroy),dr(n,{bus:t,on:i,off:Jt(n.unbind,t),emit:o})}function $a(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?$i((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return y();d=Wl(p)}}function v(P){P||g(),r=o()-(P?l*e:0),c=!1,d=Wl(p)}function y(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(P){e=P}function x(){return c}return{start:v,rewind:m,pause:y,cancel:g,set:f,isPaused:x}}function Im(e){var t=e;function n(o){t=o}function i(o){return tl(wr(o),t)}return{set:n,is:i}}function Rm(e,t){var n=$a(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Pm(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Gd(),d=[];function c(){var g=n.mediaQuery==="min";cr(o).sort(function(f,x){return g?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(g?"min":"max")+"-width:"+f+"px)")}),p(r,_l),v()}function u(g){g&&l.destroy()}function p(g,f){var x=matchMedia(f);l.bind(x,"change",v),d.push([g,x])}function v(){var g=i.is(sa),f=n.direction,x=d.reduce(function(P,b){return vi(P,b[1].matches?b[0]:{})},{});Hl(n),m(x),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function y(g){matchMedia(_l).matches&&(g?vi(n,r):Hl(n,cr(r)))}function m(g,f,x){vi(n,g),f&&vi(Object.getPrototypeOf(n),g),(x||!i.is(go))&&e.emit(mn,n)}return{setup:c,destroy:u,reduce:y,set:m}}var Ca="Arrow",Ta=Ca+"Left",La=Ca+"Right",au=Ca+"Up",su=Ca+"Down",zl="rtl",Ia="ttb",Ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[au,La],ArrowRight:[su,Ta]};function km(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===zl&&!l?1:d===Ia?0:-1;return Ha[r]&&Ha[r][c]||r.replace(/width|left|right/i,function(u,p){var v=Ha[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(r){return r*(n.direction===zl?1:-1)}return{resolve:i,orient:o}}var ni="role",bo="tabindex",Em="disabled",Mn="aria-",Lr=Mn+"controls",lu=Mn+"current",Bl=Mn+"selected",Tn=Mn+"label",pl=Mn+"labelledby",cu=Mn+"hidden",ml=Mn+"orientation",mr=Mn+"roledescription",jl=Mn+"live",Vl=Mn+"busy",Gl=Mn+"atomic",gl=[ni,bo,Em,Lr,lu,Tn,pl,cu,ml,mr],Gn=Tr+"__",Pi="is-",Oa=Tr,Xl=Gn+"track",Mm=Gn+"list",Ra=Gn+"slide",du=Ra+"--clone",Am=Ra+"__container",hl=Gn+"arrows",Pa=Gn+"arrow",uu=Pa+"--prev",pu=Pa+"--next",ka=Gn+"pagination",mu=ka+"__page",Fm=Gn+"progress",Nm=Fm+"__bar",_m=Gn+"toggle",Wm=Gn+"spinner",Hm=Gn+"sr",Om=Pi+"initialized",Yi=Pi+"active",gu=Pi+"prev",hu=Pi+"next",Ps=Pi+"visible",ks=Pi+"loading",fu=Pi+"focus-in",yu=Pi+"overflow",Dm=[Yi,Ps,gu,hu,ks,fu,yu],zm={slide:Ra,clone:du,arrows:hl,arrow:Pa,prev:uu,next:pu,pagination:ka,page:mu,spinner:Wm};function Bm(e,t){if(Hd(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!lr(n,t);)n=n.parentElement;return n}var jm=5,ql=200,vu="touchstart mousedown",Da="touchmove mousemove",za="touchend touchcancel mouseup click";function Vm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,m,g;function f(){w(),j(),b()}function x(){o(an,P),o(an,f),o(mn,b),r(document,vu+" keydown",function(k){g=k.type==="keydown"},{capture:!0}),r(l,"focusin",function(){ei(l,fu,!!g)})}function P(k){var W=gl.concat("style");ri(u),ti(l,p),ti(y,v),jn([y,m],W),jn(l,k?W:["style",mr])}function b(){ti(l,p),ti(y,v),p=B(Oa),v=B(Xl),Bn(l,p),Bn(y,v),kt(l,Tn,n.label),kt(l,pl,n.labelledby)}function w(){y=H("."+Xl),m=Cr(y,"."+Mm),ir(y&&m,"A track/list element is missing."),ta(u,Dd(m,"."+Ra+":not(."+du+")")),Xi({arrows:hl,pagination:ka,prev:uu,next:pu,bar:Nm,toggle:_m},function(k,W){c[W]=H("."+k)}),dr(c,{root:l,track:y,list:m,slides:u})}function j(){var k=l.id||Tm(Tr),W=n.role;l.id=k,y.id=y.id||k+"-track",m.id=m.id||k+"-list",!En(l,ni)&&l.tagName!=="SECTION"&&W&&kt(l,ni,W),kt(l,mr,d.carousel),kt(m,ni,"presentation")}function H(k){var W=jd(l,k);return W&&Bm(W,"."+Oa)===l?W:void 0}function B(k){return[k+"--"+n.type,k+"--"+n.direction,n.drag&&k+"--draggable",n.isNavigation&&k+"--nav",k===Oa&&Yi]}return dr(c,{setup:f,mount:x,destroy:P})}var Lo="slide",Do="loop",Ir="fade";function Gm(e,t,n,i){var o=tn(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,m=p.i18n,g=p.pagination,f=p.slideFocus,x=c.Direction.resolve,P=En(i,"style"),b=En(i,Tn),w=n>-1,j=Cr(i,"."+Am),H;function B(){w||(i.id=u.id+"-slide"+rl(t+1),kt(i,ni,g?"tabpanel":"group"),kt(i,mr,m.slide),kt(i,Tn,b||Is(m.slideLabel,[t+1,e.length]))),k()}function k(){d(i,"click",Jt(l,al,K)),d(i,"keydown",Jt(l,ou,K)),r([Oo,ru,Zi],I),r(ll,U),y&&r(ai,$)}function W(){H=!0,o.destroy(),ti(i,Dm),jn(i,gl),kt(i,"style",P),kt(i,Tn,b||"")}function U(){var T=e.splides.map(function(N){var V=N.splide.Components.Slides.getAt(t);return V?V.slide.id:""}).join(" ");kt(i,Tn,Is(m.slideX,(w?n:t)+1)),kt(i,Lr,T),kt(i,ni,f?"button":""),f&&jn(i,mr)}function $(){H||I()}function I(){if(!H){var T=e.index;O(),_(),ei(i,gu,t===T-1),ei(i,hu,t===T+1)}}function O(){var T=L();T!==Ol(i,Yi)&&(ei(i,Yi,T),kt(i,lu,v&&T||""),l(T?Xd:qd,K))}function _(){var T=D(),N=!T&&(!L()||w);if(e.state.is([Ho,br])||kt(i,cu,N||""),kt(il(i,p.focusableNodes||""),bo,N?-1:""),f&&kt(i,bo,N?-1:0),T!==Ol(i,Ps)&&(ei(i,Ps,T),l(T?Ud:Yd,K)),!T&&document.activeElement===i){var V=c.Slides.getAt(e.index);V&&zd(V.slide)}}function C(T,N,V){kn(V&&j||i,T,N)}function L(){var T=e.index;return T===t||p.cloneStatus&&T===n}function D(){if(e.is(Ir))return L();var T=$n(c.Elements.track),N=$n(i),V=x("left",!0),ae=x("right",!0);return ca(T[V])<=pr(N[V])&&ca(N[ae])<=pr(T[ae])}function S(T,N){var V=fn(T-t);return!w&&(p.rewind||e.is(Do))&&(V=$i(V,e.length-V)),V<=N}var K={index:t,slideIndex:n,slide:i,container:j,isClone:w,mount:B,destroy:W,update:I,style:C,isWithin:S};return K}function Xm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(an,m),o(an,y)}function y(){c.forEach(function(I,O){f(I,O,-1)})}function m(){H(function(I){I.destroy()}),ri(p)}function g(){H(function(I){I.update()})}function f(I,O,_){var C=Gm(e,O,_,I);C.mount(),p.push(C),p.sort(function(L,D){return L.index-D.index})}function x(I){return I?B(function(O){return!O.isClone}):p}function P(I){var O=t.Controller,_=O.toIndex(I),C=O.hasFocus()?1:n.perPage;return B(function(L){return na(L.index,_,_+C-1)})}function b(I){return B(I)[0]}function w(I,O){In(I,function(_){if(wi(_)&&(_=Bd(_)),Od(_)){var C=c[O];C?nl(_,C):$r(u,_),Bn(_,n.classes.slide),W(_,Jt(r,To))}}),r(an)}function j(I){Ui(B(I).map(function(O){return O.slide})),r(an)}function H(I,O){x(O).forEach(I)}function B(I){return p.filter(Hd(I)?I:function(O){return wi(I)?lr(O.slide,I):tl(wr(I),O.index)})}function k(I,O,_){H(function(C){C.style(I,O,_)})}function W(I,O){var _=il(I,"img"),C=_.length;C?_.forEach(function(L){l(L,"load error",function(){--C||O()})}):O()}function U(I){return I?c.length:p.length}function $(){return p.length>n.perPage}return{mount:v,destroy:m,update:g,register:f,get:x,getIn:P,getAt:b,add:w,remove:j,forEach:H,filter:B,style:k,getLength:U,isEnough:$}}function qm(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,m=d.getAt,g=d.style,f,x,P;function b(){w(),r(window,"resize load",Rm(Jt(l,To))),o([mn,an],w),o(To,j)}function w(){f=n.direction===Ia,kn(p,"maxWidth",Ai(n.width)),kn(v,c("paddingLeft"),H(!1)),kn(v,c("paddingRight"),H(!0)),j(!0)}function j(K){var T=$n(p);(K||x.width!==T.width||x.height!==T.height)&&(kn(v,"height",B()),g(c("marginRight"),Ai(n.gap)),g("width",W()),g("height",U(),!0),x=T,l(Sa),P!==(P=S())&&(ei(p,yu,P),l(Lm,P)))}function H(K){var T=n.padding,N=c(K?"right":"left");return T&&Ai(T[N]||(sr(T)?0:T))||"0px"}function B(){var K="";return f&&(K=k(),ir(K,"height or heightRatio is missing."),K="calc("+K+" - "+H(!1)+" - "+H(!0)+")"),K}function k(){return Ai(n.height||$n(y).width*n.heightRatio)}function W(){return n.autoWidth?null:Ai(n.fixedWidth)||(f?"":$())}function U(){return Ai(n.fixedHeight)||(f?n.autoHeight?null:$():k())}function $(){var K=Ai(n.gap);return"calc((100%"+(K&&" + "+K)+")/"+(n.perPage||1)+(K&&" - "+K)+")"}function I(){return $n(y)[c("width")]}function O(K,T){var N=m(K||0);return N?$n(N.slide)[c("width")]+(T?0:L()):0}function _(K,T){var N=m(K);if(N){var V=$n(N.slide)[c("right")],ae=$n(y)[c("left")];return fn(V-ae)+(T?0:L())}return 0}function C(K){return _(e.length-1)-_(0)+O(0,K)}function L(){var K=m(0);return K&&parseFloat(kn(K.slide,c("marginRight")))||0}function D(K){return parseFloat(kn(v,c("padding"+(K?"Right":"Left"))))||0}function S(){return e.is(Ir)||C(!0)>I()}return{mount:b,resize:j,listSize:I,slideSize:O,sliderSize:C,totalSize:_,getPadding:D,isOverflow:S}}var Um=2;function Ym(e,t,n){var i=tn(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(an,v),o([mn,To],m),(u=x())&&(g(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){Ui(c),ri(c),i.destroy()}function m(){var P=x();u!==P&&(u<P||!P)&&i.emit(an)}function g(P){var b=l.get().slice(),w=b.length;if(w){for(;b.length<P;)ta(b,b);ta(b.slice(-P),b.slice(0,P)).forEach(function(j,H){var B=H<P,k=f(j.slide,H);B?nl(k,b[0].slide):$r(r.list,k),ta(c,k),l.register(k,H-P+(B?0:w),j.index)})}}function f(P,b){var w=P.cloneNode(!0);return Bn(w,n.classes.clone),w.id=e.root.id+"-clone"+rl(b+1),w}function x(){var P=n.clones;if(!e.is(Do))P=0;else if(Sr(P)){var b=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=b&&pr($n(r.track)[d("width")]/b);P=w||n[d("autoWidth")]&&e.length||n.perPage*Um}return P}return{mount:p,destroy:y}}function Km(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,m=t.Direction,g=m.resolve,f=m.orient,x=t.Elements,P=x.list,b=x.track,w;function j(){w=t.Transition,o([Ri,Sa,mn,an],H)}function H(){t.Controller.isBusy()||(t.Scroll.cancel(),k(e.index),t.Slides.update())}function B(N,V,ae,ie){N!==V&&K(N>ae)&&(I(),W($(C(),N>ae),!0)),l(Ho),r(ai,V,ae,N),w.start(V,function(){l(Co),r(Oo,V,ae,N),ie&&ie()})}function k(N){W(_(N,!0))}function W(N,V){if(!e.is(Ir)){var ae=V?N:U(N);kn(P,"transform","translate"+g("X")+"("+ae+"px)"),N!==ae&&r(ru)}}function U(N){if(e.is(Do)){var V=O(N),ae=V>t.Controller.getEnd(),ie=V<0;(ie||ae)&&(N=$(N,ae))}return N}function $(N,V){var ae=N-S(V),ie=y();return N-=f(ie*(pr(fn(ae)/ie)||1))*(V?1:-1),N}function I(){W(C(),!0),w.cancel()}function O(N){for(var V=t.Slides.get(),ae=0,ie=1/0,M=0;M<V.length;M++){var de=V[M].index,X=fn(_(de,!0)-N);if(X<=ie)ie=X,ae=de;else break}return ae}function _(N,V){var ae=f(p(N-1)-D(N));return V?L(ae):ae}function C(){var N=g("left");return $n(P)[N]-$n(b)[N]+f(u(!1))}function L(N){return n.trimSpace&&e.is(Lo)&&(N=co(N,0,f(y(!0)-v()))),N}function D(N){var V=n.focus;return V==="center"?(v()-c(N,!0))/2:+V*c(N)||0}function S(N){return _(N?t.Controller.getEnd():0,!!n.trimSpace)}function K(N){var V=f($(C(),N));return N?V>=0:V<=P[g("scrollWidth")]-$n(b)[g("width")]}function T(N,V){V=Sr(V)?C():V;var ae=N!==!0&&f(V)<f(S(!1)),ie=N!==!1&&f(V)>f(S(!0));return ae||ie}return{mount:j,move:B,jump:k,translate:W,shift:$,cancel:I,toIndex:O,toPosition:_,getPosition:C,getLimit:S,exceededLimit:T,reposition:H}}function Zm(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,m=n.omitEnd,g=e.is(Do),f=e.is(Lo),x=Jt(C,!1),P=Jt(C,!0),b=n.start||0,w,j=b,H,B,k;function W(){U(),o([mn,an,da],U),o(Sa,$)}function U(){H=y(!0),B=n.perMove,k=n.perPage,w=K();var X=co(b,0,m?w:H-1);X!==b&&(b=X,l.reposition())}function $(){w!==K()&&r(da)}function I(X,le,ne){if(!de()){var he=_(X),ke=S(he);ke>-1&&(le||ke!==b)&&(ae(ke),l.move(he,ke,j,ne))}}function O(X,le,ne,he){t.Scroll.scroll(X,le,ne,function(){var ke=S(l.toIndex(d()));ae(m?$i(ke,w):ke),he&&he()})}function _(X){var le=b;if(wi(X)){var ne=X.match(/([+\-<>])(\d+)?/)||[],he=ne[1],ke=ne[2];he==="+"||he==="-"?le=L(b+ +(""+he+(+ke||1)),b):he===">"?le=ke?T(+ke):x(!0):he==="<"&&(le=P(!0))}else le=g?X:co(X,0,w);return le}function C(X,le){var ne=B||(M()?1:k),he=L(b+ne*(X?-1:1),b,!(B||M()));return he===-1&&f&&!Vd(d(),c(!X),1)?X?0:w:le?he:S(he)}function L(X,le,ne){if(v()||M()){var he=D(X);he!==X&&(le=X,X=he,ne=!1),X<0||X>w?!B&&(na(0,X,le,!0)||na(w,le,X,!0))?X=T(N(X)):g?X=ne?X<0?-(H%k||k):H:X:n.rewind?X=X<0?w:0:X=-1:ne&&X!==le&&(X=T(N(le)+(X<le?-1:1)))}else X=-1;return X}function D(X){if(f&&n.trimSpace==="move"&&X!==b)for(var le=d();le===u(X,!0)&&na(X,0,e.length-1,!n.rewind);)X<b?--X:++X;return X}function S(X){return g?(X+H)%H||0:X}function K(){for(var X=H-(M()||g&&B?1:k);m&&X-- >0;)if(u(H-1,!0)!==u(X,!0)){X++;break}return co(X,0,H-1)}function T(X){return co(M()?X:k*X,0,w)}function N(X){return M()?$i(X,w):ca((X>=w?H-1:X)/k)}function V(X){var le=l.toIndex(X);return f?co(le,0,w):le}function ae(X){X!==b&&(j=b,b=X)}function ie(X){return X?j:b}function M(){return!Sr(n.focus)||n.isNavigation}function de(){return e.state.is([Ho,br])&&!!n.waitForTransition}return{mount:W,go:I,scroll:O,getNext:x,getPrev:P,getAdjacent:C,getEnd:K,setIndex:ae,getIndex:ie,toIndex:T,toPage:N,toDest:V,hasFocus:M,isBusy:de}}var Jm="http://www.w3.org/2000/svg",Qm="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",Er=40;function eg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,m=v,g=u.prev,f=u.next,x,P,b={};function w(){H(),o(mn,j)}function j(){B(),w()}function H(){var O=n.arrows;O&&!(g&&f)&&U(),g&&f&&(dr(b,{prev:g,next:f}),ur(m,O?"":"none"),Bn(m,P=hl+"--"+n.direction),O&&(k(),I(),kt([g,f],Lr,y.id),l(Qd,g,f)))}function B(){i.destroy(),ti(m,P),x?(Ui(v?[g,f]:m),g=f=null):jn([g,f],gl)}function k(){o([Ri,Oo,an,Zi,da],I),r(f,"click",Jt(W,">")),r(g,"click",Jt(W,"<"))}function W(O){p.go(O,!0)}function U(){m=v||xo("div",d.arrows),g=$(!0),f=$(!1),x=!0,$r(m,[g,f]),!v&&nl(m,y)}function $(O){var _='<button class="'+d.arrow+" "+(O?d.prev:d.next)+'" type="button"><svg xmlns="'+Jm+'" viewBox="0 0 '+Er+" "+Er+'" width="'+Er+'" height="'+Er+'" focusable="false"><path d="'+(n.arrowPath||Qm)+'" />';return Bd(_)}function I(){if(g&&f){var O=e.index,_=p.getPrev(),C=p.getNext(),L=_>-1&&O<_?c.last:c.prev,D=C>-1&&O>C?c.first:c.next;g.disabled=_<0,f.disabled=C<0,kt(g,Tn,L),kt(f,Tn,D),l(eu,g,f,_,C)}}return{arrows:b,mount:w,destroy:B,update:I}}var tg=ol+"-interval";function ng(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.emit,d=$a(n.interval,e.go.bind(e,">"),k),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,m=n.autoplay,g,f,x=m==="pause";function P(){m&&(b(),y&&kt(y,Lr,u.track.id),x||w(),B())}function b(){n.pauseOnHover&&r(v,"mouseenter mouseleave",function(U){g=U.type==="mouseenter",H()}),n.pauseOnFocus&&r(v,"focusin focusout",function(U){f=U.type==="focusin",H()}),y&&r(y,"click",function(){x?w():j(!0)}),o([ai,wa,an],d.rewind),o(ai,W)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=g=x=!1,B(),l(cl))}function j(U){U===void 0&&(U=!0),x=!!U,B(),c()||(d.pause(),l(dl))}function H(){x||(g||f?j(!1):w())}function B(){y&&(ei(y,Yi,!x),kt(y,Tn,n.i18n[x?"play":"pause"]))}function k(U){var $=u.bar;$&&kn($,"width",U*100+"%"),l(iu,U)}function W(U){var $=t.Slides.getAt(U);d.set($&&+En($.slide,tg)||n.interval)}return{mount:P,destroy:d.cancel,play:w,pause:j,isPaused:c}}function ig(e,t,n){var i=tn(e),o=i.on;function r(){n.cover&&(o(ul,Jt(d,!0)),o([Ri,mn,an],Jt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Cr(u.container||u.slide,"img");p&&p.src&&d(c,p,u)})}function d(c,u,p){p.style("background",c?'center/cover no-repeat url("'+u.src+'")':"",!0),ur(u,c?"none":"")}return{mount:r,destroy:Jt(l,!1)}}var og=10,rg=600,ag=.6,sg=1.5,lg=800;function cg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Lo),m,g,f=1;function x(){o(ai,j),o([mn,an],H)}function P(k,W,U,$,I){var O=c();if(j(),U&&(!y||!p())){var _=t.Layout.sliderSize(),C=Ls(k)*_*ca(fn(k)/_)||0;k=d.toPosition(t.Controller.toDest(k%_))+C}var L=Vd(O,k,1);f=1,W=L?0:W||la(fn(k-O)/sg,lg),g=$,m=$a(W,b,Jt(w,O,k,I),1),l(br),r(wa),m.start()}function b(){l(Co),g&&g(),r(Zi)}function w(k,W,U,$){var I=c(),O=k+(W-k)*B($),_=(O-I)*f;v(I+_),y&&!U&&p()&&(f*=ag,fn(_)<og&&P(u(p(!0)),rg,!1,g,!0))}function j(){m&&m.cancel()}function H(){m&&!m.isPaused()&&(j(),b())}function B(k){var W=n.easingFunc;return W?W(k):1-Math.pow(1-k,4)}return{mount:x,destroy:j,scroll:P,cancel:H}}var uo={passive:!1,capture:!0};function dg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,m=t.Media.reduce,g=t.Direction,f=g.resolve,x=g.orient,P=u.getPosition,b=u.exceededLimit,w,j,H,B,k,W=!1,U,$,I;function O(){l(y,Da,Cs,uo),l(y,za,Cs,uo),l(y,vu,C,uo),l(y,"click",S,{capture:!0}),l(y,"dragstart",Jn),o([Ri,mn],_)}function _(){var Z=n.drag;pe(!Z),B=Z==="free"}function C(Z){if(U=!1,!$){var se=ke(Z);he(Z.target)&&(se||!Z.button)&&(v.isBusy()?Jn(Z,!0):(I=se?y:window,k=c.is([Ho,br]),H=null,l(I,Da,L,uo),l(I,za,D,uo),u.cancel(),p.cancel(),K(Z)))}}function L(Z){if(c.is(ea)||(c.set(ea),r(Kd)),Z.cancelable)if(k){u.translate(w+ne(M(Z)));var se=de(Z)>ql,oe=W!==(W=b());(se||oe)&&K(Z),U=!0,r(Zd),Jn(Z)}else V(Z)&&(k=N(Z),Jn(Z))}function D(Z){c.is(ea)&&(c.set(Co),r(Jd)),k&&(T(Z),Jn(Z)),d(I,Da,L),d(I,za,D),k=!1}function S(Z){!$&&U&&Jn(Z,!0)}function K(Z){H=j,j=Z,w=P()}function T(Z){var se=ae(Z),oe=ie(se),Re=n.rewind&&n.rewindByDrag;m(!1),B?v.scroll(oe,0,n.snap):e.is(Ir)?v.go(x(Ls(se))<0?Re?"<":"-":Re?">":"+"):e.is(Lo)&&W&&Re?v.go(b(!0)?">":"<"):v.go(v.toDest(oe),!0),m(!0)}function N(Z){var se=n.dragMinThreshold,oe=sr(se),Re=oe&&se.mouse||0,$e=(oe?se.touch:+se)||10;return fn(M(Z))>(ke(Z)?$e:Re)}function V(Z){return fn(M(Z))>fn(M(Z,!0))}function ae(Z){if(e.is(Do)||!W){var se=de(Z);if(se&&se<ql)return M(Z)/se}return 0}function ie(Z){return P()+Ls(Z)*$i(fn(Z)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function M(Z,se){return le(Z,se)-le(X(Z),se)}function de(Z){return Ts(Z)-Ts(X(Z))}function X(Z){return j===Z&&H||j}function le(Z,se){return(ke(Z)?Z.changedTouches[0]:Z)["page"+f(se?"Y":"X")]}function ne(Z){return Z/(W&&e.is(Lo)?jm:1)}function he(Z){var se=n.noDrag;return!lr(Z,"."+mu+", ."+Pa)&&(!se||!lr(Z,se))}function ke(Z){return typeof TouchEvent<"u"&&Z instanceof TouchEvent}function ye(){return k}function pe(Z){$=Z}return{mount:O,disable:pe,isDragging:ye}}var ug={Spacebar:" ",Right:La,Left:Ta,Up:au,Down:su};function fl(e){return e=wi(e)?e:e.key,ug[e]||e}var Ul="keydown";function pg(e,t,n){var i=tn(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(mn,m),o(mn,y),o(ai,f)}function y(){var P=n.keyboard;P&&(u=P==="global"?window:d,r(u,Ul,x))}function m(){l(u,Ul)}function g(P){p=P}function f(){var P=p;p=!0,Wd(function(){p=P})}function x(P){if(!p){var b=fl(P);b===c(Ta)?e.go("<"):b===c(La)&&e.go(">")}}return{mount:v,destroy:m,disable:g}}var or=ol+"-lazy",ia=or+"-srcset",mg="["+or+"], ["+ia+"]";function gg(e,t,n){var i=tn(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Oo,Zi],p=[];function v(){n.lazyLoad&&(y(),o(an,y))}function y(){ri(p),m(),c?P():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(b){il(b.slide,mg).forEach(function(w){var j=En(w,or),H=En(w,ia);if(j!==w.src||H!==w.srcset){var B=n.classes.spinner,k=w.parentElement,W=Cr(k,"."+B)||xo("span",B,k);p.push([w,b,W]),w.src||ur(w,"none")}})})}function g(){p=p.filter(function(b){var w=n.perPage*((n.preloadPages||1)+1)-1;return b[1].isWithin(e.index,w)?f(b):!0}),p.length||r(u)}function f(b){var w=b[0];Bn(b[1].slide,ks),l(w,"load error",Jt(x,b)),kt(w,"src",En(w,or)),kt(w,"srcset",En(w,ia)),jn(w,or),jn(w,ia)}function x(b,w){var j=b[0],H=b[1];ti(H.slide,ks),w.type!=="error"&&(Ui(b[2]),ur(j,""),d(ul,j,H),d(To)),c&&P()}function P(){p.length&&f(p.shift())}return{mount:v,destroy:Jt(ri,p),check:g}}function hg(e,t,n){var i=tn(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,m=t.Direction.resolve,g=c.pagination,f=[],x,P;function b(){w(),o([mn,an,da],b);var $=n.pagination;g&&ur(g,$?"":"none"),$&&(o([ai,wa,Zi],U),j(),U(),r(tu,{list:x,items:f},W(e.index)))}function w(){x&&(Ui(g?Ii(x.children):x),ti(x,P),ri(f),x=null),i.destroy()}function j(){var $=e.length,I=n.classes,O=n.i18n,_=n.perPage,C=p()?u.getEnd()+1:pr($/_);x=g||xo("ul",I.pagination,c.track.parentElement),Bn(x,P=ka+"--"+k()),kt(x,ni,"tablist"),kt(x,Tn,O.select),kt(x,ml,k()===Ia?"vertical":"");for(var L=0;L<C;L++){var D=xo("li",null,x),S=xo("button",{class:I.page,type:"button"},D),K=d.getIn(L).map(function(N){return N.slide.id}),T=!p()&&_>1?O.pageX:O.slideX;l(S,"click",Jt(H,L)),n.paginationKeyboard&&l(S,"keydown",Jt(B,L)),kt(D,ni,"presentation"),kt(S,ni,"tab"),kt(S,Lr,K.join(" ")),kt(S,Tn,Is(T,L+1)),kt(S,bo,-1),f.push({li:D,button:S,page:L})}}function H($){y(">"+$,!0)}function B($,I){var O=f.length,_=fl(I),C=k(),L=-1;_===m(La,!1,C)?L=++$%O:_===m(Ta,!1,C)?L=(--$+O)%O:_==="Home"?L=0:_==="End"&&(L=O-1);var D=f[L];D&&(zd(D.button),y(">"+L),Jn(I,!0))}function k(){return n.paginationDirection||n.direction}function W($){return f[u.toPage($)]}function U(){var $=W(v(!0)),I=W(v());if($){var O=$.button;ti(O,Yi),jn(O,Bl),kt(O,bo,-1)}if(I){var _=I.button;Bn(_,Yi),kt(_,Bl,!0),kt(_,bo,"")}r(nu,{list:x,items:f},$,I)}return{items:f,mount:b,destroy:w,getAt:W,update:U}}var fg=[" ","Enter"];function yg(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 d(){r.forEach(function(g){g.destroy()}),ri(r)}function c(){d(),l()}function u(g,f){var x=tn(g);x.on(ai,function(P,b,w){f.go(f.is(Do)?w:P)}),r.push(x)}function p(){var g=tn(e),f=g.on;f(al,y),f(ou,m),f([Ri,mn],v),r.push(g),g.emit(ll,e.splides)}function v(){kt(t.Elements.list,ml,n.direction===Ia?"vertical":"")}function y(g){e.go(g.index)}function m(g,f){tl(fg,fl(f))&&(y(g),Jn(f))}return{setup:Jt(t.Media.set,{slideFocus:Sr(o)?i:o},!0),mount:l,destroy:d,remount:c}}function vg(e,t,n){var i=tn(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,uo)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=Ts(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;fn(p)>m&&y-r>g&&(e.go(v?"<":">"),r=y),c(v)&&Jn(u)}}function c(u){return!n.releaseWheel||e.state.is(Ho)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var xg=90;function bg(e,t,n){var i=tn(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=xo("span",Hm),c=$a(xg,Jt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),kt(r,Gl,!0),d.textContent="…",o(cl,Jt(y,!0)),o(dl,Jt(y,!1)),o([Oo,Zi],Jt(p,!0)))}function p(m){kt(r,Vl,m),m?($r(r,d),c.start()):(Ui(d),c.cancel())}function v(){jn(r,[jl,Gl,Vl]),Ui(d)}function y(m){l&&kt(r,jl,m?"off":"polite")}return{mount:u,disable:y,destroy:v}}var Sg=Object.freeze({__proto__:null,Media:Pm,Direction:km,Elements:Vm,Slides:Xm,Layout:qm,Clones:Ym,Move:Km,Controller:Zm,Arrows:eg,Autoplay:ng,Cover:ig,Scroll:cg,Drag:dg,Keyboard:pg,LazyLoad:gg,Pagination:hg,Sync:yg,Wheel:vg,Live:bg}),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"},$g={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:zm,i18n:wg,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Cg(e,t,n){var i=t.Slides;function o(){tn(e).on([Ri,an],r)}function r(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Wd(c)}return{mount:o,start:l,cancel:Cs}}function Tg(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Jt(kn,l,"transition"),c;function u(){tn(e).bind(l,"transitionend",function(m){m.target===l&&c&&(v(),c())})}function p(m,g){var f=i.toPosition(m,!0),x=i.getPosition(),P=y(m);fn(f-x)>=1&&P>=1?n.useScroll?r.scroll(f,P,!1,g):(d("transform "+P+"ms "+n.easing),i.translate(f,!0),c=g):(i.jump(m),g())}function v(){d(""),r.cancel()}function y(m){var g=n.rewindSpeed;if(e.is(Lo)&&g){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&m>=x||f>=x&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:v}}var Lg=(function(){function e(n,i){this.event=tn(),this.Components={},this.state=Im(go),this.splides=[],this._o={},this._E={};var o=wi(n)?jd(document,n):n;ir(o,o+" is invalid."),this.root=o,i=vi({label:En(o,Tn)||"",labelledby:En(o,pl)||""},$g,e.defaults,i||{});try{vi(i,JSON.parse(En(o,ol)))}catch{ir(!1,"Invalid JSON")}this._o=Object.create(vi({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;ir(l.is([go,sa]),"Already mounted!"),l.set(go),this._C=d,this._T=o||this._T||(this.is(Ir)?Cg:Tg),this._E=i||this._E;var c=dr({},Sg,this._E,{Transition:this._T});return Xi(c,function(u,p){var v=u(r,d,r._o);d[p]=v,v.setup&&v.setup()}),Xi(d,function(u){u.mount&&u.mount()}),this.emit(Ri),Bn(this.root,Om),l.set(Co),this.emit(Rs),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Co)&&(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(go)?tn(this).on(Rs,this.destroy.bind(this,i)):(Xi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(sl),o.destroy(),i&&ri(this.splides),r.set(sa)),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})(),yl=Lg;yl.defaults={};yl.STATES=Cm;var Yl=[[Ri,"onMounted"],[Rs,"onReady"],[ai,"onMove"],[Oo,"onMoved"],[al,"onClick"],[Xd,"onActive"],[qd,"onInactive"],[Ud,"onVisible"],[Yd,"onHidden"],[an,"onRefresh"],[mn,"onUpdated"],[To,"onResize"],[Sa,"onResized"],[Kd,"onDrag"],[Zd,"onDragging"],[Jd,"onDragged"],[wa,"onScroll"],[Zi,"onScrolled"],[sl,"onDestroy"],[Qd,"onArrowsMounted"],[eu,"onArrowsUpdated"],[tu,"onPaginationMounted"],[nu,"onPaginationUpdated"],[ll,"onNavigationMounted"],[cl,"onAutoplayPlay"],[iu,"onAutoplayPlaying"],[dl,"onAutoplayPause"],[ul,"onLazyLoadLoaded"]];function vl(...e){return e.filter(Boolean).join(" ")}function ua(e){return e!==null&&typeof e=="object"}function Es(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Es(n,t[i]));if(ua(e)&&ua(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Es(e[o],t[o]))}return e===t}function Ig(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Rg(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 Ms(e,t){const n=e;return Rg(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():ua(i)?n[o]=Ms(ua(n[o])?n[o]:{},i):n[o]=i}),n}var Pg=({children:e,className:t,...n})=>s.createElement("div",{className:vl("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),xl=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 yl(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ms({},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&&!Es(this.options,e)&&(this.splide.options=e,this.options=Ms({},e));const t=this.getSlides();Ig(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){Yl.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:vl("splide",e),ref:this.splideRef,...this.omit(o,["options",...Yl.map(r=>r[1])])},n?s.createElement(Pg,null,i):i)}},bl=({children:e,className:t,...n})=>s.createElement("li",{className:vl("splide__slide",t),...n},e);/*!
2
2
  * Splide.js
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const kg="RichTextRenderer-module__link___BWeZ2",Eg={link:kg},Mg=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))},zo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Mg(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:zo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Eg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Ag(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Ag(e){return{...e.fontFamily&&{fontFamily:zo(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 Fg="SvgImage-module__svg___q3xE-",Ng="SvgImage-module__img___VsTm-",Kl={svg:Fg,img:Ng},_g=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Wg=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,pn=({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 d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!_g(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(Kl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(Kl.svg,i),style:{"--svg":Wg(e),"--fill":t,"--hover-fill":n,...o??{}}})},Hg={"top-left":$t.topLeftAlignment,"top-center":$t.topCenterAlignment,"top-right":$t.topRightAlignment,"middle-left":$t.middleLeftAlignment,"middle-center":$t.middleCenterAlignment,"middle-right":$t.middleRightAlignment,"bottom-left":$t.bottomLeftAlignment,"bottom-center":$t.bottomCenterAlignment,"bottom-right":$t.bottomRightAlignment};function Og({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:m}=n.imageCaption??{},[g,f]=s.useState(void 0),[x,R]=s.useState(null),[b,S]=s.useState(0),[G,D]=s.useState(0),{direction:j,transition:P,controls:M,pagination:K,imageCaption:T,triggers:L}=e,_=s.useRef(P.type),{x:z,y:$}=e.controls.offset,k=W=>{o&&o.go(W)};return s.useEffect(()=>{if(!x)return;const W=new ResizeObserver(w=>{if(!o)return;const[U]=w;f({width:Math.round(U.contentRect.width),height:Math.round(U.contentRect.height)})});return W.observe(x),()=>W.unobserve(x)},[x]),s.useEffect(()=>{!o||_.current===P.type||(D(W=>W+1),_.current=P.type)},[P.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:R,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:P.backgroundColor&&P.type==="fade in"?P.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((W,w)=>a.jsx("div",{className:Ct($t.captionText,Hg[T.alignment],{[$t.withPointerEvents]:w===b&&i,[$t.active]:w===b}),style:{fontFamily:zo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(c,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(v.fontSize,i),lineHeight:F.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:m,transitionDuration:P.duration?`${Math.round(parseInt(P.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":T.linkHoverColor,"--link-color":T.linkColor,position:"relative",top:F.scalingValue(T.offset.y,i),left:F.scalingValue(T.offset.x,i)},children:a.jsx(Ki,{content:W.imageCaption})})},w))})}),a.jsx(xl,{onMove:W=>{S(W.index)},ref:r,options:{arrows:!1,speed:P.duration?parseInt(P.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:j==="horiz"||P.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:P.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((W,w)=>a.jsx(bl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:W.image.objectFit==="contain",[$t.cover]:W.image.objectFit==="cover"}),src:W.image.url,alt:W.image.name??""})})})},w))},G),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:j==="vert",[$t.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{onClick:()=>{k("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(z,i)}, ${F.scalingValue($*(j==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(pn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ct($t.arrowImg,$t.mirror)}),!M.arrowsImgUrl&&a.jsx(Zl,{color:M.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:j==="vert",[$t.hoverArrow]:M.show==="on hover"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>k("+1"),style:{transform:`translate(${F.scalingValue(z*(j==="horiz"?-1:1),i)}, ${F.scalingValue($,i)}) scale(${e.controls.scale/100}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:[M.arrowsImgUrl&&a.jsx(pn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:$t.arrowImg}),!M.arrowsImgUrl&&a.jsx(Zl,{color:M.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),K.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:K.position==="inside-1"&&j==="horiz",[$t.paginationInsideTop]:K.position==="inside-2"&&j==="horiz",[$t.paginationOutsideBottom]:K.position==="outside-1"&&j==="horiz",[$t.paginationOutsideTop]:K.position==="outside-2"&&j==="horiz",[$t.paginationInsideLeft]:K.position==="inside-1"&&j==="vert",[$t.paginationInsideRight]:K.position==="inside-2"&&j==="vert",[$t.paginationOutsideLeft]:K.position==="outside-1"&&j==="vert",[$t.paginationOutsideRight]:K.position==="outside-2"&&j==="vert",[$t.paginationVertical]:j==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:K.colors[2],transform:`scale(${K.scale/100}) translate(${F.scalingValue(K.offset.x,i)}, ${F.scalingValue(K.offset.y,i)}) rotate(${j==="horiz"?"0deg":"90deg"})`},children:t.map((W,w)=>a.jsx("button",{onClick:()=>{o&&o.go(w)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:w===b}),style:{backgroundColor:w===b?K.colors[0]:K.colors[1],"--pagination-hover-color":K.hover}})},w))})})]})})}function Zl({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 Dg={element:Og,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"]}},zg="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Bg="ImageRevealSlider-module__image___Qjt-e",jg="ImageRevealSlider-module__link___N-iLG",Vg="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:zg,image:Bg,link:jg,cursor:Vg};function Jl(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,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Gg(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ba(e);r=l.height/l.width*o}else{const l=await Ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Xg({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[y,m]=s.useState(1),[g,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[R,b]=s.useState(!1),{sizeType:S,imageWidth:G,randomRangeImageWidth:D}=e.imageSize,{revealPosition:j,visible:P}=e.position,{cursorType:M,target:K,defaultCursorScale:T,defaultCursor:L,hoverCursorScale:_,hoverCursor:z}=e.cursor;s.useEffect(()=>{if(!i)return;const W=(C,O)=>{const V=i.getBoundingClientRect(),se=C-V.left,ie=O-V.top;if(v({x:se,y:ie}),M==="system"){f("none"),m(1);return}const N=se,de=ie,X=document.elementFromPoint(V.left+N,V.top+de);if(X&&X.closest("a")){f("none"),m(1);return}const ce=Jl(N,de,r)||K==="area"?{img:z??"none",scale:_}:{img:L??"none",scale:T};f(ce.img),m(ce.scale)},w=C=>{C.stopPropagation(),x.current={x:C.clientX,y:C.clientY},W(C.clientX,C.clientY)},U=()=>{R&&W(x.current.x,x.current.y)};return i.addEventListener("mousemove",w),window.addEventListener("scroll",U,!0),()=>{i.removeEventListener("mousemove",w),window.removeEventListener("scroll",U,!0)}},[i,R,p,M,K,z,L,_,T,r]),s.useEffect(()=>{R||(f("none"),m(0))},[R]);const $=async(W,w,U,C={})=>{const{width:O,height:V,finalWidth:se}=await Gg(W.image.url,S,G,D);let ie=0,N=0;j==="same"?(ie=w/2,N=U/2):(ie=C.x??Math.random()*w,N=C.y??Math.random()*U);const de=Math.min(Math.max(ie,O/2),w-O/2),X=Math.min(Math.max(N,V/2),U-V/2);return{id:u.current++,url:W.image.url,link:W.link,name:W.image.name,x:de,y:X,width:se}};s.useEffect(()=>{if(!i||t.length===0)return;const W=i.getBoundingClientRect(),w=W.width,U=W.height,C=[];(async()=>{const V=t[0],se=await $(V,w,U);C.push(se),l(C),c(1)})()},[S,G,D,j,i]),s.useEffect(()=>{P==="last One"&&l(W=>W.length>0?[W[W.length-1]]:[])},[P]);const k=async W=>{if(!i)return;const w=i.getBoundingClientRect(),U=W.clientX-w.left,C=W.clientY-w.top;if(K==="image"&&!Jl(U,C,r))return;let O=0,V=0;j==="on Click"?(O=U,V=C):j==="same"?(O=w.width/2,V=w.height/2):(O=Math.random()*w.width,V=Math.random()*w.height);const se=t[d],ie=await $(se,w.width,w.height,{x:O,y:V});l(N=>P==="all"?[...N,ie]:[ie]),c(N=>N>=t.length-1?0:N+1)};return a.jsxs("div",{ref:o,onClick:k,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(W=>a.jsx("div",{className:no.wrapper,style:{top:`${W.y}px`,left:`${W.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:W.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:K==="area"&&W.link?a.jsx("a",{href:W.link,target:"_blank",className:no.link,children:a.jsx("img",{src:W.url,alt:W.name,className:no.image},W.id)}):a.jsx("img",{src:W.url,alt:W.name,className:no.image},W.id)},W.id)),R&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const qg={element:Xg,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:""}]}}}},Ug="LightBox-module__hidden___9s-9x",Yg="LightBox-module__heroImage___sTxNF",Kg="LightBox-module__background___rm9ml",Zg="LightBox-module__editor___4ACaY",Jg="LightBox-module__contentStyle___Bgnsq",Qg="LightBox-module__imageStyle___tLIlB",eh="LightBox-module__imgWrapper___LuFUp",th="LightBox-module__contain___8-yaS",nh="LightBox-module__cover___hNvOG",ih="LightBox-module__caption___b6L2I",oh="LightBox-module__captionTextInner___rCGNH",rh="LightBox-module__lightboxSplide___XFuWC",ah="LightBox-module__arrow___iz38X",sh="LightBox-module__arrowVertical___Zfz81",lh="LightBox-module__nextArrow___zkAQN",ch="LightBox-module__arrowInner___p48sW",dh="LightBox-module__arrowIcon___3VaFf",uh="LightBox-module__arrowImg___pNV88",ph="LightBox-module__mirror___pjeXc",mh="LightBox-module__thumbsWrapper___GB-nU",gh="LightBox-module__thumbsContainerVertical___wttk5",hh="LightBox-module__thumbsContainer___osSma",fh="LightBox-module__thumbsAlignStart___MO6tY",yh="LightBox-module__thumbsAlignCenter___Q4sUx",vh="LightBox-module__thumbsAlignEnd___p4y9R",xh="LightBox-module__thumbItem___HvnF3",bh="LightBox-module__closeButton___g2khP",Sh="LightBox-module__fadeIn___0m5GW",wh="LightBox-module__slideInLeft___gPYwC",$h="LightBox-module__slideInRight___S-pPp",Ch="LightBox-module__slideInTop___DFdAj",Th="LightBox-module__slideInBottom___m27kZ",Lh="LightBox-module__fadeOut___55qBR",Ih="LightBox-module__slideOutLeft___NvU7P",Rh="LightBox-module__slideOutRight___SK7eC",Ph="LightBox-module__slideOutTop___Vgg0z",kh="LightBox-module__slideOutBottom___nJ0Ef",Eh="LightBox-module__scaleSlide___vZriG",at={hidden:Ug,heroImage:Yg,background:Kg,editor:Zg,contentStyle:Jg,imageStyle:Qg,imgWrapper:eh,contain:th,cover:nh,caption:ih,captionTextInner:oh,lightboxSplide:rh,arrow:ah,arrowVertical:sh,nextArrow:lh,arrowInner:ch,arrowIcon:dh,arrowImg:uh,mirror:ph,thumbsWrapper:mh,thumbsContainerVertical:gh,thumbsContainer:hh,thumbsAlignStart:fh,thumbsAlignCenter:yh,thumbsAlignEnd:vh,thumbItem:xh,closeButton:bh,fadeIn:Sh,slideInLeft:wh,slideInRight:$h,slideInTop:Ch,slideInBottom:Th,fadeOut:Lh,slideOutLeft:Ih,slideOutRight:Rh,slideOutTop:Ph,slideOutBottom:kh,scaleSlide:Eh},Mr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function xu(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 Mh(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 bu(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 d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Ah(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 d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Su(e,t,n,i,o){const{x:r,y:l}=Mh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Fh(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:d}=window.getComputedStyle(e),c=l==="cover"?Ah:bu,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:v,offsetY:y}=Su(n,i,u,p,d),m=(v+u/2)/n*100,g=(y+p/2)/i*100;return`${m}% ${g}%`}function Nh(e){return Fh(e)}function pa(e){const t=e.getBoundingClientRect(),n=xu(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:d,renderedH:c}=bu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=Su(i,o,d,c,u),y=t.left+n.left,m=t.top+n.top;return{x:p+y,y:v+m,width:d,height:c}}function Ql(e){const t=e.getBoundingClientRect(),n=xu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function _h(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 Wh=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:at.heroImage,onClick:()=>c(!0)}),a.jsx(Hh,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Hh=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:m,textAppearance:g,color:f}=i.imageCaption??{},[x,R]=s.useState(0),[b,S]=s.useState(0),[G,D]=s.useState(!1),[j,P]=s.useState(!1),[M,K]=s.useState({}),T=s.useRef(null),L=s.useRef(null),_=s.useRef(null),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(null),U=s.useRef(!1),C=s.useRef(null),[O,V]=s.useState(!1),{appear:se,triggers:ie,slider:N,thumbnail:de,controls:X,area:ce,caption:oe,layout:fe}=o.lightboxBlock,{appearClass:Pe,backdropAppearClass:xe,backdropDisappearClass:pe,disappearClass:Z}=_h(se.type,se.direction),le=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Y,ee;(ee=(Y=T.current)==null?void 0:Y.splide)==null||ee.refresh()},16)},q=()=>{S(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!de.isActive){V(!1);return}const h=C.current;if(!h)return;const q=()=>{N.direction==="horiz"?V(h.scrollWidth>h.clientWidth):V(h.scrollHeight>h.clientHeight)};q();const Y=new ResizeObserver(q);return Y.observe(h),()=>Y.disconnect()},[e,de.isActive,n.length,M,N.direction]);const re=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,q=F.getColorAlpha(ce.color);h&&!l&&q>.9&&(document.body.style.backgroundColor=""),D(!0),z.current=!0;const Y=ee=>{ee.target===$.current&&ee.animationName&&($.current&&k.current&&$.current.removeEventListener("animationend",k.current),k.current=null,z.current&&(z.current=!1,t()),D(!1))};$.current&&(k.current=Y,$.current.addEventListener("animationend",Y))},[t,ce.color,l]),Ie=(h,q,Y)=>{var ee,ve;if(h){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&x===n.length-1?re():(ee=T.current)==null||ee.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const B=h.getBoundingClientRect(),I=q-B.left,Q=Y-B.top,ne=B.width,H=B.height;let te;N.direction==="horiz"?te=I<ne/2?"-1":"+1":te=Q<H/2?"-1":"+1",(ve=T.current)==null||ve.go(te)}}},we=h=>{if(U.current){U.current=!1;return}const q=n[x],Y=(q==null?void 0:q.image.objectFit)==="cover";let ee,ve;if("changedTouches"in h&&h.changedTouches.length>0)ee=h.changedTouches[0].clientX,ve=h.changedTouches[0].clientY;else if("clientX"in h)ee=h.clientX,ve=h.clientY;else return;let B;if(Y&&_.current){const I=Ql(_.current);B=ee>=I.left&&ee<=I.right&&ve>=I.top&&ve<=I.bottom}else{const I=_.current?pa(_.current):null;if(!I){h.target===h.currentTarget&&re();return}B=ee>=I.x&&ee<=I.x+I.width&&ve>=I.y&&ve<=I.y+I.height}B?Ie(_.current,ee,ve):re()},Me=h=>{const q=h.target;(q.classList.contains(at.thumbsWrapper)||q.classList.contains(at.thumbsContainer))&&we(h)};s.useEffect(()=>{if(!e)return;const h=q=>{var Y,ee;if(q.key==="Escape"){re();return}if(q.key==="ArrowRight"){R(ve=>(ve+1)%Math.max(n.length,1)),(Y=T.current)==null||Y.go("+1");return}q.key==="ArrowLeft"&&(R(ve=>(ve-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=T.current)==null||ee.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,re,n.length]),s.useEffect(()=>{if(e){if(R(0),S(q=>q+1),z.current=!1,D(!1),P(!1),K({}),!le)return;const h=new CustomEvent("page-overlay",{detail:{itemId:le}});window.dispatchEvent(h)}return()=>{$.current&&k.current&&($.current.removeEventListener("animationend",k.current),k.current=null),P(!1)}},[e,le]),s.useEffect(()=>{L.current!==null&&L.current!==N.type&&S(h=>h+1),L.current=N.type},[N.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,Y=F.getColorAlpha(ce.color);document.body.style.overflow="hidden",P(!1);const ee=B=>{B.target===$.current&&!z.current&&B.animationName&&(q&&!l&&Y>.9&&(document.body.style.backgroundColor=ce.color),P(!0),$.current&&W.current&&$.current.removeEventListener("animationend",W.current),W.current=null)};$.current&&(W.current=ee,$.current.addEventListener("animationend",ee));const ve=B=>{const I=B.target;I&&(I.closest(`.${at.thumbsWrapper}`)||I.closest(`.${at.thumbsContainer}`))||N.type!=="slide"&&B.preventDefault()};return document.addEventListener("touchmove",ve,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",ve),$.current&&W.current&&($.current.removeEventListener("animationend",W.current),W.current=null),P(!1)}},[e,l,ce.color,N.type]),s.useEffect(()=>{if(!e)return;const h=q=>{var ee,ve;if(z.current){q.stopPropagation();return}if(U.current){U.current=!1;return}const Y=q.target;if(!(Y&&(Y.closest(`.${at.thumbsContainer}`)||Y.closest(`.${at.thumbItem}`)||Y.closest(`.${at.arrow}`)||Y.closest(`.${at.closeButton}`)||Y.closest(`.${at.caption}`)))){if(N.type==="slide"&&ie.type==="drag"&&((ve=(ee=T.current)==null?void 0:ee.splide)!=null&&ve.root)){const B=T.current.splide.root;if(Y&&(B.contains(Y)||B===Y))return}if(q.touches.length===0&&q.changedTouches.length>0){const B=n[x],I=(B==null?void 0:B.image.objectFit)==="cover",Q=q.changedTouches[0];let ne;if(I&&_.current){const H=Ql(_.current);ne=Q.clientX>=H.left&&Q.clientX<=H.right&&Q.clientY>=H.top&&Q.clientY<=H.bottom}else{const H=_.current?pa(_.current):null;if(!H)return;ne=Q.clientX>=H.x&&Q.clientX<=H.x+H.width&&Q.clientY>=H.y&&Q.clientY<=H.y+H.height}if(!ne){q.stopPropagation(),z.current=!0;const H=te=>{te.stopPropagation(),te.preventDefault(),document.removeEventListener("click",H,!0)};document.addEventListener("click",H,!0),re()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,re,x,n]);const ye=(N.type==="scale"||N.type==="fade")&&N.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var te,ke;if(!e||!ye||!((ke=(te=T.current)==null?void 0:te.splide)!=null&&ke.root))return;const h=T.current.splide.root,q=30,Y=(ge,J)=>{if(w.current){const Ye=Math.abs(ge-w.current.x),je=Math.abs(J-w.current.y);(Ye>0||je>0)&&(U.current=!0)}},ee=ge=>{w.current&&(ge.preventDefault(),Y(ge.clientX,ge.clientY))},ve=ge=>{w.current&&ge.touches.length>0&&(ge.preventDefault(),Y(ge.touches[0].clientX,ge.touches[0].clientY))},B=(ge,J)=>{if(!w.current||!T.current){w.current=null;return}const Ye=Math.abs(ge-w.current.x),je=Math.abs(J-w.current.y);je>q&&je>Ye&&T.current.go(J<w.current.y?"+1":"-1"),w.current=null},I=ge=>{w.current&&B(ge.clientX,ge.clientY),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("pointermove",ee)},Q=ge=>{if(w.current){if(ge.changedTouches.length>0){const J=ge.changedTouches[0];B(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",ve)}},ne=ge=>{w.current={x:ge.clientX,y:ge.clientY},U.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",I),document.addEventListener("pointercancel",I)},H=ge=>{ge.touches.length>0&&(w.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},U.current=!1,document.addEventListener("touchmove",ve,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",ne),h.addEventListener("touchstart",H),()=>{h.removeEventListener("pointerdown",ne),h.removeEventListener("touchstart",H),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",I),document.removeEventListener("pointercancel",I),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),w.current=null,U.current=!1}},[e,ye,b]);const be={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:ai.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:$,className:Ct(at.background,G?pe:xe,{[at.editor]:l},{[at.hidden]:!e}),style:{...be,...j&&!l&&!G?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?$:null,className:Ct(at.contentStyle,G?Z:Pe,{[at.editor]:l},{[at.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(xl,{onMove:h=>R(h.index),ref:T,className:at.lightboxSplide,options:{arrows:!1,speed:N.duration?parseInt(N.duration):500,direction:N.direction==="horiz"||N.type==="fade"||N.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ye,perPage:1,width:"100%",height:"100%",type:N.type==="fade"||N.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":N.duration},children:n.map((h,q)=>{const Y=Mr(fe.position,fe.offset,l),ee=`${F.scalingValue(fe.padding.top,l)} ${F.scalingValue(fe.padding.right,l)} ${F.scalingValue(fe.padding.bottom,l)} ${F.scalingValue(fe.padding.left,l)}`,ve=N.type==="scale"?(()=>{const{transform:B,...I}=Y;return{...I,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":B||"none"}})():{...Y,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(bl,{children:a.jsx("div",{className:at.imgWrapper,onClick:we,children:a.jsx("img",{ref:q===x?_:null,className:Ct(at.imageStyle,{[at.contain]:h.image.objectFit==="contain",[at.cover]:h.image.objectFit==="cover",[at.scaleSlide]:N.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...ve,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},q)})},b),X.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(at.arrow,{[at.arrowVertical]:N.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x,l)}, ${F.scalingValue(X.offset.y*(N.direction==="horiz"?1:-1),l)}) scale(${X.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:Ct(at.arrowImg,at.mirror)}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(at.arrowIcon,at.arrowImg,at.mirror)})]})}),a.jsx("div",{className:Ct(at.arrow,at.nextArrow,{[at.arrowVertical]:N.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:at.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x*(N.direction==="horiz"?-1:1),l)}, ${F.scalingValue(X.offset.y,l)}) scale(${X.scale}) rotate(${N.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:at.arrowImg}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(at.arrowIcon,at.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const h=Mr(ce.closeIconAlign,ce.closeIconOffset,l),q=`scale(${ce.closeIconScale})`,Y=h.transform?`${h.transform} ${q}`:q;return a.jsx("button",{className:at.closeButton,style:{...h,transform:Y},onClick:re,"aria-label":"Close lightbox",children:a.jsx(pn,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),oe&&oe.isActive&&i.imageCaption&&((Ce=n[x])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:at.caption,style:{...Mr(oe.alignment,oe.offset,l),fontFamily:zo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":F.scalingValue(c.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(y,l),textAlign:v,fontSize:F.scalingValue(m.fontSize,l),lineHeight:F.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:f},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-color":oe.linkColor,"--link-hover-color":oe.linkHoverColor},children:a.jsx(Ki,{content:n[x].imageCaption})})}),de.isActive&&(()=>{const[h,q]=de.position.split("-"),Y=N.direction==="horiz"?`${h}-left`:de.position,ee=Mr(Y,de.offset,l),ve=()=>{if(N.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="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:C,className:at.thumbsWrapper,onClick:B=>Me(B),style:{position:l?"absolute":"fixed",...ee,...N.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(at.thumbsContainer,{[at.thumbsContainerVertical]:N.direction==="vert",[at.thumbsAlignStart]:de.align==="start",[at.thumbsAlignCenter]:de.align==="center",[at.thumbsAlignEnd]:de.align==="end"}),style:{gap:F.scalingValue(de.grid.gap,l),justifyContent:O?"flex-start":ve()},children:n.map((B,I)=>{const Q=I===x,ne=M[I],te=de.grid.size*(Q?de.activeState.scale:1),ke=()=>{if(de.fit!=="fit")return{};if(!ne)return N.direction==="horiz"?{height:F.scalingValue(te,l)}:{width:F.scalingValue(te,l)};const ge=ne.width/ne.height;if(N.direction==="horiz"){const J=te,Ye=J*ge;return{width:F.scalingValue(Ye,l),height:F.scalingValue(J,l)}}else{const J=te,Ye=J/ge;return{width:F.scalingValue(J,l),height:F.scalingValue(Ye,l)}}};return a.jsx("button",{className:at.thumbItem,style:{...N.direction==="horiz"&&de.fit!=="fit"?{height:F.scalingValue(te,l)}:{},...N.direction==="vert"&&de.fit!=="fit"?{width:F.scalingValue(te,l)}:{},...de.fit==="cover"?{width:F.scalingValue(te,l),height:F.scalingValue(te,l)}:{},...ke(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:ge=>{var J;ge.stopPropagation(),R(I),(J=T.current)==null||J.go(I)},onMouseEnter:()=>{var ge;de.triggers==="hov"&&((ge=T.current)==null||ge.go(I))},children:a.jsx("img",{src:B.image.url,alt:B.image.name??"",onLoad:ge=>{const J=ge.currentTarget;J.naturalWidth&&J.naturalHeight&&K(Ye=>({...Ye,[I]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${B.image.name}-${I}`)})})})})()]})]}),document.getElementById(r))};function ec({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 Oh={element:Wh,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 Ar(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dh(e){return`
6
+ */const kg="RichTextRenderer-module__link___BWeZ2",Eg={link:kg},Mg=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))},zo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Mg(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:zo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:F.scalingValue(e.letterSpacing,t),wordSpacing:F.scalingValue(e.wordSpacing,t),fontSize:F.scalingValue(n,t),lineHeight:i!==void 0?F.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(r=e.textAppearance)==null?void 0:r.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const Ki=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Eg.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Ag(i),children:i.text},o));return a.jsx(a.Fragment,{children:e.map((n,i)=>{const o=n.children;return a.jsx("div",{children:t(o)},i)})})};function Ag(e){return{...e.fontFamily&&{fontFamily:zo(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 Fg="SvgImage-module__svg___q3xE-",Ng="SvgImage-module__img___VsTm-",Kl={svg:Fg,img:Ng},_g=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Wg=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,pn=({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 d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!_g(e)||!r?a.jsx("img",{src:e,alt:"",className:Ct(Kl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:Ct(Kl.svg,i),style:{"--svg":Wg(e),"--fill":t,"--hover-fill":n,...o??{}}})},Hg={"top-left":$t.topLeftAlignment,"top-center":$t.topCenterAlignment,"top-right":$t.topRightAlignment,"middle-left":$t.middleLeftAlignment,"middle-center":$t.middleCenterAlignment,"middle-right":$t.middleRightAlignment,"bottom-left":$t.bottomLeftAlignment,"bottom-center":$t.bottomCenterAlignment,"bottom-right":$t.bottomRightAlignment};function Og({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:m}=n.imageCaption??{},[g,f]=s.useState(void 0),[x,P]=s.useState(null),[b,w]=s.useState(0),[j,H]=s.useState(0),{direction:B,transition:k,controls:W,pagination:U,imageCaption:$,triggers:I}=e,O=s.useRef(k.type),{x:_,y:C}=e.controls.offset,L=D=>{o&&o.go(D)};return s.useEffect(()=>{if(!x)return;const D=new ResizeObserver(S=>{if(!o)return;const[K]=S;f({width:Math.round(K.contentRect.width),height:Math.round(K.contentRect.height)})});return D.observe(x),()=>D.unobserve(x)},[x]),s.useEffect(()=>{!o||O.current===k.type||(H(D=>D+1),O.current=k.type)},[k.type]),a.jsx("div",{className:Ct($t.wrapper,{[$t.editor]:i}),ref:P,children:a.jsxs("div",{className:$t.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:k.backgroundColor&&k.type==="fade in"?k.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:Ct($t.captionBlock),children:a.jsx("div",{className:$t.captionTextWrapper,children:t.map((D,S)=>a.jsx("div",{className:Ct($t.captionText,Hg[$.alignment],{[$t.withPointerEvents]:S===b&&i,[$t.active]:S===b}),style:{fontFamily:zo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":F.scalingValue(l.width,i),letterSpacing:F.scalingValue(c,i),wordSpacing:F.scalingValue(p,i),textAlign:u,fontSize:F.scalingValue(v.fontSize,i),lineHeight:F.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:m,transitionDuration:k.duration?`${Math.round(parseInt(k.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:$t.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:F.scalingValue($.offset.y,i),left:F.scalingValue($.offset.x,i)},children:a.jsx(Ki,{content:D.imageCaption})})},S))})}),a.jsx(xl,{onMove:D=>{w(D.index)},ref:r,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:B==="horiz"||k.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:k.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((D,S)=>a.jsx(bl,{children:a.jsx("div",{className:$t.sliderItem,children:a.jsx("div",{className:$t.imgWrapper,children:a.jsx("img",{className:Ct($t.sliderImage,{[$t.contain]:D.image.objectFit==="contain",[$t.cover]:D.image.objectFit==="cover"}),src:D.image.url,alt:D.image.name??""})})})},S))},j),W.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct($t.arrow,{[$t.arrowVertical]:B==="vert",[$t.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:a.jsxs("button",{onClick:()=>{L("-1")},className:$t.arrowInner,style:{transform:`translate(${F.scalingValue(_,i)}, ${F.scalingValue(C*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&a.jsx(pn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:Ct($t.arrowImg,$t.mirror)}),!W.arrowsImgUrl&&a.jsx(Zl,{color:W.color,className:Ct($t.arrowIcon,$t.arrowImg,$t.mirror)})]})}),a.jsx("div",{className:Ct($t.arrow,$t.nextArrow,{[$t.arrowVertical]:B==="vert",[$t.hoverArrow]:W.show==="on hover"}),style:{color:W.color,"--arrow-hover-color":W.hover},children:a.jsxs("button",{className:$t.arrowInner,onClick:()=>L("+1"),style:{transform:`translate(${F.scalingValue(_*(B==="horiz"?-1:1),i)}, ${F.scalingValue(C,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[W.arrowsImgUrl&&a.jsx(pn,{url:W.arrowsImgUrl,fill:W.color,hoverFill:W.hover,className:$t.arrowImg}),!W.arrowsImgUrl&&a.jsx(Zl,{color:W.color,className:Ct($t.arrowIcon,$t.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:$t.clickOverlay,onClick:()=>{o&&o.go("+1")}}),U.isActive&&a.jsx("div",{className:Ct($t.pagination,{[$t.paginationInsideBottom]:U.position==="inside-1"&&B==="horiz",[$t.paginationInsideTop]:U.position==="inside-2"&&B==="horiz",[$t.paginationOutsideBottom]:U.position==="outside-1"&&B==="horiz",[$t.paginationOutsideTop]:U.position==="outside-2"&&B==="horiz",[$t.paginationInsideLeft]:U.position==="inside-1"&&B==="vert",[$t.paginationInsideRight]:U.position==="inside-2"&&B==="vert",[$t.paginationOutsideLeft]:U.position==="outside-1"&&B==="vert",[$t.paginationOutsideRight]:U.position==="outside-2"&&B==="vert",[$t.paginationVertical]:B==="vert"}),children:a.jsx("div",{className:$t.paginationInner,style:{backgroundColor:U.colors[2],transform:`scale(${U.scale/100}) translate(${F.scalingValue(U.offset.x,i)}, ${F.scalingValue(U.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((D,S)=>a.jsx("button",{onClick:()=>{o&&o.go(S)},className:Ct($t.paginationItem),children:a.jsx("div",{className:Ct($t.dot,{[$t.activeDot]:S===b}),style:{backgroundColor:S===b?U.colors[0]:U.colors[1],"--pagination-hover-color":U.hover}})},S))})})]})})}function Zl({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 Dg={element:Og,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"]}},zg="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Bg="ImageRevealSlider-module__image___Qjt-e",jg="ImageRevealSlider-module__link___N-iLG",Vg="ImageRevealSlider-module__cursor___2U03d",no={imageRevealSlider:zg,image:Bg,link:jg,cursor:Vg};function Jl(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,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function Ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function Gg(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await Ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Ba(e);r=l.height/l.width*o}else{const l=await Ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Xg({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,v]=s.useState({x:0,y:0}),[y,m]=s.useState(1),[g,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[P,b]=s.useState(!1),{sizeType:w,imageWidth:j,randomRangeImageWidth:H}=e.imageSize,{revealPosition:B,visible:k}=e.position,{cursorType:W,target:U,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:O,hoverCursor:_}=e.cursor;s.useEffect(()=>{if(!i)return;const D=(T,N)=>{const V=i.getBoundingClientRect(),ae=T-V.left,ie=N-V.top;if(v({x:ae,y:ie}),W==="system"){f("none"),m(1);return}const M=ae,de=ie,X=document.elementFromPoint(V.left+M,V.top+de);if(X&&X.closest("a")){f("none"),m(1);return}const le=Jl(M,de,r)||U==="area"?{img:_??"none",scale:O}:{img:I??"none",scale:$};f(le.img),m(le.scale)},S=T=>{T.stopPropagation(),x.current={x:T.clientX,y:T.clientY},D(T.clientX,T.clientY)},K=()=>{P&&D(x.current.x,x.current.y)};return i.addEventListener("mousemove",S),window.addEventListener("scroll",K,!0),()=>{i.removeEventListener("mousemove",S),window.removeEventListener("scroll",K,!0)}},[i,P,p,W,U,_,I,O,$,r]),s.useEffect(()=>{P||(f("none"),m(0))},[P]);const C=async(D,S,K,T={})=>{const{width:N,height:V,finalWidth:ae}=await Gg(D.image.url,w,j,H);let ie=0,M=0;B==="same"?(ie=S/2,M=K/2):(ie=T.x??Math.random()*S,M=T.y??Math.random()*K);const de=Math.min(Math.max(ie,N/2),S-N/2),X=Math.min(Math.max(M,V/2),K-V/2);return{id:u.current++,url:D.image.url,link:D.link,name:D.image.name,x:de,y:X,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const D=i.getBoundingClientRect(),S=D.width,K=D.height,T=[];(async()=>{const V=t[0],ae=await C(V,S,K);T.push(ae),l(T),c(1)})()},[w,j,H,B,i]),s.useEffect(()=>{k==="last One"&&l(D=>D.length>0?[D[D.length-1]]:[])},[k]);const L=async D=>{if(!i)return;const S=i.getBoundingClientRect(),K=D.clientX-S.left,T=D.clientY-S.top;if(U==="image"&&!Jl(K,T,r))return;let N=0,V=0;B==="on Click"?(N=K,V=T):B==="same"?(N=S.width/2,V=S.height/2):(N=Math.random()*S.width,V=Math.random()*S.height);const ae=t[d],ie=await C(ae,S.width,S.height,{x:N,y:V});l(M=>k==="all"?[...M,ie]:[ie]),c(M=>M>=t.length-1?0:M+1)};return a.jsxs("div",{ref:o,onClick:L,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:no.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(D=>a.jsx("div",{className:no.wrapper,style:{top:`${D.y}px`,left:`${D.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:D.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:U==="area"&&D.link?a.jsx("a",{href:D.link,target:"_blank",className:no.link,children:a.jsx("img",{src:D.url,alt:D.name,className:no.image},D.id)}):a.jsx("img",{src:D.url,alt:D.name,className:no.image},D.id)},D.id)),P&&a.jsx("div",{className:no.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const qg={element:Xg,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:""}]}}}},Ug="LightBox-module__hidden___9s-9x",Yg="LightBox-module__heroImage___sTxNF",Kg="LightBox-module__background___rm9ml",Zg="LightBox-module__editor___4ACaY",Jg="LightBox-module__contentStyle___Bgnsq",Qg="LightBox-module__imageStyle___tLIlB",eh="LightBox-module__imgWrapper___LuFUp",th="LightBox-module__contain___8-yaS",nh="LightBox-module__cover___hNvOG",ih="LightBox-module__caption___b6L2I",oh="LightBox-module__captionTextInner___rCGNH",rh="LightBox-module__lightboxSplide___XFuWC",ah="LightBox-module__arrow___iz38X",sh="LightBox-module__arrowVertical___Zfz81",lh="LightBox-module__nextArrow___zkAQN",ch="LightBox-module__arrowInner___p48sW",dh="LightBox-module__arrowIcon___3VaFf",uh="LightBox-module__arrowImg___pNV88",ph="LightBox-module__mirror___pjeXc",mh="LightBox-module__thumbsWrapper___GB-nU",gh="LightBox-module__thumbsContainerVertical___wttk5",hh="LightBox-module__thumbsContainer___osSma",fh="LightBox-module__thumbsAlignStart___MO6tY",yh="LightBox-module__thumbsAlignCenter___Q4sUx",vh="LightBox-module__thumbsAlignEnd___p4y9R",xh="LightBox-module__thumbItem___HvnF3",bh="LightBox-module__closeButton___g2khP",Sh="LightBox-module__fadeIn___0m5GW",wh="LightBox-module__slideInLeft___gPYwC",$h="LightBox-module__slideInRight___S-pPp",Ch="LightBox-module__slideInTop___DFdAj",Th="LightBox-module__slideInBottom___m27kZ",Lh="LightBox-module__fadeOut___55qBR",Ih="LightBox-module__slideOutLeft___NvU7P",Rh="LightBox-module__slideOutRight___SK7eC",Ph="LightBox-module__slideOutTop___Vgg0z",kh="LightBox-module__slideOutBottom___nJ0Ef",Eh="LightBox-module__scaleSlide___vZriG",rt={hidden:Ug,heroImage:Yg,background:Kg,editor:Zg,contentStyle:Jg,imageStyle:Qg,imgWrapper:eh,contain:th,cover:nh,caption:ih,captionTextInner:oh,lightboxSplide:rh,arrow:ah,arrowVertical:sh,nextArrow:lh,arrowInner:ch,arrowIcon:dh,arrowImg:uh,mirror:ph,thumbsWrapper:mh,thumbsContainerVertical:gh,thumbsContainer:hh,thumbsAlignStart:fh,thumbsAlignCenter:yh,thumbsAlignEnd:vh,thumbItem:xh,closeButton:bh,fadeIn:Sh,slideInLeft:wh,slideInRight:$h,slideInTop:Ch,slideInBottom:Th,fadeOut:Lh,slideOutLeft:Ih,slideOutRight:Rh,slideOutTop:Ph,slideOutBottom:kh,scaleSlide:Eh},Mr=(e,t,n)=>{const i={},[o,r]=e.split("-");return o==="top"?(i.top="0",i.bottom="auto"):o==="middle"?(i.top="50%",i.bottom="auto"):o==="bottom"&&(i.top="auto",i.bottom="0"),r==="left"?(i.left="0",i.right="auto"):r==="center"?(i.left="50%",i.right="auto"):r==="right"&&(i.left="auto",i.right="0"),o==="middle"&&r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), calc(-50% + ${F.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${F.scalingValue(t.x,n)}, calc(-50% + ${F.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${F.scalingValue(t.x,n)}), ${F.scalingValue(t.y,n)})`:i.transform=`translate(${F.scalingValue(t.x,n)}, ${F.scalingValue(t.y,n)})`,i};function xu(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 Mh(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 bu(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 d=e;return{renderedW:d,renderedH:d/r}}const l=t;return{renderedW:l*r,renderedH:l}}function Ah(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 d=t;return{renderedW:d*r,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/r}}function Su(e,t,n,i,o){const{x:r,y:l}=Mh(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Fh(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:d}=window.getComputedStyle(e),c=l==="cover"?Ah:bu,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:v,offsetY:y}=Su(n,i,u,p,d),m=(v+u/2)/n*100,g=(y+p/2)/i*100;return`${m}% ${g}%`}function Nh(e){return Fh(e)}function pa(e){const t=e.getBoundingClientRect(),n=xu(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:d,renderedH:c}=bu(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=Su(i,o,d,c,u),y=t.left+n.left,m=t.top+n.top;return{x:p+y,y:v+m,width:d,height:c}}function Ql(e){const t=e.getBoundingClientRect(),n=xu(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function _h(e,t){const n=(()=>{if(e==="fade in")return rt.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return rt.slideInLeft;case"right":return rt.slideInRight;case"top":return rt.slideInTop;case"bottom":return rt.slideInBottom;default:return rt.slideInRight}return rt.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return rt.fadeIn;if(e==="slide in")switch(t){case"left":return rt.slideInLeft;case"right":return rt.slideInRight;case"top":return rt.slideInTop;case"bottom":return rt.slideInBottom;default:return rt.slideInRight}return rt.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return rt.fadeOut;if(e==="slide in")switch(t){case"left":return rt.slideOutLeft;case"right":return rt.slideOutRight;case"top":return rt.slideOutTop;case"bottom":return rt.slideOutBottom;default:return rt.slideOutRight}return rt.fadeOut})(),r=(()=>{if(e==="fade in")return rt.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return rt.slideOutLeft;case"right":return rt.slideOutRight;case"top":return rt.slideOutTop;case"bottom":return rt.slideOutBottom;default:return rt.slideOutRight}return rt.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Wh=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:r,isPreviewMode:l})=>{const[d,c]=s.useState(!1),{url:u}=e.thumbnailBlock.cover;return s.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),a.jsxs(a.Fragment,{children:[a.jsx("img",{src:u,alt:"Cover",className:rt.heroImage,onClick:()=>c(!0)}),a.jsx(Hh,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Hh=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:m,textAppearance:g,color:f}=i.imageCaption??{},[x,P]=s.useState(0),[b,w]=s.useState(0),[j,H]=s.useState(!1),[B,k]=s.useState(!1),[W,U]=s.useState({}),$=s.useRef(null),I=s.useRef(null),O=s.useRef(null),_=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(null),K=s.useRef(!1),T=s.useRef(null),[N,V]=s.useState(!1),{appear:ae,triggers:ie,slider:M,thumbnail:de,controls:X,area:le,caption:ne,layout:he}=o.lightboxBlock,{appearClass:ke,backdropAppearClass:ye,backdropDisappearClass:pe,disappearClass:Z}=_h(ae.type,ae.direction),se=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var Y,ee;(ee=(Y=$.current)==null?void 0:Y.splide)==null||ee.refresh()},16)},q=()=>{w(Y=>Y+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!de.isActive){V(!1);return}const h=T.current;if(!h)return;const q=()=>{M.direction==="horiz"?V(h.scrollWidth>h.clientWidth):V(h.scrollHeight>h.clientHeight)};q();const Y=new ResizeObserver(q);return Y.observe(h),()=>Y.disconnect()},[e,de.isActive,n.length,W,M.direction]);const oe=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,q=F.getColorAlpha(le.color);h&&!l&&q>.9&&(document.body.style.backgroundColor=""),H(!0),_.current=!0;const Y=ee=>{ee.target===C.current&&ee.animationName&&(C.current&&L.current&&C.current.removeEventListener("animationend",L.current),L.current=null,_.current&&(_.current=!1,t()),H(!1))};C.current&&(L.current=Y,C.current.addEventListener("animationend",Y))},[t,le.color,l]),Re=(h,q,Y)=>{var ee,fe;if(h){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&x===n.length-1?oe():(ee=$.current)==null||ee.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const z=h.getBoundingClientRect(),R=q-z.left,Q=Y-z.top,te=z.width,ce=z.height;let G;M.direction==="horiz"?G=R<te/2?"-1":"+1":G=Q<ce/2?"-1":"+1",(fe=$.current)==null||fe.go(G)}}},$e=h=>{if(K.current){K.current=!1;return}const q=n[x],Y=(q==null?void 0:q.image.objectFit)==="cover";let ee,fe;if("changedTouches"in h&&h.changedTouches.length>0)ee=h.changedTouches[0].clientX,fe=h.changedTouches[0].clientY;else if("clientX"in h)ee=h.clientX,fe=h.clientY;else return;let z;if(Y&&O.current){const R=Ql(O.current);z=ee>=R.left&&ee<=R.right&&fe>=R.top&&fe<=R.bottom}else{const R=O.current?pa(O.current):null;if(!R){h.target===h.currentTarget&&oe();return}z=ee>=R.x&&ee<=R.x+R.width&&fe>=R.y&&fe<=R.y+R.height}z?Re(O.current,ee,fe):oe()},Me=h=>{const q=h.target;(q.classList.contains(rt.thumbsWrapper)||q.classList.contains(rt.thumbsContainer))&&$e(h)};s.useEffect(()=>{if(!e)return;const h=q=>{var Y,ee;if(q.key==="Escape"){oe();return}if(q.key==="ArrowRight"){P(fe=>(fe+1)%Math.max(n.length,1)),(Y=$.current)==null||Y.go("+1");return}q.key==="ArrowLeft"&&(P(fe=>(fe-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=$.current)==null||ee.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(P(0),w(q=>q+1),_.current=!1,H(!1),k(!1),U({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{C.current&&L.current&&(C.current.removeEventListener("animationend",L.current),L.current=null),k(!1)}},[e,se]),s.useEffect(()=>{I.current!==null&&I.current!==M.type&&w(h=>h+1),I.current=M.type},[M.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,Y=F.getColorAlpha(le.color);document.body.style.overflow="hidden",k(!1);const ee=z=>{z.target===C.current&&!_.current&&z.animationName&&(q&&!l&&Y>.9&&(document.body.style.backgroundColor=le.color),k(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=ee,C.current.addEventListener("animationend",ee));const fe=z=>{const R=z.target;R&&(R.closest(`.${rt.thumbsWrapper}`)||R.closest(`.${rt.thumbsContainer}`))||M.type!=="slide"&&z.preventDefault()};return document.addEventListener("touchmove",fe,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",fe),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),k(!1)}},[e,l,le.color,M.type]),s.useEffect(()=>{if(!e)return;const h=q=>{var ee,fe;if(_.current){q.stopPropagation();return}if(K.current){K.current=!1;return}const Y=q.target;if(!(Y&&(Y.closest(`.${rt.thumbsContainer}`)||Y.closest(`.${rt.thumbItem}`)||Y.closest(`.${rt.arrow}`)||Y.closest(`.${rt.closeButton}`)||Y.closest(`.${rt.caption}`)))){if(M.type==="slide"&&ie.type==="drag"&&((fe=(ee=$.current)==null?void 0:ee.splide)!=null&&fe.root)){const z=$.current.splide.root;if(Y&&(z.contains(Y)||z===Y))return}if(q.touches.length===0&&q.changedTouches.length>0){const z=n[x],R=(z==null?void 0:z.image.objectFit)==="cover",Q=q.changedTouches[0];let te;if(R&&O.current){const ce=Ql(O.current);te=Q.clientX>=ce.left&&Q.clientX<=ce.right&&Q.clientY>=ce.top&&Q.clientY<=ce.bottom}else{const ce=O.current?pa(O.current):null;if(!ce)return;te=Q.clientX>=ce.x&&Q.clientX<=ce.x+ce.width&&Q.clientY>=ce.y&&Q.clientY<=ce.y+ce.height}if(!te){q.stopPropagation(),_.current=!0;const ce=G=>{G.stopPropagation(),G.preventDefault(),document.removeEventListener("click",ce,!0)};document.addEventListener("click",ce,!0),oe()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,oe,x,n]);const ve=(M.type==="scale"||M.type==="fade")&&M.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var G,Ie;if(!e||!ve||!((Ie=(G=$.current)==null?void 0:G.splide)!=null&&Ie.root))return;const h=$.current.splide.root,q=30,Y=(xe,J)=>{if(S.current){const He=Math.abs(xe-S.current.x),je=Math.abs(J-S.current.y);(He>0||je>0)&&(K.current=!0)}},ee=xe=>{S.current&&(xe.preventDefault(),Y(xe.clientX,xe.clientY))},fe=xe=>{S.current&&xe.touches.length>0&&(xe.preventDefault(),Y(xe.touches[0].clientX,xe.touches[0].clientY))},z=(xe,J)=>{if(!S.current||!$.current){S.current=null;return}const He=Math.abs(xe-S.current.x),je=Math.abs(J-S.current.y);je>q&&je>He&&$.current.go(J<S.current.y?"+1":"-1"),S.current=null},R=xe=>{S.current&&z(xe.clientX,xe.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ee)},Q=xe=>{if(S.current){if(xe.changedTouches.length>0){const J=xe.changedTouches[0];z(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",fe)}},te=xe=>{S.current={x:xe.clientX,y:xe.clientY},K.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},ce=xe=>{xe.touches.length>0&&(S.current={x:xe.touches[0].clientX,y:xe.touches[0].clientY},K.current=!1,document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",te),h.addEventListener("touchstart",ce),()=>{h.removeEventListener("pointerdown",te),h.removeEventListener("touchstart",ce),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),S.current=null,K.current=!1}},[e,ve,b]);const Se={backgroundColor:le.color,backdropFilter:`blur(${le.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:si.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:C,className:Ct(rt.background,j?pe:ye,{[rt.editor]:l},{[rt.hidden]:!e}),style:{...Se,...B&&!l&&!j?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?C:null,className:Ct(rt.contentStyle,j?Z:ke,{[rt.editor]:l},{[rt.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(xl,{onMove:h=>P(h.index),ref:$,className:rt.lightboxSplide,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,direction:M.direction==="horiz"||M.type==="fade"||M.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ve,perPage:1,width:"100%",height:"100%",type:M.type==="fade"||M.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":M.duration},children:n.map((h,q)=>{const Y=Mr(he.position,he.offset,l),ee=`${F.scalingValue(he.padding.top,l)} ${F.scalingValue(he.padding.right,l)} ${F.scalingValue(he.padding.bottom,l)} ${F.scalingValue(he.padding.left,l)}`,fe=M.type==="scale"?(()=>{const{transform:z,...R}=Y;return{...R,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":z||"none"}})():{...Y,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(bl,{children:a.jsx("div",{className:rt.imgWrapper,onClick:$e,children:a.jsx("img",{ref:q===x?O:null,className:Ct(rt.imageStyle,{[rt.contain]:h.image.objectFit==="contain",[rt.cover]:h.image.objectFit==="cover",[rt.scaleSlide]:M.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...fe,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},q)})},b),X.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(rt.arrow,{[rt.arrowVertical]:M.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x,l)}, ${F.scalingValue(X.offset.y*(M.direction==="horiz"?1:-1),l)}) scale(${X.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:Ct(rt.arrowImg,rt.mirror)}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),a.jsx("div",{className:Ct(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:M.direction==="vert"}),style:{color:X.color,"--arrow-hover-color":X.hover},children:a.jsxs("button",{className:rt.arrowInner,style:{transform:`translate(${F.scalingValue(X.offset.x*(M.direction==="horiz"?-1:1),l)}, ${F.scalingValue(X.offset.y,l)}) scale(${X.scale}) rotate(${M.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=$.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[X.arrowsImgUrl&&a.jsx(pn,{url:X.arrowsImgUrl,fill:X.color,hoverFill:X.hover,className:rt.arrowImg}),!X.arrowsImgUrl&&a.jsx(ec,{color:X.color,className:Ct(rt.arrowIcon,rt.arrowImg)})]})})]}),le.closeIconUrl&&(()=>{const h=Mr(le.closeIconAlign,le.closeIconOffset,l),q=`scale(${le.closeIconScale})`,Y=h.transform?`${h.transform} ${q}`:q;return a.jsx("button",{className:rt.closeButton,style:{...h,transform:Y},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(pn,{url:le.closeIconUrl,fill:le.closeIconColor??"#000000",hoverFill:le.closeIconHover??"#cccccc"})})})(),ne&&ne.isActive&&i.imageCaption&&((Ce=n[x])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:rt.caption,style:{...Mr(ne.alignment,ne.offset,l),fontFamily:zo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":F.scalingValue(c.width,l),letterSpacing:F.scalingValue(p,l),wordSpacing:F.scalingValue(y,l),textAlign:v,fontSize:F.scalingValue(m.fontSize,l),lineHeight:F.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:f},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-color":ne.linkColor,"--link-hover-color":ne.linkHoverColor},children:a.jsx(Ki,{content:n[x].imageCaption})})}),de.isActive&&(()=>{const[h,q]=de.position.split("-"),Y=M.direction==="horiz"?`${h}-left`:de.position,ee=Mr(Y,de.offset,l),fe=()=>{if(M.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="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:T,className:rt.thumbsWrapper,onClick:z=>Me(z),style:{position:l?"absolute":"fixed",...ee,...M.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:Ct(rt.thumbsContainer,{[rt.thumbsContainerVertical]:M.direction==="vert",[rt.thumbsAlignStart]:de.align==="start",[rt.thumbsAlignCenter]:de.align==="center",[rt.thumbsAlignEnd]:de.align==="end"}),style:{gap:F.scalingValue(de.grid.gap,l),justifyContent:N?"flex-start":fe()},children:n.map((z,R)=>{const Q=R===x,te=W[R],G=de.grid.size*(Q?de.activeState.scale:1),Ie=()=>{if(de.fit!=="fit")return{};if(!te)return M.direction==="horiz"?{height:F.scalingValue(G,l)}:{width:F.scalingValue(G,l)};const xe=te.width/te.height;if(M.direction==="horiz"){const J=G,He=J*xe;return{width:F.scalingValue(He,l),height:F.scalingValue(J,l)}}else{const J=G,He=J/xe;return{width:F.scalingValue(J,l),height:F.scalingValue(He,l)}}};return a.jsx("button",{className:rt.thumbItem,style:{...M.direction==="horiz"&&de.fit!=="fit"?{height:F.scalingValue(G,l)}:{},...M.direction==="vert"&&de.fit!=="fit"?{width:F.scalingValue(G,l)}:{},...de.fit==="cover"?{width:F.scalingValue(G,l),height:F.scalingValue(G,l)}:{},...Ie(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:xe=>{var J;xe.stopPropagation(),P(R),(J=$.current)==null||J.go(R)},onMouseEnter:()=>{var xe;de.triggers==="hov"&&((xe=$.current)==null||xe.go(R))},children:a.jsx("img",{src:z.image.url,alt:z.image.name??"",onLoad:xe=>{const J=xe.currentTarget;J.naturalWidth&&J.naturalHeight&&U(He=>({...He,[R]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${z.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function ec({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 Oh={element:Wh,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 Ar(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Dh(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 zh({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=F.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:y,gap:m,fieldsGap:g,buttonCorners:f,buttonStroke:x,buttonPadding:R,isButtonFullWidth:b,inputCorners:S,inputStroke:G,inputPadding:D,inputColor:j,inputTextColor:P,inputBorderColor:M,placeholderColor:K,buttonColor:T,buttonTextColor:L,buttonBorderColor:_,labelTextColor:z,successColor:$,errorColor:k,fontFamily:W,inputFontSettings:w,inputFontSize:U,inputLineHeight:C,inputLetterSpacing:O,inputWordSpacing:V,inputTextAppearance:se,buttonFontSettings:ie,buttonFontSize:N,buttonLineHeight:de,buttonLetterSpacing:X,buttonWordSpacing:ce,buttonTextAppearance:oe,labelFontSettings:fe,labelFontSize:Pe,labelLineHeight:xe,labelLetterSpacing:pe,labelWordSpacing:Z,labelTextAppearance:le,statusFontSettings:re,statusFontSize:Ie,statusLineHeight:we,statusLetterSpacing:Me,statusWordSpacing:ye,statusTextAppearance:be,successMessage:Ce,errorMessage:h,stateOverrides:q}=e,Y=u==="B",ee=v.slice(0,Math.min(p,v.length)),ve={fontSettings:{fontFamily:W,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:U??.01,lineHeight:C,letterSpacing:O??0,wordSpacing:V??0,textAppearance:se,color:P},B=dn(Qt(ve,t)),I=F.scalingValue(G??0,t),Q=F.scalingValue((C??U??.01)+((D==null?void 0:D.top)??0)+((D==null?void 0:D.bottom)??0)+(u==="C"?G??0:(G??0)*2),t),ne={...B,borderStyle:"solid",borderRadius:u==="C"?0:F.scalingValue(S??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:I,borderLeftWidth:0}:{borderWidth:I},paddingTop:F.scalingValue((D==null?void 0:D.top)??0,t),paddingRight:F.scalingValue((D==null?void 0:D.right)??0,t),paddingBottom:F.scalingValue((D==null?void 0:D.bottom)??0,t),paddingLeft:F.scalingValue((D==null?void 0:D.left)??0,t),height:Q,minHeight:Q},H={fontSettings:{fontFamily:W,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:N??.01,lineHeight:de,letterSpacing:X??0,wordSpacing:ce??0,textAppearance:oe,color:L},te=dn(Qt(H,t)),ke=F.scalingValue(x??0,t),ge={fontSettings:{fontFamily:W,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:Pe??.01,lineHeight:xe,letterSpacing:pe??0,wordSpacing:Z??0,textAppearance:le,color:z},J=Qt(ge,t),Ye={fontSettings:{fontFamily:W,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:we,letterSpacing:Me??0,wordSpacing:ye??0,textAppearance:be,color:$},je=dn(Qt(Ye,t)),it=F.buildColorVars(c,{inputColor:j,inputTextColor:P,inputBorderColor:M,placeholderColor:K!=null&&K.trim()?K:"#cccccc",buttonColor:T,buttonTextColor:L,buttonBorderColor:_,labelTextColor:z,successColor:$,errorColor:k},Bh,jh,q),[qe,et]=s.useState(()=>Object.fromEntries(ee.map(Ee=>[Ee.name,""]))),[Je,Ge]=s.useState("idle"),[$e,He]=s.useState(null),De=r==="success"?"success":r==="error"?"error":Je,Qe=r==="error"?h:$e,he=r==="filled",_e=s.useMemo(()=>{if(!he)return qe;let Ee=null;for(const Ze of ee)(qe[Ze.name]??"").trim().length>0||(Ee=Ee??{...qe},Ee[Ze.name]="Filled");return Ee??qe},[qe,he,ee]),Ve=De==="error"?F.getFormFieldValidationError(ee,_e):null,ft=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),rt=o==null?void 0:o.submitUrl,Oe=(Ee,Ze)=>{et(We=>({...We,[Ee]:Ze}))},Fe=async Ee=>{if(Ee.preventDefault(),!d)return;const Ze=Object.fromEntries(ee.map(ot=>{var nt;return[ot.name,((nt=qe[ot.name])==null?void 0:nt.trim())??""]}).filter(([,ot])=>ot));if(!rt){Ge("error"),He("No integrations were found for this form.");return}if(Object.keys(Ze).length===0)return;const We=F.getFormFieldValidationError(ee,qe);if(We){Ge("error"),He(We);return}Ge("submitting"),He(null);try{const ot=await fetch(rt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ze)});if(!ot.ok){const nt=await ot.text();throw new Error(nt||`Request failed: ${ot.status}`)}Ge("success"),et(Object.fromEntries(ee.map(nt=>[nt.name,""])))}catch(ot){Ge("error"),He(ot instanceof Error?ot.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ft}`.trim(),style:it,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dh(c)}}),a.jsxs("form",{onSubmit:Fe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:ee.map((Ee,Ze)=>a.jsxs(s.Fragment,{children:[Ze>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:F.scalingValue(g??0,t)}}),a.jsxs("div",{className:`${c}-field-group${Y?` ${c}-labeled`:""}`,children:[Y&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:Ee.label||Ee.name}),Ee.type==="textarea"?a.jsx("textarea",{name:Ee.name,autoComplete:"off",value:_e[Ee.name]??"",onChange:We=>Oe(Ee.name,We.target.value),placeholder:Ee.placeholder,className:`${c}-input`,style:ne,rows:1,"data-filled":he||(_e[Ee.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ee.type==="phone"?"tel":Ee.type==="email"?"email":"text",name:Ee.name,autoComplete:"off",value:_e[Ee.name]??"",onChange:We=>Oe(Ee.name,We.target.value),placeholder:Ee.placeholder,required:Ee.isRequired??Ee.type==="email",className:`${c}-input`,style:ne,"data-filled":he||(_e[Ee.name]??"").trim().length>0})]})]},Ze))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:F.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:F.scalingValue(f??0,t),borderWidth:ke,paddingTop:F.scalingValue((R==null?void 0:R.top)??0,t),paddingRight:F.scalingValue((R==null?void 0:R.right)??0,t),paddingBottom:F.scalingValue((R==null?void 0:R.bottom)??0,t),paddingLeft:F.scalingValue((R==null?void 0:R.left)??0,t),pointerEvents:d?"auto":void 0,...te,...b?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:b?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Je==="submitting"?"...":y})})})]}),De==="success"&&a.jsx("p",{className:`${c}-success`,style:{...je},children:Ce}),De==="error"&&a.jsx("p",{className:`${c}-error`,style:{...je},role:"alert",children:Ve??Qe??h})]})}const Bh={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"},jh=["hover","focus","filled","success","error"],Vh=`import React, { useMemo, useState } from 'react';
158
+ `}function zh({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=F.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:y,gap:m,fieldsGap:g,buttonCorners:f,buttonStroke:x,buttonPadding:P,isButtonFullWidth:b,inputCorners:w,inputStroke:j,inputPadding:H,inputColor:B,inputTextColor:k,inputBorderColor:W,placeholderColor:U,buttonColor:$,buttonTextColor:I,buttonBorderColor:O,labelTextColor:_,successColor:C,errorColor:L,fontFamily:D,inputFontSettings:S,inputFontSize:K,inputLineHeight:T,inputLetterSpacing:N,inputWordSpacing:V,inputTextAppearance:ae,buttonFontSettings:ie,buttonFontSize:M,buttonLineHeight:de,buttonLetterSpacing:X,buttonWordSpacing:le,buttonTextAppearance:ne,labelFontSettings:he,labelFontSize:ke,labelLineHeight:ye,labelLetterSpacing:pe,labelWordSpacing:Z,labelTextAppearance:se,statusFontSettings:oe,statusFontSize:Re,statusLineHeight:$e,statusLetterSpacing:Me,statusWordSpacing:ve,statusTextAppearance:Se,successMessage:Ce,errorMessage:h,stateOverrides:q}=e,Y=u==="B",ee=v.slice(0,Math.min(p,v.length)),fe={fontSettings:{fontFamily:D,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:K??.01,lineHeight:T,letterSpacing:N??0,wordSpacing:V??0,textAppearance:ae,color:k},z=dn(Qt(fe,t)),R=F.scalingValue(j??0,t),Q=F.scalingValue((T??K??.01)+((H==null?void 0:H.top)??0)+((H==null?void 0:H.bottom)??0)+(u==="C"?j??0:(j??0)*2),t),te={...z,borderStyle:"solid",borderRadius:u==="C"?0:F.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:R,borderLeftWidth:0}:{borderWidth:R},paddingTop:F.scalingValue((H==null?void 0:H.top)??0,t),paddingRight:F.scalingValue((H==null?void 0:H.right)??0,t),paddingBottom:F.scalingValue((H==null?void 0:H.bottom)??0,t),paddingLeft:F.scalingValue((H==null?void 0:H.left)??0,t),height:Q,minHeight:Q},ce={fontSettings:{fontFamily:D,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:M??.01,lineHeight:de,letterSpacing:X??0,wordSpacing:le??0,textAppearance:ne,color:I},G=dn(Qt(ce,t)),Ie=F.scalingValue(x??0,t),xe={fontSettings:{fontFamily:D,fontWeight:(he==null?void 0:he.fontWeight)??400,fontStyle:(he==null?void 0:he.fontStyle)??"normal"},fontSize:ke??.01,lineHeight:ye,letterSpacing:pe??0,wordSpacing:Z??0,textAppearance:se,color:_},J=Qt(xe,t),He={fontSettings:{fontFamily:D,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Re??.01,lineHeight:$e,letterSpacing:Me??0,wordSpacing:ve??0,textAppearance:Se,color:C},je=dn(Qt(He,t)),ct=F.buildColorVars(c,{inputColor:B,inputTextColor:k,inputBorderColor:W,placeholderColor:U!=null&&U.trim()?U:"#cccccc",buttonColor:$,buttonTextColor:I,buttonBorderColor:O,labelTextColor:_,successColor:C,errorColor:L},Bh,jh,q),[Ve,et]=s.useState(()=>Object.fromEntries(ee.map(Ee=>[Ee.name,""]))),[Ze,Ye]=s.useState("idle"),[be,Oe]=s.useState(null),ze=r==="success"?"success":r==="error"?"error":Ze,Qe=r==="error"?h:be,ge=r==="filled",_e=s.useMemo(()=>{if(!ge)return Ve;let Ee=null;for(const Je of ee)(Ve[Je.name]??"").trim().length>0||(Ee=Ee??{...Ve},Ee[Je.name]="Filled");return Ee??Ve},[Ve,ge,ee]),Xe=ze==="error"?F.getFormFieldValidationError(ee,_e):null,ft=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),ot=o==null?void 0:o.submitUrl,De=(Ee,Je)=>{et(We=>({...We,[Ee]:Je}))},Fe=async Ee=>{if(Ee.preventDefault(),!d)return;const Je=Object.fromEntries(ee.map(it=>{var nt;return[it.name,((nt=Ve[it.name])==null?void 0:nt.trim())??""]}).filter(([,it])=>it));if(!ot){Ye("error"),Oe("No integrations were found for this form.");return}if(Object.keys(Je).length===0)return;const We=F.getFormFieldValidationError(ee,Ve);if(We){Ye("error"),Oe(We);return}Ye("submitting"),Oe(null);try{const it=await fetch(ot,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Je)});if(!it.ok){const nt=await it.text();throw new Error(nt||`Request failed: ${it.status}`)}Ye("success"),et(Object.fromEntries(ee.map(nt=>[nt.name,""])))}catch(it){Ye("error"),Oe(it instanceof Error?it.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ft}`.trim(),style:ct,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Dh(c)}}),a.jsxs("form",{onSubmit:Fe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:ee.map((Ee,Je)=>a.jsxs(s.Fragment,{children:[Je>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:F.scalingValue(g??0,t)}}),a.jsxs("div",{className:`${c}-field-group${Y?` ${c}-labeled`:""}`,children:[Y&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:Ee.label||Ee.name}),Ee.type==="textarea"?a.jsx("textarea",{name:Ee.name,autoComplete:"off",value:_e[Ee.name]??"",onChange:We=>De(Ee.name,We.target.value),placeholder:Ee.placeholder,className:`${c}-input`,style:te,rows:1,"data-filled":ge||(_e[Ee.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ee.type==="phone"?"tel":Ee.type==="email"?"email":"text",name:Ee.name,autoComplete:"off",value:_e[Ee.name]??"",onChange:We=>De(Ee.name,We.target.value),placeholder:Ee.placeholder,required:Ee.isRequired??Ee.type==="email",className:`${c}-input`,style:te,"data-filled":ge||(_e[Ee.name]??"").trim().length>0})]})]},Je))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:F.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:F.scalingValue(f??0,t),borderWidth:Ie,paddingTop:F.scalingValue((P==null?void 0:P.top)??0,t),paddingRight:F.scalingValue((P==null?void 0:P.right)??0,t),paddingBottom:F.scalingValue((P==null?void 0:P.bottom)??0,t),paddingLeft:F.scalingValue((P==null?void 0:P.left)??0,t),pointerEvents:d?"auto":void 0,...G,...b?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:b?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:Ze==="submitting"?"...":y})})})]}),ze==="success"&&a.jsx("p",{className:`${c}-success`,style:{...je},children:Ce}),ze==="error"&&a.jsx("p",{className:`${c}-error`,style:{...je},role:"alert",children:Xe??Qe??h})]})}const Bh={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"},jh=["hover","focus","filled","success","error"],Vh=`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';
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
982
982
  font-size: ${Nr(14)};
983
983
  color: var(--${e}-error-error-color, var(--${e}-error-color));
984
984
  }
985
- `}const Kh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=F.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:y,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:R,buttonFontSettings:b,buttonFontSize:S,buttonLineHeight:G,buttonLetterSpacing:D,buttonWordSpacing:j,buttonTextAppearance:P,statusFontSettings:M,statusFontSize:K,statusLineHeight:T,statusLetterSpacing:L,statusWordSpacing:_,statusTextAppearance:z,iconMaxWidth:$,minHeight:k,corners:W,stroke:w,stateOverrides:U,inputPadding:C,buttonPadding:O,successMessage:V="Thanks for subscribing!",errorMessage:se="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[N,de]=s.useState(()=>Object.fromEntries(ie.map(ge=>[ge.name,""]))),[X,ce]=s.useState("idle"),[oe,fe]=s.useState(null),Pe=o==="success"?"success":o==="error"?"error":X,xe=o==="error"?se:oe,pe=o==="filled",Z=s.useMemo(()=>{if(!pe)return N;let ge=null;for(const J of ie)(N[J.name]??"").trim().length>0||(ge=ge??{...N},ge[J.name]="Filled");return ge??N},[pe,N,ie]),le=Pe==="error"?F.getFormFieldValidationError(ie,Z):null,re=o&&o!=="default"?`${r}-state-${o}`:"",Ie=ie.some(ge=>(Z[ge.name]??"").trim().length>0),we=re!==`${r}-state-filled`&&Ie?`${r}-state-filled`:"",Me=`${re} ${we}`.trim(),ye=i==null?void 0:i.submitUrl,be=u??"",Ce=(c==null?void 0:c.icon)??"",h=(c==null?void 0:c.mode)==="On",q=be||"Submit",Y={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:m??.01,lineHeight:g,letterSpacing:f??0,wordSpacing:x??0,textAppearance:R,color:e.inputTextColor??"#111111"},ee={fontSettings:{fontFamily:v,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:S??.01,lineHeight:G,letterSpacing:D??0,wordSpacing:j??0,textAppearance:P,color:e.buttonTextColor??"#ffffff"},ve={fontSettings:{fontFamily:v,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:K??.01,lineHeight:T,letterSpacing:L??0,wordSpacing:_??0,textAppearance:z,color:e.successColor??"#22c55e"},B=dn(Qt(Y,t)),I=dn(Qt(ee,t)),Q=dn(Qt(ve,t)),ne=F.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Y==null?void 0:Y.color)??"#111111",buttonTextColor:e.buttonTextColor??(ee==null?void 0:ee.color)??"#ffffff"},Zh,Jh,U),H={borderRadius:F.scalingValue(W,t),borderWidth:F.scalingValue(w,t),borderStyle:"solid"},te={borderLeftWidth:F.scalingValue(w,t)},ke=async ge=>{if(ge.preventDefault(),!l)return;const J=Object.fromEntries(ie.map(je=>{var it;return[je.name,((it=N[je.name])==null?void 0:it.trim())??""]}).filter(([,je])=>je));if(!ye){ce("error"),fe("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ye=F.getFormFieldValidationError(ie,N);if(Ye){ce("error"),fe(Ye);return}ce("submitting"),fe(null);try{const je=await fetch(ye,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!je.ok){const it=await je.text();throw new Error(it||`Request failed: ${je.status}`)}ce("success"),de(Object.fromEntries(ie.map(it=>[it.name,""])))}catch(je){ce("error"),fe(je instanceof Error?je.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Me}`.trim(),style:ne,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Yh(r)}}),a.jsxs("form",{onSubmit:ke,className:`${r}-form`,style:{...H,height:F.scalingValue(k,t),minHeight:F.scalingValue(k,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:Z[ge.name]??"",onChange:J=>de(Ye=>({...Ye,[ge.name]:J.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...B,paddingRight:F.scalingValue(C.right,t),paddingLeft:F.scalingValue(C.left,t),paddingTop:F.scalingValue(C.top,t),paddingBottom:F.scalingValue(C.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":q,style:{...I,...te,paddingRight:F.scalingValue(O.right,t),paddingLeft:F.scalingValue(O.left,t),paddingTop:F.scalingValue(O.top,t),paddingBottom:F.scalingValue(O.bottom,t),pointerEvents:l?"auto":void 0},children:X==="submitting"?"...":h?Ce&&a.jsx(pn,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:F.scalingValue($??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):be})})]}),Pe==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Q},children:V}),Pe==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Q},role:"alert",children:le??xe??se})]})},Zh={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"},Jh=["hover","focus","filled","success","error"],Qh=`import React, { useMemo, useState } from 'react';
985
+ `}const Kh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=F.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:y,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:P,buttonFontSettings:b,buttonFontSize:w,buttonLineHeight:j,buttonLetterSpacing:H,buttonWordSpacing:B,buttonTextAppearance:k,statusFontSettings:W,statusFontSize:U,statusLineHeight:$,statusLetterSpacing:I,statusWordSpacing:O,statusTextAppearance:_,iconMaxWidth:C,minHeight:L,corners:D,stroke:S,stateOverrides:K,inputPadding:T,buttonPadding:N,successMessage:V="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[M,de]=s.useState(()=>Object.fromEntries(ie.map(xe=>[xe.name,""]))),[X,le]=s.useState("idle"),[ne,he]=s.useState(null),ke=o==="success"?"success":o==="error"?"error":X,ye=o==="error"?ae:ne,pe=o==="filled",Z=s.useMemo(()=>{if(!pe)return M;let xe=null;for(const J of ie)(M[J.name]??"").trim().length>0||(xe=xe??{...M},xe[J.name]="Filled");return xe??M},[pe,M,ie]),se=ke==="error"?F.getFormFieldValidationError(ie,Z):null,oe=o&&o!=="default"?`${r}-state-${o}`:"",Re=ie.some(xe=>(Z[xe.name]??"").trim().length>0),$e=oe!==`${r}-state-filled`&&Re?`${r}-state-filled`:"",Me=`${oe} ${$e}`.trim(),ve=i==null?void 0:i.submitUrl,Se=u??"",Ce=(c==null?void 0:c.icon)??"",h=(c==null?void 0:c.mode)==="On",q=Se||"Submit",Y={fontSettings:{fontFamily:v,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:m??.01,lineHeight:g,letterSpacing:f??0,wordSpacing:x??0,textAppearance:P,color:e.inputTextColor??"#111111"},ee={fontSettings:{fontFamily:v,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:w??.01,lineHeight:j,letterSpacing:H??0,wordSpacing:B??0,textAppearance:k,color:e.buttonTextColor??"#ffffff"},fe={fontSettings:{fontFamily:v,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:U??.01,lineHeight:$,letterSpacing:I??0,wordSpacing:O??0,textAppearance:_,color:e.successColor??"#22c55e"},z=dn(Qt(Y,t)),R=dn(Qt(ee,t)),Q=dn(Qt(fe,t)),te=F.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(Y==null?void 0:Y.color)??"#111111",buttonTextColor:e.buttonTextColor??(ee==null?void 0:ee.color)??"#ffffff"},Zh,Jh,K),ce={borderRadius:F.scalingValue(D,t),borderWidth:F.scalingValue(S,t),borderStyle:"solid"},G={borderLeftWidth:F.scalingValue(S,t)},Ie=async xe=>{if(xe.preventDefault(),!l)return;const J=Object.fromEntries(ie.map(je=>{var ct;return[je.name,((ct=M[je.name])==null?void 0:ct.trim())??""]}).filter(([,je])=>je));if(!ve){le("error"),he("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const He=F.getFormFieldValidationError(ie,M);if(He){le("error"),he(He);return}le("submitting"),he(null);try{const je=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!je.ok){const ct=await je.text();throw new Error(ct||`Request failed: ${je.status}`)}le("success"),de(Object.fromEntries(ie.map(ct=>[ct.name,""])))}catch(je){le("error"),he(je instanceof Error?je.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Me}`.trim(),style:te,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Yh(r)}}),a.jsxs("form",{onSubmit:Ie,className:`${r}-form`,style:{...ce,height:F.scalingValue(L,t),minHeight:F.scalingValue(L,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(xe=>a.jsx("input",{type:xe.type==="email"?"email":xe.type==="phone"?"tel":"text",name:xe.name,autoComplete:"off",value:Z[xe.name]??"",onChange:J=>de(He=>({...He,[xe.name]:J.target.value})),placeholder:xe.placeholder,required:xe.isRequired??xe.type==="email",className:`${r}-input`,style:{...z,paddingRight:F.scalingValue(T.right,t),paddingLeft:F.scalingValue(T.left,t),paddingTop:F.scalingValue(T.top,t),paddingBottom:F.scalingValue(T.bottom,t)}},xe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":q,style:{...R,...G,paddingRight:F.scalingValue(N.right,t),paddingLeft:F.scalingValue(N.left,t),paddingTop:F.scalingValue(N.top,t),paddingBottom:F.scalingValue(N.bottom,t),pointerEvents:l?"auto":void 0},children:X==="submitting"?"...":h?Ce&&a.jsx(pn,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:F.scalingValue(C??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):Se})})]}),ke==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Q},children:V}),ke==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Q},role:"alert",children:se??ye??ae})]})},Zh={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"},Jh=["hover","focus","filled","success","error"],Qh=`import React, { useMemo, useState } from 'react';
986
986
  import { CommonComponentProps } from '../props';
987
987
  import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
988
988
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
1693
1693
  .${e}-image-hover-grayscale:hover video {
1694
1694
  filter: grayscale(100%);
1695
1695
  }
1696
- `}const sf=30,lf=20,Va=3,cf=12,df=32,uf=3,pf=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},mf=(e,t)=>Array.from({length:t},()=>e).flat(),gf=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},wu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),tc=(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 d=Array.from({length:t},(u,p)=>e.children[p]),c=wu(d);return c<=0?0:c+r*Math.max(0,t-1)},hf=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=wu(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},ff=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},yf=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ff(i,e))},vf=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??"")},xf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,bf=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var _,z,$,k;const p=s.useRef(null),v=!!((_=e.image)!=null&&_.url&&vf(e.image));s.useLayoutEffect(()=>{d&&xf(p.current)&&(u==null||u())},[d,(z=e.image)==null?void 0:z.url,u]);const y=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[f,x]=m.split(":").map(Number),S=(g?x:f)/(g?f:x),G=i/S,D=G>o?o:G,j=G>o?o*S:i,P=c(j),M=c(D),K={borderRadius:c(r)},T=y?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...K}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...K},L=(($=e.image)==null?void 0:$.url)&&(v?a.jsx("video",{ref:W=>{p.current=W},src:e.image.url,style:T,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:W=>{p.current=W},src:e.image.url,alt:((k=e.image)==null?void 0:k.name)??"",style:T,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...y?{width:P}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...y?{width:P,height:M,overflow:"hidden",...K}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:L&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Ct(`${t}-marquee-link`,!y&&`${t}-marquee-link-contain`),children:L}):L})})},Sf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>af(r,c),[r,c]),{speed:p,direction:v,pauseOnHover:y,gap:m,imageMaxWidth:g,imageMaxHeight:f,hoverEffect:x,cornerRadius:R=0}=e,b=s.useMemo(()=>gf(e.imageFit),[e.imageFit]),S=(t==null?void 0:t.length)??0,G=!!o,D=!n||!!i,j=D&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,P=n?!!i:!0,K=((t==null?void 0:t.length)??0)>0&&(P||!!n),T=Math.max(0,p)*sf,L=we=>F.scalingValue(we,n??!1),_=s.useRef(null),z=s.useRef(null),$=s.useRef(null),[k,W]=s.useState(0),w=P&&y==="on",[U,C]=s.useState(!1),[O,V]=s.useState({}),se=s.useRef(O);se.current=O;const ie=s.useRef(null),N=s.useRef(0),de=s.useRef(null),X=s.useMemo(()=>(t??[]).map(we=>{var Me;return((Me=we.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[ce,oe]=s.useState(Va),fe=s.useMemo(()=>{const we=t??[];return we.length===0||!(P||!!n)?we:mf(we,ce)},[t,P,ce,n]),Pe=s.useMemo(()=>(t??[]).filter(we=>{var Me;return!!((Me=we.image)!=null&&Me.url)}).length,[t]),xe=K?uf:1;s.useLayoutEffect(()=>{N.current=0,V({}),ie.current=null,oe(Va),d(0)},[X]),s.useEffect(()=>{if(!D||x!=="randomize")return;const we=_.current;if(!we)return;const Me=h=>{V(q=>{const Y=Array.from(h).filter(ve=>ve in q&&!yf(we,ve));if(Y.length===0)return q;const ee={...q};return Y.forEach(ve=>{delete ee[ve]}),ee})},ye=new IntersectionObserver(h=>{const q=new Set;for(const Y of h){const ee=Y.target.dataset.marqueeItemIndex,ve=ee!==void 0?Number(ee):NaN;Number.isNaN(ve)||q.add(ve)}q.size>0&&Me(q)},{root:we,threshold:0});Object.keys(O).forEach(h=>{const q=Number(h);we.querySelectorAll(`[data-marquee-item-index="${q}"]`).forEach(Y=>ye.observe(Y))});const be={current:0},Ce=()=>{const h=Object.keys(se.current);h.length!==0&&(Me(h.map(Number)),be.current=requestAnimationFrame(Ce))};return Object.keys(se.current).length>0&&(be.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(be.current),ye.disconnect()}},[x,O,D]),s.useLayoutEffect(()=>{if(!K)return;const we=_.current,Me=$.current;if(!we||!Me)return;const ye={current:0},be=()=>{const q=we.getBoundingClientRect().width||we.offsetWidth,Y=hf(Me),ee=ie.current,ve=typeof ee=="number"&&Math.abs(ee-Y)<=.25;ie.current=Y;let B=ce,I=0;if((P||n)&&S>0&&q>0){const H=tc(Me,S);if(H>=df){I=H;const te=Math.min(cf,Math.max(Va,Math.ceil(q/H)+1));B=te,te!==ce&&oe(te)}}const ne=B!==ce&&I>0?I*B:Y>0?Y:I>0?I*B:(()=>{const H=tc(Me,S);return H>0?H*B:0})();ne>0?d(H=>H<=0?ne:!ve||Math.round(H)===Math.round(ne)?H:ne):!ve&&l<=0&&(cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be))},Ce=()=>{cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be)};de.current=Ce,Ce();const h=new ResizeObserver(Ce);return h.observe(we),h.observe(Me),()=>{de.current=null,cancelAnimationFrame(ye.current),h.disconnect()}},[P,K,l,X,ce,S,n]),s.useLayoutEffect(()=>{if(!K||c<=0)return;const we=z.current;we&&pf(we)},[K,c,v,T]),s.useLayoutEffect(()=>{if(!K||l<=0){W(0);return}const we=z.current,Me=$.current;if(!we||!Me)return;const ye=()=>{const Ce=we.offsetHeight||we.getBoundingClientRect().height,h=Array.from(Me.children).reduce((Y,ee)=>Math.max(Y,ee.offsetHeight||ee.getBoundingClientRect().height),0),q=Ce>0?Ce:h;W(q>0?q:0)};ye();const be=new ResizeObserver(ye);return be.observe(we),be.observe(Me),()=>be.disconnect()},[K,xe,fe,n,m,g,f,l,b,O]),s.useLayoutEffect(()=>{if(!n||!G||!K||typeof window>"u")return;const we=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(we)},[n,G,K,v,l,k,m,fe]);const pe=()=>{w&&C(!0)},Z=()=>{w&&C(!1)},le=s.useCallback(()=>{var we;N.current=Math.min(Pe,N.current+1),(we=de.current)==null||we.call(de)},[Pe]),re=s.useCallback((we,Me)=>{V(ye=>{const be=ye[we]??Me,Ce=(t??[]).filter(q=>q!==be);if(Ce.length===0)return ye;const h=Ce[Math.floor(Math.random()*Ce.length)];return{...ye,[we]:h}})},[t]),Ie=(we,Me,ye,be)=>{const Ce=D&&x==="randomize"&&b.display==="cover"?O[ye]??we:we,h=`max(${L(m)}, ${lf}px)`,q=`calc(-0.5 * (${h} + ${L(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ye,onMouseEnter:D&&x==="randomize"&&b.display==="cover"?()=>re(ye,we):void 0,children:[a.jsx(bf,{item:Ce,prefix:r,imageFit:b,imageMaxWidth:g,imageMaxHeight:f,cornerRadius:R,imageHoverClass:j,isEditor:n,isFirstSet:be,scaled:L,onFirstSetImageDone:le}),G&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:q,width:h,height:"100%"}})]},`${Me}-${ye}`)};if(K){const we=P?w&&U?"paused":"running":"paused",Me=c>0&&T>0?c/T*1e3:0,ye=`${Math.max(0,Me)/1e3}s`;return a.jsxs("div",{ref:_,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:k>0?{height:k}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:z,className:`${r}-marquee-track`,"data-direction":v,onMouseEnter:pe,onMouseLeave:Z,style:{WebkitAnimationDuration:ye,animationDuration:ye,WebkitAnimationPlayState:we,animationPlayState:we},children:Array.from({length:xe},(be,Ce)=>a.jsx("div",{ref:Ce===0?$:void 0,className:Ct(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:L(m),paddingRight:L(m)},"aria-hidden":Ce>0,children:fe.map((h,q)=>Ie(h,Ce,q,Ce===0&&q<S))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:_,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Ct(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:L(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((we,Me)=>Ie(we,0,Me))},"marquee-static")]})},wf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1696
+ `}const sf=30,lf=20,Va=3,cf=12,df=32,uf=3,pf=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},mf=(e,t)=>Array.from({length:t},()=>e).flat(),gf=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},wu=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),tc=(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 d=Array.from({length:t},(u,p)=>e.children[p]),c=wu(d);return c<=0?0:c+r*Math.max(0,t-1)},hf=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=wu(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},ff=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},yf=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>ff(i,e))},vf=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??"")},xf=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,bf=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var O,_,C,L;const p=s.useRef(null),v=!!((O=e.image)!=null&&O.url&&vf(e.image));s.useLayoutEffect(()=>{d&&xf(p.current)&&(u==null||u())},[d,(_=e.image)==null?void 0:_.url,u]);const y=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[f,x]=m.split(":").map(Number),w=(g?x:f)/(g?f:x),j=i/w,H=j>o?o:j,B=j>o?o*w:i,k=c(B),W=c(H),U={borderRadius:c(r)},$=y?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...U}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...U},I=((C=e.image)==null?void 0:C.url)&&(v?a.jsx("video",{ref:D=>{p.current=D},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:D=>{p.current=D},src:e.image.url,alt:((L=e.image)==null?void 0:L.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...y?{width:k}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:a.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...y?{width:k,height:W,overflow:"hidden",...U}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:I&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:Ct(`${t}-marquee-link`,!y&&`${t}-marquee-link-contain`),children:I}):I})})},Sf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>af(r,c),[r,c]),{speed:p,direction:v,pauseOnHover:y,gap:m,imageMaxWidth:g,imageMaxHeight:f,hoverEffect:x,cornerRadius:P=0}=e,b=s.useMemo(()=>gf(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,j=!!o,H=!n||!!i,B=H&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,k=n?!!i:!0,U=((t==null?void 0:t.length)??0)>0&&(k||!!n),$=Math.max(0,p)*sf,I=$e=>F.scalingValue($e,n??!1),O=s.useRef(null),_=s.useRef(null),C=s.useRef(null),[L,D]=s.useState(0),S=k&&y==="on",[K,T]=s.useState(!1),[N,V]=s.useState({}),ae=s.useRef(N);ae.current=N;const ie=s.useRef(null),M=s.useRef(0),de=s.useRef(null),X=s.useMemo(()=>(t??[]).map($e=>{var Me;return((Me=$e.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[le,ne]=s.useState(Va),he=s.useMemo(()=>{const $e=t??[];return $e.length===0||!(k||!!n)?$e:mf($e,le)},[t,k,le,n]),ke=s.useMemo(()=>(t??[]).filter($e=>{var Me;return!!((Me=$e.image)!=null&&Me.url)}).length,[t]),ye=U?uf:1;s.useLayoutEffect(()=>{M.current=0,V({}),ie.current=null,ne(Va),d(0)},[X]),s.useEffect(()=>{if(!H||x!=="randomize")return;const $e=O.current;if(!$e)return;const Me=h=>{V(q=>{const Y=Array.from(h).filter(fe=>fe in q&&!yf($e,fe));if(Y.length===0)return q;const ee={...q};return Y.forEach(fe=>{delete ee[fe]}),ee})},ve=new IntersectionObserver(h=>{const q=new Set;for(const Y of h){const ee=Y.target.dataset.marqueeItemIndex,fe=ee!==void 0?Number(ee):NaN;Number.isNaN(fe)||q.add(fe)}q.size>0&&Me(q)},{root:$e,threshold:0});Object.keys(N).forEach(h=>{const q=Number(h);$e.querySelectorAll(`[data-marquee-item-index="${q}"]`).forEach(Y=>ve.observe(Y))});const Se={current:0},Ce=()=>{const h=Object.keys(ae.current);h.length!==0&&(Me(h.map(Number)),Se.current=requestAnimationFrame(Ce))};return Object.keys(ae.current).length>0&&(Se.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(Se.current),ve.disconnect()}},[x,N,H]),s.useLayoutEffect(()=>{if(!U)return;const $e=O.current,Me=C.current;if(!$e||!Me)return;const ve={current:0},Se=()=>{const q=$e.getBoundingClientRect().width||$e.offsetWidth,Y=hf(Me),ee=ie.current,fe=typeof ee=="number"&&Math.abs(ee-Y)<=.25;ie.current=Y;let z=le,R=0;if((k||n)&&w>0&&q>0){const ce=tc(Me,w);if(ce>=df){R=ce;const G=Math.min(cf,Math.max(Va,Math.ceil(q/ce)+1));z=G,G!==le&&ne(G)}}const te=z!==le&&R>0?R*z:Y>0?Y:R>0?R*z:(()=>{const ce=tc(Me,w);return ce>0?ce*z:0})();te>0?d(ce=>ce<=0?te:!fe||Math.round(ce)===Math.round(te)?ce:te):!fe&&l<=0&&(cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(Se))},Ce=()=>{cancelAnimationFrame(ve.current),ve.current=requestAnimationFrame(Se)};de.current=Ce,Ce();const h=new ResizeObserver(Ce);return h.observe($e),h.observe(Me),()=>{de.current=null,cancelAnimationFrame(ve.current),h.disconnect()}},[k,U,l,X,le,w,n]),s.useLayoutEffect(()=>{if(!U||c<=0)return;const $e=_.current;$e&&pf($e)},[U,c,v,$]),s.useLayoutEffect(()=>{if(!U||l<=0){D(0);return}const $e=_.current,Me=C.current;if(!$e||!Me)return;const ve=()=>{const Ce=$e.offsetHeight||$e.getBoundingClientRect().height,h=Array.from(Me.children).reduce((Y,ee)=>Math.max(Y,ee.offsetHeight||ee.getBoundingClientRect().height),0),q=Ce>0?Ce:h;D(q>0?q:0)};ve();const Se=new ResizeObserver(ve);return Se.observe($e),Se.observe(Me),()=>Se.disconnect()},[U,ye,he,n,m,g,f,l,b,N]),s.useLayoutEffect(()=>{if(!n||!j||!U||typeof window>"u")return;const $e=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame($e)},[n,j,U,v,l,L,m,he]);const pe=()=>{S&&T(!0)},Z=()=>{S&&T(!1)},se=s.useCallback(()=>{var $e;M.current=Math.min(ke,M.current+1),($e=de.current)==null||$e.call(de)},[ke]),oe=s.useCallback(($e,Me)=>{V(ve=>{const Se=ve[$e]??Me,Ce=(t??[]).filter(q=>q!==Se);if(Ce.length===0)return ve;const h=Ce[Math.floor(Math.random()*Ce.length)];return{...ve,[$e]:h}})},[t]),Re=($e,Me,ve,Se)=>{const Ce=H&&x==="randomize"&&b.display==="cover"?N[ve]??$e:$e,h=`max(${I(m)}, ${lf}px)`,q=`calc(-0.5 * (${h} + ${I(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ve,onMouseEnter:H&&x==="randomize"&&b.display==="cover"?()=>oe(ve,$e):void 0,children:[a.jsx(bf,{item:Ce,prefix:r,imageFit:b,imageMaxWidth:g,imageMaxHeight:f,cornerRadius:P,imageHoverClass:B,isEditor:n,isFirstSet:Se,scaled:I,onFirstSetImageDone:se}),j&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:q,width:h,height:"100%"}})]},`${Me}-${ve}`)};if(U){const $e=k?S&&K?"paused":"running":"paused",Me=c>0&&$>0?c/$*1e3:0,ve=`${Math.max(0,Me)/1e3}s`;return a.jsxs("div",{ref:O,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:L>0?{height:L}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:_,className:`${r}-marquee-track`,"data-direction":v,onMouseEnter:pe,onMouseLeave:Z,style:{WebkitAnimationDuration:ve,animationDuration:ve,WebkitAnimationPlayState:$e,animationPlayState:$e},children:Array.from({length:ye},(Se,Ce)=>a.jsx("div",{ref:Ce===0?C:void 0,className:Ct(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:I(m),paddingRight:I(m)},"aria-hidden":Ce>0,children:he.map((h,q)=>Re(h,Ce,q,Ce===0&&q<w))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:O,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:Ct(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:I(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map(($e,Me)=>Re($e,0,Me))},"marquee-static")]})},wf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
1697
1697
  import cn from 'classnames';
1698
1698
  import { CommonComponentProps } from '../props';
1699
1699
  import { scalingValue } from '../utils/scalingValue';
@@ -2605,7 +2605,7 @@ ${o}
2605
2605
  left: -9999px;
2606
2606
  top: 0;
2607
2607
  }
2608
- `}const Lf=30,Ga=3,If=12,Rf=96,nc=3,As=.72,Pf=100,kf=10,Ef=e=>e/Pf,Mf=e=>Math.max(0,e)/kf,Af=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")},Ff=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Nf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),_f=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ic=e=>{e.style.transform=""},Wf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Hf=(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)},$u=96,Cu=(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,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,y=v+c;o[p+1]=y,r[p+1]=r[p]+(d(v)+d(y))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Of=(e,t)=>{const n=Cu(e,t,$u);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Df=(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:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const f=m+g>>1;return l[f]<=r?c(f,g):c(m,f)},[u,p]=c(0,l.length-1),v=l[p]-l[u],y=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*y)},zf=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,v=e+o-u,y=Math.max(4,Math.ceil(r*4*(v/Math.max(e,1)))),m=Array.from({length:y},(g,f)=>{const x=u+f/y*v,R=u+(f+1)/y*v,b=R-x,S=d(x),G=d(R),D=x+b/3,j=S+c(x)*b/3,P=R-b/3,M=G-c(R)*b/3;return`C${D.toFixed(2)} ${j.toFixed(2)} ${P.toFixed(2)} ${M.toFixed(2)} ${R.toFixed(2)} ${G.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Bf=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${As}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:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((g,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=a.jsxs(a.Fragment,{children:[p,v]});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:y}):y})},jf=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:y,curveAmplitude:m,curveFrequency:g,textFontFamily:f,textFontSettings:x,textFontSize:R,textLineHeight:b,textLetterSpacing:S,textWordSpacing:G,textTextAppearance:D,textColor:j,backgroundColor:P,ribbonWidth:M}=e,K=M??b,T=y==="curve",L=Ef(m),_=Mf(g),z=s.useMemo(()=>Tf(o,d,T),[o,d,T]),$=s.useMemo(()=>Qt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:S,wordSpacing:G,fontSize:R,lineHeight:b,textAppearance:D,color:j},n),[f,x,S,G,R,b,D,j,n]),k=Oe=>F.scalingValue(Oe,n??!1),W=((t==null?void 0:t.length)??0)>0,w=n?!!i:!0,U=W&&(w||!!n),C=Math.max(0,c)*Lf,O=w&&p==="on",[V,se]=s.useState(!1),ie=w?O&&V?"paused":"running":"paused",N=ie==="running"&&C>0&&d>0,de=d>0&&C>0?d/C*1e3:0,X=s.useRef(null),ce=s.useRef(null),oe=s.useRef(null),fe=s.useRef(null),Pe=s.useRef(null),xe=s.useRef(null),pe=s.useRef(N),Z=s.useRef(null),le=s.useRef(null),re=s.useRef(L),Ie=s.useRef(_);pe.current=N,re.current=L,Ie.current=_;const[we,Me]=s.useState(0),[ye,be]=s.useState(0),[Ce,h]=s.useState(0),[q,Y]=s.useState(0),[ee,ve]=s.useState(0),B=s.useMemo(()=>(t??[]).map(Oe=>{var Fe;return`${Oe.text}\0${((Fe=Oe.image)==null?void 0:Fe.url)??""}\0${Oe.link??""}`}).join("\0"),[t]),[I,Q]=s.useState(Ga),ne=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(w||n)?Oe:Ff(Oe,I)},[t,w,I,n]),H=U?nc:1;s.useLayoutEffect(()=>{Q(Ga),l(0)},[B]),s.useLayoutEffect(()=>{var We;const Oe=xe.current;if(!Oe)return;const Fe=()=>{const ot=getComputedStyle(Oe),nt=parseFloat(ot.fontSize)||0;if(nt<=0)return;const me=Nf();if(!me){Me(nt*As),be(0);return}me.font=`${ot.fontStyle} ${ot.fontWeight} ${nt}px ${ot.fontFamily}`;const Ne=me.measureText("H"),st=Ne.actualBoundingBoxAscent>0?Ne.actualBoundingBoxAscent:nt*As,ut=Math.max(0,Ne.actualBoundingBoxDescent||0),Be=Ne.fontBoundingBoxAscent||0,pt=Ne.fontBoundingBoxDescent||0;Me(Lt=>Math.abs(Lt-st)>.5?st:Lt);const Tt=Be>0||pt>0?(pt-ut-(Be-st))/2:0;be(Lt=>Math.abs(Lt-Tt)>.25?Tt:Lt)};Fe();const Ee=typeof document<"u"?document.fonts:void 0;(We=Ee==null?void 0:Ee.ready)==null||We.then(Fe).catch(()=>{});const Ze=new ResizeObserver(Fe);return Ze.observe(Oe),()=>Ze.disconnect()},[$.fontFamily,$.fontWeight,$.fontStyle,$.fontSize,$.lineHeight]),s.useLayoutEffect(()=>{if(!U)return;const Oe=X.current,Fe=fe.current;if(!Oe||!Fe)return;const Ee={id:0},Ze=()=>{const me=Oe.offsetWidth||Oe.getBoundingClientRect().width,Ne=Fe.offsetWidth||Fe.getBoundingClientRect().width;if(W&&me>0&&Ne>0){const st=Ne/I;if(st>0){let ut=me,Be=If;if(T){const Tt=me*re.current,Lt=Ie.current,xt=Lt>0?2*Math.PI*Lt/me:0,Et=Of(Tt,xt);ut=Math.max(me,Et*me/(nc-1)),Be=Rf}const pt=Math.min(Be,Math.max(Ga,Math.ceil(ut/st)+1));if(pt!==I){Q(pt);return}}}Ne>0&&l(Ne)},We=()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ze)};We();const ot=new ResizeObserver(We);ot.observe(Oe),ot.observe(Fe);const nt=()=>{document.hidden||We()};return document.addEventListener("visibilitychange",nt),window.addEventListener("pageshow",nt),window.addEventListener("focus",nt),()=>{cancelAnimationFrame(Ee.id),ot.disconnect(),document.removeEventListener("visibilitychange",nt),window.removeEventListener("pageshow",nt),window.removeEventListener("focus",nt)}},[U,B,I,W,we,T,L,_]),s.useLayoutEffect(()=>{const Oe=Pe.current;if(!Oe)return;const Fe={id:0},Ee=()=>{const We=Oe.offsetHeight;We>0&&ve(ot=>Math.abs(ot-We)>.5?We:ot)};Fe.id=requestAnimationFrame(Ee);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Fe.id),Fe.id=requestAnimationFrame(Ee)});return Ze.observe(Oe),()=>{cancelAnimationFrame(Fe.id),Ze.disconnect()}},[K,n]),s.useLayoutEffect(()=>{if(!T){h(0),Y(0);return}const Oe=X.current,Fe=fe.current;if(!Oe||!Fe)return;const Ee={id:0},Ze=()=>{const ot=Oe.offsetWidth,nt=Fe.offsetHeight;ot>0&&Y(me=>Math.abs(me-ot)>.5?ot:me),nt>0&&h(me=>Math.abs(me-nt)>.5?nt:me)};Ee.id=requestAnimationFrame(Ze);const We=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ze)});return We.observe(Oe),We.observe(Fe),()=>{cancelAnimationFrame(Ee.id),We.disconnect()}},[T,B,we,b,R,U]),s.useLayoutEffect(()=>{if(!U||d<=0)return;const Oe=oe.current;Oe&&Af(Oe)},[U,d,u,C]),s.useLayoutEffect(()=>{if(!T||!W)return;const Oe=X.current;if(!Oe)return;const Fe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const st of Fe.itemsCache)for(const ut of st.glyphs)ic(ut.inner)},Ze=()=>{const st=ce.current??Oe;Fe.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),ut=>{const Be=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(pt=>{const Tt=pt.firstElementChild;Tt&&Be.push({inner:Tt,layoutLocalX:Hf(pt,st)})}),{item:ut,glyphs:Be}}),Fe.cacheDirty=!1},We=()=>{Fe.cacheDirty&&Ze();const ut=(ce.current??Oe).offsetWidth||1,Be=ut*re.current,pt=Ie.current,Tt=2*Math.PI*pt/ut,Lt=`${ut}|${Be}|${Tt}`;if(Lt!==Fe.lutKey&&(Fe.lutKey=Lt,Fe.lut=Cu(Be,Tt,$u)),Math.abs(Be)<=0||Tt<=0){Ee();return}const xt=oe.current,Et=xt?Wf(getComputedStyle(xt).transform):0,Vt=Oe.getBoundingClientRect(),Ut=Vt.left,Kt=Vt.right,Pt=Fe.lut&&Fe.lut.wavelength>0?Math.max(0,(Fe.lut.periodArc/Fe.lut.wavelength-1)*ut):0;for(const{item:jt,glyphs:on}of Fe.itemsCache){const vt=jt.getBoundingClientRect();if(vt.right<Ut||vt.left>Kt+Pt){for(const Le of on)ic(Le.inner);continue}for(const Le of on){const Xe=Le.layoutLocalX+Et,lt=Fe.lut?Df(Fe.lut,Xe):Xe,ct=Tt*lt,wt=Be*Math.sin(ct),It=Be*Tt*Math.cos(ct),gt=Math.atan(It)*(180/Math.PI);_f(Le.inner,lt-Xe,wt,gt)}}},ot=()=>{Fe.cancelled||(Fe.raf=0,We(),pe.current&&!document.hidden&&(Fe.raf=requestAnimationFrame(ot)))},nt=()=>{Fe.cancelled||Fe.raf||(Fe.raf=requestAnimationFrame(ot))},me=()=>{Fe.cacheDirty=!0,We(),nt()};Z.current=nt,le.current=me,We(),nt();const Ne=()=>{if(document.hidden){cancelAnimationFrame(Fe.raf),Fe.raf=0;return}cancelAnimationFrame(Fe.raf),Fe.raf=0,me()};return document.addEventListener("visibilitychange",Ne),window.addEventListener("pageshow",Ne),window.addEventListener("focus",Ne),()=>{Fe.cancelled=!0,Z.current=null,le.current=null,cancelAnimationFrame(Fe.raf),document.removeEventListener("visibilitychange",Ne),window.removeEventListener("pageshow",Ne),window.removeEventListener("focus",Ne),Ee()}},[T,W]),s.useLayoutEffect(()=>{var Oe;!T||!W||(Oe=le.current)==null||Oe.call(le)},[T,W,r,B,I,we,L,_,q]),s.useLayoutEffect(()=>{var Oe;(Oe=Z.current)==null||Oe.call(Z)},[N,u]);const te=()=>{O&&se(!0)},ke=()=>{O&&se(!1)},ge=T?Math.abs(L)*100:0,J=k(K),Ye={minHeight:J,...T?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},je={height:J,...T?{visibility:"hidden"}:{backgroundColor:P}},it={gap:k(v),minHeight:J},qe=q*L,et=Math.abs(qe),Je=ee>0?ee:Ce,Ge=Math.max(Ce,Je),$e=et+Ge/2,He=Math.max(Je,1),De=T&&q>0&&Ge>0?zf(q,qe,_,$e,He):"",Qe=et*2+Ge,he=De?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:De,fill:"none",stroke:P,strokeWidth:Je,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,_e=a.jsx("div",{ref:Pe,className:`${o}-ribbon`,style:je,"aria-hidden":!0}),Ve=(Oe,Fe,Ee)=>a.jsx(Bf,{item:Oe,prefix:o,textCss:$,capHeightPx:we,opticalOffsetY:ye,imageGapPx:k(v),isCurve:T},`${Fe}-${Ee}`),tt=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:$,children:"H"}),ft=`${Math.max(0,de)/1e3}s`,rt=U?a.jsx("div",{ref:oe,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:te,onMouseLeave:ke,style:{WebkitAnimationDuration:ft,animationDuration:ft,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:H},(Oe,Fe)=>a.jsx("div",{ref:Fe===0?fe:void 0,className:`${o}-marquee-set`,style:{...it,paddingRight:k(v)},"aria-hidden":Fe>0,children:ne.map((Ee,Ze)=>Ve(Ee,Fe,Ze))},`set-${Fe}`))}):a.jsx("div",{ref:fe,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:it,children:t==null?void 0:t.map((Oe,Fe)=>Ve(Oe,0,Fe))});return a.jsxs("div",{ref:X,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:z}}),tt,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Ye,children:[_e,he,rt]})]})},Vf=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2608
+ `}const Lf=30,Ga=3,If=12,Rf=96,nc=3,As=.72,Pf=100,kf=10,Ef=e=>e/Pf,Mf=e=>Math.max(0,e)/kf,Af=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")},Ff=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),io={ctx:void 0},Nf=()=>io.ctx!==void 0?io.ctx:typeof document>"u"?(io.ctx=null,io.ctx):(io.ctx=document.createElement("canvas").getContext("2d"),io.ctx),_f=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ic=e=>{e.style.transform=""},Wf=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Hf=(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)},$u=96,Cu=(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,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,y=v+c;o[p+1]=y,r[p+1]=r[p]+(d(v)+d(y))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Of=(e,t)=>{const n=Cu(e,t,$u);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Df=(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:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const f=m+g>>1;return l[f]<=r?c(f,g):c(m,f)},[u,p]=c(0,l.length-1),v=l[p]-l[u],y=v>0?(r-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*y)},zf=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,v=e+o-u,y=Math.max(4,Math.ceil(r*4*(v/Math.max(e,1)))),m=Array.from({length:y},(g,f)=>{const x=u+f/y*v,P=u+(f+1)/y*v,b=P-x,w=d(x),j=d(P),H=x+b/3,B=w+c(x)*b/3,k=P-b/3,W=j-c(P)*b/3;return`C${H.toFixed(2)} ${B.toFixed(2)} ${k.toFixed(2)} ${W.toFixed(2)} ${P.toFixed(2)} ${j.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Bf=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${As}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:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((g,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=a.jsxs(a.Fragment,{children:[p,v]});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:y}):y})},jf=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=F.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:y,curveAmplitude:m,curveFrequency:g,textFontFamily:f,textFontSettings:x,textFontSize:P,textLineHeight:b,textLetterSpacing:w,textWordSpacing:j,textTextAppearance:H,textColor:B,backgroundColor:k,ribbonWidth:W}=e,U=W??b,$=y==="curve",I=Ef(m),O=Mf(g),_=s.useMemo(()=>Tf(o,d,$),[o,d,$]),C=s.useMemo(()=>Qt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:j,fontSize:P,lineHeight:b,textAppearance:H,color:B},n),[f,x,w,j,P,b,H,B,n]),L=De=>F.scalingValue(De,n??!1),D=((t==null?void 0:t.length)??0)>0,S=n?!!i:!0,K=D&&(S||!!n),T=Math.max(0,c)*Lf,N=S&&p==="on",[V,ae]=s.useState(!1),ie=S?N&&V?"paused":"running":"paused",M=ie==="running"&&T>0&&d>0,de=d>0&&T>0?d/T*1e3:0,X=s.useRef(null),le=s.useRef(null),ne=s.useRef(null),he=s.useRef(null),ke=s.useRef(null),ye=s.useRef(null),pe=s.useRef(M),Z=s.useRef(null),se=s.useRef(null),oe=s.useRef(I),Re=s.useRef(O);pe.current=M,oe.current=I,Re.current=O;const[$e,Me]=s.useState(0),[ve,Se]=s.useState(0),[Ce,h]=s.useState(0),[q,Y]=s.useState(0),[ee,fe]=s.useState(0),z=s.useMemo(()=>(t??[]).map(De=>{var Fe;return`${De.text}\0${((Fe=De.image)==null?void 0:Fe.url)??""}\0${De.link??""}`}).join("\0"),[t]),[R,Q]=s.useState(Ga),te=s.useMemo(()=>{const De=t??[];return De.length===0||!(S||n)?De:Ff(De,R)},[t,S,R,n]),ce=K?nc:1;s.useLayoutEffect(()=>{Q(Ga),l(0)},[z]),s.useLayoutEffect(()=>{var We;const De=ye.current;if(!De)return;const Fe=()=>{const it=getComputedStyle(De),nt=parseFloat(it.fontSize)||0;if(nt<=0)return;const me=Nf();if(!me){Me(nt*As),Se(0);return}me.font=`${it.fontStyle} ${it.fontWeight} ${nt}px ${it.fontFamily}`;const Ne=me.measureText("H"),at=Ne.actualBoundingBoxAscent>0?Ne.actualBoundingBoxAscent:nt*As,ut=Math.max(0,Ne.actualBoundingBoxDescent||0),Ge=Ne.fontBoundingBoxAscent||0,pt=Ne.fontBoundingBoxDescent||0;Me(Lt=>Math.abs(Lt-at)>.5?at:Lt);const Tt=Ge>0||pt>0?(pt-ut-(Ge-at))/2:0;Se(Lt=>Math.abs(Lt-Tt)>.25?Tt:Lt)};Fe();const Ee=typeof document<"u"?document.fonts:void 0;(We=Ee==null?void 0:Ee.ready)==null||We.then(Fe).catch(()=>{});const Je=new ResizeObserver(Fe);return Je.observe(De),()=>Je.disconnect()},[C.fontFamily,C.fontWeight,C.fontStyle,C.fontSize,C.lineHeight]),s.useLayoutEffect(()=>{if(!K)return;const De=X.current,Fe=he.current;if(!De||!Fe)return;const Ee={id:0},Je=()=>{const me=De.offsetWidth||De.getBoundingClientRect().width,Ne=Fe.offsetWidth||Fe.getBoundingClientRect().width;if(D&&me>0&&Ne>0){const at=Ne/R;if(at>0){let ut=me,Ge=If;if($){const Tt=me*oe.current,Lt=Re.current,xt=Lt>0?2*Math.PI*Lt/me:0,Et=Of(Tt,xt);ut=Math.max(me,Et*me/(nc-1)),Ge=Rf}const pt=Math.min(Ge,Math.max(Ga,Math.ceil(ut/at)+1));if(pt!==R){Q(pt);return}}}Ne>0&&l(Ne)},We=()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Je)};We();const it=new ResizeObserver(We);it.observe(De),it.observe(Fe);const nt=()=>{document.hidden||We()};return document.addEventListener("visibilitychange",nt),window.addEventListener("pageshow",nt),window.addEventListener("focus",nt),()=>{cancelAnimationFrame(Ee.id),it.disconnect(),document.removeEventListener("visibilitychange",nt),window.removeEventListener("pageshow",nt),window.removeEventListener("focus",nt)}},[K,z,R,D,$e,$,I,O]),s.useLayoutEffect(()=>{const De=ke.current;if(!De)return;const Fe={id:0},Ee=()=>{const We=De.offsetHeight;We>0&&fe(it=>Math.abs(it-We)>.5?We:it)};Fe.id=requestAnimationFrame(Ee);const Je=new ResizeObserver(()=>{cancelAnimationFrame(Fe.id),Fe.id=requestAnimationFrame(Ee)});return Je.observe(De),()=>{cancelAnimationFrame(Fe.id),Je.disconnect()}},[U,n]),s.useLayoutEffect(()=>{if(!$){h(0),Y(0);return}const De=X.current,Fe=he.current;if(!De||!Fe)return;const Ee={id:0},Je=()=>{const it=De.offsetWidth,nt=Fe.offsetHeight;it>0&&Y(me=>Math.abs(me-it)>.5?it:me),nt>0&&h(me=>Math.abs(me-nt)>.5?nt:me)};Ee.id=requestAnimationFrame(Je);const We=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Je)});return We.observe(De),We.observe(Fe),()=>{cancelAnimationFrame(Ee.id),We.disconnect()}},[$,z,$e,b,P,K]),s.useLayoutEffect(()=>{if(!K||d<=0)return;const De=ne.current;De&&Af(De)},[K,d,u,T]),s.useLayoutEffect(()=>{if(!$||!D)return;const De=X.current;if(!De)return;const Fe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const at of Fe.itemsCache)for(const ut of at.glyphs)ic(ut.inner)},Je=()=>{const at=le.current??De;Fe.itemsCache=Array.from(De.querySelectorAll("[data-marquee-text-item]"),ut=>{const Ge=[];return ut.querySelectorAll("[data-marquee-wave-node]").forEach(pt=>{const Tt=pt.firstElementChild;Tt&&Ge.push({inner:Tt,layoutLocalX:Hf(pt,at)})}),{item:ut,glyphs:Ge}}),Fe.cacheDirty=!1},We=()=>{Fe.cacheDirty&&Je();const ut=(le.current??De).offsetWidth||1,Ge=ut*oe.current,pt=Re.current,Tt=2*Math.PI*pt/ut,Lt=`${ut}|${Ge}|${Tt}`;if(Lt!==Fe.lutKey&&(Fe.lutKey=Lt,Fe.lut=Cu(Ge,Tt,$u)),Math.abs(Ge)<=0||Tt<=0){Ee();return}const xt=ne.current,Et=xt?Wf(getComputedStyle(xt).transform):0,Vt=De.getBoundingClientRect(),Ut=Vt.left,Kt=Vt.right,Pt=Fe.lut&&Fe.lut.wavelength>0?Math.max(0,(Fe.lut.periodArc/Fe.lut.wavelength-1)*ut):0;for(const{item:jt,glyphs:on}of Fe.itemsCache){const vt=jt.getBoundingClientRect();if(vt.right<Ut||vt.left>Kt+Pt){for(const Le of on)ic(Le.inner);continue}for(const Le of on){const qe=Le.layoutLocalX+Et,st=Fe.lut?Df(Fe.lut,qe):qe,lt=Tt*st,wt=Ge*Math.sin(lt),It=Ge*Tt*Math.cos(lt),gt=Math.atan(It)*(180/Math.PI);_f(Le.inner,st-qe,wt,gt)}}},it=()=>{Fe.cancelled||(Fe.raf=0,We(),pe.current&&!document.hidden&&(Fe.raf=requestAnimationFrame(it)))},nt=()=>{Fe.cancelled||Fe.raf||(Fe.raf=requestAnimationFrame(it))},me=()=>{Fe.cacheDirty=!0,We(),nt()};Z.current=nt,se.current=me,We(),nt();const Ne=()=>{if(document.hidden){cancelAnimationFrame(Fe.raf),Fe.raf=0;return}cancelAnimationFrame(Fe.raf),Fe.raf=0,me()};return document.addEventListener("visibilitychange",Ne),window.addEventListener("pageshow",Ne),window.addEventListener("focus",Ne),()=>{Fe.cancelled=!0,Z.current=null,se.current=null,cancelAnimationFrame(Fe.raf),document.removeEventListener("visibilitychange",Ne),window.removeEventListener("pageshow",Ne),window.removeEventListener("focus",Ne),Ee()}},[$,D]),s.useLayoutEffect(()=>{var De;!$||!D||(De=se.current)==null||De.call(se)},[$,D,r,z,R,$e,I,O,q]),s.useLayoutEffect(()=>{var De;(De=Z.current)==null||De.call(Z)},[M,u]);const G=()=>{N&&ae(!0)},Ie=()=>{N&&ae(!1)},xe=$?Math.abs(I)*100:0,J=L(U),He={minHeight:J,...$?{paddingTop:`${xe}%`,paddingBottom:`${xe}%`}:{}},je={height:J,...$?{visibility:"hidden"}:{backgroundColor:k}},ct={gap:L(v),minHeight:J},Ve=q*I,et=Math.abs(Ve),Ze=ee>0?ee:Ce,Ye=Math.max(Ce,Ze),be=et+Ye/2,Oe=Math.max(Ze,1),ze=$&&q>0&&Ye>0?zf(q,Ve,O,be,Oe):"",Qe=et*2+Ye,ge=ze?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:ze,fill:"none",stroke:k,strokeWidth:Ze,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,_e=a.jsx("div",{ref:ke,className:`${o}-ribbon`,style:je,"aria-hidden":!0}),Xe=(De,Fe,Ee)=>a.jsx(Bf,{item:De,prefix:o,textCss:C,capHeightPx:$e,opticalOffsetY:ve,imageGapPx:L(v),isCurve:$},`${Fe}-${Ee}`),tt=a.jsx("span",{ref:ye,"aria-hidden":!0,className:`${o}-cap-ref`,style:C,children:"H"}),ft=`${Math.max(0,de)/1e3}s`,ot=K?a.jsx("div",{ref:ne,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:G,onMouseLeave:Ie,style:{WebkitAnimationDuration:ft,animationDuration:ft,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:ce},(De,Fe)=>a.jsx("div",{ref:Fe===0?he:void 0,className:`${o}-marquee-set`,style:{...ct,paddingRight:L(v)},"aria-hidden":Fe>0,children:te.map((Ee,Je)=>Xe(Ee,Fe,Je))},`set-${Fe}`))}):a.jsx("div",{ref:he,className:Ct(`${o}-marquee-set`,`${o}-marquee-static`),style:ct,children:t==null?void 0:t.map((De,Fe)=>Xe(De,0,Fe))});return a.jsxs("div",{ref:X,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),tt,a.jsxs("div",{ref:le,className:`${o}-marquee-wrapper`,style:He,children:[_e,ge,ot]})]})},Vf=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
2609
2609
  import cn from 'classnames';
2610
2610
  import { CommonComponentProps } from '../props';
2611
2611
  import { scalingValue } from '../utils/scalingValue';
@@ -3624,7 +3624,7 @@ type MarqueeTextProps = {
3624
3624
  pointer-events: auto;
3625
3625
  z-index: 10;
3626
3626
  }
3627
- `}const Yf=30,oc=2,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")},Zf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:y,stroke:m,strokeColor:g,bgColor:f,padding:x,logoMarginTop:R,logoWidth:b,logoHeight:S,captionMarginTop:G}=e,D=!!o,j=((t==null?void 0:t.length)??0)>0,P=d>0&&(!n||i),M=j&&(P||n),K=Math.max(0,d)*Yf,T=I=>F.scalingValue(I,n??!1),L=s.useRef(null),_=s.useRef(null),z=s.useRef(null),[$,k]=s.useState(0),[W,w]=s.useState(0),U=W>0?W:0,C=s.useMemo(()=>Uf(r,U),[r,U]),[O,V]=s.useState(0),se=P&&u==="on",[ie,N]=s.useState(!1),de=s.useRef(null),[X,ce]=s.useState(0),[oe,fe]=s.useState(0),Pe=s.useRef(null),xe=I=>{var ne,H,te,ke,ge;return{fontSettings:{fontFamily:(e==null?void 0:e[`${I}FontFamily`])??"Arial",fontWeight:((ne=e==null?void 0:e[`${I}FontSettings`])==null?void 0:ne.fontWeight)??400,fontStyle:((H=e==null?void 0:e[`${I}FontSettings`])==null?void 0:H.fontStyle)??"normal"},textAppearance:{textTransform:((te=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:te.textTransform)??"none",textDecoration:((ke=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:ke.textDecoration)??"none",fontVariant:((ge=e==null?void 0:e[`${I}TextAppearance`])==null?void 0:ge.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"}},pe=xe("text"),Z=xe("caption"),le=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(I=>{var Q,ne;return(((Q=I.text)==null?void 0:Q.length)??0)>0||(((ne=I.caption)==null?void 0:ne.length)??0)>0}),[t]),re=s.useMemo(()=>!M||(t==null?void 0:t.length)===0?1:W<=0||$<=0?oc:Math.max(oc,Math.ceil($/W)+1),[M,t==null?void 0:t.length,W,$]);s.useLayoutEffect(()=>{if(!M)return;const I=L.current,Q=z.current;if(!I||!Q)return;let ne=0;const H=()=>{const ge=I.getBoundingClientRect().width,J=Q.getBoundingClientRect().width,Ye=Pe.current,je=typeof Ye=="number"&&Math.abs(Ye-J)<=.25;if(Pe.current=J,k(ge),typeof J=="number"&&J>0&&W<=0){w(J);return}je&&J!==W?w(J):!je&&W<=0&&(cancelAnimationFrame(ne),ne=requestAnimationFrame(H))},te=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame(H)};te();const ke=new ResizeObserver(te);return ke.observe(I),ke.observe(Q),()=>{cancelAnimationFrame(ne),ke.disconnect()}},[P,M,W]);const Ie=U>0&&K>0?U/K*1e3:0,we=`${Math.max(0,Ie)/1e3}s`;s.useLayoutEffect(()=>{if(!M||U<=0)return;const I=_.current;I&&Kf(I)},[M,U,c]),s.useLayoutEffect(()=>{if(!M){V(0);return}const I=z.current,Q=_.current;if(!I||!Q)return;const ne=()=>{let te=0;for(let ke=0;ke<I.children.length;ke++){const J=I.children[ke].firstElementChild;J&&(te=Math.max(te,J.offsetHeight))}te<=0&&(te=Q.offsetHeight),V(te>0?te:0)};ne();const H=new ResizeObserver(ne);return H.observe(I),H.observe(Q),()=>{H.disconnect()}},[M,re,t,n,p,v,x,m,y,b,S,X,oe]);const Me=()=>{se&&N(!0)},ye=()=>{se&&N(!1)},be=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,Q,ne,H)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":D?H==null?void 0:H.controlsName:void 0,"data-controls-axis":D?"y":void 0,className:D?`${r}-control`:void 0,style:{height:T((H==null?void 0:H.marginTop)??0)}}),a.jsx("div",{...H!=null&&H.dataMeasureKind?{"data-testimonial-measure":H.dataMeasureKind}:{},style:{...Qt(I,n),textAlign:Ce,pointerEvents:"auto",...typeof(H==null?void 0:H.minHeightPx)=="number"&&H.minHeightPx>0?{minHeight:H.minHeightPx}:{}},children:a.jsx(Ki,{content:Q})})]},ne),[be,Ce,n,D,r,T]),q=s.useCallback((I,Q,ne)=>{var H,te,ke;return a.jsxs("div",{style:{padding:`${T(x.top)} ${T(x.right)} ${T(x.bottom)} ${T(x.left)}`,width:T(v+m*2),height:"100%",borderRadius:T(y),border:`${T(m)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:be,textAlign:Ce},children:[I.text&&h(pe,I.text,"text",ne!=null&&ne.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ne==null?void 0:ne.textMinHeightPx)=="number"&&ne.textMinHeightPx>0?{minHeightPx:ne.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":D&&!(ne!=null&&ne.dataMeasureAttrs)?"logoMarginTop":void 0,className:D&&!(ne!=null&&ne.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:T(R)}}),a.jsx("div",{style:{width:T(b),height:T(S)},children:((H=I.logo)==null?void 0:H.url)&&a.jsx("img",{src:I.logo.url,alt:((te=I.logo)==null?void 0:te.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((ke=I.logo)==null?void 0:ke.objectFit)||"contain"}})})]}),I.caption&&h(Z,I.caption,"caption",{...ne!=null&&ne.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:G,...ne!=null&&ne.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ne==null?void 0:ne.captionMinHeightPx)=="number"&&ne.captionMinHeightPx>0?{minHeightPx:ne.captionMinHeightPx}:{}})]})]},Q)},[f,G,Z,v,y,S,R,b,be,Ce,x.bottom,x.left,x.right,x.top,h,m,g,pe,n,D,r]),Y=s.useCallback(I=>{ce(I.maxTextPx),fe(I.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!le){Y({maxTextPx:0,maxCaptionPx:0});return}const I=de.current;if(!I)return;const Q=()=>{F.readTestimonialTextMeasure(I,Y)};Q();const ne=new ResizeObserver(Q);return ne.observe(I),()=>{ne.disconnect()}},[le,Y,t,q]);const ee=le?{textMinHeightPx:X,captionMinHeightPx:oe}:void 0,ve=le?a.jsx("div",{ref:de,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((I,Q)=>q(I,`measure-${Q}`,{dataMeasureAttrs:!0}))}):null,B=(I,Q)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[q(I,`card-${Q}`,ee),D&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${T(p)})`,width:T(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},Q);if(M){const I=P?se&&ie?"paused":"running":"paused";return a.jsxs("div",{ref:L,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...O>0?{height:O}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:C}}),ve,a.jsx("div",{ref:_,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:ye,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:we,WebkitAnimationDuration:we,animationPlayState:I,WebkitAnimationPlayState:I},children:Array.from({length:re},(Q,ne)=>a.jsx("div",{ref:ne===0?z:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:T(p),paddingRight:T(p)},"aria-hidden":ne>0,children:t==null?void 0:t.map((H,te)=>B(H,`${ne}-${te}`))},`set-${ne}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:C}}),ve,a.jsx("div",{style:{gap:T(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((I,Q)=>B(I,Q))})]})},Jf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3627
+ `}const Yf=30,oc=2,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")},Zf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:y,stroke:m,strokeColor:g,bgColor:f,padding:x,logoMarginTop:P,logoWidth:b,logoHeight:w,captionMarginTop:j}=e,H=!!o,B=((t==null?void 0:t.length)??0)>0,k=d>0&&(!n||i),W=B&&(k||n),U=Math.max(0,d)*Yf,$=R=>F.scalingValue(R,n??!1),I=s.useRef(null),O=s.useRef(null),_=s.useRef(null),[C,L]=s.useState(0),[D,S]=s.useState(0),K=D>0?D:0,T=s.useMemo(()=>Uf(r,K),[r,K]),[N,V]=s.useState(0),ae=k&&u==="on",[ie,M]=s.useState(!1),de=s.useRef(null),[X,le]=s.useState(0),[ne,he]=s.useState(0),ke=s.useRef(null),ye=R=>{var te,ce,G,Ie,xe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((te=e==null?void 0:e[`${R}FontSettings`])==null?void 0:te.fontWeight)??400,fontStyle:((ce=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ce.fontStyle)??"normal"},textAppearance:{textTransform:((G=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:G.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((xe=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:xe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},pe=ye("text"),Z=ye("caption"),se=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var Q,te;return(((Q=R.text)==null?void 0:Q.length)??0)>0||(((te=R.caption)==null?void 0:te.length)??0)>0}),[t]),oe=s.useMemo(()=>!W||(t==null?void 0:t.length)===0?1:D<=0||C<=0?oc:Math.max(oc,Math.ceil(C/D)+1),[W,t==null?void 0:t.length,D,C]);s.useLayoutEffect(()=>{if(!W)return;const R=I.current,Q=_.current;if(!R||!Q)return;let te=0;const ce=()=>{const xe=R.getBoundingClientRect().width,J=Q.getBoundingClientRect().width,He=ke.current,je=typeof He=="number"&&Math.abs(He-J)<=.25;if(ke.current=J,L(xe),typeof J=="number"&&J>0&&D<=0){S(J);return}je&&J!==D?S(J):!je&&D<=0&&(cancelAnimationFrame(te),te=requestAnimationFrame(ce))},G=()=>{cancelAnimationFrame(te),te=requestAnimationFrame(ce)};G();const Ie=new ResizeObserver(G);return Ie.observe(R),Ie.observe(Q),()=>{cancelAnimationFrame(te),Ie.disconnect()}},[k,W,D]);const Re=K>0&&U>0?K/U*1e3:0,$e=`${Math.max(0,Re)/1e3}s`;s.useLayoutEffect(()=>{if(!W||K<=0)return;const R=O.current;R&&Kf(R)},[W,K,c]),s.useLayoutEffect(()=>{if(!W){V(0);return}const R=_.current,Q=O.current;if(!R||!Q)return;const te=()=>{let G=0;for(let Ie=0;Ie<R.children.length;Ie++){const J=R.children[Ie].firstElementChild;J&&(G=Math.max(G,J.offsetHeight))}G<=0&&(G=Q.offsetHeight),V(G>0?G:0)};te();const ce=new ResizeObserver(te);return ce.observe(R),ce.observe(Q),()=>{ce.disconnect()}},[W,oe,t,n,p,v,x,m,y,b,w,X,ne]);const Me=()=>{ae&&M(!0)},ve=()=>{ae&&M(!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((R,Q,te,ce)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:Se,width:"100%"},children:[a.jsx("div",{"data-controls":H?ce==null?void 0:ce.controlsName:void 0,"data-controls-axis":H?"y":void 0,className:H?`${r}-control`:void 0,style:{height:$((ce==null?void 0:ce.marginTop)??0)}}),a.jsx("div",{...ce!=null&&ce.dataMeasureKind?{"data-testimonial-measure":ce.dataMeasureKind}:{},style:{...Qt(R,n),textAlign:Ce,pointerEvents:"auto",...typeof(ce==null?void 0:ce.minHeightPx)=="number"&&ce.minHeightPx>0?{minHeight:ce.minHeightPx}:{}},children:a.jsx(Ki,{content:Q})})]},te),[Se,Ce,n,H,r,$]),q=s.useCallback((R,Q,te)=>{var ce,G,Ie;return a.jsxs("div",{style:{padding:`${$(x.top)} ${$(x.right)} ${$(x.bottom)} ${$(x.left)}`,width:$(v+m*2),height:"100%",borderRadius:$(y),border:`${$(m)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:Se,textAlign:Ce},children:[R.text&&h(pe,R.text,"text",te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(te==null?void 0:te.textMinHeightPx)=="number"&&te.textMinHeightPx>0?{minHeightPx:te.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:Se,width:"100%"},children:[a.jsx("div",{"data-controls":H&&!(te!=null&&te.dataMeasureAttrs)?"logoMarginTop":void 0,className:H&&!(te!=null&&te.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(P)}}),a.jsx("div",{style:{width:$(b),height:$(w)},children:((ce=R.logo)==null?void 0:ce.url)&&a.jsx("img",{src:R.logo.url,alt:((G=R.logo)==null?void 0:G.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ie=R.logo)==null?void 0:Ie.objectFit)||"contain"}})})]}),R.caption&&h(Z,R.caption,"caption",{...te!=null&&te.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:j,...te!=null&&te.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(te==null?void 0:te.captionMinHeightPx)=="number"&&te.captionMinHeightPx>0?{minHeightPx:te.captionMinHeightPx}:{}})]})]},Q)},[f,j,Z,v,y,w,P,b,Se,Ce,x.bottom,x.left,x.right,x.top,h,m,g,pe,n,H,r]),Y=s.useCallback(R=>{le(R.maxTextPx),he(R.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!se){Y({maxTextPx:0,maxCaptionPx:0});return}const R=de.current;if(!R)return;const Q=()=>{F.readTestimonialTextMeasure(R,Y)};Q();const te=new ResizeObserver(Q);return te.observe(R),()=>{te.disconnect()}},[se,Y,t,q]);const ee=se?{textMinHeightPx:X,captionMinHeightPx:ne}:void 0,fe=se?a.jsx("div",{ref:de,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,Q)=>q(R,`measure-${Q}`,{dataMeasureAttrs:!0}))}):null,z=(R,Q)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[q(R,`card-${Q}`,ee),H&&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}})]},Q);if(W){const R=k?ae&&ie?"paused":"running":"paused";return a.jsxs("div",{ref:I,className:Ct(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...N>0?{height:N}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),fe,a.jsx("div",{ref:O,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:ve,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:R,WebkitAnimationPlayState:R},children:Array.from({length:oe},(Q,te)=>a.jsx("div",{ref:te===0?_:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":te>0,children:t==null?void 0:t.map((ce,G)=>z(ce,`${te}-${G}`))},`set-${te}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),fe,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,Q)=>z(R,Q))})]})},Jf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
3628
3628
  import cn from 'classnames';
3629
3629
  import { CommonComponentProps } from '../props';
3630
3630
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -4379,7 +4379,7 @@ type TestimonialsSettings = {
4379
4379
  width: 100%;
4380
4380
  height: 100%;
4381
4381
  }
4382
- `}const ny=3e3,iy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:y,imageWidth:m,imageHeight:g,controlsWidth:f,controlsColor:x,controlsHoverColor:R}=e,b=d>0&&(!n||!!i),[S,G]=s.useState(0),[D,j]=s.useState(null),[P,M]=s.useState(!1),K=s.useRef(null),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{G(0),j(null),M(!1)},[l.length]);const _=l[S],z=D===null?null:l[D],$=xe=>{var Z,le,re,Ie,we;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((Z=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:Z.fontWeight)??400,fontStyle:((le=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:le.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((Ie=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Ie.textDecoration)??"none",fontVariant:((we=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:we.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"}},k=$("text"),W=$("caption"),w=l.length>1&&l.some(xe=>{var pe,Z;return(((pe=xe.text)==null?void 0:pe.length)??0)>0||(((Z=xe.caption)==null?void 0:Z.length)??0)>0}),U=s.useRef(null),[C,O]=s.useState(0),[V,se]=s.useState(0),ie=e.controls??{mode:"Off",icon:null},N=l.length>1,de=s.useCallback((xe,pe)=>!N||pe===xe?xe:(K.current&&window.clearTimeout(K.current),j(xe),M(!0),K.current=window.setTimeout(()=>{j(null),M(!1),K.current=null},300),pe),[N]),X=s.useCallback(()=>{N&&G(xe=>de(xe,(xe-1+l.length)%l.length))},[N,de,l.length]),ce=s.useCallback(()=>{N&&G(xe=>de(xe,(xe+1)%l.length))},[N,de,l.length]);s.useEffect(()=>{if(!b||!N)return;const xe=Math.max(300,ny/d),pe=window.setInterval(()=>{G(Z=>de(Z,(Z+1)%l.length))},xe);return()=>{window.clearInterval(pe)}},[b,N,de,l.length,d]),s.useEffect(()=>()=>{K.current&&window.clearTimeout(K.current)},[]);const oe=(xe,pe)=>{var we,Me,ye,be;const Z=pe==null?void 0:pe.textMinHeightPx,le=pe==null?void 0:pe.captionMinHeightPx,re=pe==null?void 0:pe.dataMeasureAttrs,Ie=o&&!(pe!=null&&pe.dataMeasureAttrs)&&!(pe!=null&&pe.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Ie?"textMarginTop":void 0,className:Ie?`${r}-control`:void 0,style:{height:F.scalingValue(v??0,n??!1)}}),a.jsx("div",{...re&&{"data-testimonial-measure":"text"},style:{...Qt(k,n),...Z&&Z>0?{minHeight:Z}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ki,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Ie?"imageMarginTop":void 0,className:Ie?`${r}-control`:void 0,style:{height:F.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:F.scalingValue(m??0,n??!1),height:F.scalingValue(g??0,n??!1)},children:((we=xe.image)==null?void 0:we.url)&&a.jsx("img",{src:(Me=xe.image)==null?void 0:Me.url,alt:((ye=xe.image)==null?void 0:ye.name)??"",className:`${r}-icon`,style:{objectFit:((be=xe.image)==null?void 0:be.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Ie?"captionMarginTop":void 0,className:Ie?`${r}-control`:void 0,style:{height:F.scalingValue(y??0,n??!1)}}),a.jsx("div",{...re?{"data-testimonial-measure":"caption"}:{},style:{...Qt(W,n),...le&&le>0?{minHeight:le}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ki,{content:xe.caption})})]})]})},fe=s.useCallback(xe=>{O(xe.maxTextPx),se(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!w){fe({maxTextPx:0,maxCaptionPx:0});return}const xe=U.current;if(!xe)return;const pe=()=>{F.readTestimonialTextMeasure(xe,fe)};pe();const Z=new ResizeObserver(pe);return Z.observe(xe),()=>{Z.disconnect()}},[w,fe,t]),!_)return a.jsx(a.Fragment,{});const Pe=w?{textMinHeightPx:C,captionMinHeightPx:V}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ty(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:F.scalingValue(u??0,n??!1),alignItems:T},children:[w&&a.jsx("div",{ref:U,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,pe)=>a.jsx("div",{style:{width:"100%"},children:oe(xe,{dataMeasureAttrs:!0})},pe))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[z&&P&&a.jsx("div",{className:Ct(`${r}-fade-item-prev`,`${r}-fade-out`),children:oe(z,{...Pe,hideControls:!0})}),a.jsx("div",{className:Ct(`${r}-fade-item-current`,P?`${r}-fade-in`:void 0),children:oe(_,Pe)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:F.scalingValue(f??.02,n??!1),height:F.scalingValue(f??.02,n??!1),"--arrow-hover-color":R},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:X,disabled:!N,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:x,hoverFill:R,className:Ct(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Ct(`${r}-arrow`,`${r}-next-arrow`),style:{width:F.scalingValue(f??.02,n??!1),height:F.scalingValue(f??.02,n??!1),"--arrow-hover-color":R},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!N,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:x,hoverFill:R,className:`${r}-arrow-img`})})})]})]})})},oy=`import cn from 'classnames';
4382
+ `}const ny=3e3,iy=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=F.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:y,imageWidth:m,imageHeight:g,controlsWidth:f,controlsColor:x,controlsHoverColor:P}=e,b=d>0&&(!n||!!i),[w,j]=s.useState(0),[H,B]=s.useState(null),[k,W]=s.useState(!1),U=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),I=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{j(0),B(null),W(!1)},[l.length]);const O=l[w],_=H===null?null:l[H],C=ye=>{var Z,se,oe,Re,$e;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ye}FontFamily`])??"Arial",fontWeight:((Z=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:Z.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${ye}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Re=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:Re.textDecoration)??"none",fontVariant:(($e=e==null?void 0:e[`${ye}TextAppearance`])==null?void 0:$e.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ye}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ye}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ye}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ye}WordSpacing`])??0,color:(e==null?void 0:e[`${ye}Color`])??"#000000"}},L=C("text"),D=C("caption"),S=l.length>1&&l.some(ye=>{var pe,Z;return(((pe=ye.text)==null?void 0:pe.length)??0)>0||(((Z=ye.caption)==null?void 0:Z.length)??0)>0}),K=s.useRef(null),[T,N]=s.useState(0),[V,ae]=s.useState(0),ie=e.controls??{mode:"Off",icon:null},M=l.length>1,de=s.useCallback((ye,pe)=>!M||pe===ye?ye:(U.current&&window.clearTimeout(U.current),B(ye),W(!0),U.current=window.setTimeout(()=>{B(null),W(!1),U.current=null},300),pe),[M]),X=s.useCallback(()=>{M&&j(ye=>de(ye,(ye-1+l.length)%l.length))},[M,de,l.length]),le=s.useCallback(()=>{M&&j(ye=>de(ye,(ye+1)%l.length))},[M,de,l.length]);s.useEffect(()=>{if(!b||!M)return;const ye=Math.max(300,ny/d),pe=window.setInterval(()=>{j(Z=>de(Z,(Z+1)%l.length))},ye);return()=>{window.clearInterval(pe)}},[b,M,de,l.length,d]),s.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current)},[]);const ne=(ye,pe)=>{var $e,Me,ve,Se;const Z=pe==null?void 0:pe.textMinHeightPx,se=pe==null?void 0:pe.captionMinHeightPx,oe=pe==null?void 0:pe.dataMeasureAttrs,Re=o&&!(pe!=null&&pe.dataMeasureAttrs)&&!(pe!=null&&pe.hideControls);return a.jsxs(a.Fragment,{children:[ye.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"textMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:F.scalingValue(v??0,n??!1)}}),a.jsx("div",{...oe&&{"data-testimonial-measure":"text"},style:{...Qt(L,n),...Z&&Z>0?{minHeight:Z}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ki,{content:ye.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"imageMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:F.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:F.scalingValue(m??0,n??!1),height:F.scalingValue(g??0,n??!1)},children:(($e=ye.image)==null?void 0:$e.url)&&a.jsx("img",{src:(Me=ye.image)==null?void 0:Me.url,alt:((ve=ye.image)==null?void 0:ve.name)??"",className:`${r}-icon`,style:{objectFit:((Se=ye.image)==null?void 0:Se.objectFit)||"contain"}})})]}),ye.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"captionMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:F.scalingValue(y??0,n??!1)}}),a.jsx("div",{...oe?{"data-testimonial-measure":"caption"}:{},style:{...Qt(D,n),...se&&se>0?{minHeight:se}:{},textAlign:I,pointerEvents:"auto"},children:a.jsx(Ki,{content:ye.caption})})]})]})},he=s.useCallback(ye=>{N(ye.maxTextPx),ae(ye.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!S){he({maxTextPx:0,maxCaptionPx:0});return}const ye=K.current;if(!ye)return;const pe=()=>{F.readTestimonialTextMeasure(ye,he)};pe();const Z=new ResizeObserver(pe);return Z.observe(ye),()=>{Z.disconnect()}},[S,he,t]),!O)return a.jsx(a.Fragment,{});const ke=S?{textMinHeightPx:T,captionMinHeightPx:V}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ty(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:F.scalingValue(u??0,n??!1),alignItems:$},children:[S&&a.jsx("div",{ref:K,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ye,pe)=>a.jsx("div",{style:{width:"100%"},children:ne(ye,{dataMeasureAttrs:!0})},pe))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[_&&k&&a.jsx("div",{className:Ct(`${r}-fade-item-prev`,`${r}-fade-out`),children:ne(_,{...ke,hideControls:!0})}),a.jsx("div",{className:Ct(`${r}-fade-item-current`,k?`${r}-fade-in`:void 0),children:ne(O,ke)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:F.scalingValue(f??.02,n??!1),height:F.scalingValue(f??.02,n??!1),"--arrow-hover-color":P},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:X,disabled:!M,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:x,hoverFill:P,className:Ct(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:Ct(`${r}-arrow`,`${r}-next-arrow`),style:{width:F.scalingValue(f??.02,n??!1),height:F.scalingValue(f??.02,n??!1),"--arrow-hover-color":P},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:le,disabled:!M,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(pn,{url:ie.icon,fill:x,hoverFill:P,className:`${r}-arrow-img`})})})]})]})})},oy=`import cn from 'classnames';
4383
4383
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
4384
4384
  import { CommonComponentProps } from '../props';
4385
4385
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
@@ -5222,7 +5222,7 @@ type TestimonialsSettings = {
5222
5222
  z-index: 2;
5223
5223
  width: 100%;
5224
5224
  }
5225
- `}function dy(){return Math.random()<.5?"ltr":"ttb"}function uy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function py(e){const t=dy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{uy(e)})})}const Pn=500,my=750,ci="cubic-bezier(0.22, 1, 0.36, 1)",gy=72,hy=50;function fy(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 yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Tu(e){return!Array.isArray(e)||e.length===0?[]:fy(e)?e.flatMap(t=>{const n=yy(t);if(!n)return[];const i=vy(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 qi(e){return e.type==="video"}function xy(e){const t=new Set,n=[];for(const i of e){const o=Tu(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 by({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=>qi(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 Sy(e){e.pause(),e.removeAttribute("src"),e.load()}function lc({media:e,className:t,style:n,onMediaClick:i}){return qi(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 cc(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 $y({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Sy(d)}},[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 Cy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=s.useRef(null),y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),R=s.useRef("none"),b=s.useRef(!1),S=s.useRef(!1),G=s.useRef(null),D=s.useRef(0),j=s.useRef(null),P=s.useRef(!1),M=s.useRef(null),K=s.useRef(null),T=s.useRef(null),L=s.useRef(()=>{}),[_,z]=s.useState(null),[$,k]=s.useState(null),[W,w]=s.useState("opening"),[U,C]=s.useState(0),[O,V]=s.useState(0),[se,ie]=s.useState(null),[N,de]=s.useState(!1),[X,ce]=s.useState(!1),[oe,fe]=s.useState(!1),[Pe,xe]=s.useState(null),pe=s.useRef(n),Z=s.useRef(void 0),le=t[n],re=le?qi(le):!1,Ie=O!==0||N,we=se!==null,Me=s.useCallback(he=>{const _e=he.currentTarget,Ve=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Ve.width||!Ve.height||xe(Ve)},[]);s.useEffect(()=>{G.current=$},[$]),s.useEffect(()=>{const he=v.current;if(!he)return;const _e=()=>k(cc(he));_e();const Ve=new ResizeObserver(_e);return Ve.observe(he),()=>Ve.disconnect()},[]);const ye=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),be=s.useCallback(()=>{const he=K.current;K.current=null,ye(),j.current=null,P.current=!1,ie(null),de(!1),V(0),D.current=0,ce(!1),b.current=!1,x.current=0,R.current="none",he===1?d():he===-1&&l()},[ye,d,l]),Ce=s.useCallback(()=>{ye(),K.current=null,j.current=null,P.current=!1,ie(null),de(!1),V(0),D.current=0},[ye]),h=s.useCallback(()=>{ye(),M.current=window.setTimeout(()=>{K.current!==null&&be()},Pn+32)},[ye,be]),q=s.useCallback((he,_e)=>{var tt;const Ve=((tt=G.current)==null?void 0:tt.width)??0;if(ye(),j.current=he,ie(he),P.current=!0,de(!0),_e){K.current=he;const ft=-he*Ve;D.current=ft,V(ft),h();return}D.current=0,V(0),M.current=window.setTimeout(()=>{M.current=null,Ce()},Pn+32)},[ye,Ce,h]),Y=s.useCallback(he=>{if(!(t.length<=1)){if(P.current){if(K.current===he){T.current=he,be();return}Ce()}ye(),j.current=he,ie(he),P.current=!1,de(!1),D.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(he,!0)})})}},[t.length,q,be,Ce,ye]);L.current=Y;const ee=s.useCallback(he=>{he.propertyName!=="transform"||!P.current||K.current!==null&&be()},[be]),ve=s.useCallback(()=>{const he=y.current;if(!he)return;const _e=cc(he);!_e.width||!_e.height||z(_e)},[]);s.useEffect(()=>{ve();const he=y.current;if(!he)return;const _e=new ResizeObserver(()=>ve());return _e.observe(he),()=>_e.disconnect()},[ve]),s.useEffect(()=>{W==="opening"&&_&&w("open")},[W,_]),s.useEffect(()=>{if(W!=="closing")return;const he=setTimeout(()=>r(),Pn);return()=>clearTimeout(he)},[W,r]),s.useEffect(()=>()=>{ye()},[ye]),s.useLayoutEffect(()=>{pe.current===n&&Z.current===(le==null?void 0:le.url)||(ye(),K.current=null,ie(null),C(0),V(0),de(!1),fe(!1),ce(!1),xe(null),f.current=0,x.current=0,R.current="none",b.current=!1,P.current=!1,D.current=0,j.current=null,g.current=null,S.current=!1,pe.current=n,Z.current=le==null?void 0:le.url)},[n,le==null?void 0:le.url,ye]),s.useLayoutEffect(()=>{const he=T.current;he!==null&&(T.current=null,requestAnimationFrame(()=>{L.current(he)}))},[n,le==null?void 0:le.url]),s.useEffect(()=>{if(W!=="open")return;let he=null;const _e=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ve=()=>{_e(),he=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),_e()},document.addEventListener("click",he,!0)},tt=Fe=>{const Ee=Fe<0?1:-1;if(Math.abs(Fe)>hy&&t.length>1){q(Ee,!0);return}q(Ee,!1)},ft=Fe=>{if(Fe.touches.length!==1||P.current)return;const Ee=Fe.touches[0];S.current=!0,g.current={x:Ee.clientX,y:Ee.clientY},R.current="none",x.current=0,b.current=!1},rt=Fe=>{if(!g.current||Fe.touches.length!==1||P.current)return;const Ee=Fe.touches[0],Ze=Ee.clientX-g.current.x,We=Ee.clientY-g.current.y;if(R.current==="none"){if(Math.abs(Ze)<10&&Math.abs(We)<10)return;if(Math.abs(Ze)>Math.abs(We)){if(t.length<=1)return;R.current="horizontal"}else if(We>0)R.current="vertical";else return}if(R.current==="horizontal"){b.current=!0,ce(!0),x.current=Ze;const ot=Ze<0?1:-1;j.current!==ot&&(j.current=ot,ie(ot)),D.current=Ze,V(Ze),Fe.preventDefault();return}R.current==="vertical"&&(b.current=!0,ce(!0),f.current=We,C(We),Fe.preventDefault())},Oe=()=>{if(!g.current)return;const Fe=R.current,Ee=b.current;if(Ee&&Fe==="horizontal")tt(x.current),Ve();else if(Ee&&Fe==="vertical")if(f.current>gy){const We=window.innerHeight;f.current=We,fe(!0),C(We),w("closing")}else f.current=0,C(0),Ve();else Fe==="horizontal"&&Math.abs(x.current)>0&&(tt(x.current),Ve());g.current=null,R.current="none",x.current=0,b.current=!1,ce(!1)};return document.addEventListener("touchstart",ft,{passive:!0}),document.addEventListener("touchmove",rt,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",ft),document.removeEventListener("touchmove",rt),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),_e()}},[W,t.length,q]),s.useEffect(()=>{const he=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),W!=="closing"&&w("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[W]);const B=()=>{W!=="closing"&&w("closing")},I=W==="open",Q=W==="closing",ne=U>0?Math.max(0,1-U/500):1,H=U>0?Math.max(.35,1-U/500):1,te=_?p?_:wy(_,Pe):null,ke=he=>{if(he.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientY-_e.top,tt=Math.min(52,_e.height*.2);if(!(Ve>_e.height-tt)){if(he.clientX-_e.left<_e.width/2){Y(-1);return}Y(1)}},ge=he=>{if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientX-_e.left,tt=he.clientY-_e.top,ft=Math.min(52,_e.height*.2);if(tt>_e.height-ft){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ve<_e.width/2?"w-resize":"e-resize"},J={position:"fixed",top:$==null?void 0:$.top,left:$==null?void 0:$.left,width:$==null?void 0:$.width,height:$==null?void 0:$.height,zIndex:9998},Ye=p?"cover":"contain",je=O!==0||U>0?`translate(${O}px, ${U}px)`:void 0,it=X&&!N?"none":N?`transform ${Pn}ms ${ci}`:oe?`transform ${Pn}ms ${ci}, opacity ${Pn}ms ${ci}`:W==="opening"||Q?`opacity ${Pn}ms ${ci}`:"none",qe={...J,transform:je,opacity:U>0?H:W==="opening"||Q?0:1,transition:it,pointerEvents:"none"},et={position:"absolute",top:((te==null?void 0:te.top)??0)-(($==null?void 0:$.top)??0),left:((te==null?void 0:te.left)??0)-(($==null?void 0:$.left)??0),width:te==null?void 0:te.width,height:te==null?void 0:te.height,objectFit:Ye,pointerEvents:re&&I&&!Ie?"auto":"none",touchAction:re&&I?"none":void 0},Je=($==null?void 0:$.width)??0,Ge=we?(n+se+t.length)%t.length:null,$e=Ge!==null?t[Ge]:null,He={...J,transform:we?`translateX(${se*Je+O}px)`:void 0,opacity:1,transition:N?`transform ${Pn}ms ${ci}`:"none",pointerEvents:"none"},De={position:"absolute",top:((_==null?void 0:_.top)??0)-(($==null?void 0:$.top)??0),left:((_==null?void 0:_.left)??0)-(($==null?void 0:$.left)??0),width:_==null?void 0:_.width,height:_==null?void 0:_.height,objectFit:Ye,pointerEvents:"none"},Qe=te?{position:"fixed",top:te.top,height:te.height,width:te.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:B,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:I?ne:0,transition:X?"none":`opacity ${Pn}ms ${ci}`,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:y,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 ${Pn}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,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 ${Pn}ms ${ci}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),_&&$&&$e&&a.jsx("div",{style:He,onTransitionEnd:ee,children:qi($e)?a.jsx("video",{src:$e.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Ge}-${$e.url}`):a.jsx("img",{src:$e.url,alt:$e.name,style:De},`neighbor-${Ge}-${$e.url}`)}),_&&$&&le&&a.jsx("div",{style:qe,onTransitionEnd:ee,children:re?a.jsx($y,{src:le.url,phase:W,mediaRef:m,mediaStyle:et,onLoadedMetadata:Me,onClick:ke,onMouseMove:ge},`${n}-${le.url}`):a.jsx("img",{ref:m,src:le.url,alt:le.name,onLoad:Me,style:et},`${n}-${le.url}`)}),I&&Qe&&t.length>1&&!re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:te.left,cursor:"w-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),Y(-1)}}),a.jsx("div",{style:{...Qe,left:te.left+te.width/2,cursor:"e-resize",pointerEvents:X?"none":"auto"},onClick:he=>{if(S.current){S.current=!1;return}he.stopPropagation(),Y(1)}})]})]})}function Ty(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:m,entriesCount:g,lightbox:f,imageDisplay:x,imageCorners:R,lightboxImageDisplay:b,slider:S,sliderTiming:G,direction:D,transition:j,titleMarginTop:P,subtitleMarginTop:M,titleColor:K,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:_,titleFontSettings:z,titleFontSize:$,titleLineHeight:k,titleLetterSpacing:W,titleWordSpacing:w,titleTextAppearance:U,subtitleFontFamily:C,subtitleFontSettings:O,subtitleFontSize:V,subtitleLineHeight:se,subtitleLetterSpacing:ie,subtitleWordSpacing:N,subtitleTextAppearance:de,lightboxCounterFontFamily:X,lightboxCounterFontSettings:ce,lightboxCounterFontSize:oe,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Pe,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:pe,showText:Z="always",alignEntries:le="off",align:re="top"}=e,Ie={fontSettings:{fontFamily:_,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:$??.01,lineHeight:k,letterSpacing:W??0,wordSpacing:w??0,textAppearance:U,color:K},Me={...dn(Qt(Ie,n))},ye={fontSettings:{fontFamily:C,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:V??.01,lineHeight:se,letterSpacing:ie??0,wordSpacing:N??0,textAppearance:de,color:T},Ce={...dn(Qt(ye,n))},h={fontSettings:{fontFamily:X,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:fe,letterSpacing:Pe??0,wordSpacing:xe??0,textAppearance:pe,color:L},Y={...dn(Qt(h,n)),...qa(oe,fe,u,n)},ee=Xa($,k,`${u}-item-title`,`${u}-text-tight-leading`),ve=Xa(V,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),B=qa($,k,u,n),I=qa(V,se,u,n),Q=Xa(oe,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=F.buildColorVars(u,{titleColor:K,subtitleColor:T,lightboxCounterColor:L},Iy,Ry),ke=`${l&&l!=="default"?`${u}-state-${l}`:""}${Z==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=g===0?1/0:g,J=(t??[]).slice(0,ge),Ye=s.useMemo(()=>f==="on"?xy(J):[],[J,f]),je=v.entryWidth??.2,it=(x==null?void 0:x.display)==="cover",qe=(x==null?void 0:x.ratioValue)??"1:1",et=(x==null?void 0:x.reversed)??!1,[Je,Ge]=qe.split(":").map(Number),De=`${et?Ge:Je} / ${et?Je:Ge}`,Qe=v.columnsCount,he=F.scalingValue(je??0,n),_e=he,Ve=!it&&S!=="off",tt=J.length%Qe||Qe,ft=tt<Qe&&J.length>0,rt=J.length-tt,Oe=ft?Math.floor((Qe-tt)/2)+1:1,Fe=R?F.scalingValue(R,n):void 0,Ee={width:_e,...it?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...Fe?{borderRadius:Fe,overflow:"hidden"}:{}},Ze=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",ot=le==="on",nt=`calc(${F.scalingValue(je??0,n)} * (${y} / 100))`,me=F.scalingValue(je*y/100,n),Ne=it?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}},[st,ut]=s.useState(0),Be=s.useRef(null),pt=j==="fade"||D==="horizontal"?"ltr":D==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=Be.current;if(!vt)return;const Le=new ResizeObserver(Xe=>{ut(Math.round(Xe[0].contentRect.width))});return Le.observe(vt),()=>Le.disconnect()},[]);const Tt=(()=>{const vt={...ne},Le=Be.current?getComputedStyle(Be.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(vt["--cntrl-article-width"]=Le),vt})(),[Lt,xt]=s.useState(!1),[Et,Vt]=s.useState([]),[Ut,Kt]=s.useState(0),Pt=f==="on"&&(!n||i),jt=(vt,Le)=>{n&&!i||f!=="off"&&(Vt(vt),Kt(Le),xt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Lt,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const on=s.useMemo(()=>cy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),f==="on"&&a.jsx(by,{mediaList:Ye}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:Be,className:`${u}-wrapper ${u}-type-${p}${ot?` ${u}-align-entries`:""} ${u}-image-align-${re} ${ke}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${he})`,rowGap:ot?0:F.scalingValue(m??0,n),columnGap:F.scalingValue(v.horizontalGap??0,n),width:F.scalingValue(v.wrapperWidth??0,n),...ot?{[`--${u}-align-entries-row-gap`]:F.scalingValue(m??0,n)}:{}},children:J.map((vt,Le)=>{var Bt;const Xe=sc(vt.title),lt=sc(vt.subtitle),ct=(((Bt=vt.link)==null?void 0:Bt.length)??0)>0&&f==="off"?vt.link:void 0,wt=Math.floor(Le/Qe)===Math.ceil(J.length/Qe)-1,It=ft&&Le>=rt?`${Oe+(Le-rt)}`:void 0,gt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[Xe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:me}}),lt&&a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:me}})]}):null,Ot=ot?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?F.scalingValue(P??0,n):0,width:me}}),Xe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),We&&Xe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(P??0,n),width:me}})]}):null,_t=ot?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?F.scalingValue(M??0,n):0,width:me}}),lt&&a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle}),We&&lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(M??0,n),width:me}})]}):null,Mt=ct?a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:[Ot,_t]}):a.jsxs(a.Fragment,{children:[Ot,_t]}),Gt=Tu(vt.gallery),Xt=Gt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),Dt=a.jsx("div",{className:Ze,style:Ee,children:Gt.length===0?null:S==="off"?(()=>{const{displayMedia:bt,lightboxMedia:A}=Gt[0],Te=A?Xt.findIndex(Ae=>Ae.url===A.url):-1;return a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Te>=0?()=>jt(Xt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ve&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:bt})=>qi(bt)?a.jsx("video",{src:bt.url,muted:!0,playsInline:!0},`sizer-${bt.url}`):a.jsx("img",{src:bt.url,alt:""},`sizer-${bt.url}`))}),a.jsx(xl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:G*1e3,width:"100%",height:"100%",speed:my,type:j==="fade"?"fade":"loop",rewind:j==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:pt},onMoved:bt=>{D!=="random"||j==="fade"||py(bt)},children:Gt.map(({displayMedia:bt,lightboxMedia:A},Te)=>{const Ae=A?Xt.findIndex(ze=>ze.url===A.url):-1;return a.jsx(bl,{children:a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Ae>=0?()=>jt(Xt,Ae):void 0})},Te)})},`${j}-${je}-${D}-${G}-${st}-${d}`)]})}),zt=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Xe?"titleMarginTop":void 0,className:o&&Xe?`${u}-control`:void 0,style:{height:Xe?F.scalingValue(P??0,n):0,width:me}}),a.jsx("p",{className:ee,style:{width:nt,...Me,...B},children:vt.title}),a.jsx("div",{"data-controls":o&&lt?"subtitleMarginTop":void 0,className:o&&lt?`${u}-control`:void 0,style:{height:lt?F.scalingValue(M??0,n):0,width:me}}),a.jsx("p",{className:ve,style:{width:nt,...Ce,...I},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!ot?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ot&&wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${he} * (${y} / 100))`:he,...It&&ot?{gridColumn:It}:{}},children:ot?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Mt]})}):ct?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ct,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!We&&a.jsx("a",{href:ct,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,zt]})})},Le)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const vt=(c?document.getElementById(c):null)??document.body;return ai.createPortal(a.jsx("div",{style:Tt,"data-selection":"none",children:a.jsx(Cy,{prefix:u,items:Et,index:Ut,imageDisplay:Ty(b),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Kt(Le=>(Le-1+Et.length)%Et.length),onNext:()=>Kt(Le=>(Le+1)%Et.length),counterClassName:Q,counterStyle:Y})}),vt)})()]})}const Iy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ry=["hover","focus","filled","success","error"],Py=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5225
+ `}function dy(){return Math.random()<.5?"ltr":"ttb"}function uy(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function py(e){const t=dy();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{uy(e)})})}const Pn=500,my=750,di="cubic-bezier(0.22, 1, 0.36, 1)",gy=72,hy=50;function fy(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 yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Tu(e){return!Array.isArray(e)||e.length===0?[]:fy(e)?e.flatMap(t=>{const n=yy(t);if(!n)return[];const i=vy(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 qi(e){return e.type==="video"}function xy(e){const t=new Set,n=[];for(const i of e){const o=Tu(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 by({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=>qi(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 Sy(e){e.pause(),e.removeAttribute("src"),e.load()}function lc({media:e,className:t,style:n,onMediaClick:i}){return qi(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 cc(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 $y({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Sy(d)}},[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 Cy({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=s.useRef(null),y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),P=s.useRef("none"),b=s.useRef(!1),w=s.useRef(!1),j=s.useRef(null),H=s.useRef(0),B=s.useRef(null),k=s.useRef(!1),W=s.useRef(null),U=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[O,_]=s.useState(null),[C,L]=s.useState(null),[D,S]=s.useState("opening"),[K,T]=s.useState(0),[N,V]=s.useState(0),[ae,ie]=s.useState(null),[M,de]=s.useState(!1),[X,le]=s.useState(!1),[ne,he]=s.useState(!1),[ke,ye]=s.useState(null),pe=s.useRef(n),Z=s.useRef(void 0),se=t[n],oe=se?qi(se):!1,Re=N!==0||M,$e=ae!==null,Me=s.useCallback(ge=>{const _e=ge.currentTarget,Xe=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Xe.width||!Xe.height||ye(Xe)},[]);s.useEffect(()=>{j.current=C},[C]),s.useEffect(()=>{const ge=v.current;if(!ge)return;const _e=()=>L(cc(ge));_e();const Xe=new ResizeObserver(_e);return Xe.observe(ge),()=>Xe.disconnect()},[]);const ve=s.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Se=s.useCallback(()=>{const ge=U.current;U.current=null,ve(),B.current=null,k.current=!1,ie(null),de(!1),V(0),H.current=0,le(!1),b.current=!1,x.current=0,P.current="none",ge===1?d():ge===-1&&l()},[ve,d,l]),Ce=s.useCallback(()=>{ve(),U.current=null,B.current=null,k.current=!1,ie(null),de(!1),V(0),H.current=0},[ve]),h=s.useCallback(()=>{ve(),W.current=window.setTimeout(()=>{U.current!==null&&Se()},Pn+32)},[ve,Se]),q=s.useCallback((ge,_e)=>{var tt;const Xe=((tt=j.current)==null?void 0:tt.width)??0;if(ve(),B.current=ge,ie(ge),k.current=!0,de(!0),_e){U.current=ge;const ft=-ge*Xe;H.current=ft,V(ft),h();return}H.current=0,V(0),W.current=window.setTimeout(()=>{W.current=null,Ce()},Pn+32)},[ve,Ce,h]),Y=s.useCallback(ge=>{if(!(t.length<=1)){if(k.current){if(U.current===ge){$.current=ge,Se();return}Ce()}ve(),B.current=ge,ie(ge),k.current=!1,de(!1),H.current=0,V(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(ge,!0)})})}},[t.length,q,Se,Ce,ve]);I.current=Y;const ee=s.useCallback(ge=>{ge.propertyName!=="transform"||!k.current||U.current!==null&&Se()},[Se]),fe=s.useCallback(()=>{const ge=y.current;if(!ge)return;const _e=cc(ge);!_e.width||!_e.height||_(_e)},[]);s.useEffect(()=>{fe();const ge=y.current;if(!ge)return;const _e=new ResizeObserver(()=>fe());return _e.observe(ge),()=>_e.disconnect()},[fe]),s.useEffect(()=>{D==="opening"&&O&&S("open")},[D,O]),s.useEffect(()=>{if(D!=="closing")return;const ge=setTimeout(()=>r(),Pn);return()=>clearTimeout(ge)},[D,r]),s.useEffect(()=>()=>{ve()},[ve]),s.useLayoutEffect(()=>{pe.current===n&&Z.current===(se==null?void 0:se.url)||(ve(),U.current=null,ie(null),T(0),V(0),de(!1),he(!1),le(!1),ye(null),f.current=0,x.current=0,P.current="none",b.current=!1,k.current=!1,H.current=0,B.current=null,g.current=null,w.current=!1,pe.current=n,Z.current=se==null?void 0:se.url)},[n,se==null?void 0:se.url,ve]),s.useLayoutEffect(()=>{const ge=$.current;ge!==null&&($.current=null,requestAnimationFrame(()=>{I.current(ge)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(D!=="open")return;let ge=null;const _e=()=>{ge&&(document.removeEventListener("click",ge,!0),ge=null)},Xe=()=>{_e(),ge=Fe=>{Fe.stopPropagation(),Fe.preventDefault(),_e()},document.addEventListener("click",ge,!0)},tt=Fe=>{const Ee=Fe<0?1:-1;if(Math.abs(Fe)>hy&&t.length>1){q(Ee,!0);return}q(Ee,!1)},ft=Fe=>{if(Fe.touches.length!==1||k.current)return;const Ee=Fe.touches[0];w.current=!0,g.current={x:Ee.clientX,y:Ee.clientY},P.current="none",x.current=0,b.current=!1},ot=Fe=>{if(!g.current||Fe.touches.length!==1||k.current)return;const Ee=Fe.touches[0],Je=Ee.clientX-g.current.x,We=Ee.clientY-g.current.y;if(P.current==="none"){if(Math.abs(Je)<10&&Math.abs(We)<10)return;if(Math.abs(Je)>Math.abs(We)){if(t.length<=1)return;P.current="horizontal"}else if(We>0)P.current="vertical";else return}if(P.current==="horizontal"){b.current=!0,le(!0),x.current=Je;const it=Je<0?1:-1;B.current!==it&&(B.current=it,ie(it)),H.current=Je,V(Je),Fe.preventDefault();return}P.current==="vertical"&&(b.current=!0,le(!0),f.current=We,T(We),Fe.preventDefault())},De=()=>{if(!g.current)return;const Fe=P.current,Ee=b.current;if(Ee&&Fe==="horizontal")tt(x.current),Xe();else if(Ee&&Fe==="vertical")if(f.current>gy){const We=window.innerHeight;f.current=We,he(!0),T(We),S("closing")}else f.current=0,T(0),Xe();else Fe==="horizontal"&&Math.abs(x.current)>0&&(tt(x.current),Xe());g.current=null,P.current="none",x.current=0,b.current=!1,le(!1)};return document.addEventListener("touchstart",ft,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",De),document.addEventListener("touchcancel",De),()=>{document.removeEventListener("touchstart",ft),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",De),document.removeEventListener("touchcancel",De),_e()}},[D,t.length,q]),s.useEffect(()=>{const ge=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),D!=="closing"&&S("closing"))};return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[D]);const z=()=>{D!=="closing"&&S("closing")},R=D==="open",Q=D==="closing",te=K>0?Math.max(0,1-K/500):1,ce=K>0?Math.max(.35,1-K/500):1,G=O?p?O:wy(O,ke):null,Ie=ge=>{if(ge.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const _e=G??ge.currentTarget.getBoundingClientRect(),Xe=ge.clientY-_e.top,tt=Math.min(52,_e.height*.2);if(!(Xe>_e.height-tt)){if(ge.clientX-_e.left<_e.width/2){Y(-1);return}Y(1)}},xe=ge=>{if(t.length<=1)return;const _e=G??ge.currentTarget.getBoundingClientRect(),Xe=ge.clientX-_e.left,tt=ge.clientY-_e.top,ft=Math.min(52,_e.height*.2);if(tt>_e.height-ft){ge.currentTarget.style.cursor="default";return}ge.currentTarget.style.cursor=Xe<_e.width/2?"w-resize":"e-resize"},J={position:"fixed",top:C==null?void 0:C.top,left:C==null?void 0:C.left,width:C==null?void 0:C.width,height:C==null?void 0:C.height,zIndex:9998},He=p?"cover":"contain",je=N!==0||K>0?`translate(${N}px, ${K}px)`:void 0,ct=X&&!M?"none":M?`transform ${Pn}ms ${di}`:ne?`transform ${Pn}ms ${di}, opacity ${Pn}ms ${di}`:D==="opening"||Q?`opacity ${Pn}ms ${di}`:"none",Ve={...J,transform:je,opacity:K>0?ce:D==="opening"||Q?0:1,transition:ct,pointerEvents:"none"},et={position:"absolute",top:((G==null?void 0:G.top)??0)-((C==null?void 0:C.top)??0),left:((G==null?void 0:G.left)??0)-((C==null?void 0:C.left)??0),width:G==null?void 0:G.width,height:G==null?void 0:G.height,objectFit:He,pointerEvents:oe&&R&&!Re?"auto":"none",touchAction:oe&&R?"none":void 0},Ze=(C==null?void 0:C.width)??0,Ye=$e?(n+ae+t.length)%t.length:null,be=Ye!==null?t[Ye]:null,Oe={...J,transform:$e?`translateX(${ae*Ze+N}px)`:void 0,opacity:1,transition:M?`transform ${Pn}ms ${di}`:"none",pointerEvents:"none"},ze={position:"absolute",top:((O==null?void 0:O.top)??0)-((C==null?void 0:C.top)??0),left:((O==null?void 0:O.left)??0)-((C==null?void 0:C.left)??0),width:O==null?void 0:O.width,height:O==null?void 0:O.height,objectFit:He,pointerEvents:"none"},Qe=G?{position:"fixed",top:G.top,height:G.height,width:G.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:z,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?te:0,transition:X?"none":`opacity ${Pn}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:y,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${Pn}ms ${di}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${Pn}ms ${di}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),O&&C&&be&&a.jsx("div",{style:Oe,onTransitionEnd:ee,children:qi(be)?a.jsx("video",{src:be.url,muted:!0,playsInline:!0,preload:"auto",style:ze},`neighbor-${Ye}-${be.url}`):a.jsx("img",{src:be.url,alt:be.name,style:ze},`neighbor-${Ye}-${be.url}`)}),O&&C&&se&&a.jsx("div",{style:Ve,onTransitionEnd:ee,children:oe?a.jsx($y,{src:se.url,phase:D,mediaRef:m,mediaStyle:et,onLoadedMetadata:Me,onClick:Ie,onMouseMove:xe},`${n}-${se.url}`):a.jsx("img",{ref:m,src:se.url,alt:se.name,onLoad:Me,style:et},`${n}-${se.url}`)}),R&&Qe&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:G.left,cursor:"w-resize",pointerEvents:X?"none":"auto"},onClick:ge=>{if(w.current){w.current=!1;return}ge.stopPropagation(),Y(-1)}}),a.jsx("div",{style:{...Qe,left:G.left+G.width/2,cursor:"e-resize",pointerEvents:X?"none":"auto"},onClick:ge=>{if(w.current){w.current=!1;return}ge.stopPropagation(),Y(1)}})]})]})}function Ty(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=F.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:m,entriesCount:g,lightbox:f,imageDisplay:x,imageCorners:P,lightboxImageDisplay:b,slider:w,sliderTiming:j,direction:H,transition:B,titleMarginTop:k,subtitleMarginTop:W,titleColor:U,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:O,titleFontSettings:_,titleFontSize:C,titleLineHeight:L,titleLetterSpacing:D,titleWordSpacing:S,titleTextAppearance:K,subtitleFontFamily:T,subtitleFontSettings:N,subtitleFontSize:V,subtitleLineHeight:ae,subtitleLetterSpacing:ie,subtitleWordSpacing:M,subtitleTextAppearance:de,lightboxCounterFontFamily:X,lightboxCounterFontSettings:le,lightboxCounterFontSize:ne,lightboxCounterLineHeight:he,lightboxCounterLetterSpacing:ke,lightboxCounterWordSpacing:ye,lightboxCounterTextAppearance:pe,showText:Z="always",alignEntries:se="off",align:oe="top"}=e,Re={fontSettings:{fontFamily:O,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:C??.01,lineHeight:L,letterSpacing:D??0,wordSpacing:S??0,textAppearance:K,color:U},Me={...dn(Qt(Re,n))},ve={fontSettings:{fontFamily:T,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:V??.01,lineHeight:ae,letterSpacing:ie??0,wordSpacing:M??0,textAppearance:de,color:$},Ce={...dn(Qt(ve,n))},h={fontSettings:{fontFamily:X,fontWeight:(le==null?void 0:le.fontWeight)??400,fontStyle:(le==null?void 0:le.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:he,letterSpacing:ke??0,wordSpacing:ye??0,textAppearance:pe,color:I},Y={...dn(Qt(h,n)),...qa(ne,he,u,n)},ee=Xa(C,L,`${u}-item-title`,`${u}-text-tight-leading`),fe=Xa(V,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),z=qa(C,L,u,n),R=qa(V,ae,u,n),Q=Xa(ne,he,`${u}-lightbox-counter`,`${u}-text-tight-leading`),te=F.buildColorVars(u,{titleColor:U,subtitleColor:$,lightboxCounterColor:I},Iy,Ry),Ie=`${l&&l!=="default"?`${u}-state-${l}`:""}${Z==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),xe=g===0?1/0:g,J=(t??[]).slice(0,xe),He=s.useMemo(()=>f==="on"?xy(J):[],[J,f]),je=v.entryWidth??.2,ct=(x==null?void 0:x.display)==="cover",Ve=(x==null?void 0:x.ratioValue)??"1:1",et=(x==null?void 0:x.reversed)??!1,[Ze,Ye]=Ve.split(":").map(Number),ze=`${et?Ye:Ze} / ${et?Ze:Ye}`,Qe=v.columnsCount,ge=F.scalingValue(je??0,n),_e=ge,Xe=!ct&&w!=="off",tt=J.length%Qe||Qe,ft=tt<Qe&&J.length>0,ot=J.length-tt,De=ft?Math.floor((Qe-tt)/2)+1:1,Fe=P?F.scalingValue(P,n):void 0,Ee={width:_e,...ct?{aspectRatio:ze,height:"auto",overflow:"hidden"}:{height:"auto"},...Fe?{borderRadius:Fe,overflow:"hidden"}:{}},Je=`${u}-item-image-wrapper${Xe?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",it=se==="on",nt=`calc(${F.scalingValue(je??0,n)} * (${y} / 100))`,me=F.scalingValue(je*y/100,n),Ne=ct?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Fe?{borderRadius:Fe}:{}},[at,ut]=s.useState(0),Ge=s.useRef(null),pt=B==="fade"||H==="horizontal"?"ltr":H==="vertical"?"ttb":"ltr";s.useEffect(()=>{const vt=Ge.current;if(!vt)return;const Le=new ResizeObserver(qe=>{ut(Math.round(qe[0].contentRect.width))});return Le.observe(vt),()=>Le.disconnect()},[]);const Tt=(()=>{const vt={...te},Le=Ge.current?getComputedStyle(Ge.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(vt["--cntrl-article-width"]=Le),vt})(),[Lt,xt]=s.useState(!1),[Et,Vt]=s.useState([]),[Ut,Kt]=s.useState(0),Pt=f==="on"&&(!n||i),jt=(vt,Le)=>{n&&!i||f!=="off"&&(Vt(vt),Kt(Le),xt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const vt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=vt}},[Lt,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const on=s.useMemo(()=>cy(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:on}}),f==="on"&&a.jsx(by,{mediaList:He}),a.jsx("div",{style:te,children:a.jsx("div",{ref:Ge,className:`${u}-wrapper ${u}-type-${p}${it?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${Ie}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${ge})`,rowGap:it?0:F.scalingValue(m??0,n),columnGap:F.scalingValue(v.horizontalGap??0,n),width:F.scalingValue(v.wrapperWidth??0,n),...it?{[`--${u}-align-entries-row-gap`]:F.scalingValue(m??0,n)}:{}},children:J.map((vt,Le)=>{var Bt;const qe=sc(vt.title),st=sc(vt.subtitle),lt=(((Bt=vt.link)==null?void 0:Bt.length)??0)>0&&f==="off"?vt.link:void 0,wt=Math.floor(Le/Qe)===Math.ceil(J.length/Qe)-1,It=ft&&Le>=ot?`${De+(Le-ot)}`:void 0,gt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[qe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...z},children:vt.title}),qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(k??0,n),width:me}}),st&&a.jsx("p",{className:fe,style:{width:nt,...Ce,...R},children:vt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(W??0,n),width:me}})]}):null,Ot=it?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?F.scalingValue(k??0,n):0,width:me}}),qe&&a.jsx("p",{className:ee,style:{width:nt,...Me,...z},children:vt.title}),We&&qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(k??0,n),width:me}})]}):null,_t=it?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?F.scalingValue(W??0,n):0,width:me}}),st&&a.jsx("p",{className:fe,style:{width:nt,...Ce,...R},children:vt.subtitle}),We&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:F.scalingValue(W??0,n),width:me}})]}):null,Mt=lt?a.jsxs("a",{href:lt,target:"_blank",className:`${u}-item-text-link`,children:[Ot,_t]}):a.jsxs(a.Fragment,{children:[Ot,_t]}),Gt=Tu(vt.gallery),Xt=Gt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),Dt=a.jsx("div",{className:Je,style:Ee,children:Gt.length===0?null:w==="off"?(()=>{const{displayMedia:bt,lightboxMedia:A}=Gt[0],Te=A?Xt.findIndex(Ae=>Ae.url===A.url):-1;return a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Te>=0?()=>jt(Xt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Xe&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Gt.map(({displayMedia:bt})=>qi(bt)?a.jsx("video",{src:bt.url,muted:!0,playsInline:!0},`sizer-${bt.url}`):a.jsx("img",{src:bt.url,alt:""},`sizer-${bt.url}`))}),a.jsx(xl,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:j*1e3,width:"100%",height:"100%",speed:my,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:pt},onMoved:bt=>{H!=="random"||B==="fade"||py(bt)},children:Gt.map(({displayMedia:bt,lightboxMedia:A},Te)=>{const Ae=A?Xt.findIndex(Be=>Be.url===A.url):-1;return a.jsx(bl,{children:a.jsx(lc,{media:bt,className:`${u}-item-${qi(bt)?"video":"image"}`.trim(),style:Ne,onMediaClick:Pt&&Ae>=0?()=>jt(Xt,Ae):void 0})},Te)})},`${B}-${je}-${H}-${j}-${at}-${d}`)]})}),zt=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?F.scalingValue(k??0,n):0,width:me}}),a.jsx("p",{className:ee,style:{width:nt,...Me,...z},children:vt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?F.scalingValue(W??0,n):0,width:me}}),a.jsx("p",{className:fe,style:{width:nt,...Ce,...R},children:vt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!it?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${it&&wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${ge} * (${y} / 100))`:ge,...It&&it?{gridColumn:It}:{}},children:it?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:lt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:lt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Mt]})}):lt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:lt,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!We&&a.jsx("a",{href:lt,target:"_blank",className:`${u}-item-text-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,zt]})})},Le)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const vt=(c?document.getElementById(c):null)??document.body;return si.createPortal(a.jsx("div",{style:Tt,"data-selection":"none",children:a.jsx(Cy,{prefix:u,items:Et,index:Ut,imageDisplay:Ty(b),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Kt(Le=>(Le-1+Et.length)%Et.length),onNext:()=>Kt(Le=>(Le+1)%Et.length),counterClassName:Q,counterStyle:Y})}),vt)})()]})}const Iy={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ry=["hover","focus","filled","success","error"],Py=`import { Splide, SplideSlide } from '@splidejs/react-splide';
5226
5226
  import '@splidejs/react-splide/css/core';
5227
5227
  import { CommonComponentProps } from '../props';
5228
5228
  import {
@@ -7275,7 +7275,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
7275
7275
  };
7276
7276
 
7277
7277
  const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7278
- `,Ua={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ky=["titleColor","subtitleColor","lightboxCounterColor"],Ey={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:{...Ua.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:{...Ua.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:{...Ua.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},My={element:Ly,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:Ey,sourceCode:Py},Ay=50,dc=10,Sl="cntrl-lightbox-journal",Ea=Sl,Fs=`${Sl}-`,Ma=e=>`${Sl}-${e}`,wl=e=>e===Ea||e.startsWith(Fs),uc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},pc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=uc(t.get(Ma(e)));if(i)return i}const n=uc(t.get(Ea));if(n)return n;for(const[i]of t){if(!i.startsWith(Fs))continue;const o=i.slice(Fs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},mc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Lu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{wl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ma(t),String(e)):i.searchParams.set(Ea,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Fy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ma(e)||i===Ea:wl(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)}},Iu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ma(e)):[...t.keys()].some(n=>wl(n))},Ny=(e,t)=>{if(Iu(t)){if(e){window.history.back();return}Fy(t)}},_y=20,Wy=2,Ya=e=>`max(${e}, ${_y}px)`,Io=e=>((e==null?void 0:e.image)??[]).slice(0,Wy),Ru=e=>e.reduce((t,n)=>t+Io(n).length,0),Hy=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Io(r).length,1),i=Io(e[t]).length;return{start:n,end:n+i-1}},Oy=(e,t)=>{const n=Ru(e),{start:i,end:o}=Hy(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},oa=(e,t)=>t==="B"?e.flatMap((n,i)=>Io(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Io(n)})),Dy=(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 Oy(i,o)},gc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zy=(e,t,n)=>e==="B"?t.length>1:Ru(n)>1,Cn=.004,vi=.004,So={title1Width:.13,title2Width:.13,title3Width:.14},xi=(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},Ro=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},gr=(e,t)=>Ro(e,t),hn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},bi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ro(e.length,n),effective:gr(e.length,n)}},Pu=(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),ku=(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),Ci=["title1","title2","title3","count"],yt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[yt(e,"fontFamily"),yt(e,"fontSettings"),{type:"row",items:[yt(e,"fontSize"),yt(e,"lineHeight"),yt(e,"letterSpacing"),yt(e,"wordSpacing")]},yt(e,"textAlign"),yt(e,"textAppearance")],By=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ci.map(e=>[$l[e],Cl(e)]))}),jy={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Vy={title1:.02,title2:.02,title3:.02,count:.017},Bi=(e,t)=>{const n=i=>{const o=yt(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[jy[t]]}},ji=(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??Vy[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 Eu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:R=null,closeIconMaxWidth:b=0,closeIconColor:S="#000000",closeIconHoverColor:G="#cccccc"}=n,D=F.scalingValue(f,i),j=F.scalingValue(x,i),P=F.scalingValue(m,i),M=g==="mobile",K=ji("title1",Bi(n,"title1"),i),T=ji("title2",Bi(n,"title2"),i),L=ji("title3",Bi(n,"title3"),i),_=s.useMemo(()=>({title1Width:d??So.title1Width,title2Width:c??So.title2Width,title3Width:u??So.title3Width}),[d,c,u]),z=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),$=s.useMemo(()=>xi(e,t,K,T,L),[e,t,K,T,L]),k=s.useMemo(()=>$.map(H=>_[H.widthKey]),[$,_]),W=s.useMemo(()=>Ro($.length,k),[$.length,k]),w=s.useMemo(()=>gr($.length,k),[$.length,k]),U=s.useMemo(()=>$.filter(H=>H.prefix==="title1"),[$]),C=s.useMemo(()=>$.filter(H=>H.prefix==="title2"||H.prefix==="title3"),[$]),O=s.useMemo(()=>bi(U,_),[U,_]),V=s.useMemo(()=>bi(C,_),[C,_]),se=!!(t.title1||t.title2||t.title3),ie=R!==null;if(!(se||ie))return null;const de=(p??0)>0||o,X=(H,te)=>{const ke=$.findIndex(J=>J.prefix===H.prefix);if(!M||te==="single-row")return{effectiveWidth:w[ke]??0,resolvedWidth:W[ke]??0,maxWidth:hn(ke,W)};if(te==="two-row-top"){const J=U.findIndex(Ye=>Ye.prefix===H.prefix);return{effectiveWidth:O.effective[J]??0,resolvedWidth:O.resolved[J]??0,maxWidth:hn(J,O.resolved)}}const ge=C.findIndex(J=>J.prefix===H.prefix);return{effectiveWidth:V.effective[ge]??0,resolvedWidth:V.resolved[ge]??0,maxWidth:hn(ge,V.resolved)}},ce=(H,te,ke)=>{if(!M||ke==="single-row"){const it=H.findIndex(Ge=>Ge.prefix===te.prefix),qe=H.map(Ge=>_[Ge.widthKey]),et=Ro(H.length,qe);return{effectiveWidth:gr(H.length,qe)[it]??0,resolvedWidth:et[it]??0,maxWidth:hn(it,et)}}if(ke==="two-row-top"){const it=H.filter(Ge=>Ge.prefix==="title1"),qe=it.findIndex(Ge=>Ge.prefix===te.prefix),{resolved:et,effective:Je}=bi(it,_);return{effectiveWidth:Je[qe]??0,resolvedWidth:et[qe]??0,maxWidth:hn(qe,et)}}const ge=H.filter(it=>it.prefix==="title2"||it.prefix==="title3"),J=ge.findIndex(it=>it.prefix===te.prefix),{resolved:Ye,effective:je}=bi(ge,_);return{effectiveWidth:je[J]??0,resolvedWidth:Ye[J]??0,maxWidth:hn(J,Ye)}},oe=H=>ku($,W,z,H)+(M?0:p??0),fe=()=>M?0:p??0,Pe=H=>C.slice(0,H).reduce((te,ke,ge)=>te+(ke.marginLeftKey?z[ke.marginLeftKey]??0:0)+(V.resolved[ge]??0),0),xe=H=>{const te=C[H];return Pe(H)+(te.marginLeftKey?z[te.marginLeftKey]??0:0)+(V.resolved[H]??0)},pe=(H,te,ke)=>{const ge=H.marginLeftKey?z[H.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ye,maxWidth:je}=ke??X(H,te),it=Math.max(ge,vi),qe=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":H.prefix,style:{width:F.scalingValue(J,i),...ge>0?{marginLeft:F.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:H.className,style:H.style,children:H.text}),qe&&H.marginLeftKey?a.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:F.scalingValue(-ge,i),width:F.scalingValue(it,i),height:"100%",pointerEvents:"auto"}}):null,qe?a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:F.scalingValue(-Cn/2,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}}):null]},H.className)},Z=(H="two-row")=>{const te=$.findIndex(J=>J.prefix==="title1"),ke=te>=0?W[te]:_.title1Width,ge=H==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:K,"aria-hidden":"true",children:" "}),re=H=>{const te=xi(e,H,K,T,L);return a.jsx(a.Fragment,{children:te.map(ke=>pe(ke,"single-row",ce(te,ke,"single-row")))})},Ie=H=>{const te=xi(e,H,K,T,L),ke=te.find(ge=>ge.prefix==="title1");return ke?pe(ke,"two-row-top",ce(te,ke,"two-row-top")):null},we=(H,te=!1)=>{const ke=xi(e,H,K,T,L),ge=ke.filter(je=>je.prefix==="title2"||je.prefix==="title3"),J=o&&te;return ge.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ge.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:ge.map(je=>pe(je,"two-row-bottom",ce(ke,je,"two-row-bottom")))}),te&&o?a.jsxs(a.Fragment,{children:[ee(),ve()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:P,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(b??0,i),height:F.scalingValue(b??0,i),marginRight:j,"--close-icon-hover-color":G},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:H=>{H.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(pn,{url:R??"",fill:S,hoverFill:i&&!r?S: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:j,height:"100%",pointerEvents:"auto"}})]}),ye=()=>ie?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,be=H=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:H})}),Ce=H=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||se?le():null,de?Z("two-row"):null,be(H),ye()]}),h=(H,te=!1)=>a.jsxs(a.Fragment,{children:[Ce(Ie(H)),we(H,te)]}),q=()=>{const H=M?-1:$.findIndex(ge=>ge.prefix==="title1"),te=!M&&(o||(p??0)>0)?(()=>{const ge=p??0,J=H>=0?W[H]:_.title1Width,Ye=Math.max(ge,vi);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:F.scalingValue(Ye,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ke=$.flatMap((ge,J)=>{if(!ge.marginLeftKey)return[];const Ye=z[ge.marginLeftKey]??0,je=Pu($,W,z,J)+fe(),it=Math.max(Ye,vi);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(W[J]),style:{position:"absolute",top:0,left:F.scalingValue(je,i),width:F.scalingValue(it,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return te?[te,...ke]:ke},Y=()=>$.map((H,te)=>{const ke=hn(te,W),J=oe(te)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),ee=()=>C.flatMap((H,te)=>{if(!H.marginLeftKey)return[];const ke=z[H.marginLeftKey]??0,ge=Pe(te),J=Math.max(ke,vi),{resolvedWidth:Ye}=X(H,"two-row-bottom");return a.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:F.scalingValue(ge,i),width:F.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)}),ve=()=>C.map((H,te)=>{const{maxWidth:ke}=X(H,"two-row-bottom"),J=xe(te)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),B=()=>!o||M?null:a.jsxs(a.Fragment,{children:[q(),Y()]}),I=!!(t.title2||t.title3||(m??0)>0||o),Q=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||se?le():null,de?Z("single-row"):null,se?be(re(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ye(),B()]}),ne=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...I?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:I?void 0:{flex:"0 0 auto",height:"auto"},children:h(t,!0)}),B()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:D,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...M?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${M?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${M?` ${e}-text-bar-cell-stacked`:""}`,style:M?void 0:{flex:1,minWidth:0,width:"100%"},children:M?ne():Q()})})})]})}function Gy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xy(e){return`
7278
+ `,Ua={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ky=["titleColor","subtitleColor","lightboxCounterColor"],Ey={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:{...Ua.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:{...Ua.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:{...Ua.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",slider:"on",sliderTiming:3,direction:"horizontal",transition:"fade",showText:"always",alignEntries:"off",align:"top",titleColor:"#000000",subtitleColor:"#000000",lightboxCounterColor:"#DEDDDD",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},subtitleFontFamily:"Goudy Bookletter 1911",subtitleFontSettings:{fontWeight:400,fontStyle:"normal"},subtitleLetterSpacing:0,subtitleWordSpacing:0,subtitleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{type:"b",gridLayout:{entryWidth:.8,horizontalGap:.0533,wrapperWidth:1,columnsCount:1,lockedParam:null},textBoxWidth:100,verticalGap:.266,entriesCount:0,titleMarginTop:.02,subtitleMarginTop:.02,titleStroke:.003,titleCorners:.192,imageCorners:0,subtitlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titlePadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},titleFontSize:.1066,titleLineHeight:.0853,subtitleFontSize:.056,subtitleLineHeight:.064,lightboxCounterFontSize:.0373,lightboxCounterLineHeight:.0373},t:{type:"b",gridLayout:{entryWidth:.1041,horizontalGap:.26041,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:250,verticalGap:.09722,entriesCount:0,titleMarginTop:.01953125,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.03255,titleLineHeight:.03255,titleLetterSpacing:-.00118,subtitleFontSize:.01822,subtitleLineHeight:.02083,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},d:{type:"b",gridLayout:{entryWidth:.0833,horizontalGap:.25,wrapperWidth:1,columnsCount:3,lockedParam:null},textBoxWidth:200,verticalGap:.09722,entriesCount:0,titleMarginTop:.008,subtitleMarginTop:.008,titleStroke:.001,titleCorners:.05,imageCorners:0,subtitlePadding:{top:.01,right:.01,bottom:.01,left:.01},titlePadding:{top:.01,right:.01,bottom:.01,left:.01},titleFontSize:.027,titleLineHeight:.0222,titleLetterSpacing:-.00118,subtitleFontSize:.01,subtitleLineHeight:.01,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01}},displayRules:[{if:{name:"transition",value:"fade"},then:{name:"properties.direction.display.enabled",value:!1}},{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}},{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","name","type","gridLayout","textBoxWidth","verticalGap","showText","alignEntries","align","entriesCount","lightbox","imageDisplay","imageCorners","lightboxImageDisplay","slider","sliderTiming","direction","transition","transition","titleMarginTop","subtitleMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"Grid",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["textBoxWidth","verticalGap"]},{type:"row",title:"",items:["entriesCount","showText"]},{type:"row",title:"",items:["alignEntries","align"]}]},{id:"imageSettings",icon:"cover",title:"Image settings",tooltip:"Image settings",layout:["__componentName__",{type:"row",title:"Image",items:["imageDisplay","imageCorners"]},{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",title:"Slider",items:[{type:"group",title:"",items:["slider","direction"]},{type:"group",title:"",items:["sliderTiming","transition"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]},{type:"group",title:"Subtitle",items:["subtitleFontFamily","subtitleFontSettings",{type:"row",items:["subtitleFontSize","subtitleLineHeight","subtitleLetterSpacing","subtitleWordSpacing"]},"subtitleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:[...ky],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},My={element:Ly,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:Ey,sourceCode:Py},Ay=50,dc=10,Sl="cntrl-lightbox-journal",Ea=Sl,Fs=`${Sl}-`,Ma=e=>`${Sl}-${e}`,wl=e=>e===Ea||e.startsWith(Fs),uc=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},pc=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=uc(t.get(Ma(e)));if(i)return i}const n=uc(t.get(Ea));if(n)return n;for(const[i]of t){if(!i.startsWith(Fs))continue;const o=i.slice(Fs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},mc=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Lu=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{wl(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Ma(t),String(e)):i.searchParams.set(Ea,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Fy=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Ma(e)||i===Ea:wl(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)}},Iu=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Ma(e)):[...t.keys()].some(n=>wl(n))},Ny=(e,t)=>{if(Iu(t)){if(e){window.history.back();return}Fy(t)}},_y=20,Wy=2,Ya=e=>`max(${e}, ${_y}px)`,Io=e=>((e==null?void 0:e.image)??[]).slice(0,Wy),Ru=e=>e.reduce((t,n)=>t+Io(n).length,0),Hy=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Io(r).length,1),i=Io(e[t]).length;return{start:n,end:n+i-1}},Oy=(e,t)=>{const n=Ru(e),{start:i,end:o}=Hy(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},oa=(e,t)=>t==="B"?e.flatMap((n,i)=>Io(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Io(n)})),Dy=(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 Oy(i,o)},gc=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",zy=(e,t,n)=>e==="B"?t.length>1:Ru(n)>1,Cn=.004,Qn=.004,So={title1Width:.13,title2Width:.13,title3Width:.14},xi=(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},Ro=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},gr=(e,t)=>Ro(e,t),hn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},bi=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Ro(e.length,n),effective:gr(e.length,n)}},Pu=(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),ku=(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),Ci=["title1","title2","title3","count"],yt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,$l={title1:"1",title2:"2",title3:"3",count:"Count"},Cl=e=>[yt(e,"fontFamily"),yt(e,"fontSettings"),{type:"row",items:[yt(e,"fontSize"),yt(e,"lineHeight"),yt(e,"letterSpacing"),yt(e,"wordSpacing")]},yt(e,"textAlign"),yt(e,"textAppearance")],By=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ci.map(e=>[$l[e],Cl(e)]))}),jy={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Vy={title1:.02,title2:.02,title3:.02,count:.017},Bi=(e,t)=>{const n=i=>{const o=yt(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[jy[t]]}},ji=(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??Vy[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 Eu({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:P=null,closeIconMaxWidth:b=0,closeIconColor:w="#000000",closeIconHoverColor:j="#cccccc"}=n,H=F.scalingValue(f,i),B=F.scalingValue(Math.max(f,Qn),i),k=F.scalingValue(x,i),W=F.scalingValue(m,i),U=g==="mobile",$=ji("title1",Bi(n,"title1"),i),I=ji("title2",Bi(n,"title2"),i),O=ji("title3",Bi(n,"title3"),i),_=s.useMemo(()=>({title1Width:d??So.title1Width,title2Width:c??So.title2Width,title3Width:u??So.title3Width}),[d,c,u]),C=s.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),L=s.useMemo(()=>xi(e,t,$,I,O),[e,t,$,I,O]),D=s.useMemo(()=>L.map(G=>_[G.widthKey]),[L,_]),S=s.useMemo(()=>Ro(L.length,D),[L.length,D]),K=s.useMemo(()=>gr(L.length,D),[L.length,D]),T=s.useMemo(()=>L.filter(G=>G.prefix==="title1"),[L]),N=s.useMemo(()=>L.filter(G=>G.prefix==="title2"||G.prefix==="title3"),[L]),V=s.useMemo(()=>bi(T,_),[T,_]),ae=s.useMemo(()=>bi(N,_),[N,_]),ie=!!(t.title1||t.title2||t.title3),M=P!==null;if(!(ie||M))return null;const X=(p??0)>0||o,le=(G,Ie)=>{const xe=L.findIndex(He=>He.prefix===G.prefix);if(!U||Ie==="single-row")return{effectiveWidth:K[xe]??0,resolvedWidth:S[xe]??0,maxWidth:hn(xe,S)};if(Ie==="two-row-top"){const He=T.findIndex(je=>je.prefix===G.prefix);return{effectiveWidth:V.effective[He]??0,resolvedWidth:V.resolved[He]??0,maxWidth:hn(He,V.resolved)}}const J=N.findIndex(He=>He.prefix===G.prefix);return{effectiveWidth:ae.effective[J]??0,resolvedWidth:ae.resolved[J]??0,maxWidth:hn(J,ae.resolved)}},ne=(G,Ie,xe)=>{if(!U||xe==="single-row"){const Ve=G.findIndex(be=>be.prefix===Ie.prefix),et=G.map(be=>_[be.widthKey]),Ze=Ro(G.length,et);return{effectiveWidth:gr(G.length,et)[Ve]??0,resolvedWidth:Ze[Ve]??0,maxWidth:hn(Ve,Ze)}}if(xe==="two-row-top"){const Ve=G.filter(be=>be.prefix==="title1"),et=Ve.findIndex(be=>be.prefix===Ie.prefix),{resolved:Ze,effective:Ye}=bi(Ve,_);return{effectiveWidth:Ye[et]??0,resolvedWidth:Ze[et]??0,maxWidth:hn(et,Ze)}}const J=G.filter(Ve=>Ve.prefix==="title2"||Ve.prefix==="title3"),He=J.findIndex(Ve=>Ve.prefix===Ie.prefix),{resolved:je,effective:ct}=bi(J,_);return{effectiveWidth:ct[He]??0,resolvedWidth:je[He]??0,maxWidth:hn(He,je)}},he=G=>ku(L,S,C,G)+(U?0:p??0),ke=()=>U?0:p??0,ye=G=>N.slice(0,G).reduce((Ie,xe,J)=>Ie+(xe.marginLeftKey?C[xe.marginLeftKey]??0:0)+(ae.resolved[J]??0),0),pe=G=>{const Ie=N[G];return ye(G)+(Ie.marginLeftKey?C[Ie.marginLeftKey]??0:0)+(ae.resolved[G]??0)},Z=(G,Ie,xe)=>{const J=G.marginLeftKey?C[G.marginLeftKey]??0:0,{effectiveWidth:He,resolvedWidth:je,maxWidth:ct}=xe??le(G,Ie),Ve=Math.max(J,Qn),et=o&&Ie==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":G.prefix,style:{width:F.scalingValue(He,i),...J>0?{marginLeft:F.scalingValue(J,i)}:{}},children:[a.jsx("p",{className:G.className,style:G.style,children:G.text}),et&&G.marginLeftKey?a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:F.scalingValue(-J,i),width:F.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}}):null,et?a.jsx("div",{"data-controls":G.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:F.scalingValue(-Cn/2,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}}):null]},G.className)},se=(G="two-row")=>{const Ie=L.findIndex(He=>He.prefix==="title1"),xe=Ie>=0?S[Ie]:_.title1Width,J=G==="two-row"&&o;return a.jsx("div",{...J?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(xe)}:{},style:{width:F.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...J?{pointerEvents:"auto"}:{}}})},oe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:$,"aria-hidden":"true",children:" "}),Re=G=>{const Ie=xi(e,G,$,I,O);return a.jsx(a.Fragment,{children:Ie.map(xe=>Z(xe,"single-row",ne(Ie,xe,"single-row")))})},$e=G=>{const Ie=xi(e,G,$,I,O),xe=Ie.find(J=>J.prefix==="title1");return xe?Z(xe,"two-row-top",ne(Ie,xe,"two-row-top")):null},Me=(G,Ie=!1)=>{const xe=xi(e,G,$,I,O),J=xe.filter(ct=>ct.prefix==="title2"||ct.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(ct=>Z(ct,"two-row-bottom",ne(xe,ct,"two-row-bottom")))}),Ie&&o?a.jsxs(a.Fragment,{children:[fe(),z()]}):null]}):null,(m??0)>0||He?a.jsx("div",{"data-controls":He?"titleRowMarginBottom":void 0,"data-controls-axis":He?"y":void 0,"data-controls-reverse":He?"":void 0,className:He?`${e}-control`:void 0,style:{height:W,width:"100%",flexShrink:0,pointerEvents:He?"auto":"none"}}):null]}):null},ve=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(b??0,i),height:F.scalingValue(b??0,i),marginRight:k,"--close-icon-hover-color":j},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:G=>{G.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(pn,{url:P??"",fill:w,hoverFill:i&&!r?w:j,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:k,height:"100%",pointerEvents:"auto"}})]}),Se=()=>M?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ve()}):null,Ce=G=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:G})}),h=G=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[M||ie?oe():null,X?se("two-row"):null,Ce(G),Se()]}),q=(G,Ie=!1)=>a.jsxs(a.Fragment,{children:[h($e(G)),Me(G,Ie)]}),Y=()=>{const G=U?-1:L.findIndex(J=>J.prefix==="title1"),Ie=!U&&(o||(p??0)>0)?(()=>{const J=p??0,He=G>=0?S[G]:_.title1Width,je=Math.max(J,Qn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:0,width:F.scalingValue(je,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,xe=L.flatMap((J,He)=>{if(!J.marginLeftKey)return[];const je=C[J.marginLeftKey]??0,ct=Pu(L,S,C,He)+ke(),Ve=Math.max(je,Qn);return a.jsx("div",{"data-controls":J.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(S[He]),style:{position:"absolute",top:0,left:F.scalingValue(ct,i),width:F.scalingValue(Ve,i),height:"100%",pointerEvents:"auto"}},J.marginLeftKey)});return Ie?[Ie,...xe]:xe},ee=()=>L.map((G,Ie)=>{const xe=hn(Ie,S),He=he(Ie)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),fe=()=>N.flatMap((G,Ie)=>{if(!G.marginLeftKey)return[];const xe=C[G.marginLeftKey]??0,J=ye(Ie),He=Math.max(xe,Qn),{resolvedWidth:je}=le(G,"two-row-bottom");return a.jsx("div",{"data-controls":G.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:F.scalingValue(J,i),width:F.scalingValue(He,i),height:"100%",pointerEvents:"auto"}},G.marginLeftKey)}),z=()=>N.map((G,Ie)=>{const{maxWidth:xe}=le(G,"two-row-bottom"),He=pe(Ie)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":G.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:F.scalingValue(He,i),width:F.scalingValue(Cn,i),height:"100%",pointerEvents:"auto"}})},`${G.widthKey}-junction`)}),R=()=>!o||U?null:a.jsxs(a.Fragment,{children:[Y(),ee()]}),Q=!!(t.title2||t.title3||(m??0)>0||o),te=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[M||ie?oe():null,X?se("single-row"):null,ie?Ce(Re(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),Se(),R()]}),ce=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Q?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Q?void 0:{flex:"0 0 auto",height:"auto"},children:q(t,!0)}),R()]});return a.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:H,flexShrink:0},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:B,pointerEvents:"auto"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...U?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${U?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${U?` ${e}-text-bar-cell-stacked`:""}`,style:U?void 0:{flex:1,minWidth:0,width:"100%"},children:U?ce():te()})})})]})}function Gy(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xy(e){return`
7279
7279
  .${e}-wrapper {
7280
7280
  display: grid;
7281
7281
  align-items: start;
@@ -7595,7 +7595,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
7595
7595
  pointer-events: auto;
7596
7596
  flex-shrink: 0;
7597
7597
  }
7598
- `}const hc={url:"",name:"",objectFit:"cover"},_n=500,qo=650,xn="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Uy=50,Yy=1e4,Ky=650,Zy=500;function Jy(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 Mu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 Qy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Mu(i,n):null}function ev(e){return e.reduce((t,n,i)=>{const o=Tl(n.gallery),l=Ll(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function er(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 fc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return er(e,i,n)}const tv=.03;function Au(e){return e.width*tv}const Ka={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _r(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function yc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ns(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function iv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ns(e,t.width,t.height)}function ov(e,t){if(Bo(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 rv(e){const t=new Set,n=[];for(const i of e){const o=Tl(i.gallery),r=Ll(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function av({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=>Bo(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 Po(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Au(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function ma(e,t,n){const i=Po(e,t,n);return{...i,left:2*i.left-e.left}}function sv(e,t,n){const{left:i,width:o}=n,r=Au(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 Fu(e,t,n,i){const o=Po(e,"left",i),r=Po(e,"right",i),l=ma(e,"left",i),d=ma(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function lv(e,t,n,i){const{start:o,end:r}=Fu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function cv(e,t,n){const i=Po(e,t,n),o=ma(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Nu(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 Tl(e){if(!e)return;if(Nu(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??hc,i??o??hc]}]}function dv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function uv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ll(e){if(!Array.isArray(e)||e.length===0)return[];if(Nu(e)){const t=[];for(const n of e){const i=dv(n);if(!i)continue;const o=uv(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 Bo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function pv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Bo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Wr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Bo(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 gv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const R=s.useRef(null),b=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[D,j]=s.useState(0),P=s.useRef(null),M=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),_=s.useRef(!1),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),C=s.useRef(null),O=s.useRef(null),V=s.useRef(!1),[se,ie]=s.useState(null),[N,de]=s.useState(Ka),[X,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[pe,Z]=s.useState(0),[le,re]=s.useState(!1),[Ie,we]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[ve,B]=s.useState(!1),I=s.useRef(!1),[Q,ne]=s.useState(!1),[H,te]=s.useState(!1),ke=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?Bo(J):!1,je=pe!==0||le,it=!l&&(!r||!!d),qe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?er(u,p,-1):Je(n,-1),$e=et?er(u,p,1):Je(n,1),He=Ie===-1&&je?et&&Me!==null?er(u,Me,-1):be!==null?Je(be,-1):null:null,De=Ie===1&&je?et&&Me!==null?er(u,Me,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&qe?(()=>{const A=et?fc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&qe?(()=>{const A=et?fc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ft=he??Ve,rt=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const ze=G.current,mt=ze.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(ze.set(A,{width:Te,height:Ae}),j(Nt=>Nt+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=G.current.get(A.url);return iv(b.current,Te)},[D,X]),Fe=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=b.current;Te&&ie(yc(Te))},[J,Oe]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{z.current=A,re(A)},[]),We=s.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),ot=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{We(),Ze(!1)},qo+32)},[We,Ze]),nt=s.useCallback(()=>{const A=R.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ka.width,height:typeof window<"u"?window.innerHeight:Ka.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!le)return`translate(${pe}px, 0px)`;if(le&&Ie!==null){const Ae=Oe(A);if(!Ae)return;const{x:ze,y:mt}=lv(Ae,Te,Ie,N);return`translate(${ze}px, ${mt}px)`}if(le)return"translate(0px, 0px)"}},[je,Q,le,pe,Ie,N,Oe]),Ne=s.useCallback(()=>{const A=k.current;k.current=null,We(),Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&x()},[We,Ze,f,x]),st=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{k.current!==null&&Ne()},qo+32)},[We,Ne]),ut=s.useCallback(()=>{We(),k.current=null,Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[We,Ze]),Be=s.useCallback(A=>{if(!(!qe||!se)){if(z.current){if(k.current===A){W.current=A,Ne();return}ut()}We(),Ee(A),k.current=A,we(A),Ze(!0),st()}},[qe,se,Ne,ut,We,Ee,Ze,st]);w.current=Be;const pt=s.useCallback(()=>{U.current=null,V.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Tt=s.useCallback(A=>{C.current!==null&&window.clearInterval(C.current);const Te=V.current?Zy:Ky;C.current=window.setInterval(()=>{w.current(A)},Te)},[]),Lt=s.useCallback(A=>{U.current!==A&&(pt(),U.current=A,V.current=!1,w.current(A),Tt(A),O.current=window.setTimeout(()=>{O.current=null,U.current===A&&(V.current=!0,Tt(A))},Yy))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?G.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Ns(A,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ht}=nv(ze);if(Nt&&ht){rt(Te,Nt,ht),ie(Ns(A,Nt,ht));return}}const mt=yc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,rt]),Et=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),ce(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=R.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,D]),s.useEffect(()=>{const A=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||A.has(ze.url)||(A.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{G.current.has(ze.url)||ov(ze,rt)})},[t,u,rt]),s.useEffect(()=>{if(oe!=="opening"||!se)return;if(!y){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,se,y]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),_n);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{ke.current===n&&ge.current===(J==null?void 0:J.url)||(We(),k.current=null,we(null),ye(null),Ce(null),xe(0),Z(0),Ze(!1),te(!1),ne(!1),M.current=0,K.current=0,T.current="none",L.current=!1,P.current=null,_.current=!1,S.current=null,Fe(),ke.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,We,Fe]),s.useLayoutEffect(()=>{const A=W.current;A!==null&&(W.current=null,requestAnimationFrame(()=>{w.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){I.current=!1,B(!1);return}if(oe!=="open"||I.current)return;if(!Ge&&!$e){I.current=!0;return}B(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),k.current=St,we(St),Ze(!0),st()},Ae=ht=>{if(Math.abs(ht)>Uy&&qe){Te(ht);return}k.current=null,we(null),ye(null),Ce(null),Ze(!0),Z(0),ot()},ze=ht=>{if(ht.touches.length!==1||z.current)return;const St=ht.touches[0];_.current=!0,P.current={x:St.clientX,y:St.clientY},T.current="none",K.current=0,L.current=!1},mt=ht=>{if(!P.current||ht.touches.length!==1||z.current)return;const St=ht.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!qe)return;T.current="horizontal"}else if(At>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,Z(qt),ht.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),M.current=At,xe(At),ht.preventDefault())},Nt=()=>{if(!P.current)return;const ht=T.current,St=L.current;if(St&&ht==="horizontal")Ae(K.current),A();else if(St&&ht==="vertical"){const qt=M.current;if(it&&qt>qy){const At=window.innerHeight;M.current=At,te(!0),xe(At),fe("closing")}else M.current=0,xe(0);A()}else ht==="horizontal"&&Math.abs(K.current)>0&&(Ae(K.current),A());P.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[oe,qe,Ze,ot,We,it,st,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&se&&(ee(A),q(!0)),fe("closing")},[m,y,se]);s.useEffect(()=>{const A=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!qe)return;ze.preventDefault();const mt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===mt||Lt(mt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const mt=ze.key==="ArrowLeft"?-1:1;U.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[oe,r,d,Ut,qe,Lt,pt]),s.useEffect(()=>{oe!=="open"&&pt()},[oe,pt]);const Kt=()=>{oe==="closing"||l||Ut()},Pt=oe==="open",jt=oe==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!z.current)){if(k.current!==null){Ne();return}We(),Ze(!1)}},[We,Ze,Ne]),Xe=oe==="closing"?Y??y:y,lt=Xe&&se&&(oe==="opening"||jt)?Jy(Xe,se):void 0,ct=je&&J?me(J,"center"):Pe>0?`translateY(${Pe}px)`:lt,wt=se?_r(se,N):null,It=!!(Xe&&se),gt=It&&(oe==="closing"||oe==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:Pe>0?vt:It?1:oe==="opening"||jt?0:1,transition:Q&&!le?"none":le?`transform ${qo}ms ${xn}`:H?`transform ${_n}ms ${xn}, opacity ${_n}ms ${xn}`:gt?`transform ${_n}ms ${xn}`:oe==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:Ye&&Pt&&!je?"auto":"none",touchAction:Ye&&Pt?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const ze=Oe(A);if(!ze)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Ie!==null?Fu(ze,mt,Ie,N):{start:Ae==="far"?ma(ze,Te,N):Po(ze,Te,N)},ht=_r(Nt,N),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!ve?cv(ze,Te,N):null,At=Ae==="far"&&je&&Ie===(Te==="left"?-1:1),sn=Q&&!le?!1:le,gn=Ae==="adjacent"&&Pt&&ve&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${qo}ms ${xn}`:`transform ${qo}ms ${xn}, opacity ${_n}ms ${xn}`:gn?`transform ${_n}ms ${xn}`:oe==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=Oe(A);return Ae?sv(Po(Ae,Te,N),Te,N):null},Xt=A=>Te=>{if(!l){if(_.current){_.current=!1;return}Te.stopPropagation(),Be(A)}},Dt=Ge?Gt(Ge,"left"):null,zt=$e?Gt($e,"right"):null,Bt=Dt?_r(Dt,N):null,bt=zt?_r(zt,N):null;return a.jsxs("div",{ref:R,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Wr,{media:tt,style:Mt(tt,"left","far"),onMeasure:rt,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:Ge,style:Mt(Ge,"left"),onMeasure:rt,onTransitionEnd:Le},`prev-${Ge.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:$e,style:Mt($e,"right"),onMeasure:rt,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Wr,{media:ft,style:Mt(ft,"right","far"),onMeasure:rt,onTransitionEnd:Le},`far-next-${ft.url}`),se&&J&&(Ye?a.jsx(mv,{src:J.url,phase:oe,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}function hv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=F.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",g=(v==null?void 0:v.reversed)??!1,[f,x]=m.split(":").map(Number),S=`${g?x:f} / ${g?f:x}`,G=c.entryWidth??.2,D=c.columnsCount,j=F.scalingValue(G,n),P=F.scalingValue(c.horizontalGap??0,n),M=j,K=j,T={width:M,...y?{aspectRatio:S,height:"auto",overflow:"hidden"}:{height:"auto"}},L=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},_=s.useRef(null),[z,$]=s.useState(!1),[k,W]=s.useState([]),[w,U]=s.useState(0),[C,O]=s.useState(0),[V,se]=s.useState(null),[ie,N]=s.useState({title1:"",title2:"",title3:""}),de=(()=>{const be={},Ce=_.current?getComputedStyle(_.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(be["--cntrl-article-width"]=Ce),be})(),X=!n||i||o,ce=s.useMemo(()=>Xy(d),[d]),oe=t??[],fe=oe.length%D||D,Pe=fe<D&&oe.length>0,xe=oe.length-fe,pe=Pe?Math.floor((D-fe)/2)+1:1,Z=s.useMemo(()=>ev(oe),[oe]),le=s.useMemo(()=>rv(oe),[oe]),re=(be,Ce,h)=>{if(n&&!o&&!i)return;const q=Z.findIndex(ee=>ee.gridIndex===be);if(q<0)return;const Y=Z[q];O(q),W(Y.items),U(Ce),N(Y.entry),se(h??null),$(!0)},Ie=s.useCallback(()=>{$(!1),se(null)},[]),we=s.useCallback(()=>{const be=Z[C];return!be||!_.current?V:Qy(_.current,be.gridIndex,y?"cover":"contain")??V},[Z,C,V,y]),Me=s.useCallback(be=>{if(Z.length>1){const Ce=Z.length,h=(C+be+Ce)%Ce,q=Z[h],Y=Math.min(w,q.items.length-1);O(h),W(q.items),U(Y),N(q.entry);return}U(Ce=>(Ce+be+k.length)%k.length)},[Z,C,w,k.length]),ye=Z.length>1||k.length>1;return s.useEffect(()=>{if(!z||typeof document>"u")return;const be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=be}},[z]),s.useEffect(()=>{!n||o||i||$(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(av,{mediaList:le}),a.jsx("div",{ref:_,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${D}, ${j})`,rowGap:0,columnGap:P,width:F.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:oe.map((be,Ce)=>{const h=Tl(be.gallery),q=Ll(h),Y=q.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),ee=Math.floor(Ce/D)===Math.ceil(oe.length/D)-1,ve=Pe&&Ce>=xe?`${pe+(Ce-xe)}`:void 0,B=q[0],I=B!=null&&B.lightboxMedia?Y.findIndex(ne=>ne.url===B.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:T,children:q.length>0&&a.jsx(pv,{media:B.displayMedia,gridIndex:Ce,className:`${d}-item-${Bo(B.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:X&&I>=0?ne=>re(Ce,I,Mu(ne.currentTarget,y?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ee?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:j,...ve?{gridColumn:ve}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:K}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:K}})})]})},Ce)})}),z&&typeof document<"u"&&(()=>{const be=(l?document.getElementById(l):null)??document.body;return ai.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(gv,{prefix:d,items:k,index:w,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:Z,entryIdx:C,layoutId:r,sourceRect:V,resolveCloseSourceRect:we,onClose:Ie,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),be)})()]})}const fv=`import { CommonComponentProps } from '../props';
7598
+ `}const hc={url:"",name:"",objectFit:"cover"},_n=500,qo=650,xn="cubic-bezier(0.22, 1, 0.36, 1)",qy=72,Uy=50,Yy=1e4,Ky=650,Zy=500;function Jy(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 Mu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 Qy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Mu(i,n):null}function ev(e){return e.reduce((t,n,i)=>{const o=Tl(n.gallery),l=Ll(o).filter(d=>d.lightboxMedia).map(d=>d.lightboxMedia);return l.length===0||t.push({gridIndex:i,items:l,entry:{title1:n.title1??"",title2:n.title2??"",title3:n.title3??""}}),t},[])}function er(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 fc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return er(e,i,n)}const tv=.03;function Au(e){return e.width*tv}const Ka={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function _r(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function yc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function nv(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ns(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function iv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ns(e,t.width,t.height)}function ov(e,t){if(Bo(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 rv(e){const t=new Set,n=[];for(const i of e){const o=Tl(i.gallery),r=Ll(o);for(const l of r)for(const d of[l.displayMedia,l.lightboxMedia])d!=null&&d.url&&!t.has(d.url)&&(t.add(d.url),n.push(d))}return n}function av({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=>Bo(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 Po(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Au(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function ma(e,t,n){const i=Po(e,t,n);return{...i,left:2*i.left-e.left}}function sv(e,t,n){const{left:i,width:o}=n,r=Au(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 Fu(e,t,n,i){const o=Po(e,"left",i),r=Po(e,"right",i),l=ma(e,"left",i),d=ma(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function lv(e,t,n,i){const{start:o,end:r}=Fu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function cv(e,t,n){const i=Po(e,t,n),o=ma(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Nu(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 Tl(e){if(!e)return;if(Nu(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??hc,i??o??hc]}]}function dv(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function uv(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ll(e){if(!Array.isArray(e)||e.length===0)return[];if(Nu(e)){const t=[];for(const n of e){const i=dv(n);if(!i)continue;const o=uv(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 Bo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function pv({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Bo(e)?a.jsx("video",{src:e.url,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onClick:o}):a.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function mv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Wr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Bo(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 gv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const P=s.useRef(null),b=s.useRef(null),w=s.useRef(null),j=s.useRef(new Map),[H,B]=s.useState(0),k=s.useRef(null),W=s.useRef(0),U=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),O=s.useRef(!1),_=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(()=>{}),K=s.useRef(null),T=s.useRef(null),N=s.useRef(null),V=s.useRef(!1),[ae,ie]=s.useState(null),[M,de]=s.useState(Ka),[X,le]=s.useState(0),[ne,he]=s.useState("opening"),[ke,ye]=s.useState(0),[pe,Z]=s.useState(0),[se,oe]=s.useState(!1),[Re,$e]=s.useState(null),[Me,ve]=s.useState(null),[Se,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[fe,z]=s.useState(!1),R=s.useRef(!1),[Q,te]=s.useState(!1),[ce,G]=s.useState(!1),Ie=s.useRef(n),xe=s.useRef(void 0),J=t[n],He=J?Bo(J):!1,je=pe!==0||se,ct=!l&&(!r||!!d),Ve=c&&!l,et=u.length>1,Ze=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ye=et?er(u,p,-1):Ze(n,-1),be=et?er(u,p,1):Ze(n,1),Oe=Re===-1&&je?et&&Me!==null?er(u,Me,-1):Se!==null?Ze(Se,-1):null:null,ze=Re===1&&je?et&&Me!==null?er(u,Me,1):Se!==null?Ze(Se,1):null:null,Qe=Oe&&Oe.url!==(Ye==null?void 0:Ye.url)?Oe:null,ge=ze&&ze.url!==(be==null?void 0:be.url)?ze:null,_e=Ye&&Ve?(()=>{const A=et?fc(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ye.url?A:null})():null,Xe=be&&Ve?(()=>{const A=et?fc(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return A&&A.url!==be.url?A:null})():null,tt=Qe??_e,ft=ge??Xe,ot=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const Be=j.current,mt=Be.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(Be.set(A,{width:Te,height:Ae}),B(Nt=>Nt+1))},[]),De=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=j.current.get(A.url);return iv(b.current,Te)},[H,X]),Fe=s.useCallback(()=>{if(!J)return;const A=De(J);if(A){ie(A);return}const Te=b.current;Te&&ie(yc(Te))},[J,De]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ve((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ve(null))},[et,u.length,p,t.length,n]),Je=s.useCallback(A=>{_.current=A,oe(A)},[]),We=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),it=s.useCallback(()=>{We(),C.current=window.setTimeout(()=>{We(),Je(!1)},qo+32)},[We,Je]),nt=s.useCallback(()=>{const A=P.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ka.width,height:typeof window<"u"?window.innerHeight:Ka.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!se)return`translate(${pe}px, 0px)`;if(se&&Re!==null){const Ae=De(A);if(!Ae)return;const{x:Be,y:mt}=lv(Ae,Te,Re,M);return`translate(${Be}px, ${mt}px)`}if(se)return"translate(0px, 0px)"}},[je,Q,se,pe,Re,M,De]),Ne=s.useCallback(()=>{const A=L.current;L.current=null,We(),Je(!1),$e(null),ve(null),Ce(null),Z(0),te(!1),I.current=!1,U.current=0,$.current="none",A===-1?f():A===1&&x()},[We,Je,f,x]),at=s.useCallback(()=>{We(),C.current=window.setTimeout(()=>{L.current!==null&&Ne()},qo+32)},[We,Ne]),ut=s.useCallback(()=>{We(),L.current=null,Je(!1),$e(null),ve(null),Ce(null),Z(0),te(!1),I.current=!1,U.current=0,$.current="none"},[We,Je]),Ge=s.useCallback(A=>{if(!(!Ve||!ae)){if(_.current){if(L.current===A){D.current=A,Ne();return}ut()}We(),Ee(A),L.current=A,$e(A),Je(!0),at()}},[Ve,ae,Ne,ut,We,Ee,Je,at]);S.current=Ge;const pt=s.useCallback(()=>{K.current=null,V.current=!1,T.current!==null&&(window.clearInterval(T.current),T.current=null),N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),Tt=s.useCallback(A=>{T.current!==null&&window.clearInterval(T.current);const Te=V.current?Zy:Ky;T.current=window.setInterval(()=>{S.current(A)},Te)},[]),Lt=s.useCallback(A=>{K.current!==A&&(pt(),K.current=A,V.current=!1,S.current(A),Tt(A),N.current=window.setTimeout(()=>{N.current=null,K.current===A&&(V.current=!0,Tt(A))},Yy))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?j.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Ns(A,Ae.width,Ae.height));return}const Be=w.current;if(Be&&Te&&(Be.src===Te||Be.currentSrc===Te)){const{width:Nt,height:ht}=nv(Be);if(Nt&&ht){ot(Te,Nt,ht),ie(Ns(A,Nt,ht));return}}const mt=yc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,ot]),Et=s.useCallback(A=>{if(w.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),le(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=P.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=w.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,H]),s.useEffect(()=>{const A=new Set,Te=[],Ae=Be=>{!(Be!=null&&Be.url)||A.has(Be.url)||(A.add(Be.url),Te.push(Be))};t.forEach(Ae),u.forEach(Be=>Be.items.forEach(Ae)),Te.forEach(Be=>{j.current.has(Be.url)||ov(Be,ot)})},[t,u,ot]),s.useEffect(()=>{if(ne!=="opening"||!ae)return;if(!y){he("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),he("open")})});return()=>cancelAnimationFrame(A)},[ne,ae,y]),s.useEffect(()=>{if(ne!=="closing")return;const A=setTimeout(()=>g(),_n);return()=>clearTimeout(A)},[ne,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Ie.current===n&&xe.current===(J==null?void 0:J.url)||(We(),L.current=null,$e(null),ve(null),Ce(null),ye(0),Z(0),Je(!1),G(!1),te(!1),W.current=0,U.current=0,$.current="none",I.current=!1,k.current=null,O.current=!1,w.current=null,Fe(),Ie.current=n,xe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Je,We,Fe]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{S.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){R.current=!1,z(!1);return}if(ne!=="open"||R.current)return;if(!Ye&&!be){R.current=!0;return}z(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(A)},[ne,Ye==null?void 0:Ye.url,be==null?void 0:be.url]),s.useEffect(()=>{if(ne!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),L.current=St,$e(St),Je(!0),at()},Ae=ht=>{if(Math.abs(ht)>Uy&&Ve){Te(ht);return}L.current=null,$e(null),ve(null),Ce(null),Je(!0),Z(0),it()},Be=ht=>{if(ht.touches.length!==1||_.current)return;const St=ht.touches[0];O.current=!0,k.current={x:St.clientX,y:St.clientY},$.current="none",U.current=0,I.current=!1},mt=ht=>{if(!k.current||ht.touches.length!==1||_.current)return;const St=ht.touches[0],qt=St.clientX-k.current.x,At=St.clientY-k.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Ve)return;$.current="horizontal"}else if(At>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,te(!0),U.current=qt,Z(qt),ht.preventDefault();return}$.current==="vertical"&&(I.current=!0,te(!0),W.current=At,ye(At),ht.preventDefault())},Nt=()=>{if(!k.current)return;const ht=$.current,St=I.current;if(St&&ht==="horizontal")Ae(U.current),A();else if(St&&ht==="vertical"){const qt=W.current;if(ct&&qt>qy){const At=window.innerHeight;W.current=At,G(!0),ye(At),he("closing")}else W.current=0,ye(0);A()}else ht==="horizontal"&&Math.abs(U.current)>0&&(Ae(U.current),A());k.current=null,$.current="none",U.current=0,I.current=!1,te(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[ne,Ve,Je,it,We,ct,at,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&ae&&(ee(A),q(!0)),he("closing")},[m,y,ae]);s.useEffect(()=>{const A=Be=>{if(Be.key==="Escape"){if(r&&d||ne==="closing")return;pt(),Ut();return}if(Be.key!=="ArrowLeft"&&Be.key!=="ArrowRight"||ne!=="open"||!Ve)return;Be.preventDefault();const mt=Be.key==="ArrowLeft"?-1:1;Be.repeat&&K.current===mt||Lt(mt)},Te=Be=>{if(Be.key!=="ArrowLeft"&&Be.key!=="ArrowRight")return;const mt=Be.key==="ArrowLeft"?-1:1;K.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[ne,r,d,Ut,Ve,Lt,pt]),s.useEffect(()=>{ne!=="open"&&pt()},[ne,pt]);const Kt=()=>{ne==="closing"||l||Ut()},Pt=ne==="open",jt=ne==="closing",on=ke>0?Math.max(0,1-ke/500):1,vt=ke>0?Math.max(.35,1-ke/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!_.current)){if(L.current!==null){Ne();return}We(),Je(!1)}},[We,Je,Ne]),qe=ne==="closing"?Y??y:y,st=qe&&ae&&(ne==="opening"||jt)?Jy(qe,ae):void 0,lt=je&&J?me(J,"center"):ke>0?`translateY(${ke}px)`:st,wt=ae?_r(ae,M):null,It=!!(qe&&ae),gt=It&&(ne==="closing"||ne==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:lt,opacity:ke>0?vt:It?1:ne==="opening"||jt?0:1,transition:Q&&!se?"none":se?`transform ${qo}ms ${xn}`:ce?`transform ${_n}ms ${xn}, opacity ${_n}ms ${xn}`:gt?`transform ${_n}ms ${xn}`:ne==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:He&&Pt&&!je?"auto":"none",touchAction:He&&Pt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const Be=De(A);if(!Be)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Re!==null?Fu(Be,mt,Re,M):{start:Ae==="far"?ma(Be,Te,M):Po(Be,Te,M)},ht=_r(Nt,M),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!fe?cv(Be,Te,M):null,At=Ae==="far"&&je&&Re===(Te==="left"?-1:1),sn=Q&&!se?!1:se,gn=Ae==="adjacent"&&Pt&&fe&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${qo}ms ${xn}`:`transform ${qo}ms ${xn}, opacity ${_n}ms ${xn}`:gn?`transform ${_n}ms ${xn}`:ne==="opening"||jt?`opacity ${_n}ms ${xn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=De(A);return Ae?sv(Po(Ae,Te,M),Te,M):null},Xt=A=>Te=>{if(!l){if(O.current){O.current=!1;return}Te.stopPropagation(),Ge(A)}},Dt=Ye?Gt(Ye,"left"):null,zt=be?Gt(be,"right"):null,Bt=Dt?_r(Dt,M):null,bt=zt?_r(zt,M):null;return a.jsxs("div",{ref:P,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${_n}ms ${xn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Wr,{media:tt,style:Mt(tt,"left","far"),onMeasure:ot,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:Ye,style:Mt(Ye,"left"),onMeasure:ot,onTransitionEnd:Le},`prev-${Ye.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&be&&a.jsxs(a.Fragment,{children:[a.jsx(Wr,{media:be,style:Mt(be,"right"),onMeasure:ot,onTransitionEnd:Le},`next-${be.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Wr,{media:ft,style:Mt(ft,"right","far"),onMeasure:ot,onTransitionEnd:Le},`far-next-${ft.url}`),ae&&J&&(He?a.jsx(mv,{src:J.url,phase:ne,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}function hv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=F.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",m=(v==null?void 0:v.ratioValue)??"1:1",g=(v==null?void 0:v.reversed)??!1,[f,x]=m.split(":").map(Number),w=`${g?x:f} / ${g?f:x}`,j=c.entryWidth??.2,H=c.columnsCount,B=F.scalingValue(j,n),k=F.scalingValue(c.horizontalGap??0,n),W=B,U=B,$={width:W,...y?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},I=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},O=s.useRef(null),[_,C]=s.useState(!1),[L,D]=s.useState([]),[S,K]=s.useState(0),[T,N]=s.useState(0),[V,ae]=s.useState(null),[ie,M]=s.useState({title1:"",title2:"",title3:""}),de=(()=>{const Se={},Ce=O.current?getComputedStyle(O.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(Se["--cntrl-article-width"]=Ce),Se})(),X=!n||i||o,le=s.useMemo(()=>Xy(d),[d]),ne=t??[],he=ne.length%H||H,ke=he<H&&ne.length>0,ye=ne.length-he,pe=ke?Math.floor((H-he)/2)+1:1,Z=s.useMemo(()=>ev(ne),[ne]),se=s.useMemo(()=>rv(ne),[ne]),oe=(Se,Ce,h)=>{if(n&&!o&&!i)return;const q=Z.findIndex(ee=>ee.gridIndex===Se);if(q<0)return;const Y=Z[q];N(q),D(Y.items),K(Ce),M(Y.entry),ae(h??null),C(!0)},Re=s.useCallback(()=>{C(!1),ae(null)},[]),$e=s.useCallback(()=>{const Se=Z[T];return!Se||!O.current?V:Qy(O.current,Se.gridIndex,y?"cover":"contain")??V},[Z,T,V,y]),Me=s.useCallback(Se=>{if(Z.length>1){const Ce=Z.length,h=(T+Se+Ce)%Ce,q=Z[h],Y=Math.min(S,q.items.length-1);N(h),D(q.items),K(Y),M(q.entry);return}K(Ce=>(Ce+Se+L.length)%L.length)},[Z,T,S,L.length]),ve=Z.length>1||L.length>1;return s.useEffect(()=>{if(!_||typeof document>"u")return;const Se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Se}},[_]),s.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:le}}),a.jsx(av,{mediaList:se}),a.jsx("div",{ref:O,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${H}, ${B})`,rowGap:0,columnGap:k,width:F.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:F.scalingValue(u??0,n)},children:ne.map((Se,Ce)=>{const h=Tl(Se.gallery),q=Ll(h),Y=q.filter(te=>te.lightboxMedia).map(te=>te.lightboxMedia),ee=Math.floor(Ce/H)===Math.ceil(ne.length/H)-1,fe=ke&&Ce>=ye?`${pe+(Ce-ye)}`:void 0,z=q[0],R=z!=null&&z.lightboxMedia?Y.findIndex(te=>te.url===z.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:q.length>0&&a.jsx(pv,{media:z.displayMedia,gridIndex:Ce,className:`${d}-item-${Bo(z.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:X&&R>=0?te=>oe(Ce,R,Mu(te.currentTarget,y?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ee?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...fe?{gridColumn:fe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:U}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:U}})})]})},Ce)})}),_&&typeof document<"u"&&(()=>{const Se=(l?document.getElementById(l):null)??document.body;return si.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(gv,{prefix:d,items:L,index:S,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ve,lightboxEntries:Z,entryIdx:T,layoutId:r,sourceRect:V,resolveCloseSourceRect:$e,onClose:Re,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),Se)})()]})}const fv=`import { CommonComponentProps } from '../props';
7599
7599
  import { scalingValue, useScopedStyles } from '../utils/index';
7600
7600
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
7601
7601
  import { createPortal } from 'react-dom';
@@ -10314,7 +10314,7 @@ a.${e}-list-item {
10314
10314
  overflow-wrap: anywhere;
10315
10315
  word-break: break-word;
10316
10316
  }
10317
- `}const Ti=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Il=["AColumn","BColumn","CColumn","DColumn","EColumn"],ni="cutLabel",hr=[...Il,ni],Aa=["A","B","C","D","E"];function _u(e){return`${e}ColumnVerticalAlign`}const _s=["Top","Center","Bottom"];function Rl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Aa.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Fv(e){const t=Rl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Nv(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Aa.includes(n)?n:null}function Wu(e,t,n){const i=Nv(e);return i?i===t?!1:Fv(n[_u(i)]):!0}function fr(e){const t=Rl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Aa.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _v(e,t,n){if(Hu(e,t,n))return fr(e);const i=fr(e);return i.kind==="baseline"?{kind:"top"}:i}function Wv(e){const t=fr(e);return t.kind==="baseline"?{kind:"top"}:t}function Hu(e,t,n){return Wu(e,n,t)?fr(e).kind==="baseline":!1}function Hv(e){const t={};let n=!1;for(const i of Aa){const o=_u(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}Wu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ov(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Dv(e){const t=fr(e).kind;return t==="baseline"?"center":t}function zv(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function $c(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bv(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 es(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Bv(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function jv(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 Vv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Gv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ht(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Xv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qv(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),{type:"row",items:[Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing")]},Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function Uv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(hr.map(e=>[Xv[e],qv(e)]))}}function ga(e,t){const n=i=>{const o=Ht(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===ni?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Cc(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 Tc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Lc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((r-l)/2,i)}}const Ln=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Mo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Yv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Kv=["hover","focus","filled","success","error"],Ic=.004,po=.004,ts=po,Pl=50,yr=1440,vr=Pl/yr;function Ou(e){const t=typeof e=="number"&&e>0?e:yr;return Pl/t}function Zv(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 yr}const Du={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function rr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Jv(e,t=1){const n=t/e;return Object.fromEntries(Ln.map(i=>[i,n]))}function Qv(){return Object.fromEntries([...Eo.map(e=>[e,0]),...Mo.map(e=>[e,0])])}function e0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Hr(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function zu(e,t,n){const i=e-vr,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 ra(e,t,n){const i=kl(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 t0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Eo[o],l=Mo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=zu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function kl(e,t,n){if(e<=0)return[];const i=Ln.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)+vr;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-vr;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function n0(e,t,n){if(e<=1)return{};const i=kl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Ln[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Rc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ti]}function i0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function o0(e,t,n,i){const o=Math.min(i,e.length,Ln.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=Ln[c],p=Eo[c],v=Mo[c],y=Ao[c],m=Ln[l],g=Eo[l],f=Mo[l],x=Ao[l],R=n[u],b=n[p],S=n[v],G=n[y];typeof R=="number"&&(r[m]=R),typeof b=="number"&&(r[g]=b),typeof S=="number"&&(r[f]=S),typeof G=="number"&&(r[x]=G)}return r}function Bu(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 r0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=rr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Jv(n,o),...Qv()};if(r)for(const d of Ao)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,e0());return Bu(e,l)?l:e}function a0(e,t,n){const i=Hv(e);i&&(e={...e,...i});const o=Ou(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=rr(e),c=rr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ti.length,v=S=>{if(u)return S;const G=Hr({...t,...S}),D=rr(S),j=ra(p,D,G),P=t0(p,j,{...t,...S});return Object.keys(P).length===0?S:{...S,...P}};if(typeof r=="number"&&r!==l)return e;const y=Rc(e),m=Rc(t);if(!i0(y,m))return v({...e,...o0(y,m,t,p)});if(d<c&&typeof p=="number"&&!u){const S=Hr({...t,...e});return v({...e,...n0(p,d,S)})}if(u){const S=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,G=Math.max(0,(d-o)/2);return S>G?{...e,textPaddingLR:G}:e}const g=Hr({...t,...e}),f=ra(p,c,Hr(t)),R=ra(p,d,g).some((S,G)=>S<(f[G]??S)),b=Ln.some(S=>{const G=e[S],D=t[S];return typeof G=="number"&&typeof D=="number"&&G!==D});return R||b?v(e):e}function s0(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(vr,i-o-r-vr)}function l0(e,t){return Math.random()*(t-e)+e}function c0(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function ns(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function d0(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Eo[d],u=Mo[d],p=Ao[d];return{key:l,textPrefix:Gv[l],widthKey:Ln[d],width:n[Ln[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function u0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=F.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:m,cellMinHeight:g,dividerWidth:f,showVisibility:x,cut:R,showCut:b,cutCellMinHeight:S,cutLabel:G,imageSize:D,imageOnHover:j,imagePosition:P="cursor",imageInterpolation:M="on",entryHoverEffect:K,entryHoverShowOption:T,rowPaddingTop:L,rowPaddingBottom:_,rowPaddingTopB:z,columnsOrder:$,textPaddingLR:k,textColor:W,backgroundColor:w,dividerColor:U,textHoverColor:C,backgroundHoverColor:O,dividerHoverColor:V}=e,[se,ie]=s.useState(void 0),[N,de]=s.useState(null),X=s.useRef(null),ce=j==="on"&&(!n||i),oe=P==="cursor",fe=oe&&M==="on",{anchorRef:Pe,onShow:xe,onCursorMove:pe,exit:Z}=Mv(!!(ce&&N!==null),fe),le=(R??0)>0,re=v==="b",Ie=s.useRef(null),we=s.useRef(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(yr),h=Ou(be),q=Math.max(0,((y??0)-h)/2),Y=Math.min(k??0,q),ee=Math.max(Y,po),ve=((y??0)+h)/2;s.useLayoutEffect(()=>{if(!n){Ce(yr);return}const Le=()=>{Ce(Zv(Ie.current))};Le();const Xe=Ie.current;if(!Xe)return;const lt=new ResizeObserver(Le);lt.observe(Xe);let ct=Xe;for(;ct&&!ct.style.getPropertyValue("--cntrl-article-width");)ct=ct.parentElement;return ct&&lt.observe(ct),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[R,b,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const B=F.buildColorVars(c,{textColor:W,backgroundColor:w,dividerColor:U,textHoverColor:C,backgroundHoverColor:O,dividerHoverColor:V},Yv,Kv),I=r&&r!=="default"?`${c}-state-${r}`:"",ne=`${!n||i?K==="default"?`${c}-entry-hover-default`:K==="blinds"?`${c}-entry-hover-blinds`:K==="reveal"?`${c}-entry-hover-reveal`:"":""} ${I}`.trim(),H=K==="reveal"&&(!n||i),te=(x==null?void 0:x[0])??!1,ke=(x==null?void 0:x[1])??!1,ge=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,J.current=l;return}if(J.current!==l){ge.current=e,J.current=l;return}const Le=ge.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){ge.current=e;return}const lt=a0(e,Le,{designWidth:be});ge.current=e,Bu(e,lt)&&d(lt)},[e,d,n,l,be]);const Ye=s.useMemo(()=>c0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=s.useMemo(()=>ns(e,Eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),it=s.useMemo(()=>ns(e,Mo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),qe=s.useMemo(()=>ns(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray($)&&$.length>0?$:[...Ti],[$]),Je=s.useMemo(()=>d0(et,p,Ye,je,it,qe),[et,p,Ye,je,it,qe]),Ge=rr(e),$e=s.useMemo(()=>Ln.slice(0,p).map(Le=>Ye[Le]),[p,Ye]),He=s.useMemo(()=>kl(p,Ge,Ye),[p,Ge,Ye]),De=s.useMemo(()=>ra(p,Ge,Ye),[p,Ge,Ye]),Qe=s.useMemo(()=>Je.map((Le,Xe)=>zu(De[Xe]??0,Le.paddingLeft,Le.paddingRight)),[Je,De]),he=s.useMemo(()=>{const Le=m===0?1/0:m;return(t??[]).slice(0,Le).map((lt,ct)=>({id:ct,cells:Object.fromEntries(Ti.map(wt=>[wt,lt[wt]??""])),image:lt.image,link:lt.link}))},[t,m]),_e=le?se??R:he.length,Ve=s.useMemo(()=>le?he.slice(0,_e):he,[he,le,_e]),tt=le&&_e<he.length,ft=Ve.length>1||tt,rt=[te?`${c}-divider-top`:"",ke||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Oe=!n||i,Fe=()=>{if(!Oe)return;const Le=se??R;if(!b){ie(he.length);return}ie(Math.min(Le+b,he.length))},Ee=Le=>F.scalingValue(Le,n??!1),Ze=re?z??0:L??0,We=_??0,ot=g??0,nt=Math.max(We,ts),me=bc(0,Ve.length,te,ke,tt,f??0,n??!1).borderTopWidth,Ne=re?"rowPaddingTopB":"rowPaddingTop",st=Je[0],ut=Je[Je.length-1],Be=Qe[0],pt=Qe[Qe.length-1],Tt=st&&Be?Math.max(Be.paddingLeft,po):0,Lt=ut&&pt?Math.max(pt.paddingRight,po):0,xt=Ge,Et=(Le,Xe)=>Ev(P,Ie.current,oe?Le:null,Xe),Vt=(Le,Xe)=>{if(!ce)return;const lt=Le.image;if(!(lt!=null&&lt.url)){Z(()=>de(null));return}const ct=(D==null?void 0:D.min)??80,wt=(D==null?void 0:D.max)??320,It=(N==null?void 0:N.rowId)===Le.id,gt=It?N.widthPx:l0(ct,wt),{x:Ot,y:_t}=Et(Xe,gt);if(It&&oe){pe(Ot,_t);return}de({rowId:Le.id,url:lt.url,objectFit:"contain",isVideo:Lv(lt),widthPx:gt}),X.current={x:Ot,y:_t}},Ut=Le=>{if(!ce||!N||!oe)return;const{x:Xe,y:lt}=Et(Le,N.widthPx);pe(Xe,lt)},Kt=()=>{N&&Z(()=>de(null))},Pt=Le=>{H&&vc(Le,c),!(!ce||!N)&&Z(()=>de(null))},jt=Le=>{H&&xc(Le,c)};s.useLayoutEffect(()=>{if(!N||!X.current)return;const{x:Le,y:Xe}=X.current;X.current=null,xe(Le,Xe)},[N==null?void 0:N.rowId,N==null?void 0:N.url,xe]),s.useLayoutEffect(()=>{if(!u||re){ye(null);return}const Le=we.current,Xe=Le==null?void 0:Le.parentElement;if(!Le||!Xe){ye(null);return}const lt=()=>{const wt=Le.querySelector("[data-list-row]");if(!wt){ye(null);return}const It=Xe.getBoundingClientRect(),gt=wt.getBoundingClientRect();ye(gt.top-It.top+gt.height/2)};lt();const ct=new ResizeObserver(lt);return ct.observe(Le),ct.observe(Xe),()=>ct.disconnect()},[u,re,Ve,Ze,We,ot,t,e,Je,De,be,f,te,ke,tt]);const on=s.useMemo(()=>!re&&Il.some(Le=>{const Xe=Le.charAt(0),lt=e[`${Le}VerticalAlign`];return Hu(lt,e,Xe)}),[re,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Le=Ie.current;if(!Le)return;const Xe=()=>{Le.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Mt=_t.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Gt=_t.querySelector(`.${c}-list-col-title`);Gt&&(Gt.style.transform="")})};if(re||!on){Xe();return}const lt=()=>{const _t=Array.from(Le.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Gt=`${c}-baseline-probe`;_t.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const zt=Dt.querySelector(`.${Mt}`);zt&&(zt.style.minHeight="",zt.style.height="");const Bt=Dt.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})}),_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));jv(Xt,Dt,Mt)}),Le.offsetHeight,_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),zt=Xt.getBoundingClientRect().top,Bt=new Map,bt=Dt.map(Ae=>{const ze=Ae.querySelector(`.${c}-list-col-title`),mt={el:Ae,titleEl:ze,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return Bt.set(mt.letter,mt),mt}),A=new Map,Te=(Ae,ze)=>{const mt=A.get(Ae.letter);if(mt!==void 0)return mt;const Nt=Ae.anchor?Bt.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Nt||ze.has(Ae.letter)){const sn=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,sn),sn}ze.add(Ae.letter);const ht=Te(Nt,ze);ze.delete(Ae.letter);const St=es(Ae,zt,Mt,Gt),qt=ht-St;Vv(Ae.titleEl,qt);const At=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,At),At};bt.forEach(Ae=>Te(Ae,new Set))})};let ct=null;const wt=()=>{ct===null&&(ct=requestAnimationFrame(()=>{ct=null,lt()}))};lt();const It=new ResizeObserver(()=>wt());It.observe(Le);let gt=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{gt||wt()}),()=>{gt=!0,ct!==null&&(cancelAnimationFrame(ct),ct=null),It.disconnect(),Xe()}},[on,re,e,t,be,Ve,De]);const vt=s.useMemo(()=>Av(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),a.jsx("div",{style:B,children:a.jsxs("div",{ref:Ie,className:`${c}-wrapper ${ne}${rt?` ${rt}`:""}${re?` ${c}-type-b`:""}`.trim(),style:{width:F.scalingValue(y??0,n)},onMouseMove:ce?Ut:void 0,onMouseLeave:ce?Kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Le,Xe)=>{var It;const lt=(((It=Le.link)==null?void 0:It.length)??0)>0,ct=lt&&(!n||i)?"a":"div",wt=bc(Xe,Ve.length,te,ke,tt,f??0,n??!1);return a.jsxs(ct,{ref:Xe===0?gt=>{we.current=gt}:void 0,className:`${c}-list-item${lt||T==="always"?` ${c}-list-item-has-link`:""}${tt&&Xe===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Le.link,target:"_blank"}:{},style:wt,onMouseEnter:gt=>{H&&(lt||T==="always")&&vc(gt,c),ce&&Vt(Le,gt)},onMouseLeave:gt=>{H&&(lt||T==="always")&&xc(gt,c)},children:[Ze>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Ze)}}),a.jsxs("div",{className:`${c}-list-cols-row${re?"":` ${c}-list-cols-row-h`}${u&&Xe===0&&re?` ${c}-list-cols-row-controls`:""}`,...re?{}:{"data-list-row":""},style:re?void 0:{minHeight:Ee(ot)},children:[Je.map((gt,Ot)=>{const _t=Ot===Je.length-1,Mt=Qe[Ot],Gt=gt.paddingBottom,Xt=Rv(Le.cells[gt.key]),Dt=re&&Xt&&Gt>0,zt=re?{minHeight:Ee(ot)}:{width:Ee(De[Ot])},Bt=re?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{paddingLeft:Ee(Mt.paddingLeft),paddingRight:Ee(Mt.paddingRight)},bt=gt.textPrefix.charAt(0),A=re?Wv(e[`${gt.textPrefix}VerticalAlign`]):_v(e[`${gt.textPrefix}VerticalAlign`],e,bt),Te=re&&Xt&&u&&Xe===0;return re&&!Xt?null:a.jsxs("div",{className:re?`${c}-list-col-wrap`:void 0,...re?{}:{"data-list-col":"","data-col-letter":bt,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...Bt,...zt,...re?{justifyContent:$c(A.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Tc(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Cc(ga(e,gt.textPrefix),n),...Lc(e,gt.textPrefix,c,n),...re?{}:Ov(A.kind)},children:Le.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Gt)}}),Te&&a.jsx("div",{"data-controls":gt.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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(Math.max(Gt,ts))}})]},gt.key)}),u&&Xe===0&&re&&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(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(ee),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(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ee(Math.max(ee,Ge-ee)),width:Ee(ee),height:"100%"}})]})]}),!re&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(We)}}),u&&Xe===0&&!re&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(nt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ne,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":re?"center":"left-y",className:`${c}-control-anchor`,style:{top:me,left:0,width:"100%",height:Ee(Math.max(Ze,ts))}})},"row-padding-handles"),u&&!re&&st&&ut&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((Be==null?void 0:Be.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(Tt),height:"100%"}}),a.jsx("div",{"data-controls":ut.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Je.length-1]-((pt==null?void 0:pt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(xt-Lt),width:Ee(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!re&&Je.slice(0,-1).map((Le,Xe)=>{const lt=Je[Xe+1],ct=He.slice(0,Xe+1).reduce((_t,Mt)=>_t+Mt,0),wt=Qe[Xe],It=Qe[Xe+1],gt=Math.max(wt.paddingRight,po),Ot=Math.max(It.paddingLeft,po);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Xe]-wt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(ct-gt),width:Ee(gt),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[Xe+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(ct),width:Ee(Ot),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!re&&Je.slice(0,-1).map((Le,Xe)=>{const lt=s0(Xe,He,$e,Ge),wt=He.slice(0,Xe+1).reduce((It,gt)=>It+gt,0)-Ic/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(Pl),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ee(wt),width:Ee(Ic),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),tt&&(()=>{const Le=ga(e,ni),Xe=Dv(e.cutLabelVerticalAlign),lt=Le.textTextAlign==="justify"||re;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ee(S??0),cursor:Oe?"pointer":"default",...Pv(ke,f??0,n??!1)},onClick:Oe?Fe:void 0,onMouseEnter:H||ce?Pt:void 0,onMouseLeave:H?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...re?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{},justifyContent:zv(Le.textTextAlign),alignItems:$c(Xe)},children:a.jsx("span",{className:Tc(e,ni,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Cc(Le,n),...Lc(e,ni,c,n),...lt?{width:"100%"}:{}},children:G})})})})(),ce&&N&&(()=>{const Le=`${N.widthPx}px`,Xe={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Pe,className:`${c}-hover-media-anchor`,children:a.jsx(Iv,{media:N,className:N.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Xe},`${N.rowId}-${N.url}`)})})()]})})]})}const p0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10317
+ `}const Ti=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Il=["AColumn","BColumn","CColumn","DColumn","EColumn"],ii="cutLabel",hr=[...Il,ii],Aa=["A","B","C","D","E"];function _u(e){return`${e}ColumnVerticalAlign`}const _s=["Top","Center","Bottom"];function Rl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Aa.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Fv(e){const t=Rl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Nv(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Aa.includes(n)?n:null}function Wu(e,t,n){const i=Nv(e);return i?i===t?!1:Fv(n[_u(i)]):!0}function fr(e){const t=Rl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Aa.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function _v(e,t,n){if(Hu(e,t,n))return fr(e);const i=fr(e);return i.kind==="baseline"?{kind:"top"}:i}function Wv(e){const t=fr(e);return t.kind==="baseline"?{kind:"top"}:t}function Hu(e,t,n){return Wu(e,n,t)?fr(e).kind==="baseline":!1}function Hv(e){const t={};let n=!1;for(const i of Aa){const o=_u(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}Wu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ov(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Dv(e){const t=fr(e).kind;return t==="baseline"?"center":t}function zv(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function $c(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Bv(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 es(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Bv(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=r.getBoundingClientRect(),c=o.getBoundingClientRect().height;let u=0;return e.kind==="center"?u=(d.height-c)/2:e.kind==="bottom"&&(u=d.height-c),d.top-t+u+l}function jv(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 Vv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Gv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Ht(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Xv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function qv(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),{type:"row",items:[Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing")]},Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function Uv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(hr.map(e=>[Xv[e],qv(e)]))}}function ga(e,t){const n=i=>{const o=Ht(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===ii?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Cc(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 Tc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Lc(e,t,n,i){const o=ga(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:F.scalingValue((r-l)/2,i)}}const Ln=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Eo=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Mo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Ao=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Yv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Kv=["hover","focus","filled","success","error"],Ic=.004,po=.004,ts=po,Pl=50,yr=1440,vr=Pl/yr;function Ou(e){const t=typeof e=="number"&&e>0?e:yr;return Pl/t}function Zv(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 yr}const Du={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function rr(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Jv(e,t=1){const n=t/e;return Object.fromEntries(Ln.map(i=>[i,n]))}function Qv(){return Object.fromEntries([...Eo.map(e=>[e,0]),...Mo.map(e=>[e,0])])}function e0(){return Object.fromEntries(Ao.map(e=>[e,0]))}function Hr(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function zu(e,t,n){const i=e-vr,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 ra(e,t,n){const i=kl(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 t0(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Eo[o],l=Mo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=zu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function kl(e,t,n){if(e<=0)return[];const i=Ln.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)+vr;if(t>=l)return i;const d=[...o];let c=l-t;for(let u=d.length-1;u>=0&&c>0;u-=1){const p=d[u]-vr;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function n0(e,t,n){if(e<=1)return{};const i=kl(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=Ln[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Rc(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Ti]}function i0(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function o0(e,t,n,i){const o=Math.min(i,e.length,Ln.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=Ln[c],p=Eo[c],v=Mo[c],y=Ao[c],m=Ln[l],g=Eo[l],f=Mo[l],x=Ao[l],P=n[u],b=n[p],w=n[v],j=n[y];typeof P=="number"&&(r[m]=P),typeof b=="number"&&(r[g]=b),typeof w=="number"&&(r[f]=w),typeof j=="number"&&(r[x]=j)}return r}function Bu(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 r0(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=rr(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Jv(n,o),...Qv()};if(r)for(const d of Ao)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,e0());return Bu(e,l)?l:e}function a0(e,t,n){const i=Hv(e);i&&(e={...e,...i});const o=Ou(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=rr(e),c=rr(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Ti.length,v=w=>{if(u)return w;const j=Hr({...t,...w}),H=rr(w),B=ra(p,H,j),k=t0(p,B,{...t,...w});return Object.keys(k).length===0?w:{...w,...k}};if(typeof r=="number"&&r!==l)return e;const y=Rc(e),m=Rc(t);if(!i0(y,m))return v({...e,...o0(y,m,t,p)});if(d<c&&typeof p=="number"&&!u){const w=Hr({...t,...e});return v({...e,...n0(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,j=Math.max(0,(d-o)/2);return w>j?{...e,textPaddingLR:j}:e}const g=Hr({...t,...e}),f=ra(p,c,Hr(t)),P=ra(p,d,g).some((w,j)=>w<(f[j]??w)),b=Ln.some(w=>{const j=e[w],H=t[w];return typeof j=="number"&&typeof H=="number"&&j!==H});return P||b?v(e):e}function s0(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),r=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(vr,i-o-r-vr)}function l0(e,t){return Math.random()*(t-e)+e}function c0(e){return Object.fromEntries(Ln.map(t=>[t,typeof e[t]=="number"?e[t]:Du[t]]))}function ns(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function d0(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Eo[d],u=Mo[d],p=Ao[d];return{key:l,textPrefix:Gv[l],widthKey:Ln[d],width:n[Ln[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function u0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=F.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:m,cellMinHeight:g,dividerWidth:f,showVisibility:x,cut:P,showCut:b,cutCellMinHeight:w,cutLabel:j,imageSize:H,imageOnHover:B,imagePosition:k="cursor",imageInterpolation:W="on",entryHoverEffect:U,entryHoverShowOption:$,rowPaddingTop:I,rowPaddingBottom:O,rowPaddingTopB:_,columnsOrder:C,textPaddingLR:L,textColor:D,backgroundColor:S,dividerColor:K,textHoverColor:T,backgroundHoverColor:N,dividerHoverColor:V}=e,[ae,ie]=s.useState(void 0),[M,de]=s.useState(null),X=s.useRef(null),le=B==="on"&&(!n||i),ne=k==="cursor",he=ne&&W==="on",{anchorRef:ke,onShow:ye,onCursorMove:pe,exit:Z}=Mv(!!(le&&M!==null),he),se=(P??0)>0,oe=v==="b",Re=s.useRef(null),$e=s.useRef(null),[Me,ve]=s.useState(null),[Se,Ce]=s.useState(yr),h=Ou(Se),q=Math.max(0,((y??0)-h)/2),Y=Math.min(L??0,q),ee=Math.max(Y,po),fe=((y??0)+h)/2;s.useLayoutEffect(()=>{if(!n){Ce(yr);return}const Le=()=>{Ce(Zv(Re.current))};Le();const qe=Re.current;if(!qe)return;const st=new ResizeObserver(Le);st.observe(qe);let lt=qe;for(;lt&&!lt.style.getPropertyValue("--cntrl-article-width");)lt=lt.parentElement;return lt&&st.observe(lt),()=>st.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[P,b,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const z=F.buildColorVars(c,{textColor:D,backgroundColor:S,dividerColor:K,textHoverColor:T,backgroundHoverColor:N,dividerHoverColor:V},Yv,Kv),R=r&&r!=="default"?`${c}-state-${r}`:"",te=`${!n||i?U==="default"?`${c}-entry-hover-default`:U==="blinds"?`${c}-entry-hover-blinds`:U==="reveal"?`${c}-entry-hover-reveal`:"":""} ${R}`.trim(),ce=U==="reveal"&&(!n||i),G=(x==null?void 0:x[0])??!1,Ie=(x==null?void 0:x[1])??!1,xe=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){xe.current=e,J.current=l;return}if(J.current!==l){xe.current=e,J.current=l;return}const Le=xe.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){xe.current=e;return}const st=a0(e,Le,{designWidth:Se});xe.current=e,Bu(e,st)&&d(st)},[e,d,n,l,Se]);const He=s.useMemo(()=>c0(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=s.useMemo(()=>ns(e,Eo),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),ct=s.useMemo(()=>ns(e,Mo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Ve=s.useMemo(()=>ns(e,Ao),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...Ti],[C]),Ze=s.useMemo(()=>d0(et,p,He,je,ct,Ve),[et,p,He,je,ct,Ve]),Ye=rr(e),be=s.useMemo(()=>Ln.slice(0,p).map(Le=>He[Le]),[p,He]),Oe=s.useMemo(()=>kl(p,Ye,He),[p,Ye,He]),ze=s.useMemo(()=>ra(p,Ye,He),[p,Ye,He]),Qe=s.useMemo(()=>Ze.map((Le,qe)=>zu(ze[qe]??0,Le.paddingLeft,Le.paddingRight)),[Ze,ze]),ge=s.useMemo(()=>{const Le=m===0?1/0:m;return(t??[]).slice(0,Le).map((st,lt)=>({id:lt,cells:Object.fromEntries(Ti.map(wt=>[wt,st[wt]??""])),image:st.image,link:st.link}))},[t,m]),_e=se?ae??P:ge.length,Xe=s.useMemo(()=>se?ge.slice(0,_e):ge,[ge,se,_e]),tt=se&&_e<ge.length,ft=Xe.length>1||tt,ot=[G?`${c}-divider-top`:"",Ie||ft?`${c}-divider-bottom`:""].filter(Boolean).join(" "),De=!n||i,Fe=()=>{if(!De)return;const Le=ae??P;if(!b){ie(ge.length);return}ie(Math.min(Le+b,ge.length))},Ee=Le=>F.scalingValue(Le,n??!1),Je=oe?_??0:I??0,We=O??0,it=g??0,nt=Math.max(We,ts),me=bc(0,Xe.length,G,Ie,tt,f??0,n??!1).borderTopWidth,Ne=oe?"rowPaddingTopB":"rowPaddingTop",at=Ze[0],ut=Ze[Ze.length-1],Ge=Qe[0],pt=Qe[Qe.length-1],Tt=at&&Ge?Math.max(Ge.paddingLeft,po):0,Lt=ut&&pt?Math.max(pt.paddingRight,po):0,xt=Ye,Et=(Le,qe)=>Ev(k,Re.current,ne?Le:null,qe),Vt=(Le,qe)=>{if(!le)return;const st=Le.image;if(!(st!=null&&st.url)){Z(()=>de(null));return}const lt=(H==null?void 0:H.min)??80,wt=(H==null?void 0:H.max)??320,It=(M==null?void 0:M.rowId)===Le.id,gt=It?M.widthPx:l0(lt,wt),{x:Ot,y:_t}=Et(qe,gt);if(It&&ne){pe(Ot,_t);return}de({rowId:Le.id,url:st.url,objectFit:"contain",isVideo:Lv(st),widthPx:gt}),X.current={x:Ot,y:_t}},Ut=Le=>{if(!le||!M||!ne)return;const{x:qe,y:st}=Et(Le,M.widthPx);pe(qe,st)},Kt=()=>{M&&Z(()=>de(null))},Pt=Le=>{ce&&vc(Le,c),!(!le||!M)&&Z(()=>de(null))},jt=Le=>{ce&&xc(Le,c)};s.useLayoutEffect(()=>{if(!M||!X.current)return;const{x:Le,y:qe}=X.current;X.current=null,ye(Le,qe)},[M==null?void 0:M.rowId,M==null?void 0:M.url,ye]),s.useLayoutEffect(()=>{if(!u||oe){ve(null);return}const Le=$e.current,qe=Le==null?void 0:Le.parentElement;if(!Le||!qe){ve(null);return}const st=()=>{const wt=Le.querySelector("[data-list-row]");if(!wt){ve(null);return}const It=qe.getBoundingClientRect(),gt=wt.getBoundingClientRect();ve(gt.top-It.top+gt.height/2)};st();const lt=new ResizeObserver(st);return lt.observe(Le),lt.observe(qe),()=>lt.disconnect()},[u,oe,Xe,Je,We,it,t,e,Ze,ze,Se,f,G,Ie,tt]);const on=s.useMemo(()=>!oe&&Il.some(Le=>{const qe=Le.charAt(0),st=e[`${Le}VerticalAlign`];return Hu(st,e,qe)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Ot;const Le=Re.current;if(!Le)return;const qe=()=>{Le.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Mt=_t.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Gt=_t.querySelector(`.${c}-list-col-title`);Gt&&(Gt.style.transform="")})};if(oe||!on){qe();return}const st=()=>{const _t=Array.from(Le.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Gt=`${c}-baseline-probe`;_t.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const zt=Dt.querySelector(`.${Mt}`);zt&&(zt.style.minHeight="",zt.style.height="");const Bt=Dt.querySelector(`.${c}-list-col-title`);Bt&&(Bt.style.transform="")})}),_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));jv(Xt,Dt,Mt)}),Le.offsetHeight,_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),zt=Xt.getBoundingClientRect().top,Bt=new Map,bt=Dt.map(Ae=>{const Be=Ae.querySelector(`.${c}-list-col-title`),mt={el:Ae,titleEl:Be,letter:Ae.getAttribute("data-col-letter")??"",kind:Ae.getAttribute("data-valign")??"top",anchor:Ae.getAttribute("data-valign-anchor")};return Bt.set(mt.letter,mt),mt}),A=new Map,Te=(Ae,Be)=>{const mt=A.get(Ae.letter);if(mt!==void 0)return mt;const Nt=Ae.anchor?Bt.get(Ae.anchor):void 0;if(Ae.kind!=="baseline"||!Nt||Be.has(Ae.letter)){const sn=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,sn),sn}Be.add(Ae.letter);const ht=Te(Nt,Be);Be.delete(Ae.letter);const St=es(Ae,zt,Mt,Gt),qt=ht-St;Vv(Ae.titleEl,qt);const At=es(Ae,zt,Mt,Gt);return A.set(Ae.letter,At),At};bt.forEach(Ae=>Te(Ae,new Set))})};let lt=null;const wt=()=>{lt===null&&(lt=requestAnimationFrame(()=>{lt=null,st()}))};st();const It=new ResizeObserver(()=>wt());It.observe(Le);let gt=!1;return typeof document<"u"&&((Ot=document.fonts)!=null&&Ot.ready)&&document.fonts.ready.then(()=>{gt||wt()}),()=>{gt=!0,lt!==null&&(cancelAnimationFrame(lt),lt=null),It.disconnect(),qe()}},[on,oe,e,t,Se,Xe,ze]);const vt=s.useMemo(()=>Av(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vt}}),a.jsx("div",{style:z,children:a.jsxs("div",{ref:Re,className:`${c}-wrapper ${te}${ot?` ${ot}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:F.scalingValue(y??0,n)},onMouseMove:le?Ut:void 0,onMouseLeave:le?Kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Xe.map((Le,qe)=>{var It;const st=(((It=Le.link)==null?void 0:It.length)??0)>0,lt=st&&(!n||i)?"a":"div",wt=bc(qe,Xe.length,G,Ie,tt,f??0,n??!1);return a.jsxs(lt,{ref:qe===0?gt=>{$e.current=gt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${tt&&qe===Xe.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Le.link,target:"_blank"}:{},style:wt,onMouseEnter:gt=>{ce&&(st||$==="always")&&vc(gt,c),le&&Vt(Le,gt)},onMouseLeave:gt=>{ce&&(st||$==="always")&&xc(gt,c)},children:[Je>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Je)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&qe===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Ee(it)},children:[Ze.map((gt,Ot)=>{const _t=Ot===Ze.length-1,Mt=Qe[Ot],Gt=gt.paddingBottom,Xt=Rv(Le.cells[gt.key]),Dt=oe&&Xt&&Gt>0,zt=oe?{minHeight:Ee(it)}:{width:Ee(ze[Ot])},Bt=oe?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{paddingLeft:Ee(Mt.paddingLeft),paddingRight:Ee(Mt.paddingRight)},bt=gt.textPrefix.charAt(0),A=oe?Wv(e[`${gt.textPrefix}VerticalAlign`]):_v(e[`${gt.textPrefix}VerticalAlign`],e,bt),Te=oe&&Xt&&u&&qe===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":bt,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...Bt,...zt,...oe?{justifyContent:$c(A.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Tc(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Cc(ga(e,gt.textPrefix),n),...Lc(e,gt.textPrefix,c,n),...oe?{}:Ov(A.kind)},children:Le.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(Gt)}}),Te&&a.jsx("div",{"data-controls":gt.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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(Math.max(Gt,ts))}})]},gt.key)}),u&&qe===0&&oe&&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(fe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(ee),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(fe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ee(Math.max(ee,Ye-ee)),width:Ee(ee),height:"100%"}})]})]}),!oe&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ee(We)}}),u&&qe===0&&!oe&&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:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ee(nt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ne,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:me,left:0,width:"100%",height:Ee(Math.max(Je,ts))}})},"row-padding-handles"),u&&!oe&&at&&ut&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":at.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[0]-((Ge==null?void 0:Ge.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ee(Tt),height:"100%"}}),a.jsx("div",{"data-controls":ut.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[Ze.length-1]-((pt==null?void 0:pt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(xt-Lt),width:Ee(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&Ze.slice(0,-1).map((Le,qe)=>{const st=Ze[qe+1],lt=Oe.slice(0,qe+1).reduce((_t,Mt)=>_t+Mt,0),wt=Qe[qe],It=Qe[qe+1],gt=Math.max(wt.paddingRight,po),Ot=Math.max(It.paddingLeft,po);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ze[qe]-wt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(lt-gt),width:Ee(gt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ze[qe+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":Me??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ee(lt),width:Ee(Ot),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!oe&&Ze.slice(0,-1).map((Le,qe)=>{const st=s0(qe,Oe,be,Ye),wt=Oe.slice(0,qe+1).reduce((It,gt)=>It+gt,0)-Ic/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(Pl),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ee(wt),width:Ee(Ic),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),tt&&(()=>{const Le=ga(e,ii),qe=Dv(e.cutLabelVerticalAlign),st=Le.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ee(w??0),cursor:De?"pointer":"default",...Pv(Ie,f??0,n??!1)},onClick:De?Fe:void 0,onMouseEnter:ce||le?Pt:void 0,onMouseLeave:ce?jt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Ee(Y),paddingRight:Ee(Y)}:{},justifyContent:zv(Le.textTextAlign),alignItems:$c(qe)},children:a.jsx("span",{className:Tc(e,ii,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Cc(Le,n),...Lc(e,ii,c,n),...st?{width:"100%"}:{}},children:j})})})})(),le&&M&&(()=>{const Le=`${M.widthPx}px`,qe={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:ke,className:`${c}-hover-media-anchor`,children:a.jsx(Iv,{media:M,className:M.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:qe},`${M.rowId}-${M.url}`)})})()]})})]})}const p0=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
10318
10318
  import { CommonComponentProps } from '../props';
10319
10319
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
10320
10320
  import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
@@ -13402,7 +13402,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13402
13402
  </>
13403
13403
  );
13404
13404
  }
13405
- `,jo=["A","B","C","D","E"],Pc=[..._s,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ni={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function m0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function g0(){return Object.fromEntries(jo.map((e,t)=>{const n=Ti[t],i=`${e} column`;return[n,m0(i)]}))}function h0(){const e={};for(const t of jo)e[`${t}ColumnWidth`]=Or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Or(`${t} column padding bottom`);return e}function kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Ti]};for(const r of jo)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 f0(e){const t={};if(e===ni)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[..._s]},enum:[..._s]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Pc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Pc]}}return t[Ht(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ht(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ht(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const y0=hr.reduce((e,t)=>({...e,...f0(t)}),{});function v0(e){return{verticalAlign:e===ni?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ni?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function x0(e,t={}){var n;return{...v0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ec=new Set(["textFontFamily","textFontSettings"]);function b0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Ec.has(r):!Ec.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Rl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ht(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ht(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ht(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ht(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ht(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ht(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ht(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ht(e,"textTextAppearance")]=t.textTextAppearance),o}function aa(e={},t){return hr.reduce((n,i)=>({...n,...b0(i,x0(i,e),t)}),{})}const S0=aa(),w0=Uv();function ju(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing"),Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function $0(){const e=[];return Il.forEach((t,n)=>{const i=Ti[n],o=ju(t);for(let r=1;r<Ti.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const C0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ju(ni);const T0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],L0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:_i[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:_i[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:_i[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:_i[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:_i[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:_i[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:_i[6],link:""}],I0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],R0={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:{...g0(),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:L0},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"}},...h0(),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"}},...y0,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",...S0,...aa({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:kc({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},...aa({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:kc({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},...aa({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...$0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...T0.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}},...jo.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",...I0]},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:[...C0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},P0={element:u0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>r0(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:[...hr.map(e=>({path:`${Ht(e,"textFontFamily")}`}))]},fontRelations:{...hr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ht(t,"textFontFamily")}`}),{})},schema:R0,sourceCode:p0},Mc=300,di=.004,k0={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},E0=["hover","focus","filled","success","error"];function M0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Fc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function A0(e){return`
13405
+ `,jo=["A","B","C","D","E"],Pc=[..._s,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],Ni={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function m0(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Or(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function g0(){return Object.fromEntries(jo.map((e,t)=>{const n=Ti[t],i=`${e} column`;return[n,m0(i)]}))}function h0(){const e={};for(const t of jo)e[`${t}ColumnWidth`]=Or(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Or(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Or(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Or(`${t} column padding bottom`);return e}function kc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Ti]};for(const r of jo)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 f0(e){const t={};if(e===ii)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[..._s]},enum:[..._s]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Pc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Pc]}}return t[Ht(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Ht(e,"textFontSettings")]={...Ni.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Ht(e,"textFontSize")]={...Ni.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ht(e,"textLineHeight")]={...Ni.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ht(e,"textLetterSpacing")]={...Ni.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ht(e,"textWordSpacing")]={...Ni.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ht(e,"textTextAlign")]={...Ni.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ht(e,"textTextAppearance")]={...Ni.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const y0=hr.reduce((e,t)=>({...e,...f0(t)}),{});function v0(e){return{verticalAlign:e===ii?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===ii?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function x0(e,t={}){var n;return{...v0(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Ec=new Set(["textFontFamily","textFontSettings"]);function b0(e,t,n){const i=r=>n===void 0?!0:n==="common"?Ec.has(r):!Ec.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Rl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Ht(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Ht(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Ht(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Ht(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Ht(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Ht(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Ht(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Ht(e,"textTextAppearance")]=t.textTextAppearance),o}function aa(e={},t){return hr.reduce((n,i)=>({...n,...b0(i,x0(i,e),t)}),{})}const S0=aa(),w0=Uv();function ju(e){return[Ht(e,"textFontFamily"),Ht(e,"textFontSettings"),Ht(e,"textFontSize"),Ht(e,"textLineHeight"),Ht(e,"textLetterSpacing"),Ht(e,"textWordSpacing"),Ht(e,"textTextAlign"),Ht(e,"textTextAppearance"),`${e}VerticalAlign`]}function $0(){const e=[];return Il.forEach((t,n)=>{const i=Ti[n],o=ju(t);for(let r=1;r<Ti.length;r+=1){const l=[{name:"columns",value:r},...Array.from({length:r},(d,c)=>({name:`columnsOrder.${c}`,value:i,isNotEqual:!0}))];o.forEach(d=>{e.push({if:l,then:{name:`properties.${d}.display.visible`,value:!1}})})}}),e}const C0=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ju(ii);const T0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],_i=[{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg"},{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg"}],L0=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:_i[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:_i[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:_i[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:_i[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:_i[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:_i[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:_i[6],link:""}],I0=[...jo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],R0={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:{...g0(),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:L0},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"}},...h0(),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"}},...y0,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",...S0,...aa({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:kc({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},...aa({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:kc({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},...aa({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...$0(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...T0.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}},...jo.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",...I0]},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:[...C0],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},P0={element:u0,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>r0(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:[...hr.map(e=>({path:`${Ht(e,"textFontFamily")}`}))]},fontRelations:{...hr.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Ht(t,"textFontFamily")}`}),{})},schema:R0,sourceCode:p0},Mc=300,ui=.004,k0={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},E0=["hover","focus","filled","success","error"];function M0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ac(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Fc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function A0(e){return`
13406
13406
  .${e}-wrapper {
13407
13407
  box-sizing: border-box;
13408
13408
  display: flex;
@@ -13567,7 +13567,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
13567
13567
  pointer-events: none;
13568
13568
  z-index: 2;
13569
13569
  }
13570
- `}function Nc(e,t,n,i,o,r,l,d){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:d??"#000000"}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=F.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:y="default",autoclose:m="off",icon:g,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:R="rotate 45",questionColor:b="#000000",answerColor:S="#000000",dividerColor:G="#0000001F",iconColor:D="#000000",questionHoverColor:j="#666666",iconHoverColor:P="#666666",iconActiveColor:M="#000000",dividerHoverColor:K="#000000",questionFontFamily:T,questionFontSettings:L,questionFontSize:_,questionLineHeight:z,questionLetterSpacing:$,questionWordSpacing:k,questionTextAppearance:W,answerFontFamily:w,answerFontSettings:U,answerFontSize:C,answerLineHeight:O,answerLetterSpacing:V,answerWordSpacing:se,answerTextAppearance:ie,questionPaddingLeft:N=0,questionPaddingTop:de=0,questionPaddingBottom:X=0,answerPaddingLeft:ce=0,answerPaddingRight:oe=0,answerPaddingTop:fe=0,answerPaddingBottom:Pe=0}=e,xe=t??[],[pe,Z]=s.useState(()=>new Set),le=!n||i;s.useEffect(()=>{Z(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&Z(new Set)},[n,o,i]);const re=Qe=>F.scalingValue(Qe,n??!1),Ie=Math.max(N,di),we=Math.max(de,di),Me=Math.max(X,di),ye=Math.max(ce,di),be=Math.max(oe,di),Ce=Math.max(fe,di),h=Math.max(Pe,di),q=Math.max(0,(c??1)-x-f),Y=Math.max(0,(c??1)-oe),ee=Math.max(0,(c??1)-ce),ve=Math.max(x,di),B=Math.max(0,(c??1)-N-f),I=s.useMemo(()=>pe.size===0?0:Math.min(...pe),[pe]),Q=s.useCallback(Qe=>pe.has(Qe),[pe]),ne=le&&y==="default"?`${l}-entry-hover-default`:"",H=g??"",te=H!=="",ke=R.replace(/^rotate /,""),ge=`${l}-icon-anim-${ke}`,J=dn(Qt(Nc(T,L,_,z,$,k,W,b),n)),Ye=dn(Qt(Nc(w,U,C,O,V,se,ie,S),n)),je=Ac(_,z,`${l}-question`,`${l}-text-tight-leading`),it=Ac(C,O,`${l}-answer-text`,`${l}-text-tight-leading`),qe=Fc(_,z,l,n),et=Fc(C,O,l,n),Je=F.buildColorVars(l,{questionColor:b,answerColor:S,dividerColor:G,iconColor:D,questionHoverColor:j,iconHoverColor:P,iconActiveColor:M,dividerHoverColor:K},k0,E0),Ge=r&&r!=="default"?`${l}-state-${r}`:"",$e=s.useCallback(Qe=>{le&&Z(he=>{if(he.has(Qe)){const Ve=new Set(he);return Ve.delete(Qe),Ve}if(m==="on")return new Set([Qe]);const _e=new Set(he);return _e.add(Qe),_e})},[le,m]),He=s.useMemo(()=>A0(l),[l]),De={[`--${l}-divider-width`]:F.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:F.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:F.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),a.jsx("div",{style:Je,children:a.jsx("div",{className:Ct(`${l}-wrapper`,n&&!i&&`${l}-editor`,ne,Ge),style:{width:F.scalingValue(c,n??!1),maxWidth:"100%",...De},children:xe.map((Qe,he)=>{var Oe;const _e=Q(he),Ve=((Oe=Qe.question)==null?void 0:Oe.trim())??"",tt=Qe.answer,ft=((tt==null?void 0:tt.length)??0)>0,rt=d&&he===I;return a.jsxs("div",{className:Ct(`${l}-item`,_e&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[rt&&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:re(we)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(Ie),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:re(ve),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":_e,style:{...J,...qe,paddingLeft:re(N),paddingRight:re(x)},onClick:()=>$e(he),children:[de>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(de)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:je,children:Ve}),ft&&(te?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ge}`,"aria-hidden":"true",children:a.jsx(pn,{url:H,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 ${ge}`,"aria-hidden":"true"}))]}),X>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(X)},"aria-hidden":"true"})]}),rt&&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:re(Me)}})]}),ft&&tt&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!_e,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[rt&&_e&&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:re(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(Y),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(ye),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(ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:re(be),height:"100%"}})]}),fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(fe)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ye,...et,paddingLeft:re(ce),paddingRight:re(oe)},children:a.jsx("div",{className:it,children:a.jsx(Ki,{content:tt})})}),Pe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(Pe)}}),rt&&_e&&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:re(h)}})]})})})]},he)})})})]})}const N0=`import { useCallback, useEffect, useMemo, useState } from 'react';
13570
+ `}function Nc(e,t,n,i,o,r,l,d){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:d??"#000000"}}function F0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=F.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:y="default",autoclose:m="off",icon:g,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:P="rotate 45",questionColor:b="#000000",answerColor:w="#000000",dividerColor:j="#0000001F",iconColor:H="#000000",questionHoverColor:B="#666666",iconHoverColor:k="#666666",iconActiveColor:W="#000000",dividerHoverColor:U="#000000",questionFontFamily:$,questionFontSettings:I,questionFontSize:O,questionLineHeight:_,questionLetterSpacing:C,questionWordSpacing:L,questionTextAppearance:D,answerFontFamily:S,answerFontSettings:K,answerFontSize:T,answerLineHeight:N,answerLetterSpacing:V,answerWordSpacing:ae,answerTextAppearance:ie,questionPaddingLeft:M=0,questionPaddingTop:de=0,questionPaddingBottom:X=0,answerPaddingLeft:le=0,answerPaddingRight:ne=0,answerPaddingTop:he=0,answerPaddingBottom:ke=0}=e,ye=t??[],[pe,Z]=s.useState(()=>new Set),se=!n||i;s.useEffect(()=>{Z(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&Z(new Set)},[n,o,i]);const oe=Qe=>F.scalingValue(Qe,n??!1),Re=Math.max(M,ui),$e=Math.max(de,ui),Me=Math.max(X,ui),ve=Math.max(le,ui),Se=Math.max(ne,ui),Ce=Math.max(he,ui),h=Math.max(ke,ui),q=Math.max(0,(c??1)-x-f),Y=Math.max(0,(c??1)-ne),ee=Math.max(0,(c??1)-le),fe=Math.max(x,ui),z=Math.max(0,(c??1)-M-f),R=s.useMemo(()=>pe.size===0?0:Math.min(...pe),[pe]),Q=s.useCallback(Qe=>pe.has(Qe),[pe]),te=se&&y==="default"?`${l}-entry-hover-default`:"",ce=g??"",G=ce!=="",Ie=P.replace(/^rotate /,""),xe=`${l}-icon-anim-${Ie}`,J=dn(Qt(Nc($,I,O,_,C,L,D,b),n)),He=dn(Qt(Nc(S,K,T,N,V,ae,ie,w),n)),je=Ac(O,_,`${l}-question`,`${l}-text-tight-leading`),ct=Ac(T,N,`${l}-answer-text`,`${l}-text-tight-leading`),Ve=Fc(O,_,l,n),et=Fc(T,N,l,n),Ze=F.buildColorVars(l,{questionColor:b,answerColor:w,dividerColor:j,iconColor:H,questionHoverColor:B,iconHoverColor:k,iconActiveColor:W,dividerHoverColor:U},k0,E0),Ye=r&&r!=="default"?`${l}-state-${r}`:"",be=s.useCallback(Qe=>{se&&Z(ge=>{if(ge.has(Qe)){const Xe=new Set(ge);return Xe.delete(Qe),Xe}if(m==="on")return new Set([Qe]);const _e=new Set(ge);return _e.add(Qe),_e})},[se,m]),Oe=s.useMemo(()=>A0(l),[l]),ze={[`--${l}-divider-width`]:F.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:F.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:F.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Oe}}),a.jsx("div",{style:Ze,children:a.jsx("div",{className:Ct(`${l}-wrapper`,n&&!i&&`${l}-editor`,te,Ye),style:{width:F.scalingValue(c,n??!1),maxWidth:"100%",...ze},children:ye.map((Qe,ge)=>{var De;const _e=Q(ge),Xe=((De=Qe.question)==null?void 0:De.trim())??"",tt=Qe.answer,ft=((tt==null?void 0:tt.length)??0)>0,ot=d&&ge===R;return a.jsxs("div",{className:Ct(`${l}-item`,_e&&`${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:oe($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(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(Re),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(z),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(fe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":_e,style:{...J,...Ve,paddingLeft:oe(M),paddingRight:oe(x)},onClick:()=>be(ge),children:[de>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(de)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:je,children:Xe}),ft&&(G?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${xe}`,"aria-hidden":"true",children:a.jsx(pn,{url:ce,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 ${xe}`,"aria-hidden":"true"}))]}),X>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(X)},"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:oe(Me)}})]}),ft&&tt&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!_e,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[ot&&_e&&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:oe(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(Y),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(ve),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(ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(Se),height:"100%"}})]}),he>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(he)}}),a.jsx("div",{className:`${l}-answer`,style:{...He,...et,paddingLeft:oe(le),paddingRight:oe(ne)},children:a.jsx("div",{className:ct,children:a.jsx(Ki,{content:tt})})}),ke>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(ke)}}),ot&&_e&&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:oe(h)}})]})})})]},ge)})})})]})}const N0=`import { useCallback, useEffect, useMemo, useState } from 'react';
13571
13571
  import cn from 'classnames';
13572
13572
  import { CommonComponentProps } from '../props';
13573
13573
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
@@ -14315,7 +14315,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14315
14315
  </>
14316
14316
  );
14317
14317
  }
14318
- `;function ui(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const _c={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],W0={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:ui("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:{..._c.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:{..._c.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:ui("Question Padding Left"),questionPaddingTop:ui("Question Padding Top"),questionPaddingBottom:ui("Question Padding Bottom"),answerPaddingLeft:ui("Answer Padding Left"),answerPaddingRight:ui("Answer Padding Right"),answerPaddingTop:ui("Answer Padding Top"),answerPaddingBottom:ui("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:[..._0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},H0={element:F0,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:W0,sourceCode:N0},ii=e=>e.display==="cover",Fa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Wc=100,O0=.2,Hc=8,Vu=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Wc:Math.max(Wc,window.innerHeight*O0),[]),v=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),y=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,_=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${_})`},[]),g=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),x=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;d(!0),r(T),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),R=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(c.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),b=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const _=T.clientX-L.startX,z=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(_)<Hc&&Math.abs(z)<Hc)return;if(z>0&&z>Math.abs(_))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;T.preventDefault();const $=Math.max(0,z);u.current=$,r($)},[e,g]),S=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const _=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!_){g();return}T.clientY-L.startY>=p?x():f()},[p,x,e,g,f]),G=s.useCallback(T=>{S(T)},[S]),D=s.useCallback(T=>{S(T)},[S]),j=o>0,P=l?`transform ${n}ms ease`:"none",M=l?`opacity ${n}ms ease`:"none",K=o>0||l;return{isSwipeDragging:j,backdropStyle:{opacity:v(o),transition:M},mediaAreaStyle:{transform:m(o),transition:P,touchAction:j?"none":void 0,willChange:j?"transform":void 0},overlayContentStyle:K?{opacity:y(o),transition:M}:void 0,swipeHandlers:e?{onPointerDown:R,onPointerMove:b,onPointerUp:G,onPointerCancel:D}:{},dismissAreaStyle:e?{touchAction:j?"none":"pan-x"}:void 0}},D0="[data-lightbox-scrollable]",Gu=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(D0)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},z0=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},B0=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},j0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},V0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,f)=>{B0(t),e.scrollLeft=g,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,y(),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(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-j0(t),!1))}},ar=300,G0=900,X0=1500,q0="cubic-bezier(0.16, 1, 0.3, 1)",U0=3e3,Y0=2,K0=16,Z0=.05,J0=1,Dr=.3,Q0=50,ex=20,oo=.004,Fo=["title1","title2","title3"],tx={title1:"1",title2:"2",title3:"3"},nx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ix={title1:.02,title2:.02,title3:.02},zr=e=>`max(${e}, ${ex}px)`,ox=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]}},rx=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=ox(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ax=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")],sx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[tx[e],ax(e)]))}),El=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Xu=(e,t)=>El(e,t),Br=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Oc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:El(e.length,n),effective:Xu(e.length,n)}},lx=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},is=(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[nx[t]]}},cx=(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),os=(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??ix[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},dx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:R,thumbnailObjectFit:b,thumbnailActive:S,thumbnailActiveColor:G,title1Width:D,title2Width:j,title3Width:P,title1MarginLeft:M=0,title2MarginLeft:K=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:_="desktop",contentMarginTop:z,iconMarginLeft:$}=n,k=E=>F.scalingValue(E,i??!1),W=c??n.thumnailSize??.03,w=k(W),U=k(u),C=k(p??.02),O=k(v??0),V=k(z??0),se=zr(V),ie=k($??0),[N,de]=s.useState(0),X=s.useRef(N);X.current=N;const ce=t[N],{title1:oe,title2:fe,title3:Pe}=rx(ce),xe=os("title1",is(n,"title1"),i),pe=os("title2",is(n,"title2"),i),Z=os("title3",is(n,"title3"),i),le=_==="mobile",re=!o&&(!i||r),Ie=re,we=re,Me=re,ye=ii(b),be=ye?{"--image-aspect-ratio":Fa(b)}:void 0,Ce=!!(oe||fe||Pe),h=s.useMemo(()=>lx(e,oe,fe,Pe,xe,pe,Z),[e,N,oe,fe,Pe,xe,pe,Z]),q=s.useMemo(()=>({title1Width:D,title2Width:j,title3Width:P}),[D,j,P]),Y=s.useMemo(()=>h.map(E=>q[E.widthKey]),[h,q]),ee=s.useMemo(()=>El(h.length,Y),[h.length,Y]),ve=s.useMemo(()=>Xu(h.length,Y),[h.length,Y]),B=s.useMemo(()=>h.filter(E=>E.prefix==="title1"),[h]),I=s.useMemo(()=>h.filter(E=>E.prefix==="title2"||E.prefix==="title3"),[h]),Q=s.useMemo(()=>Oc(B,q),[B,q]),ne=s.useMemo(()=>Oc(I,q),[I,q]),H=s.useCallback((E,ae)=>{const ue=h.indexOf(E);if(!le||ae==="single-row")return{effectiveWidth:ve[ue]??0,resolvedWidth:ee[ue]??0,maxWidth:Br(ue,ee)};if(ae==="two-row-top"){const Ue=B.indexOf(E);return{effectiveWidth:Q.effective[Ue]??0,resolvedWidth:Q.resolved[Ue]??0,maxWidth:Br(Ue,Q.resolved)}}const Re=I.indexOf(E);return{effectiveWidth:ne.effective[Re]??0,resolvedWidth:ne.resolved[Re]??0,maxWidth:Br(Re,ne.resolved)}},[I,ne,ve,ee,h,B,Q,le]),te=s.useCallback(E=>F.scalingValue(E,i??!1),[i]),ke=te(L??0),ge=s.useMemo(()=>({title1MarginLeft:M,title2MarginLeft:K,title3MarginLeft:T}),[M,K,T]),J=s.useCallback(E=>h.slice(0,E+1).reduce((ae,ue,Re)=>ae+(ue!=null&&ue.marginLeftKey?ge[ue.marginLeftKey]??0:0)+(ee[Re]??0),0)+(le?0:M??0),[h,ge,ee,le,M]),Ye=s.useCallback(()=>le?0:M??0,[le,M]),je=s.useCallback(E=>I.slice(0,E).reduce((ae,ue,Re)=>ae+(ue.marginLeftKey?ge[ue.marginLeftKey]??0:0)+(ne.resolved[Re]??0),0),[I,ne.resolved,ge]),it=s.useCallback(E=>{const ae=I[E];return je(E)+(ae.marginLeftKey?ge[ae.marginLeftKey]??0:0)+(ne.resolved[E]??0)},[I,ne.resolved,je,ge]),qe=(E,ae)=>{const ue=E.marginLeftKey?ge[E.marginLeftKey]??0:0,{effectiveWidth:Re,resolvedWidth:Ue,maxWidth:dt}=H(E,ae),Rt=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":E.prefix,style:{...ae==="single-row"?{gridArea:E.prefix}:{},width:te(Re),...ue>0?{marginLeft:te(ue)}:{}},children:[a.jsx("p",{className:E.className,style:E.style,children:E.text}),Rt&&E.marginLeftKey&&a.jsx("div",{"data-controls":E.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:te(-ue),width:`max(${te(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:te(-oo/2),width:te(oo),height:"100%",pointerEvents:"auto"}})]},E.className)},et=()=>{const E=le?-1:h.findIndex(Re=>Re.prefix==="title1"),ae=!le&&(o||(M??0)>0)?(()=>{const Re=M??0,Ue=E>=0?ee[E]:D??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(${te(Re)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ue=h.flatMap((Re,Ue)=>{if(!Re.marginLeftKey)return[];const dt=ge[Re.marginLeftKey]??0,Rt=cx(h,ee,ge,Ue)+Ye();return a.jsx("div",{"data-controls":Re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee[Ue]),style:{position:"absolute",top:0,left:te(Rt),width:`max(${te(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Re.marginLeftKey)});return ae?[ae,...ue]:ue},Je=()=>h.map((E,ae)=>{const ue=Br(ae,ee),Ue=J(ae)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),Ge=()=>I.flatMap((E,ae)=>{if(!E.marginLeftKey)return[];const ue=ge[E.marginLeftKey]??0,Re=je(ae),{resolvedWidth:Ue}=H(E,"two-row-bottom");return a.jsx("div",{"data-controls":E.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:te(Re),width:`max(${te(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},E.marginLeftKey)}),$e=()=>I.map((E,ae)=>{const{maxWidth:ue}=H(E,"two-row-bottom"),Ue=it(ae)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),He=s.useRef(null),De=s.useRef(null),Qe=s.useRef(null),he=s.useRef(null),_e=s.useRef([]),Ve=s.useRef([]),tt=s.useRef(0),ft=s.useRef(null),rt=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Fe=s.useRef(null),Ee=s.useRef(0),Ze=s.useRef("forward"),We=s.useRef(0),ot=s.useRef(null),nt=s.useRef(!1),me=t.length>1&&(!o||!!r),Ne=me?3:1,st=s.useMemo(()=>Array.from({length:Ne},()=>t).flat(),[t,Ne]),[ut,Be]=s.useState(!1),[pt,Tt]=s.useState(!1),[Lt,xt]=s.useState(!0),Et=s.useRef(null),Vt=s.useRef(null),Ut=s.useRef(!1),Kt=s.useRef(!1),Pt=s.useRef(null),jt=s.useRef(null),on=Ie&&!Lt,vt=s.useCallback(()=>{Ie&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{rt.current.isActive||xt(!1)},U0))},[Ie]),Le=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,Tt(!1),Pt.current=setTimeout(()=>{l()},ar))},[o,l]),Xe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:F.scalingValue(m??0,i),height:F.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(pn,{url:y,fill:g,hoverFill:i&&!r?g:f,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:ie,height:"100%",pointerEvents:"auto"}})]}),lt=(E="two-row")=>a.jsx("div",{...E==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:te(M??0),flexShrink:0,...E==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...E==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ct=()=>{const E=h.find(Re=>Re.prefix==="title1"),ae=h.filter(Re=>Re.prefix==="title2"||Re.prefix==="title3"),ue=ae.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(M??0)>0||o?lt():null,E&&qe(E,"two-row-top"),y&&Xe()]}),ue?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Re=>qe(Re,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),$e()]})]}):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:ke,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},wt=()=>a.jsxs(a.Fragment,{children:[(M??0)>0||o?lt("single-row"):null,h.map(E=>qe(E,"single-row")),o?a.jsxs(a.Fragment,{children:[et(),Je()]}):null,y?Xe():null]}),It=s.useCallback(E=>!!(E.closest("[data-controls]")||E.closest(`.${e}-thumbnails`)||E.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Ot,mediaAreaStyle:_t,overlayContentStyle:Mt,swipeHandlers:Gt,dismissAreaStyle:Xt}=Vu({enabled:re??!1,onClose:Le,animMs:ar,isBlockedTarget:It}),Dt=()=>{if(!me||t.length===0)return tt.current=0,0;const E=Ve.current[0],ae=Ve.current[t.length];if(!E||!ae)return tt.current;const ue=ae.offsetLeft-E.offsetLeft;return ue>0&&(tt.current=ue),tt.current},zt=(E=!1)=>{if(!me)return;const ae=De.current,ue=Dt();!ae||ue<=0||ue<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=ue,E&&(rt.current.scrollLeft+=ue),nt.current&&(We.current+=ue)):ae.scrollLeft>=ue*2&&(ae.scrollLeft-=ue,E&&(rt.current.scrollLeft-=ue),nt.current&&(We.current-=ue)))},Bt=(E,ae=(ue=>(ue=De.current)==null?void 0:ue.scrollLeft)()??0)=>{if(!me)return E;let Re=t.length+E,Ue=1/0;for(let dt=0;dt<Ne;dt++){const Rt=dt*t.length+E,Ft=Ve.current[Rt];if(!Ft)continue;const rn=Math.abs(Ft.offsetLeft-ae);rn<Ue&&(Ue=rn,Re=Rt)}return Re},bt=E=>{const ae=De.current;return!E||!ae?!1:E.offsetWidth>ae.clientWidth+1},A=E=>{const ae=De.current;if(!E||!ae||!bt(E))return!1;const ue=E.offsetLeft,Re=ue+E.offsetWidth;return ae.scrollLeft>=ue-1&&ae.scrollLeft+ae.clientWidth<=Re+1},Te=(E=(ae=>(ae=De.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Re=0;Re<Ve.current.length;Re+=1){const Ue=Ve.current[Re];if(Ue&&A(Ue))return Re}let ue={flatIndex:0,distance:1/0};return Ve.current.forEach((Re,Ue)=>{if(!Re)return;const dt=Math.abs(Re.offsetLeft-E);dt<ue.distance&&(ue={flatIndex:Ue,distance:dt})}),ue.flatIndex},Ae=E=>{De.current&&Ve.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=bt(ae)&&E==="backward"?"end":"start")})},ze=(E,ae,ue)=>{const Re=E-ae,Ue=Te(ae),dt=Ve.current[Ue];if(A(dt))return Te(E)%t.length;const Rt=Ve.current[Ue+1],Ft=dt?Rt?Rt.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,rn=Ft>0?Re>Ft*Dr?1:Re<-Ft*Dr?-1:0:0;return rn===0?ue:me?(ue+rn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ue+rn))},mt=s.useCallback((E=!1)=>{if(R!=="on"||o)return;const ae=he.current,ue=X.current,Re=_e.current[ue];if(!ae||!Re||ae.scrollWidth<=ae.clientWidth)return;const Ue=ae.scrollLeft,dt=Ue+ae.clientWidth,Rt=Re.offsetLeft,Ft=Rt+Re.offsetWidth;if(Rt>=Ue&&Ft<=dt)return;const rn=ae.scrollWidth-ae.clientWidth;let nn=Ue;if(!E&&Et.current===null){const Fn=_e.current[ue-1],si=_e.current[ue+1],to=Fn?Re.offsetLeft-Fn.offsetLeft:si?si.offsetLeft-Re.offsetLeft:Re.offsetWidth;Ft>dt?nn+=to:Rt<Ue&&(nn-=to)}else Ft>dt?nn=Ft-ae.clientWidth:nn=Rt;ae.scrollLeft=Math.max(0,Math.min(rn,nn))},[o,R]),Nt=s.useCallback((E=!1)=>{E&&(Ut.current=!0),Vt.current===null&&(Vt.current=requestAnimationFrame(()=>{Vt.current=null;const ae=Ut.current;Ut.current=!1,mt(ae)}))},[mt]),ht=s.useCallback(E=>{if(E===X.current)return;const ae=X.current;X.current=E;const ue=Math.abs(E-ae)>1,Re=me&&t.length>1&&(ae===t.length-1&&E===0||ae===0&&E===t.length-1);de(E),Nt(ue||Re)},[t.length,me,Nt]),St=()=>{if(!De.current||t.length===0||Et.current!==null||rt.current.isActive&&rt.current.hasMoved)return;const E=De.current.scrollLeft,ae=Te(E)%t.length;ae!==X.current&&ht(ae)},qt=()=>{Et.current=null},At=E=>{const ae=De.current;ae&&(ae.style.scrollSnapType=E?"":"none")},sn=()=>{var E;(E=Fe.current)==null||E.call(Fe),Fe.current=null},gn=()=>{ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),nt.current=!1},Xn=()=>{const E=De.current;if(!E){ot.current=null,nt.current=!1;return}const ae=We.current-E.scrollLeft;if(Math.abs(ae)<.5){E.scrollLeft=We.current,zt(),St(),ot.current=null,nt.current=!1;return}E.scrollLeft+=ae*Z0,zt(),St(),vt(),ot.current=requestAnimationFrame(Xn)},yn=()=>{const E=Qe.current;E&&(E.style.transition="",E.style.transform="",E.style.willChange="")},qn=(E,ae,ue,Re)=>{yn(),E.scrollLeft=ae,Ee.current=E.scrollLeft,zt(),ue!==void 0?(X.current=ue,de(ue)):St(),At(!0),Re==null||Re()},ki=(E,{behavior:ae="smooth",activeIndex:ue,onComplete:Re}={})=>{const Ue=De.current,dt=Qe.current;if(!Ue||!dt)return;if(gn(),sn(),At(!1),ae==="auto"){qn(Ue,E,ue,Re);return}const Rt=Math.abs(E-Ue.scrollLeft),Ft=z0(Rt,G0,X0,Ue.clientWidth*.55);Fe.current=V0(Ue,dt,E,{duration:Ft,easing:q0,onComplete:()=>{Fe.current=null,qn(Ue,E,ue,Re)}})},Ji=(E="smooth")=>{const ae=De.current;if(!ae||t.length===0)return;const ue=Te()%t.length,Re=Bt(ue,ae.scrollLeft),Ue=Ve.current[Re];Ue&&ki(Ue.offsetLeft,{behavior:E,activeIndex:ue})},Go=(E,ae="smooth",ue,Re)=>{const Ue=De.current;if(!Ue||t.length===0)return;const dt=(Re??Ue.scrollLeft)-E,Rt=Te(E),Ft=Ve.current[Rt];if(A(Ft)){At(!0),St();return}const rn=Ve.current[Rt+1],nn=Ft?rn?rn.offsetLeft-Ft.offsetLeft:Ft.offsetWidth:0;if((nn>0?dt>nn*Dr?1:dt<-nn*Dr?-1:0:0)!==0){const Pr=ue??Rt%t.length,_a=ze(Re??Ue.scrollLeft,E,Pr);un(_a,ae);return}const si=Re??Ue.scrollLeft,to=Te(si),Ei=Ve.current[to];if(Ei&&Math.abs(Ei.offsetLeft-si)<1){At(!0),St();return}Ji("auto")},un=(E,ae="smooth")=>{const ue=De.current;if(!ue||t.length===0)return;const Re=Bt(E,ue.scrollLeft),Ue=Ve.current[Re];Ue&&(ae==="smooth"?Et.current=E:Et.current=null,X.current=E,de(E),Nt(!0),ki(Ue.offsetLeft,{behavior:ae,activeIndex:E,onComplete:ae==="smooth"?qt:void 0}))},An=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},Rn=(E,ae,ue,Re,Ue)=>{const dt=ue-E,Rt=Re-ae,Ft=Math.abs(dt),rn=Math.abs(Rt);if(Ft<Q0||Ft<=rn)return!1;const nn=dt<0?1:-1,Fn=me?(Ue+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+nn));return Fn===Ue?!1:(un(Fn),!0)},Un=E=>{if(!rt.current.isActive)return;An();const ae=De.current;if(!ae)return;const{scrollLeft:ue,startActiveIndex:Re,hasMoved:Ue}=rt.current,dt=ae.scrollLeft;zt(!0),rt.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Be(!1),E!==void 0&&ae.hasPointerCapture(E)&&ae.releasePointerCapture(E),Ue?Go(ue,"smooth",Re,dt):(At(!0),St()),vt()},Qi=(E,ae)=>{const ue=ft.current;ft.current=null,ue&&(Rn(ue.startX,ue.startY,E,ae,ue.startActiveIndex),vt())},Xo=E=>{if(!we)return;if(E.pointerType==="touch"){if(gn(),At(!0),It(E.target))return;ft.current={startX:E.clientX,startY:E.clientY,startActiveIndex:X.current};return}if(E.pointerType!=="mouse"||E.button!==0||It(E.target))return;const ae=De.current;if(!ae)return;gn(),sn(),yn(),Et.current=null,rt.current={isActive:!0,startX:E.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:X.current,hasMoved:!1},At(!1),vt(),ae.setPointerCapture(E.pointerId),An();const ue=Re=>{Re.pointerType==="mouse"&&Un(Re.pointerId)};Oe.current=ue,window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ue)},eo=E=>{if(!we||E.pointerType!=="mouse")return;const ae=De.current;if(!ae||!rt.current.isActive)return;if(E.buttons===0){Un(E.pointerId);return}const ue=E.clientX-rt.current.startX;Math.abs(ue)>J0&&(rt.current.hasMoved=!0,Be(!0)),rt.current.hasMoved&&(E.preventDefault(),ae.scrollLeft=rt.current.scrollLeft-ue,zt(!0),St(),vt())},Se=E=>{if(we){if(E.pointerType==="touch"){E.type==="pointerup"?Qi(E.clientX,E.clientY):ft.current=null;return}E.pointerType==="mouse"&&Un(E.pointerId)}},Ke=E=>{!we||E.pointerType!=="mouse"||Un(E.pointerId)};return Gu(),s.useEffect(()=>{const E=requestAnimationFrame(()=>Tt(!0));return()=>{cancelAnimationFrame(E),sn(),An(),Vt.current!==null&&(cancelAnimationFrame(Vt.current),Vt.current=null),Pt.current&&clearTimeout(Pt.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Ie){xt(!0);return}vt();const E=()=>vt();return document.addEventListener("pointermove",E,{passive:!0}),document.addEventListener("pointerdown",E,{passive:!0}),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerdown",E),jt.current&&clearTimeout(jt.current)}},[Ie,vt]),s.useEffect(()=>{const E=ae=>{ae.key==="Escape"&&Le()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[Le]),s.useLayoutEffect(()=>{Dt()},[O,t.length,me]),s.useLayoutEffect(()=>{o||un(X.current,"auto")},[O,o]),s.useLayoutEffect(()=>{un(0,"auto")},[t.length,me]),s.useEffect(()=>{const E=De.current;if(!E||o||!re)return;const ae=ue=>{if(ue.preventDefault(),Math.abs(ue.deltaY)<=Math.abs(ue.deltaX))return;const Re=ue.deltaMode===1?K0:ue.deltaMode===2?E.clientHeight:1,Ue=ue.deltaY*Re*Y0;if(Ue!==0){if(sn(),nt.current||(nt.current=!0,We.current=E.scrollLeft,Et.current=null,At(!1)),We.current+=Ue,!me){const dt=E.scrollWidth-E.clientWidth;We.current=Math.max(0,Math.min(dt,We.current))}vt(),ot.current===null&&(ot.current=requestAnimationFrame(Xn))}};return E.addEventListener("wheel",ae,{passive:!1}),()=>{E.removeEventListener("wheel",ae),gn()}},[o,re,me]),s.useEffect(()=>{const E=De.current;if(!E)return;const ae=()=>{zt(rt.current.isActive);const Re=E.scrollLeft,Ue=Re-Ee.current;Ee.current=Re;const dt=tt.current>0?tt.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<dt){const Rt=Ue>0?"forward":"backward";Rt!==Ze.current&&(Ze.current=Rt,Ae(Rt))}rt.current.isActive&&rt.current.hasMoved||St()};E.addEventListener("scroll",ae,{passive:!0});const ue=new ResizeObserver(()=>{Dt(),zt(rt.current.isActive),Ae(Ze.current),St()});return ue.observe(E),()=>{sn(),E.removeEventListener("scroll",ae),ue.disconnect()}},[t.length,me]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:pt?1:0,transition:`opacity ${ar}ms ease`,pointerEvents:pt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Xt,...Gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:E=>E.stopPropagation(),children:a.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":ut?"true":"false",onPointerDown:Xo,onPointerMove:eo,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:O},children:st.map((E,ae)=>{const ue=E.image.objectFit??"contain",Re=ae%t.length,Ue=Math.floor(ae/t.length),dt=zr(O),Rt=`calc(-0.5 * (${dt} + ${O}))`;return a.jsxs("div",{ref:Ft=>Ve.current[ae]=Ft,className:`${e}-strip-item`,style:{height:_==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:E.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ue}}),o&&Re<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${E.image.url}-${Re}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:se,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${le?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||y)&&a.jsx("div",{className:`${e}-header ${le?`${e}-header-two-row`:`${e}-header-single-row`}`,children:le?ct():Ce||y?wt():null})})})]}),t.length>1&&R==="on"&&(()=>{const E=zr(C),ae=`calc(-0.5 * (${C} + ${E}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:C},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ue=>ue.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":S,style:{gap:U,"--thumbnail-active-color":G},children:[t.map((ue,Re)=>{const Ue=zr(U),dt=`calc(-0.5 * (${Ue} + ${U}))`;return a.jsxs("div",{ref:Rt=>{_e.current[Re]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":N===Re?"true":"false",onClick:()=>re&&x==="click"&&un(Re),onMouseEnter:()=>Me&&x==="hover"&&un(Re),"aria-label":ue.image.name?`View ${ue.image.name}`:`View image ${Re+1}`,"aria-current":N===Re?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ye?` ${e}-thumb-image-cover`:""}`,src:ue.image.url,alt:"",draggable:!1,style:{...be,maxWidth:w,maxHeight:w,width:b.display==="cover"?"auto":"100%",height:"auto",objectFit:b.display==="cover"?"cover":"contain"}})}),o&&Re<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:dt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ue.image.url}-${Re}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:E,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ux(e){return`
14318
+ `;function pi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const _c={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_0=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],W0={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:{..._c.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:{..._c.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:[..._0],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},H0={element:F0,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:W0,sourceCode:N0},oi=e=>e.display==="cover",Fa=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},Wc=100,O0=.2,Hc=8,Vu=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,r]=s.useState(0),[l,d]=s.useState(!1),c=s.useRef(null),u=s.useRef(0);u.current=o;const p=s.useMemo(()=>typeof window>"u"?Wc:Math.max(Wc,window.innerHeight*O0),[]),v=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),y=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),m=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,O=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${O})`},[]),g=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),P=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),b=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const O=$.clientX-I.startX,_=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(O)<Hc&&Math.abs(_)<Hc)return;if(_>0&&_>Math.abs(O))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,g();return}}if(!I.isLocked)return;$.preventDefault();const C=Math.max(0,_);u.current=C,r(C)},[e,g]),w=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const O=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!O){g();return}$.clientY-I.startY>=p?x():f()},[p,x,e,g,f]),j=s.useCallback($=>{w($)},[w]),H=s.useCallback($=>{w($)},[w]),B=o>0,k=l?`transform ${n}ms ease`:"none",W=l?`opacity ${n}ms ease`:"none",U=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:v(o),transition:W},mediaAreaStyle:{transform:m(o),transition:k,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:U?{opacity:y(o),transition:W}:void 0,swipeHandlers:e?{onPointerDown:P,onPointerMove:b,onPointerUp:j,onPointerCancel:H}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},D0="[data-lightbox-scrollable]",Gu=()=>{s.useEffect(()=>{const e=window.scrollY,t=document.body.style.overflow,n=document.body.style.position,i=document.body.style.top,o=document.body.style.width,r=document.documentElement.style.overflow;document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e}px`,document.body.style.width="100%",document.documentElement.style.overflow="hidden";const l=d=>{const c=d.target;c instanceof Element&&c.closest(D0)||d.preventDefault()};return document.addEventListener("touchmove",l,{passive:!1}),()=>{document.removeEventListener("touchmove",l),document.body.style.overflow=t,document.body.style.position=n,document.body.style.top=i,document.body.style.width=o,document.documentElement.style.overflow=r,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},z0=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},B0=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},j0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},V0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,f)=>{B0(t),e.scrollLeft=g,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",m),clearTimeout(v)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,y(),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(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-j0(t),!1))}},ar=300,G0=900,X0=1500,q0="cubic-bezier(0.16, 1, 0.3, 1)",U0=3e3,Y0=2,K0=16,Z0=.05,J0=1,Dr=.3,Q0=50,ex=20,oo=.004,Fo=["title1","title2","title3"],tx={title1:"1",title2:"2",title3:"3"},nx={title1:"title1Color",title2:"title2Color",title3:"title3Color"},ix={title1:.02,title2:.02,title3:.02},zr=e=>`max(${e}, ${ex}px)`,ox=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]}},rx=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=ox(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ax=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")],sx=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Fo.map(e=>[tx[e],ax(e)]))}),El=(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},d)=>{if(r<=0||d<=0)return{overflow:r,widths:[d,...l]};const c=Math.min(r,d);return{overflow:r-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Xu=(e,t)=>El(e,t),Br=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Oc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:El(e.length,n),effective:Xu(e.length,n)}},lx=(e,t,n,i,o,r,l)=>{const d=[];return t&&d.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:o,text:t}),n&&d.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:r,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},is=(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[nx[t]]}},cx=(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),os=(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??ix[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Qt(i,n)},dx=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:P,thumbnailObjectFit:b,thumbnailActive:w,thumbnailActiveColor:j,title1Width:H,title2Width:B,title3Width:k,title1MarginLeft:W=0,title2MarginLeft:U=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:O="desktop",contentMarginTop:_,iconMarginLeft:C}=n,L=E=>F.scalingValue(E,i??!1),D=c??n.thumnailSize??.03,S=L(D),K=L(u),T=L(p??.02),N=L(v??0),V=L(_??0),ae=zr(V),ie=L(C??0),[M,de]=s.useState(0),X=s.useRef(M);X.current=M;const le=t[M],{title1:ne,title2:he,title3:ke}=rx(le),ye=os("title1",is(n,"title1"),i),pe=os("title2",is(n,"title2"),i),Z=os("title3",is(n,"title3"),i),se=O==="mobile",oe=!o&&(!i||r),Re=oe,$e=oe,Me=oe,ve=oi(b),Se=ve?{"--image-aspect-ratio":Fa(b)}:void 0,Ce=!!(ne||he||ke),h=s.useMemo(()=>lx(e,ne,he,ke,ye,pe,Z),[e,M,ne,he,ke,ye,pe,Z]),q=s.useMemo(()=>({title1Width:H,title2Width:B,title3Width:k}),[H,B,k]),Y=s.useMemo(()=>h.map(E=>q[E.widthKey]),[h,q]),ee=s.useMemo(()=>El(h.length,Y),[h.length,Y]),fe=s.useMemo(()=>Xu(h.length,Y),[h.length,Y]),z=s.useMemo(()=>h.filter(E=>E.prefix==="title1"),[h]),R=s.useMemo(()=>h.filter(E=>E.prefix==="title2"||E.prefix==="title3"),[h]),Q=s.useMemo(()=>Oc(z,q),[z,q]),te=s.useMemo(()=>Oc(R,q),[R,q]),ce=s.useCallback((E,re)=>{const ue=h.indexOf(E);if(!se||re==="single-row")return{effectiveWidth:fe[ue]??0,resolvedWidth:ee[ue]??0,maxWidth:Br(ue,ee)};if(re==="two-row-top"){const Ue=z.indexOf(E);return{effectiveWidth:Q.effective[Ue]??0,resolvedWidth:Q.resolved[Ue]??0,maxWidth:Br(Ue,Q.resolved)}}const Pe=R.indexOf(E);return{effectiveWidth:te.effective[Pe]??0,resolvedWidth:te.resolved[Pe]??0,maxWidth:Br(Pe,te.resolved)}},[R,te,fe,ee,h,z,Q,se]),G=s.useCallback(E=>F.scalingValue(E,i??!1),[i]),Ie=G(I??0),xe=s.useMemo(()=>({title1MarginLeft:W,title2MarginLeft:U,title3MarginLeft:$}),[W,U,$]),J=s.useCallback(E=>h.slice(0,E+1).reduce((re,ue,Pe)=>re+(ue!=null&&ue.marginLeftKey?xe[ue.marginLeftKey]??0:0)+(ee[Pe]??0),0)+(se?0:W??0),[h,xe,ee,se,W]),He=s.useCallback(()=>se?0:W??0,[se,W]),je=s.useCallback(E=>R.slice(0,E).reduce((re,ue,Pe)=>re+(ue.marginLeftKey?xe[ue.marginLeftKey]??0:0)+(te.resolved[Pe]??0),0),[R,te.resolved,xe]),ct=s.useCallback(E=>{const re=R[E];return je(E)+(re.marginLeftKey?xe[re.marginLeftKey]??0:0)+(te.resolved[E]??0)},[R,te.resolved,je,xe]),Ve=(E,re)=>{const ue=E.marginLeftKey?xe[E.marginLeftKey]??0:0,{effectiveWidth:Pe,resolvedWidth:Ue,maxWidth:dt}=ce(E,re),Rt=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":E.prefix,style:{...re==="single-row"?{gridArea:E.prefix}:{},width:G(Pe),...ue>0?{marginLeft:G(ue)}:{}},children:[a.jsx("p",{className:E.className,style:E.style,children:E.text}),Rt&&E.marginLeftKey&&a.jsx("div",{"data-controls":E.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:G(-ue),width:`max(${G(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-oo/2),width:G(oo),height:"100%",pointerEvents:"auto"}})]},E.className)},et=()=>{const E=se?-1:h.findIndex(Pe=>Pe.prefix==="title1"),re=!se&&(o||(W??0)>0)?(()=>{const Pe=W??0,Ue=E>=0?ee[E]:H??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(${G(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ue=h.flatMap((Pe,Ue)=>{if(!Pe.marginLeftKey)return[];const dt=xe[Pe.marginLeftKey]??0,Rt=cx(h,ee,xe,Ue)+He();return a.jsx("div",{"data-controls":Pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee[Ue]),style:{position:"absolute",top:0,left:G(Rt),width:`max(${G(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Pe.marginLeftKey)});return re?[re,...ue]:ue},Ze=()=>h.map((E,re)=>{const ue=Br(re,ee),Ue=J(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(Ue),width:G(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),Ye=()=>R.flatMap((E,re)=>{if(!E.marginLeftKey)return[];const ue=xe[E.marginLeftKey]??0,Pe=je(re),{resolvedWidth:Ue}=ce(E,"two-row-bottom");return a.jsx("div",{"data-controls":E.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:G(Pe),width:`max(${G(ue)}, 10px)`,height:"100%",pointerEvents:"auto"}},E.marginLeftKey)}),be=()=>R.map((E,re)=>{const{maxWidth:ue}=ce(E,"two-row-bottom"),Ue=ct(re)-oo/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":E.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(Ue),width:G(oo),height:"100%",pointerEvents:"auto"}})},`${E.widthKey}-junction`)}),Oe=s.useRef(null),ze=s.useRef(null),Qe=s.useRef(null),ge=s.useRef(null),_e=s.useRef([]),Xe=s.useRef([]),tt=s.useRef(0),ft=s.useRef(null),ot=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),De=s.useRef(null),Fe=s.useRef(null),Ee=s.useRef(0),Je=s.useRef("forward"),We=s.useRef(0),it=s.useRef(null),nt=s.useRef(!1),me=t.length>1&&(!o||!!r),Ne=me?3:1,at=s.useMemo(()=>Array.from({length:Ne},()=>t).flat(),[t,Ne]),[ut,Ge]=s.useState(!1),[pt,Tt]=s.useState(!1),[Lt,xt]=s.useState(!0),Et=s.useRef(null),Vt=s.useRef(null),Ut=s.useRef(!1),Kt=s.useRef(!1),Pt=s.useRef(null),jt=s.useRef(null),on=Re&&!Lt,vt=s.useCallback(()=>{Re&&(xt(!0),jt.current&&clearTimeout(jt.current),jt.current=setTimeout(()=>{ot.current.isActive||xt(!1)},U0))},[Re]),Le=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,Tt(!1),Pt.current=setTimeout(()=>{l()},ar))},[o,l]),qe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":on?"true":"false",style:{width:F.scalingValue(m??0,i),height:F.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(pn,{url:y,fill:g,hoverFill:i&&!r?g:f,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:ie,height:"100%",pointerEvents:"auto"}})]}),st=(E="two-row")=>a.jsx("div",{...E==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:G(W??0),flexShrink:0,...E==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...E==="two-row"&&o?{pointerEvents:"auto"}:{}}}),lt=()=>{const E=h.find(Pe=>Pe.prefix==="title1"),re=h.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),ue=re.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(W??0)>0||o?st():null,E&&Ve(E,"two-row-top"),y&&qe()]}),ue?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(Pe=>Ve(Pe,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ye(),be()]})]}):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]})},wt=()=>a.jsxs(a.Fragment,{children:[(W??0)>0||o?st("single-row"):null,h.map(E=>Ve(E,"single-row")),o?a.jsxs(a.Fragment,{children:[et(),Ze()]}):null,y?qe():null]}),It=s.useCallback(E=>!!(E.closest("[data-controls]")||E.closest(`.${e}-thumbnails`)||E.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Ot,mediaAreaStyle:_t,overlayContentStyle:Mt,swipeHandlers:Gt,dismissAreaStyle:Xt}=Vu({enabled:oe??!1,onClose:Le,animMs:ar,isBlockedTarget:It}),Dt=()=>{if(!me||t.length===0)return tt.current=0,0;const E=Xe.current[0],re=Xe.current[t.length];if(!E||!re)return tt.current;const ue=re.offsetLeft-E.offsetLeft;return ue>0&&(tt.current=ue),tt.current},zt=(E=!1)=>{if(!me)return;const re=ze.current,ue=Dt();!re||ue<=0||ue<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=ue,E&&(ot.current.scrollLeft+=ue),nt.current&&(We.current+=ue)):re.scrollLeft>=ue*2&&(re.scrollLeft-=ue,E&&(ot.current.scrollLeft-=ue),nt.current&&(We.current-=ue)))},Bt=(E,re=(ue=>(ue=ze.current)==null?void 0:ue.scrollLeft)()??0)=>{if(!me)return E;let Pe=t.length+E,Ue=1/0;for(let dt=0;dt<Ne;dt++){const Rt=dt*t.length+E,Ft=Xe.current[Rt];if(!Ft)continue;const rn=Math.abs(Ft.offsetLeft-re);rn<Ue&&(Ue=rn,Pe=Rt)}return Pe},bt=E=>{const re=ze.current;return!E||!re?!1:E.offsetWidth>re.clientWidth+1},A=E=>{const re=ze.current;if(!E||!re||!bt(E))return!1;const ue=E.offsetLeft,Pe=ue+E.offsetWidth;return re.scrollLeft>=ue-1&&re.scrollLeft+re.clientWidth<=Pe+1},Te=(E=(re=>(re=ze.current)==null?void 0:re.scrollLeft)()??0)=>{for(let Pe=0;Pe<Xe.current.length;Pe+=1){const Ue=Xe.current[Pe];if(Ue&&A(Ue))return Pe}let ue={flatIndex:0,distance:1/0};return Xe.current.forEach((Pe,Ue)=>{if(!Pe)return;const dt=Math.abs(Pe.offsetLeft-E);dt<ue.distance&&(ue={flatIndex:Ue,distance:dt})}),ue.flatIndex},Ae=E=>{ze.current&&Xe.current.forEach(re=>{re&&(re.style.scrollSnapAlign=bt(re)&&E==="backward"?"end":"start")})},Be=(E,re,ue)=>{const Pe=E-re,Ue=Te(re),dt=Xe.current[Ue];if(A(dt))return Te(E)%t.length;const Rt=Xe.current[Ue+1],Ft=dt?Rt?Rt.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,rn=Ft>0?Pe>Ft*Dr?1:Pe<-Ft*Dr?-1:0:0;return rn===0?ue:me?(ue+rn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ue+rn))},mt=s.useCallback((E=!1)=>{if(P!=="on"||o)return;const re=ge.current,ue=X.current,Pe=_e.current[ue];if(!re||!Pe||re.scrollWidth<=re.clientWidth)return;const Ue=re.scrollLeft,dt=Ue+re.clientWidth,Rt=Pe.offsetLeft,Ft=Rt+Pe.offsetWidth;if(Rt>=Ue&&Ft<=dt)return;const rn=re.scrollWidth-re.clientWidth;let nn=Ue;if(!E&&Et.current===null){const Fn=_e.current[ue-1],li=_e.current[ue+1],to=Fn?Pe.offsetLeft-Fn.offsetLeft:li?li.offsetLeft-Pe.offsetLeft:Pe.offsetWidth;Ft>dt?nn+=to:Rt<Ue&&(nn-=to)}else Ft>dt?nn=Ft-re.clientWidth:nn=Rt;re.scrollLeft=Math.max(0,Math.min(rn,nn))},[o,P]),Nt=s.useCallback((E=!1)=>{E&&(Ut.current=!0),Vt.current===null&&(Vt.current=requestAnimationFrame(()=>{Vt.current=null;const re=Ut.current;Ut.current=!1,mt(re)}))},[mt]),ht=s.useCallback(E=>{if(E===X.current)return;const re=X.current;X.current=E;const ue=Math.abs(E-re)>1,Pe=me&&t.length>1&&(re===t.length-1&&E===0||re===0&&E===t.length-1);de(E),Nt(ue||Pe)},[t.length,me,Nt]),St=()=>{if(!ze.current||t.length===0||Et.current!==null||ot.current.isActive&&ot.current.hasMoved)return;const E=ze.current.scrollLeft,re=Te(E)%t.length;re!==X.current&&ht(re)},qt=()=>{Et.current=null},At=E=>{const re=ze.current;re&&(re.style.scrollSnapType=E?"":"none")},sn=()=>{var E;(E=Fe.current)==null||E.call(Fe),Fe.current=null},gn=()=>{it.current!==null&&(cancelAnimationFrame(it.current),it.current=null),nt.current=!1},Xn=()=>{const E=ze.current;if(!E){it.current=null,nt.current=!1;return}const re=We.current-E.scrollLeft;if(Math.abs(re)<.5){E.scrollLeft=We.current,zt(),St(),it.current=null,nt.current=!1;return}E.scrollLeft+=re*Z0,zt(),St(),vt(),it.current=requestAnimationFrame(Xn)},yn=()=>{const E=Qe.current;E&&(E.style.transition="",E.style.transform="",E.style.willChange="")},qn=(E,re,ue,Pe)=>{yn(),E.scrollLeft=re,Ee.current=E.scrollLeft,zt(),ue!==void 0?(X.current=ue,de(ue)):St(),At(!0),Pe==null||Pe()},ki=(E,{behavior:re="smooth",activeIndex:ue,onComplete:Pe}={})=>{const Ue=ze.current,dt=Qe.current;if(!Ue||!dt)return;if(gn(),sn(),At(!1),re==="auto"){qn(Ue,E,ue,Pe);return}const Rt=Math.abs(E-Ue.scrollLeft),Ft=z0(Rt,G0,X0,Ue.clientWidth*.55);Fe.current=V0(Ue,dt,E,{duration:Ft,easing:q0,onComplete:()=>{Fe.current=null,qn(Ue,E,ue,Pe)}})},Ji=(E="smooth")=>{const re=ze.current;if(!re||t.length===0)return;const ue=Te()%t.length,Pe=Bt(ue,re.scrollLeft),Ue=Xe.current[Pe];Ue&&ki(Ue.offsetLeft,{behavior:E,activeIndex:ue})},Go=(E,re="smooth",ue,Pe)=>{const Ue=ze.current;if(!Ue||t.length===0)return;const dt=(Pe??Ue.scrollLeft)-E,Rt=Te(E),Ft=Xe.current[Rt];if(A(Ft)){At(!0),St();return}const rn=Xe.current[Rt+1],nn=Ft?rn?rn.offsetLeft-Ft.offsetLeft:Ft.offsetWidth:0;if((nn>0?dt>nn*Dr?1:dt<-nn*Dr?-1:0:0)!==0){const Pr=ue??Rt%t.length,_a=Be(Pe??Ue.scrollLeft,E,Pr);un(_a,re);return}const li=Pe??Ue.scrollLeft,to=Te(li),Ei=Xe.current[to];if(Ei&&Math.abs(Ei.offsetLeft-li)<1){At(!0),St();return}Ji("auto")},un=(E,re="smooth")=>{const ue=ze.current;if(!ue||t.length===0)return;const Pe=Bt(E,ue.scrollLeft),Ue=Xe.current[Pe];Ue&&(re==="smooth"?Et.current=E:Et.current=null,X.current=E,de(E),Nt(!0),ki(Ue.offsetLeft,{behavior:re,activeIndex:E,onComplete:re==="smooth"?qt:void 0}))},An=()=>{De.current&&(window.removeEventListener("pointerup",De.current),window.removeEventListener("pointercancel",De.current),De.current=null)},Rn=(E,re,ue,Pe,Ue)=>{const dt=ue-E,Rt=Pe-re,Ft=Math.abs(dt),rn=Math.abs(Rt);if(Ft<Q0||Ft<=rn)return!1;const nn=dt<0?1:-1,Fn=me?(Ue+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+nn));return Fn===Ue?!1:(un(Fn),!0)},Un=E=>{if(!ot.current.isActive)return;An();const re=ze.current;if(!re)return;const{scrollLeft:ue,startActiveIndex:Pe,hasMoved:Ue}=ot.current,dt=re.scrollLeft;zt(!0),ot.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ge(!1),E!==void 0&&re.hasPointerCapture(E)&&re.releasePointerCapture(E),Ue?Go(ue,"smooth",Pe,dt):(At(!0),St()),vt()},Qi=(E,re)=>{const ue=ft.current;ft.current=null,ue&&(Rn(ue.startX,ue.startY,E,re,ue.startActiveIndex),vt())},Xo=E=>{if(!$e)return;if(E.pointerType==="touch"){if(gn(),At(!0),It(E.target))return;ft.current={startX:E.clientX,startY:E.clientY,startActiveIndex:X.current};return}if(E.pointerType!=="mouse"||E.button!==0||It(E.target))return;const re=ze.current;if(!re)return;gn(),sn(),yn(),Et.current=null,ot.current={isActive:!0,startX:E.clientX,scrollLeft:re.scrollLeft,startActiveIndex:X.current,hasMoved:!1},At(!1),vt(),re.setPointerCapture(E.pointerId),An();const ue=Pe=>{Pe.pointerType==="mouse"&&Un(Pe.pointerId)};De.current=ue,window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ue)},eo=E=>{if(!$e||E.pointerType!=="mouse")return;const re=ze.current;if(!re||!ot.current.isActive)return;if(E.buttons===0){Un(E.pointerId);return}const ue=E.clientX-ot.current.startX;Math.abs(ue)>J0&&(ot.current.hasMoved=!0,Ge(!0)),ot.current.hasMoved&&(E.preventDefault(),re.scrollLeft=ot.current.scrollLeft-ue,zt(!0),St(),vt())},we=E=>{if($e){if(E.pointerType==="touch"){E.type==="pointerup"?Qi(E.clientX,E.clientY):ft.current=null;return}E.pointerType==="mouse"&&Un(E.pointerId)}},Ke=E=>{!$e||E.pointerType!=="mouse"||Un(E.pointerId)};return Gu(),s.useEffect(()=>{const E=requestAnimationFrame(()=>Tt(!0));return()=>{cancelAnimationFrame(E),sn(),An(),Vt.current!==null&&(cancelAnimationFrame(Vt.current),Vt.current=null),Pt.current&&clearTimeout(Pt.current),jt.current&&clearTimeout(jt.current)}},[]),s.useEffect(()=>{if(!Re){xt(!0);return}vt();const E=()=>vt();return document.addEventListener("pointermove",E,{passive:!0}),document.addEventListener("pointerdown",E,{passive:!0}),()=>{document.removeEventListener("pointermove",E),document.removeEventListener("pointerdown",E),jt.current&&clearTimeout(jt.current)}},[Re,vt]),s.useEffect(()=>{const E=re=>{re.key==="Escape"&&Le()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[Le]),s.useLayoutEffect(()=>{Dt()},[N,t.length,me]),s.useLayoutEffect(()=>{o||un(X.current,"auto")},[N,o]),s.useLayoutEffect(()=>{un(0,"auto")},[t.length,me]),s.useEffect(()=>{const E=ze.current;if(!E||o||!oe)return;const re=ue=>{if(ue.preventDefault(),Math.abs(ue.deltaY)<=Math.abs(ue.deltaX))return;const Pe=ue.deltaMode===1?K0:ue.deltaMode===2?E.clientHeight:1,Ue=ue.deltaY*Pe*Y0;if(Ue!==0){if(sn(),nt.current||(nt.current=!0,We.current=E.scrollLeft,Et.current=null,At(!1)),We.current+=Ue,!me){const dt=E.scrollWidth-E.clientWidth;We.current=Math.max(0,Math.min(dt,We.current))}vt(),it.current===null&&(it.current=requestAnimationFrame(Xn))}};return E.addEventListener("wheel",re,{passive:!1}),()=>{E.removeEventListener("wheel",re),gn()}},[o,oe,me]),s.useEffect(()=>{const E=ze.current;if(!E)return;const re=()=>{zt(ot.current.isActive);const Pe=E.scrollLeft,Ue=Pe-Ee.current;Ee.current=Pe;const dt=tt.current>0?tt.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<dt){const Rt=Ue>0?"forward":"backward";Rt!==Je.current&&(Je.current=Rt,Ae(Rt))}ot.current.isActive&&ot.current.hasMoved||St()};E.addEventListener("scroll",re,{passive:!0});const ue=new ResizeObserver(()=>{Dt(),zt(ot.current.isActive),Ae(Je.current),St()});return ue.observe(E),()=>{sn(),E.removeEventListener("scroll",re),ue.disconnect()}},[t.length,me]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:pt?1:0,transition:`opacity ${ar}ms ease`,pointerEvents:pt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Ot}}),a.jsxs("div",{ref:Oe,className:`${e}-lightbox-dismiss-area`,style:Xt,...Gt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:E=>E.stopPropagation(),children:a.jsx("div",{ref:ze,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":ut?"true":"false",onPointerDown:Xo,onPointerMove:eo,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:N},children:at.map((E,re)=>{const ue=E.image.objectFit??"contain",Pe=re%t.length,Ue=Math.floor(re/t.length),dt=zr(N),Rt=`calc(-0.5 * (${dt} + ${N}))`;return a.jsxs("div",{ref:Ft=>Xe.current[re]=Ft,className:`${e}-strip-item`,style:{height:O==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:E.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ue}}),o&&Pe<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${E.image.url}-${Pe}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":on?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:V,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ae,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||y)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?lt():Ce||y?wt():null})})})]}),t.length>1&&P==="on"&&(()=>{const E=zr(T),re=`calc(-0.5 * (${T} + ${E}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:T},children:a.jsx("div",{ref:ge,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ue=>ue.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:K,"--thumbnail-active-color":j},children:[t.map((ue,Pe)=>{const Ue=zr(K),dt=`calc(-0.5 * (${Ue} + ${K}))`;return a.jsxs("div",{ref:Rt=>{_e.current[Pe]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":M===Pe?"true":"false",onClick:()=>oe&&x==="click"&&un(Pe),onMouseEnter:()=>Me&&x==="hover"&&un(Pe),"aria-label":ue.image.name?`View ${ue.image.name}`:`View image ${Pe+1}`,"aria-current":M===Pe?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ve?` ${e}-thumb-image-cover`:""}`,src:ue.image.url,alt:"",draggable:!1,style:{...Se,maxWidth:S,maxHeight:S,width:b.display==="cover"?"auto":"100%",height:"auto",objectFit:b.display==="cover"?"cover":"contain"}})}),o&&Pe<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:dt,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ue.image.url}-${Pe}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:E,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function ux(e){return`
14319
14319
  .${e}-wrapper {
14320
14320
  position: relative;
14321
14321
  width: 100%;
@@ -14700,7 +14700,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
14700
14700
  pointer-events: auto;
14701
14701
  z-index: 10;
14702
14702
  }
14703
- `}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=F.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,v]=s.useState(!1),y=t??[],m=p&&y.length>0,g=()=>{y.length!==0&&v(!0)};return s.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ux(l)}}),d&&a.jsx("div",{className:`${l}-cover ${ii(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...ii(c)?{"--image-aspect-ratio":Fa(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${ii(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return ai.createPortal(a.jsx(dx,{prefix:l,images:y,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),f)})()]})},mx=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14703
+ `}const px=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=F.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,v]=s.useState(!1),y=t??[],m=p&&y.length>0,g=()=>{y.length!==0&&v(!0)};return s.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ux(l)}}),d&&a.jsx("div",{className:`${l}-cover ${oi(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...oi(c)?{"--image-aspect-ratio":Fa(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${oi(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx(dx,{prefix:l,images:y,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),f)})()]})},mx=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
14704
14704
  import { createPortal } from 'react-dom';
14705
14705
  import { CommonComponentProps } from '../props';
14706
14706
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -15246,7 +15246,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15246
15246
  </>
15247
15247
  );
15248
15248
  };
15249
- `,gx="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),Wi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function hx(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")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const fx=Fo.reduce((e,t)=>({...e,...hx(t)}),{}),yx=Fo.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 rs(e){return Fo.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 vx=sx(),xx={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"}},...fx,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:gx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...yx},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,...rs({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,...rs({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,...rs({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:[vx]}],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"}]}},bx={element:px,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:xx,sourceCode:mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Sx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:m,imageGap:g,maxWidth:f,maxHeight:x,textTransition:R,title1Width:b,title2Width:S,title3Width:G,title1MarginLeft:D=0,title2MarginLeft:j=0,title3MarginLeft:P=0,titleRowMarginBottom:M=0,titleHeaderLayout:K="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:_,closeIconColor:z,closeIconHoverColor:$,contentMarginTop:k=0,iconMarginRight:W=0}=n,w=s.useCallback(Se=>F.scalingValue(Se,i??!1),[i]),U=w(g??0),C=`${f}%`,O=`${x}%`,V=w(T),se=w(k),ie=w(W),N=ji("title1",Bi(n,"title1"),i),de=ji("title2",Bi(n,"title2"),i),X=ji("title3",Bi(n,"title3"),i),ce=ji("count",Bi(n,"count"),i),oe=K==="mobile",fe=!i||!!r,Pe=!o&&(!i||!!r),xe=s.useMemo(()=>oa(t,v),[t,v]),[pe,Z]=s.useState(l),le=xe[pe],re=le==null?void 0:le.entry,[Ie,we]=s.useState(!1),[Me,ye]=s.useState(null),[be,Ce]=s.useState(!1),[h,q]=s.useState(null),[Y,ee]=s.useState(!1),[ve,B]=s.useState(0),[I,Q]=s.useState(),[ne,H]=s.useState(),[te,ke]=s.useState(null),ge=s.useRef(null),J=s.useRef(0),Ye=s.useRef(0),je=s.useRef(0),it=s.useRef(!1),qe=s.useRef(null),et=s.useRef(null),Je=s.useRef(null),Ge=s.useRef(null),$e=s.useRef(null),He=s.useRef(null),De=s.useRef(null),Qe=s.useCallback(()=>{const Se=et.current;if(!Se)return;const Ke=Se.closest(`.${e}-lightbox-content-area`);if(!Ke)return Se.getBoundingClientRect().width;const E=Array.from(Ke.children).reduce((ae,ue)=>!(ue instanceof HTMLElement)||ue.contains(Se)?ae:ae+ue.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-E},[e]),he=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),_e=s.useCallback(Se=>{Se===J.current&&(q(null),ee(!1))},[]),Ve=s.useCallback(()=>{o||it.current||(it.current=!0,u==null||u(),we(!1),qe.current=setTimeout(()=>{p()},300))},[o,u,p]),tt=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:rt,mediaAreaStyle:Oe,overlayContentStyle:Fe,swipeHandlers:Ee,dismissAreaStyle:Ze}=Vu({enabled:Pe,onClose:Ve,animMs:300,isBlockedTarget:tt}),We=s.useCallback(Se=>{d&&Lu(Se+1,c,!0)},[d,c]),ot=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),nt=s.useCallback(Se=>{if(xe.length===0)return;const Ke=(Se%xe.length+xe.length)%xe.length;if(Ke===pe)return;const E=xe[pe],ae=xe[Ke];J.current+=1;const ue=J.current,Re=R==="fade"&&gc(E==null?void 0:E.entry)!==gc(ae==null?void 0:ae.entry),Ue=ot(Je.current),dt=Re?(()=>{const Ft=Qe();ai.flushSync(()=>{ke(ae.entry)}),Je.current&&Ft&&(Je.current.style.width=`${Ft}px`);const rn=ot(Je.current);return Je.current&&(Je.current.style.width=""),{measuredIncomingTitlesHeight:rn,incomingTitlesMeasureWidth:Ft}})():void 0,Rt=Math.max(Ue??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;B(ue),q(pe),ee(!0),Z(Ke),We(Ke),je.current=Ke,Re?(he(),Rt&&Q(Rt),dt!=null&&dt.incomingTitlesMeasureWidth&&H(dt.incomingTitlesMeasureWidth),ye((E==null?void 0:E.entryIndex)??null),Ce(!0),Ye.current=ae.entryIndex,ge.current=setTimeout(()=>{ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),ge.current=null},400)):(he(),ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),Ye.current=ae.entryIndex)},[pe,he,Qe,ot,xe,We,R]),me=s.useCallback(()=>{De.current=null},[]),Ne=s.useCallback(Se=>{!fe||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(De.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[fe,xe.length]),st=s.useCallback(Se=>{var Ft;if(!fe||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(ft){me();return}const Ke=De.current;if(!Ke||Ke.pointerId!==Se.pointerId||(me(),Se.target.closest("[data-controls]")))return;const ae=Se.clientX-Ke.startX,ue=Se.clientY-Ke.startY,Re=Math.abs(ae),Ue=Math.abs(ue);if(Re>=Ay&&Re>Ue){nt(ae>0?pe-1:pe+1);return}if(Re>dc||Ue>dc)return;const dt=(Ft=Ge.current)==null?void 0:Ft.getBoundingClientRect(),Rt=dt?dt.left+dt.width/2:window.innerWidth/2;nt(Se.clientX<Rt?pe-1:pe+1)},[pe,fe,nt,ft,me,xe.length]),ut=s.useCallback(Se=>{const Ke=De.current;(Ke==null?void 0:Ke.pointerId)===Se.pointerId&&me()},[me]);Gu(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{$e.current?$e.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(Se),qe.current&&clearTimeout(qe.current),ge.current&&clearTimeout(ge.current);const Ke=He.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;R!=="fade"&&(Ye.current=((Se=xe[pe])==null?void 0:Se.entryIndex)??0,he(),ye(null),Ce(!1),Q(void 0),H(void 0))},[pe,he,xe,R]),s.useEffect(()=>{const Se=Ke=>{if(Ke.key==="Escape"){Ve();return}if(Ke.key==="ArrowLeft"&&xe.length>1){nt(pe-1);return}if(Ke.key==="ArrowRight"&&xe.length>1){nt(pe+1);return}if(Ke.key==="Tab"&&Ge.current){const E=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(E).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const ue=ae[0],Re=ae[ae.length-1],Ue=document.activeElement;Ke.shiftKey?(Ue===ue||!Ge.current.contains(Ue))&&(Ke.preventDefault(),Re.focus()):(Ue===Re||!Ge.current.contains(Ue))&&(Ke.preventDefault(),ue.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[nt,Ve,pe,xe.length]),s.useLayoutEffect(()=>{he(),J.current=0,B(0),q(null),ee(!1),ye(null),Ce(!1),Q(void 0),H(void 0),ke(null),Z(Se=>{const Ke=Math.max(0,xe.length-1);return Math.min(Se,Ke)})},[he,t.length,v,xe.length]),s.useLayoutEffect(()=>{var E;const Se=Math.max(0,xe.length-1),Ke=Math.min(Math.max(0,l),Se);je.current=Ke,Ye.current=((E=xe[Ke])==null?void 0:E.entryIndex)??0,Z(Ke)},[l]);const Be=Me!==null?t[Me]:null,pt=h!==null?xe[h]:null,Tt=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(Be==null?void 0:Be.title1)||(Be==null?void 0:Be.title2)||(Be==null?void 0:Be.title3),Lt=zy(v,xe,t),xt=L!==null,Et=Tt||Lt||xt,Vt=Lt&&xt?{gap:V}:void 0,Ut=`${e}-titles-stack${oe?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${oe?` ${e}-titles-layer-out-stacked`:""}`,Pt=`${e}-titles-layer-out`,jt=(D??0)>0||o,on=w(M),vt=s.useMemo(()=>({title1Width:b??So.title1Width,title2Width:S??So.title2Width,title3Width:G??So.title3Width}),[b,S,G]),Le=s.useMemo(()=>({title2MarginLeft:j,title3MarginLeft:P}),[j,P]),Xe=s.useMemo(()=>re?xi(e,re,N,de,X):[],[e,re,N,de,X]),lt=s.useMemo(()=>Xe.map(Se=>vt[Se.widthKey]),[Xe,vt]),ct=s.useMemo(()=>Ro(Xe.length,lt),[Xe.length,lt]),wt=s.useMemo(()=>gr(Xe.length,lt),[Xe.length,lt]),It=s.useMemo(()=>Xe.filter(Se=>Se.prefix==="title1"),[Xe]),gt=s.useMemo(()=>Xe.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Xe]),Ot=s.useMemo(()=>bi(It,vt),[It,vt]),_t=s.useMemo(()=>bi(gt,vt),[gt,vt]),Mt=s.useCallback((Se,Ke)=>{const E=Xe.findIndex(ue=>ue.prefix===Se.prefix);if(!oe||Ke==="single-row")return{effectiveWidth:wt[E]??0,resolvedWidth:ct[E]??0,maxWidth:hn(E,ct)};if(Ke==="two-row-top"){const ue=It.findIndex(Re=>Re.prefix===Se.prefix);return{effectiveWidth:Ot.effective[ue]??0,resolvedWidth:Ot.resolved[ue]??0,maxWidth:hn(ue,Ot.resolved)}}const ae=gt.findIndex(ue=>ue.prefix===Se.prefix);return{effectiveWidth:_t.effective[ae]??0,resolvedWidth:_t.resolved[ae]??0,maxWidth:hn(ae,_t.resolved)}},[Xe,gt,_t,wt,ct,It,Ot,oe]),Gt=s.useCallback(Se=>ku(Xe,ct,Le,Se)+(oe?0:D??0),[Xe,ct,Le,oe,D]),Xt=s.useCallback(()=>oe?0:D??0,[oe,D]),Dt=s.useCallback(Se=>gt.slice(0,Se).reduce((Ke,E,ae)=>Ke+(E.marginLeftKey?Le[E.marginLeftKey]??0:0)+(_t.resolved[ae]??0),0),[gt,_t.resolved,Le]),zt=s.useCallback(Se=>{const Ke=gt[Se];return Dt(Se)+(Ke.marginLeftKey?Le[Ke.marginLeftKey]??0:0)+(_t.resolved[Se]??0)},[gt,_t.resolved,Dt,Le]),Bt=s.useCallback((Se,Ke,E)=>{if(!oe||E==="single-row"){const dt=Se.findIndex(nn=>nn.prefix===Ke.prefix),Rt=Se.map(nn=>vt[nn.widthKey]),Ft=Ro(Se.length,Rt);return{effectiveWidth:gr(Se.length,Rt)[dt]??0,resolvedWidth:Ft[dt]??0,maxWidth:hn(dt,Ft)}}if(E==="two-row-top"){const dt=Se.filter(nn=>nn.prefix==="title1"),Rt=dt.findIndex(nn=>nn.prefix===Ke.prefix),{resolved:Ft,effective:rn}=bi(dt,vt);return{effectiveWidth:rn[Rt]??0,resolvedWidth:Ft[Rt]??0,maxWidth:hn(Rt,Ft)}}const ae=Se.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),ue=ae.findIndex(dt=>dt.prefix===Ke.prefix),{resolved:Re,effective:Ue}=bi(ae,vt);return{effectiveWidth:Ue[ue]??0,resolvedWidth:Re[ue]??0,maxWidth:hn(ue,Re)}},[vt,oe]),bt=(Se,Ke,E)=>{const ae=Se.marginLeftKey?Le[Se.marginLeftKey]??0:0,{effectiveWidth:ue,resolvedWidth:Re,maxWidth:Ue}=E??Mt(Se,Ke),dt=Math.max(ae,vi),Rt=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:w(ue),...ae>0?{marginLeft:w(ae)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),Rt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(-ae),width:w(dt),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":Se.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:w(-Cn/2),width:w(Cn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},A=(Se="two-row")=>{const Ke=Xe.findIndex(ue=>ue.prefix==="title1"),E=Ke>=0?ct[Ke]:vt.title1Width,ae=Se==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E)}:{},style:{width:w(D??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:N,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Dy(xe,pe,v,t)}),ze=()=>Lt?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ya(V)} + ${V}))`,width:Ya(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,mt=()=>!Lt&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Vt,children:[ze(),xt?St():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,At(re),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),mt(),un()]}),ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:be&&I?{minHeight:I}:void 0,children:[a.jsx("div",{ref:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:yn(te||re)}),a.jsxs("div",{ref:et,className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%",...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Be&&be?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:yn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:yn(re)})]})]}),mt(),un()]}),St=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(_??0,i),height:F.scalingValue(_??0,i),marginRight:ie,"--close-icon-hover-color":$},children:[a.jsx("button",{ref:$e,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:a.jsx(pn,{url:L??"",fill:z,hoverFill:i&&!r?z:$,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:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(Se,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Tt?Te():null,jt?A("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),mt()]}),At=Se=>{if(!Se)return null;const Ke=xi(e,Se,N,de,X);return a.jsx(a.Fragment,{children:Ke.map(E=>bt(E,"single-row",Bt(Ke,E,"single-row")))})},sn=Se=>{if(!Se)return null;const Ke=xi(e,Se,N,de,X),E=Ke.find(ae=>ae.prefix==="title1");return E?bt(E,"two-row-top",Bt(Ke,E,"two-row-top")):null},gn=(Se,Ke=!1)=>{const E=Se?xi(e,Se,N,de,X):[],ae=E.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ue=o&&Ke;return ae.length>0||ue||(M??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(Ue=>bt(Ue,"two-row-bottom",Bt(E,Ue,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[Ji(),Go()]}):null]}):null,(M??0)>0||ue?a.jsx("div",{"data-controls":ue?"titleRowMarginBottom":void 0,"data-controls-axis":ue?"y":void 0,"data-controls-reverse":ue?"":void 0,className:ue?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:ue?"auto":"none"}}):null]}):null},Xn=(Se,Ke=!1)=>a.jsxs(a.Fragment,{children:[qt(sn(Se)),gn(Se,Ke)]}),yn=Se=>oe?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Xn(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:At(Se)}):null,qn=()=>{const Se=oe?-1:Xe.findIndex(ae=>ae.prefix==="title1"),Ke=!oe&&(o||(D??0)>0)?(()=>{const ae=D??0,ue=Se>=0?ct[Se]:vt.title1Width,Re=Math.max(ae,vi);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ue),style:{position:"absolute",top:0,left:0,width:w(Re),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,E=Xe.flatMap((ae,ue)=>{if(!ae.marginLeftKey)return[];const Re=Le[ae.marginLeftKey]??0,Ue=Pu(Xe,ct,Le,ue)+Xt(),dt=Math.max(Re,vi);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ct[ue]),style:{position:"absolute",top:0,left:w(Ue),width:w(dt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return Ke?[Ke,...E]:E},ki=()=>Xe.map((Se,Ke)=>{const E=hn(Ke,ct),ue=Gt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),Ji=()=>gt.flatMap((Se,Ke)=>{if(!Se.marginLeftKey)return[];const E=Le[Se.marginLeftKey]??0,ae=Dt(Ke),ue=Math.max(E,vi),{resolvedWidth:Re}=Mt(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Re),style:{position:"absolute",top:0,left:w(ae),width:w(ue),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),Go=()=>gt.map((Se,Ke)=>{const{maxWidth:E}=Mt(Se,"two-row-bottom"),ue=zt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:w(ue),width:w(Cn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),un=()=>!o||oe?null:a.jsxs(a.Fragment,{children:[qn(),ki()]}),An=Se=>{const Ke=!Se.objectFit&&ii(y);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:C,maxHeight:O,...Ke?{"--image-aspect-ratio":Fa(y)}:{}}}},Rn=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:ii(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Un=Se=>{if(Se.length===0)return null;const Ke=Se.length>1,E=Ya(U),ae=`calc(-0.5 * (${E} + ${U}))`;if(Se.length===1){const ue=Se[0];return a.jsx("div",{...An(ue),children:a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:U}:void 0,children:Se.map((ue,Re)=>a.jsxs("div",{...An(ue),children:[a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1}),o&&Ke&&Re<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:E,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ue.url}-${Re}`))})},Qi=!!(re!=null&&re.title2||re!=null&&re.title3||Be!=null&&Be.title2||Be!=null&&Be.title3||(M??0)>0||o),Xo=()=>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:Je,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Xn(te||re)}),a.jsxs("div",{ref:et,className:`${e}-titles-row-two-row`,style:{...be&&I?{minHeight:I}:void 0,...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Ut,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%"},children:[Be&&be?a.jsx("div",{className:`${Pt} ${e}-titles-fade-out`,children:sn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:sn(re)})]}),be&&I?I:void 0),Qi?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Be&&be?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:gn(Be)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${oe?` ${e}-titles-layer-in-stacked`:""}`,children:gn(re,!0)})]}):null]})]}),eo=()=>{const Se=Qi;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Se?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Se?void 0:{flex:"0 0 auto",height:"auto"},children:Xn(re,!0)}),un()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Ie?1:0,transition:"opacity 300ms ease",pointerEvents:Ie?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...rt}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ze,...Ee,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&xe.length>1?"true":"false",onPointerDown:fe?Ne:void 0,onPointerUp:fe?st:void 0,onPointerCancel:fe?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[pt&&Y?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&_e(ve)},children:a.jsx("div",{className:`${e}-slide-area`,children:Un(pt.images)})},`slide-out-${ve}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Y?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:le?Un(le.images):null})},`slide-in-${ve}-${pe}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Fe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...oe?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:Et&&a.jsx("div",{className:`${e}-text-bar-cell${oe?` ${e}-text-bar-cell-stacked`:""}`,style:oe?void 0:{flex:1,minWidth:0,width:"100%"},children:oe?R==="fade"?Xo():eo():R==="fade"?ht():Nt()})})})]})]})]})};function wx(e){return`
15249
+ `,gx="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),Wi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function hx(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")]={...Wi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Zt(e,"fontSize")]={...Wi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Zt(e,"lineHeight")]={...Wi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Zt(e,"letterSpacing")]={...Wi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Zt(e,"wordSpacing")]={...Wi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Zt(e,"textAlign")]={...Wi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Zt(e,"textAppearance")]={...Wi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const fx=Fo.reduce((e,t)=>({...e,...hx(t)}),{}),yx=Fo.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 rs(e){return Fo.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 vx=sx(),xx={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"}},...fx,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:gx,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...yx},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,...rs({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,...rs({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,...rs({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:[vx]}],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"}]}},bx={element:px,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:xx,sourceCode:mx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Fo.map(e=>({path:`${Zt(e,"fontFamily")}`}))]},fontRelations:{...Fo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Zt(t,"fontFamily")}`}),{})}},Sx=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:m,imageGap:g,maxWidth:f,maxHeight:x,textTransition:P,title1Width:b,title2Width:w,title3Width:j,title1MarginLeft:H=0,title2MarginLeft:B=0,title3MarginLeft:k=0,titleRowMarginBottom:W=0,titleHeaderLayout:U="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:O,closeIconColor:_,closeIconHoverColor:C,contentMarginTop:L=0,iconMarginRight:D=0}=n,S=s.useCallback(we=>F.scalingValue(we,i??!1),[i]),K=S(g??0),T=`${f}%`,N=`${x}%`,V=S($),ae=S(L),ie=S(D),M=ji("title1",Bi(n,"title1"),i),de=ji("title2",Bi(n,"title2"),i),X=ji("title3",Bi(n,"title3"),i),le=ji("count",Bi(n,"count"),i),ne=U==="mobile",he=!i||!!r,ke=!o&&(!i||!!r),ye=s.useMemo(()=>oa(t,v),[t,v]),[pe,Z]=s.useState(l),se=ye[pe],oe=se==null?void 0:se.entry,[Re,$e]=s.useState(!1),[Me,ve]=s.useState(null),[Se,Ce]=s.useState(!1),[h,q]=s.useState(null),[Y,ee]=s.useState(!1),[fe,z]=s.useState(0),[R,Q]=s.useState(),[te,ce]=s.useState(),[G,Ie]=s.useState(null),xe=s.useRef(null),J=s.useRef(0),He=s.useRef(0),je=s.useRef(0),ct=s.useRef(!1),Ve=s.useRef(null),et=s.useRef(null),Ze=s.useRef(null),Ye=s.useRef(null),be=s.useRef(null),Oe=s.useRef(null),ze=s.useRef(null),Qe=s.useCallback(()=>{const we=et.current;if(!we)return;const Ke=we.closest(`.${e}-lightbox-content-area`);if(!Ke)return we.getBoundingClientRect().width;const E=Array.from(Ke.children).reduce((re,ue)=>!(ue instanceof HTMLElement)||ue.contains(we)?re:re+ue.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-E},[e]),ge=s.useCallback(()=>{xe.current&&(clearTimeout(xe.current),xe.current=null)},[]),_e=s.useCallback(we=>{we===J.current&&(q(null),ee(!1))},[]),Xe=s.useCallback(()=>{o||ct.current||(ct.current=!0,u==null||u(),$e(!1),Ve.current=setTimeout(()=>{p()},300))},[o,u,p]),tt=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:ot,mediaAreaStyle:De,overlayContentStyle:Fe,swipeHandlers:Ee,dismissAreaStyle:Je}=Vu({enabled:ke,onClose:Xe,animMs:300,isBlockedTarget:tt}),We=s.useCallback(we=>{d&&Lu(we+1,c,!0)},[d,c]),it=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),nt=s.useCallback(we=>{if(ye.length===0)return;const Ke=(we%ye.length+ye.length)%ye.length;if(Ke===pe)return;const E=ye[pe],re=ye[Ke];J.current+=1;const ue=J.current,Pe=P==="fade"&&gc(E==null?void 0:E.entry)!==gc(re==null?void 0:re.entry),Ue=it(Ze.current),dt=Pe?(()=>{const Ft=Qe();si.flushSync(()=>{Ie(re.entry)}),Ze.current&&Ft&&(Ze.current.style.width=`${Ft}px`);const rn=it(Ze.current);return Ze.current&&(Ze.current.style.width=""),{measuredIncomingTitlesHeight:rn,incomingTitlesMeasureWidth:Ft}})():void 0,Rt=Math.max(Ue??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;z(ue),q(pe),ee(!0),Z(Ke),We(Ke),je.current=Ke,Pe?(ge(),Rt&&Q(Rt),dt!=null&&dt.incomingTitlesMeasureWidth&&ce(dt.incomingTitlesMeasureWidth),ve((E==null?void 0:E.entryIndex)??null),Ce(!0),He.current=re.entryIndex,xe.current=setTimeout(()=>{ve(null),Ce(!1),Q(void 0),ce(void 0),Ie(null),xe.current=null},400)):(ge(),ve(null),Ce(!1),Q(void 0),ce(void 0),Ie(null),He.current=re.entryIndex)},[pe,ge,Qe,it,ye,We,P]),me=s.useCallback(()=>{ze.current=null},[]),Ne=s.useCallback(we=>{!he||ye.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(ze.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[he,ye.length]),at=s.useCallback(we=>{var Ft;if(!he||ye.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(ft){me();return}const Ke=ze.current;if(!Ke||Ke.pointerId!==we.pointerId||(me(),we.target.closest("[data-controls]")))return;const re=we.clientX-Ke.startX,ue=we.clientY-Ke.startY,Pe=Math.abs(re),Ue=Math.abs(ue);if(Pe>=Ay&&Pe>Ue){nt(re>0?pe-1:pe+1);return}if(Pe>dc||Ue>dc)return;const dt=(Ft=Ye.current)==null?void 0:Ft.getBoundingClientRect(),Rt=dt?dt.left+dt.width/2:window.innerWidth/2;nt(we.clientX<Rt?pe-1:pe+1)},[pe,he,nt,ft,me,ye.length]),ut=s.useCallback(we=>{const Ke=ze.current;(Ke==null?void 0:Ke.pointerId)===we.pointerId&&me()},[me]);Gu(),s.useEffect(()=>{Oe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{be.current?be.current.focus():Ye.current&&Ye.current.focus()})});return()=>{cancelAnimationFrame(we),Ve.current&&clearTimeout(Ve.current),xe.current&&clearTimeout(xe.current);const Ke=Oe.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;P!=="fade"&&(He.current=((we=ye[pe])==null?void 0:we.entryIndex)??0,ge(),ve(null),Ce(!1),Q(void 0),ce(void 0))},[pe,ge,ye,P]),s.useEffect(()=>{const we=Ke=>{if(Ke.key==="Escape"){Xe();return}if(Ke.key==="ArrowLeft"&&ye.length>1){nt(pe-1);return}if(Ke.key==="ArrowRight"&&ye.length>1){nt(pe+1);return}if(Ke.key==="Tab"&&Ye.current){const E=Ye.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(E).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(re.length===0)return;const ue=re[0],Pe=re[re.length-1],Ue=document.activeElement;Ke.shiftKey?(Ue===ue||!Ye.current.contains(Ue))&&(Ke.preventDefault(),Pe.focus()):(Ue===Pe||!Ye.current.contains(Ue))&&(Ke.preventDefault(),ue.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[nt,Xe,pe,ye.length]),s.useLayoutEffect(()=>{ge(),J.current=0,z(0),q(null),ee(!1),ve(null),Ce(!1),Q(void 0),ce(void 0),Ie(null),Z(we=>{const Ke=Math.max(0,ye.length-1);return Math.min(we,Ke)})},[ge,t.length,v,ye.length]),s.useLayoutEffect(()=>{var E;const we=Math.max(0,ye.length-1),Ke=Math.min(Math.max(0,l),we);je.current=Ke,He.current=((E=ye[Ke])==null?void 0:E.entryIndex)??0,Z(Ke)},[l]);const Ge=Me!==null?t[Me]:null,pt=h!==null?ye[h]:null,Tt=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(Ge==null?void 0:Ge.title1)||(Ge==null?void 0:Ge.title2)||(Ge==null?void 0:Ge.title3),Lt=zy(v,ye,t),xt=I!==null,Et=Tt||Lt||xt,Vt=Lt&&xt?{gap:V}:void 0,Ut=`${e}-titles-stack${ne?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${ne?` ${e}-titles-layer-out-stacked`:""}`,Pt=`${e}-titles-layer-out`,jt=(H??0)>0||o,on=S(W),vt=s.useMemo(()=>({title1Width:b??So.title1Width,title2Width:w??So.title2Width,title3Width:j??So.title3Width}),[b,w,j]),Le=s.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:k}),[B,k]),qe=s.useMemo(()=>oe?xi(e,oe,M,de,X):[],[e,oe,M,de,X]),st=s.useMemo(()=>qe.map(we=>vt[we.widthKey]),[qe,vt]),lt=s.useMemo(()=>Ro(qe.length,st),[qe.length,st]),wt=s.useMemo(()=>gr(qe.length,st),[qe.length,st]),It=s.useMemo(()=>qe.filter(we=>we.prefix==="title1"),[qe]),gt=s.useMemo(()=>qe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[qe]),Ot=s.useMemo(()=>bi(It,vt),[It,vt]),_t=s.useMemo(()=>bi(gt,vt),[gt,vt]),Mt=s.useCallback((we,Ke)=>{const E=qe.findIndex(ue=>ue.prefix===we.prefix);if(!ne||Ke==="single-row")return{effectiveWidth:wt[E]??0,resolvedWidth:lt[E]??0,maxWidth:hn(E,lt)};if(Ke==="two-row-top"){const ue=It.findIndex(Pe=>Pe.prefix===we.prefix);return{effectiveWidth:Ot.effective[ue]??0,resolvedWidth:Ot.resolved[ue]??0,maxWidth:hn(ue,Ot.resolved)}}const re=gt.findIndex(ue=>ue.prefix===we.prefix);return{effectiveWidth:_t.effective[re]??0,resolvedWidth:_t.resolved[re]??0,maxWidth:hn(re,_t.resolved)}},[qe,gt,_t,wt,lt,It,Ot,ne]),Gt=s.useCallback(we=>ku(qe,lt,Le,we)+(ne?0:H??0),[qe,lt,Le,ne,H]),Xt=s.useCallback(()=>ne?0:H??0,[ne,H]),Dt=s.useCallback(we=>gt.slice(0,we).reduce((Ke,E,re)=>Ke+(E.marginLeftKey?Le[E.marginLeftKey]??0:0)+(_t.resolved[re]??0),0),[gt,_t.resolved,Le]),zt=s.useCallback(we=>{const Ke=gt[we];return Dt(we)+(Ke.marginLeftKey?Le[Ke.marginLeftKey]??0:0)+(_t.resolved[we]??0)},[gt,_t.resolved,Dt,Le]),Bt=s.useCallback((we,Ke,E)=>{if(!ne||E==="single-row"){const dt=we.findIndex(nn=>nn.prefix===Ke.prefix),Rt=we.map(nn=>vt[nn.widthKey]),Ft=Ro(we.length,Rt);return{effectiveWidth:gr(we.length,Rt)[dt]??0,resolvedWidth:Ft[dt]??0,maxWidth:hn(dt,Ft)}}if(E==="two-row-top"){const dt=we.filter(nn=>nn.prefix==="title1"),Rt=dt.findIndex(nn=>nn.prefix===Ke.prefix),{resolved:Ft,effective:rn}=bi(dt,vt);return{effectiveWidth:rn[Rt]??0,resolvedWidth:Ft[Rt]??0,maxWidth:hn(Rt,Ft)}}const re=we.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),ue=re.findIndex(dt=>dt.prefix===Ke.prefix),{resolved:Pe,effective:Ue}=bi(re,vt);return{effectiveWidth:Ue[ue]??0,resolvedWidth:Pe[ue]??0,maxWidth:hn(ue,Pe)}},[vt,ne]),bt=(we,Ke,E)=>{const re=we.marginLeftKey?Le[we.marginLeftKey]??0:0,{effectiveWidth:ue,resolvedWidth:Pe,maxWidth:Ue}=E??Mt(we,Ke),dt=Math.max(re,Qn),Rt=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:S(ue),...re>0?{marginLeft:S(re)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),Rt&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:S(-re),width:S(dt),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":we.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:S(-Cn/2),width:S(Cn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},A=(we="two-row")=>{const Ke=qe.findIndex(ue=>ue.prefix==="title1"),E=Ke>=0?lt[Ke]:vt.title1Width,re=we==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E)}:{},style:{width:S(H??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:M,"aria-hidden":"true",children:" "}),Ae=()=>a.jsx("span",{className:`${e}-entry-counter`,style:le,"aria-live":"polite","aria-atomic":"true",children:Dy(ye,pe,v,t)}),Be=()=>Lt?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ae(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ya(V)} + ${V}))`,width:Ya(V),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ae():null,mt=()=>!Lt&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Vt,children:[Be(),xt?St():null]}),Nt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,At(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),mt(),un()]}),ht=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Tt?Te():null,jt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:Se&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:Ze,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:yn(G||oe)}),a.jsxs("div",{ref:et,className:Ut,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%",...Se&&te?{width:te,maxWidth:"100%"}:void 0},children:[Ge&&Se?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:yn(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:yn(oe)})]})]}),mt(),un()]}),St=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:F.scalingValue(O??0,i),height:F.scalingValue(O??0,i),marginRight:ie,"--close-icon-hover-color":C},children:[a.jsx("button",{ref:be,type:"button",className:`${e}-close-icon-inner`,onClick:Xe,"aria-label":"Close",children:a.jsx(pn,{url:I??"",fill:_,hoverFill:i&&!r?_:C,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(we,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Tt?Te():null,jt?A("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),mt()]}),At=we=>{if(!we)return null;const Ke=xi(e,we,M,de,X);return a.jsx(a.Fragment,{children:Ke.map(E=>bt(E,"single-row",Bt(Ke,E,"single-row")))})},sn=we=>{if(!we)return null;const Ke=xi(e,we,M,de,X),E=Ke.find(re=>re.prefix==="title1");return E?bt(E,"two-row-top",Bt(Ke,E,"two-row-top")):null},gn=(we,Ke=!1)=>{const E=we?xi(e,we,M,de,X):[],re=E.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),ue=o&&Ke;return re.length>0||ue||(W??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ue=>bt(Ue,"two-row-bottom",Bt(E,Ue,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[Ji(),Go()]}):null]}):null,(W??0)>0||ue?a.jsx("div",{"data-controls":ue?"titleRowMarginBottom":void 0,"data-controls-axis":ue?"y":void 0,"data-controls-reverse":ue?"":void 0,className:ue?`${e}-control`:void 0,style:{height:on,width:"100%",flexShrink:0,pointerEvents:ue?"auto":"none"}}):null]}):null},Xn=(we,Ke=!1)=>a.jsxs(a.Fragment,{children:[qt(sn(we)),gn(we,Ke)]}),yn=we=>ne?a.jsx("div",{className:`${e}-titles-row-two-row`,children:Xn(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:At(we)}):null,qn=()=>{const we=ne?-1:qe.findIndex(re=>re.prefix==="title1"),Ke=!ne&&(o||(H??0)>0)?(()=>{const re=H??0,ue=we>=0?lt[we]:vt.title1Width,Pe=Math.max(re,Qn);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:S(Pe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,E=qe.flatMap((re,ue)=>{if(!re.marginLeftKey)return[];const Pe=Le[re.marginLeftKey]??0,Ue=Pu(qe,lt,Le,ue)+Xt(),dt=Math.max(Pe,Qn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(lt[ue]),style:{position:"absolute",top:0,left:S(Ue),width:S(dt),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ke?[Ke,...E]:E},ki=()=>qe.map((we,Ke)=>{const E=hn(Ke,lt),ue=Gt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(ue),width:S(Cn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),Ji=()=>gt.flatMap((we,Ke)=>{if(!we.marginLeftKey)return[];const E=Le[we.marginLeftKey]??0,re=Dt(Ke),ue=Math.max(E,Qn),{resolvedWidth:Pe}=Mt(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:S(re),width:S(ue),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),Go=()=>gt.map((we,Ke)=>{const{maxWidth:E}=Mt(we,"two-row-bottom"),ue=zt(Ke)-Cn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(E),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(ue),width:S(Cn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),un=()=>!o||ne?null:a.jsxs(a.Fragment,{children:[qn(),ki()]}),An=we=>{const Ke=!we.objectFit&&oi(y);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:T,maxHeight:N,...Ke?{"--image-aspect-ratio":Fa(y)}:{}}}},Rn=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:oi(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Un=we=>{if(we.length===0)return null;const Ke=we.length>1,E=Ya(K),re=`calc(-0.5 * (${E} + ${K}))`;if(we.length===1){const ue=we[0];return a.jsx("div",{...An(ue),children:a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:K}:void 0,children:we.map((ue,Pe)=>a.jsxs("div",{...An(ue),children:[a.jsx("img",{...Rn(ue),src:ue.url,alt:ue.name??"",draggable:!1}),o&&Ke&&Pe<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:E,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ue.url}-${Pe}`))})},Qi=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||Ge!=null&&Ge.title2||Ge!=null&&Ge.title3||(W??0)>0||o),Xo=()=>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:Ze,className:Ut,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Xn(G||oe)}),a.jsxs("div",{ref:et,className:`${e}-titles-row-two-row`,style:{...Se&&R?{minHeight:R}:void 0,...Se&&te?{width:te,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Ut,style:{position:Se?"absolute":"relative",inset:Se?0:void 0,width:"100%"},children:[Ge&&Se?a.jsx("div",{className:`${Pt} ${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(oe)})]}),Se&&R?R:void 0),Qi?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ge&&Se?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:gn(Ge)}):null,a.jsx("div",{className:`${e}-titles-layer-in${Se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${ne?` ${e}-titles-layer-in-stacked`:""}`,children:gn(oe,!0)})]}):null]})]}),eo=()=>{const we=Qi;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:Xn(oe,!0)}),un()]})};return a.jsxs("div",{ref:Ye,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||Xe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Re?1:0,transition:"opacity 300ms ease",pointerEvents:Re?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...ot}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Je,...Ee,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:De,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":he&&ye.length>1?"true":"false",onPointerDown:he?Ne:void 0,onPointerUp:he?at:void 0,onPointerCancel:he?ut:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[pt&&Y?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&_e(fe)},children:a.jsx("div",{className:`${e}-slide-area`,children:Un(pt.images)})},`slide-out-${fe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${Y?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?Un(se.images):null})},`slide-in-${fe}-${pe}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Fe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...ne?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${ne?` ${e}-lightbox-content-area-stacked`:""}`,children:Et&&a.jsx("div",{className:`${e}-text-bar-cell${ne?` ${e}-text-bar-cell-stacked`:""}`,style:ne?void 0:{flex:1,minWidth:0,width:"100%"},children:ne?P==="fade"?Xo():eo():P==="fade"?ht():Nt()})})})]})]})]})};function wx(e){return`
15250
15250
  .${e}-wrapper {
15251
15251
  position: relative;
15252
15252
  width: 100%;
@@ -15768,7 +15768,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
15768
15768
  pointer-events: auto;
15769
15769
  z-index: 10;
15770
15770
  }
15771
- `}const $x=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=F.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,y=s.useRef(null),[m,g]=s.useState(!1),[f,x]=s.useState(0),R=s.useRef(!1),b=s.useRef(!1),S=s.useRef(!1),G=s.useMemo(()=>(t??[]).filter(T=>Io(T).length>0),[t]),D=m&&G.length>0,j=!n,P=s.useCallback(()=>{j&&(S.current=!0,Ny(b.current,c),b.current=!1)},[j,c]),M=(T=0)=>{if(G.length===0||n&&!i&&!o)return;const L=oa(G,v),_=Math.max(0,Math.min(T,L.length-1));if(x(_),j){const z=Iu();Lu(_+1,c,z),b.current=!z}g(!0)},K=s.useCallback(()=>{g(!1),S.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!j||typeof window>"u")return;const T=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=T}},[j]),s.useEffect(()=>{if(!j||R.current)return;R.current=!0;const T=pc(c);if(!T)return;const L=mc(T,oa(G,v).length);L<0||(x(L),g(!0))},[G,c,j,v]),s.useEffect(()=>{if(!j)return;const T=()=>{if(S.current){S.current=!1,g(!1);return}const L=pc(c);if(!L){g(!1);return}const _=mc(L,oa(G,v).length);if(_<0){g(!1);return}b.current=!1,x(_),g(!0)};return window.addEventListener("popstate",T),()=>window.removeEventListener("popstate",T)},[G,c,j,v]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:y,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:wx(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${ii(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>M(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...ii(p)?{"--image-aspect-ratio":Fa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${ii(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),D&&typeof document<"u"&&(()=>{const T=(r?document.getElementById(r):null)??document.body;return ai.createPortal(a.jsx(Sx,{prefix:d,entries:G,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:j,journalItemId:c,onBeforeClose:P,onClose:K}),T)})()]})},Cx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15771
+ `}const $x=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=F.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,y=s.useRef(null),[m,g]=s.useState(!1),[f,x]=s.useState(0),P=s.useRef(!1),b=s.useRef(!1),w=s.useRef(!1),j=s.useMemo(()=>(t??[]).filter($=>Io($).length>0),[t]),H=m&&j.length>0,B=!n,k=s.useCallback(()=>{B&&(w.current=!0,Ny(b.current,c),b.current=!1)},[B,c]),W=($=0)=>{if(j.length===0||n&&!i&&!o)return;const I=oa(j,v),O=Math.max(0,Math.min($,I.length-1));if(x(O),B){const _=Iu();Lu(O+1,c,_),b.current=!_}g(!0)},U=s.useCallback(()=>{g(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!B||typeof window>"u")return;const $=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=$}},[B]),s.useEffect(()=>{if(!B||P.current)return;P.current=!0;const $=pc(c);if(!$)return;const I=mc($,oa(j,v).length);I<0||(x(I),g(!0))},[j,c,B,v]),s.useEffect(()=>{if(!B)return;const $=()=>{if(w.current){w.current=!1,g(!1);return}const I=pc(c);if(!I){g(!1);return}const O=mc(I,oa(j,v).length);if(O<0){g(!1);return}b.current=!1,x(O),g(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[j,c,B,v]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:y,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:wx(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${oi(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>W(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...oi(p)?{"--image-aspect-ratio":Fa(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${oi(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),H&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx(Sx,{prefix:d,entries:j,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:B,journalItemId:c,onBeforeClose:k,onClose:U}),$)})()]})},Cx=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
15772
15772
  import { createPortal } from 'react-dom';
15773
15773
  import { CommonComponentProps } from '../props';
15774
15774
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -16568,7 +16568,7 @@ export type LightboxJournalSettings = {
16568
16568
  width: 32px;
16569
16569
  height: 32px;
16570
16570
  }
16571
- `}function Nx(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 _x(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Nx(i)]));return new Map(n)}function Wx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=F.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[v,y]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,R]=s.useState(!1),[b,S]=s.useState(!1),G=s.useRef(new Map),{imageSize:D=Mx,cursor:j="system",target:P="area",position:M="random",visible:K="all",defaultCursor:T=null,hoverCursor:L=null}=e,_=t.filter(C=>{var O;return!!((O=C==null?void 0:C.image)!=null&&O.url)}),z=s.useMemo(()=>Fx(i),[i]),$=s.useCallback((C,O,V=l)=>{if(!o)return;const se=o.getBoundingClientRect(),ie=C-se.left,N=O-se.top;y({x:ie,y:N}),g(Ax(ie,N,V,o,j,P,L,T))},[o,l,j,P,L,T]);s.useEffect(()=>{const C=[..._.map(V=>V.image.url),T,L].filter(V=>!!V);if(C.length===0){G.current=new Map,S(!0);return}let O=!1;return S(!1),_x(C).then(V=>{O||(G.current=V,S(!0))}),()=>{O=!0}},[t,T,L]),s.useEffect(()=>{if(!o)return;const C=V=>{V.stopPropagation(),f.current={x:V.clientX,y:V.clientY},$(V.clientX,V.clientY)},O=()=>{x&&$(f.current.x,f.current.y)};return o.addEventListener("mousemove",C),window.addEventListener("scroll",O,!0),()=>{o.removeEventListener("mousemove",C),window.removeEventListener("scroll",O,!0)}},[o,x,$]),s.useEffect(()=>{!o||!x||$(f.current.x,f.current.y)},[l,o,x,$]),s.useEffect(()=>{x||g("none")},[x]);const k=(C,O,V,se={})=>{var oe,fe;if(!((oe=C==null?void 0:C.image)!=null&&oe.url))return null;const ie=((fe=G.current.get(C.image.url))==null?void 0:fe.aspectRatio)??1,N=zc(C.image.url,D,G.current),{heightPx:de}=ha(N,ie);let X=0,ce=0;return M==="same"?{x:X,y:ce}=Dc(O,V,N,ie):(X=se.x??Math.random()*O,ce=se.y??Math.random()*V,{x:X,y:ce}=Ws(X,ce,O,V,N,de)),{id:p.current++,url:C.image.url,link:C.link,name:C.image.name,x:X,y:ce,xRatio:X/O,yRatio:ce/V,aspectRatio:ie,widthPx:N}},W=()=>{if(!o)return;const C=o.getBoundingClientRect(),O=C.width,V=C.height;O===0||V===0||d(se=>se.length===0?se:se.map(ie=>{const N=D.sizeType==="random"?ie.widthPx:zc(ie.url,D,G.current),{heightPx:de}=ha(N,ie.aspectRatio);if(M==="same"){const{x:oe,y:fe}=Dc(O,V,N,ie.aspectRatio);return{...ie,x:oe,y:fe,widthPx:N}}const{x:X,y:ce}=Ws(ie.xRatio*O,ie.yRatio*V,O,V,N,de);return{...ie,x:X,y:ce,widthPx:N}}))};s.useEffect(()=>{if(!o||_.length===0||!b)return;const C=o.getBoundingClientRect(),O=C.width,V=C.height,se=k(_[0],O,V);se&&(d([se]),u(_.length>1?1:0))},[D,M,o,t,b]),s.useEffect(()=>{if(!o)return;W();const C=new ResizeObserver(W);return C.observe(o),window.addEventListener("resize",W),()=>{C.disconnect(),window.removeEventListener("resize",W)}},[o,M,D,l.length]),s.useEffect(()=>{K==="last One"&&d(C=>C.length>0?[C[C.length-1]]:[])},[K]);const w=C=>{if(!o||_.length===0||!b)return;const O=o.getBoundingClientRect(),V=C.clientX-O.left,se=C.clientY-O.top;if(P==="image"&&!qu(V,se,l))return;let ie=0,N=0;M==="on Click"?(ie=V,N=se):M==="same"?(ie=O.width/2,N=O.height/2):(ie=Math.random()*O.width,N=Math.random()*O.height);const de=_[c%_.length],X=k(de,O.width,O.height,{x:ie,y:N});if(!X)return;const ce=K==="all"?[...l,X]:[X];d(ce),u(oe=>(oe+1)%_.length),$(C.clientX,C.clientY,ce)},U=j==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:z}}),a.jsxs("div",{ref:r,onClick:w,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),className:`${i}-root`,style:{cursor:U?"none":"default"},children:[l.map(C=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${C.y}px`,left:`${C.x}px`,width:`${C.widthPx}px`,cursor:U?"none":"default"},children:P==="area"&&C.link?a.jsx("a",{href:C.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:C.url,alt:C.name,className:`${i}-image`})}):a.jsx("img",{src:C.url,alt:C.name,className:`${i}-image`})},C.id)),x&&U&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Hx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16571
+ `}function Nx(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 _x(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await Nx(i)]));return new Map(n)}function Wx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=F.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[v,y]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,P]=s.useState(!1),[b,w]=s.useState(!1),j=s.useRef(new Map),{imageSize:H=Mx,cursor:B="system",target:k="area",position:W="random",visible:U="all",defaultCursor:$=null,hoverCursor:I=null}=e,O=t.filter(T=>{var N;return!!((N=T==null?void 0:T.image)!=null&&N.url)}),_=s.useMemo(()=>Fx(i),[i]),C=s.useCallback((T,N,V=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),ie=T-ae.left,M=N-ae.top;y({x:ie,y:M}),g(Ax(ie,M,V,o,B,k,I,$))},[o,l,B,k,I,$]);s.useEffect(()=>{const T=[...O.map(V=>V.image.url),$,I].filter(V=>!!V);if(T.length===0){j.current=new Map,w(!0);return}let N=!1;return w(!1),_x(T).then(V=>{N||(j.current=V,w(!0))}),()=>{N=!0}},[t,$,I]),s.useEffect(()=>{if(!o)return;const T=V=>{V.stopPropagation(),f.current={x:V.clientX,y:V.clientY},C(V.clientX,V.clientY)},N=()=>{x&&C(f.current.x,f.current.y)};return o.addEventListener("mousemove",T),window.addEventListener("scroll",N,!0),()=>{o.removeEventListener("mousemove",T),window.removeEventListener("scroll",N,!0)}},[o,x,C]),s.useEffect(()=>{!o||!x||C(f.current.x,f.current.y)},[l,o,x,C]),s.useEffect(()=>{x||g("none")},[x]);const L=(T,N,V,ae={})=>{var ne,he;if(!((ne=T==null?void 0:T.image)!=null&&ne.url))return null;const ie=((he=j.current.get(T.image.url))==null?void 0:he.aspectRatio)??1,M=zc(T.image.url,H,j.current),{heightPx:de}=ha(M,ie);let X=0,le=0;return W==="same"?{x:X,y:le}=Dc(N,V,M,ie):(X=ae.x??Math.random()*N,le=ae.y??Math.random()*V,{x:X,y:le}=Ws(X,le,N,V,M,de)),{id:p.current++,url:T.image.url,link:T.link,name:T.image.name,x:X,y:le,xRatio:X/N,yRatio:le/V,aspectRatio:ie,widthPx:M}},D=()=>{if(!o)return;const T=o.getBoundingClientRect(),N=T.width,V=T.height;N===0||V===0||d(ae=>ae.length===0?ae:ae.map(ie=>{const M=H.sizeType==="random"?ie.widthPx:zc(ie.url,H,j.current),{heightPx:de}=ha(M,ie.aspectRatio);if(W==="same"){const{x:ne,y:he}=Dc(N,V,M,ie.aspectRatio);return{...ie,x:ne,y:he,widthPx:M}}const{x:X,y:le}=Ws(ie.xRatio*N,ie.yRatio*V,N,V,M,de);return{...ie,x:X,y:le,widthPx:M}}))};s.useEffect(()=>{if(!o||O.length===0||!b)return;const T=o.getBoundingClientRect(),N=T.width,V=T.height,ae=L(O[0],N,V);ae&&(d([ae]),u(O.length>1?1:0))},[H,W,o,t,b]),s.useEffect(()=>{if(!o)return;D();const T=new ResizeObserver(D);return T.observe(o),window.addEventListener("resize",D),()=>{T.disconnect(),window.removeEventListener("resize",D)}},[o,W,H,l.length]),s.useEffect(()=>{U==="last One"&&d(T=>T.length>0?[T[T.length-1]]:[])},[U]);const S=T=>{if(!o||O.length===0||!b)return;const N=o.getBoundingClientRect(),V=T.clientX-N.left,ae=T.clientY-N.top;if(k==="image"&&!qu(V,ae,l))return;let ie=0,M=0;W==="on Click"?(ie=V,M=ae):W==="same"?(ie=N.width/2,M=N.height/2):(ie=Math.random()*N.width,M=Math.random()*N.height);const de=O[c%O.length],X=L(de,N.width,N.height,{x:ie,y:M});if(!X)return;const le=U==="all"?[...l,X]:[X];d(le),u(ne=>(ne+1)%O.length),C(T.clientX,T.clientY,le)},K=B==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_}}),a.jsxs("div",{ref:r,onClick:S,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),className:`${i}-root`,style:{cursor:K?"none":"default"},children:[l.map(T=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${T.y}px`,left:`${T.x}px`,width:`${T.widthPx}px`,cursor:K?"none":"default"},children:k==="area"&&T.link?a.jsx("a",{href:T.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:T.url,alt:T.name,className:`${i}-image`})}):a.jsx("img",{src:T.url,alt:T.name,className:`${i}-image`})},T.id)),x&&K&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Hx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
16572
16572
  import { CommonComponentProps } from '../props';
16573
16573
  import { useScopedStyles } from '../utils/index';
16574
16574
 
@@ -17098,7 +17098,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17098
17098
  </>
17099
17099
  );
17100
17100
  }
17101
- `,Ox={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Dx={element:Wx,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:Ox,sourceCode:Hx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},zx=100,Bx=70,pi="cubic-bezier(0.86, 0, 0.07, 1)";function jx(e){return`
17101
+ `,Ox={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},Dx={element:Wx,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:Ox,sourceCode:Hx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},zx=100,Bx=70,mi="cubic-bezier(0.86, 0, 0.07, 1)";function jx(e){return`
17102
17102
  .${e}-wrapper {
17103
17103
  position: relative;
17104
17104
  width: 100%;
@@ -17133,34 +17133,34 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17133
17133
  }
17134
17134
  .${e}-incoming-next {
17135
17135
  z-index: 4;
17136
- transition: transform var(--${e}-transition-ms) ${pi};
17136
+ transition: transform var(--${e}-transition-ms) ${mi};
17137
17137
  }
17138
17138
  .${e}-incoming-prev {
17139
17139
  z-index: 4;
17140
- transition: transform var(--${e}-transition-ms) ${pi};
17140
+ transition: transform var(--${e}-transition-ms) ${mi};
17141
17141
  }
17142
17142
  .${e}-outgoing {
17143
17143
  will-change: transform;
17144
17144
  }
17145
17145
  .${e}-outgoing-next {
17146
17146
  z-index: 3;
17147
- transition: transform var(--${e}-transition-ms) ${pi};
17147
+ transition: transform var(--${e}-transition-ms) ${mi};
17148
17148
  }
17149
17149
  .${e}-outgoing-prev {
17150
17150
  z-index: 3;
17151
- transition: transform var(--${e}-transition-ms) ${pi};
17151
+ transition: transform var(--${e}-transition-ms) ${mi};
17152
17152
  }
17153
17153
  .${e}-outgoing-next .${e}-effect-image {
17154
- transition: filter var(--${e}-transition-ms) ${pi};
17154
+ transition: filter var(--${e}-transition-ms) ${mi};
17155
17155
  }
17156
17156
  .${e}-outgoing-prev .${e}-effect-image {
17157
- transition: filter var(--${e}-transition-ms) ${pi};
17157
+ transition: filter var(--${e}-transition-ms) ${mi};
17158
17158
  }
17159
17159
  .${e}-incoming .${e}-effect-image {
17160
- transition: filter var(--${e}-transition-ms) ${pi};
17160
+ transition: filter var(--${e}-transition-ms) ${mi};
17161
17161
  }
17162
17162
  .${e}-background .${e}-effect-image {
17163
- transition: filter var(--${e}-transition-ms) ${pi};
17163
+ transition: filter var(--${e}-transition-ms) ${mi};
17164
17164
  }
17165
17165
  .${e}-snap .${e}-incoming,
17166
17166
  .${e}-snap .${e}-outgoing,
@@ -17208,7 +17208,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
17208
17208
  display: block;
17209
17209
  pointer-events: none;
17210
17210
  }
17211
- `}function Vx(e){return e==="blur"?Bx:e==="greyscale"?zx:0}function Yo(e,t=1,n=1){const i=Vx(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 Bc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Gx(e,t){return t<=1?0:(e-1+t)%t}function Xx(e,t=1){return!e||e.height===0?t:e.width/e.height}function qx(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 d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function jc(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 Uu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Vc(e,t,n){return{...Uu(e),[`--${n}-stage-scale`]:t}}function Ux(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 Yx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,q,Y,ee,ve,B;const{prefix:o}=F.useScopedStyles(),r=s.useMemo(()=>jx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],y=Bc(v.length),[m,g]=s.useState(y.activeIndex),[f,x]=s.useState(y.backgroundIndex),[R,b]=s.useState(!1),[S,G]=s.useState(!1),[D,j]=s.useState(null),[P,M]=s.useState(null),[K,T]=s.useState(0),[L,_]=s.useState(1),[z,$]=s.useState("none"),[k,W]=s.useState("next"),[w,U]=s.useState({}),[C,O]=s.useState({width:0,height:0}),V=s.useRef(null),se=s.useRef(null),ie=!n||!!i,N=l??60,de=Math.max(10,Math.min(100,d??N)),X=Math.max(10,Math.min(100,c??N)),ce=Math.max(100,u),oe=Yo(p),fe=s.useCallback(I=>{const Q=Xx(I?w[I]:void 0);return qx(C.width,C.height,Q,de,X)},[C.height,C.width,w,X,de]);s.useEffect(()=>{const I=se.current;if(!I)return;const Q=new ResizeObserver(([ne])=>{const{width:H,height:te}=ne.contentRect;O({width:H,height:te})});return Q.observe(I),()=>Q.disconnect()},[]),s.useEffect(()=>{const I=(t??[]).map(Q=>{var ne;return(ne=Q.image)==null?void 0:ne.url}).filter(Q=>!!Q);Ux(I,(Q,ne)=>{U(H=>{var te,ke;return((te=H[Q])==null?void 0:te.width)===ne.width&&((ke=H[Q])==null?void 0:ke.height)===ne.height?H:{...H,[Q]:ne}})})},[t]),s.useEffect(()=>{const{backgroundIndex:I,activeIndex:Q}=Bc(v.length);g(Q),x(I),b(!1),G(!1),j(null),M(null),T(0),_(1),$("none"),W("next")},[v.length,t]),s.useEffect(()=>()=>{V.current&&clearTimeout(V.current)},[]);const Pe=s.useCallback(I=>{var ge,J,Ye,je;if(!ie||R||v.length<=1)return;const Q=I==="next"?(m+1)%v.length:(m-1+v.length)%v.length,ne=fe((J=(ge=v[m])==null?void 0:ge.image)==null?void 0:J.url),H=fe((je=(Ye=v[Q])==null?void 0:Ye.image)==null?void 0:je.url),te=jc(C.width,C.height,ne),ke=jc(C.width,C.height,H);V.current&&clearTimeout(V.current),W(I),G(!0),b(!0),I==="next"?(j(m),M(Q),T(0),_(1),$(Yo(p,0,1))):(x(Gx(Q,v.length)),j(Q),M(m),T(1),_(ke),$(Yo(p,1,ke))),requestAnimationFrame(()=>{G(!1),requestAnimationFrame(()=>{I==="next"?(T(1),_(te),$(Yo(p,1,te))):(T(0),_(1),$(Yo(p,0,1)))})}),V.current=setTimeout(()=>{I==="next"&&x(m),g(Q),j(null),M(null),b(!1)},ce)},[m,p,C.height,C.width,fe,R,ie,v,ce]),xe=v[m],pe=f!==null?v[f]:null,Z=D!==null?v[D]:null,le=P!==null?v[P]:null,re=v.length<=1?0:(m-1+v.length)%v.length,Ie=v.length<=1?0:(m+1)%v.length,we=fe((Ce=xe==null?void 0:xe.image)==null?void 0:Ce.url),Me=fe((h=Z==null?void 0:Z.image)==null?void 0:h.url),ye=fe((q=le==null?void 0:le.image)==null?void 0:q.url),be={[`--${o}-transition-ms`]:`${ce}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:se,className:Ct(`${o}-wrapper`,S&&`${o}-snap`,n&&!i&&`${o}-editor`),style:be,"aria-label":"Zoom gallery",children:[((Y=pe==null?void 0:pe.image)==null?void 0:Y.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:pe.image.url,alt:"",style:{filter:oe}})}),R&&((ee=Z==null?void 0:Z.image)==null?void 0:ee.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${k}`),style:Vc(Me,L,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:Z.image.url,alt:"",style:{filter:z}})}),R&&((ve=le==null?void 0:le.image)==null?void 0:ve.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${k}`),style:Vc(ye,K,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:le.image.url,alt:""})}),!R&&((B=xe==null?void 0:xe.image)==null?void 0:B.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-foreground`),style:Uu(we),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),ie&&v.length>1&&!R&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Pe("prev"),"aria-label":`Show previous image (${re+1} of ${v.length})`}),a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-next`),onClick:()=>Pe("next"),"aria-label":`Show next image (${Ie+1} of ${v.length})`})]})]})]})}const Kx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17211
+ `}function Vx(e){return e==="blur"?Bx:e==="greyscale"?zx:0}function Yo(e,t=1,n=1){const i=Vx(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 Bc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function Gx(e,t){return t<=1?0:(e-1+t)%t}function Xx(e,t=1){return!e||e.height===0?t:e.width/e.height}function qx(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 d=r,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function jc(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 Uu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Vc(e,t,n){return{...Uu(e),[`--${n}-stage-scale`]:t}}function Ux(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 Yx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,q,Y,ee,fe,z;const{prefix:o}=F.useScopedStyles(),r=s.useMemo(()=>jx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],y=Bc(v.length),[m,g]=s.useState(y.activeIndex),[f,x]=s.useState(y.backgroundIndex),[P,b]=s.useState(!1),[w,j]=s.useState(!1),[H,B]=s.useState(null),[k,W]=s.useState(null),[U,$]=s.useState(0),[I,O]=s.useState(1),[_,C]=s.useState("none"),[L,D]=s.useState("next"),[S,K]=s.useState({}),[T,N]=s.useState({width:0,height:0}),V=s.useRef(null),ae=s.useRef(null),ie=!n||!!i,M=l??60,de=Math.max(10,Math.min(100,d??M)),X=Math.max(10,Math.min(100,c??M)),le=Math.max(100,u),ne=Yo(p),he=s.useCallback(R=>{const Q=Xx(R?S[R]:void 0);return qx(T.width,T.height,Q,de,X)},[T.height,T.width,S,X,de]);s.useEffect(()=>{const R=ae.current;if(!R)return;const Q=new ResizeObserver(([te])=>{const{width:ce,height:G}=te.contentRect;N({width:ce,height:G})});return Q.observe(R),()=>Q.disconnect()},[]),s.useEffect(()=>{const R=(t??[]).map(Q=>{var te;return(te=Q.image)==null?void 0:te.url}).filter(Q=>!!Q);Ux(R,(Q,te)=>{K(ce=>{var G,Ie;return((G=ce[Q])==null?void 0:G.width)===te.width&&((Ie=ce[Q])==null?void 0:Ie.height)===te.height?ce:{...ce,[Q]:te}})})},[t]),s.useEffect(()=>{const{backgroundIndex:R,activeIndex:Q}=Bc(v.length);g(Q),x(R),b(!1),j(!1),B(null),W(null),$(0),O(1),C("none"),D("next")},[v.length,t]),s.useEffect(()=>()=>{V.current&&clearTimeout(V.current)},[]);const ke=s.useCallback(R=>{var xe,J,He,je;if(!ie||P||v.length<=1)return;const Q=R==="next"?(m+1)%v.length:(m-1+v.length)%v.length,te=he((J=(xe=v[m])==null?void 0:xe.image)==null?void 0:J.url),ce=he((je=(He=v[Q])==null?void 0:He.image)==null?void 0:je.url),G=jc(T.width,T.height,te),Ie=jc(T.width,T.height,ce);V.current&&clearTimeout(V.current),D(R),j(!0),b(!0),R==="next"?(B(m),W(Q),$(0),O(1),C(Yo(p,0,1))):(x(Gx(Q,v.length)),B(Q),W(m),$(1),O(Ie),C(Yo(p,1,Ie))),requestAnimationFrame(()=>{j(!1),requestAnimationFrame(()=>{R==="next"?($(1),O(G),C(Yo(p,1,G))):($(0),O(1),C(Yo(p,0,1)))})}),V.current=setTimeout(()=>{R==="next"&&x(m),g(Q),B(null),W(null),b(!1)},le)},[m,p,T.height,T.width,he,P,ie,v,le]),ye=v[m],pe=f!==null?v[f]:null,Z=H!==null?v[H]:null,se=k!==null?v[k]:null,oe=v.length<=1?0:(m-1+v.length)%v.length,Re=v.length<=1?0:(m+1)%v.length,$e=he((Ce=ye==null?void 0:ye.image)==null?void 0:Ce.url),Me=he((h=Z==null?void 0:Z.image)==null?void 0:h.url),ve=he((q=se==null?void 0:se.image)==null?void 0:q.url),Se={[`--${o}-transition-ms`]:`${le}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ae,className:Ct(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:Se,"aria-label":"Zoom gallery",children:[((Y=pe==null?void 0:pe.image)==null?void 0:Y.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:pe.image.url,alt:"",style:{filter:ne}})}),P&&((ee=Z==null?void 0:Z.image)==null?void 0:ee.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${L}`),style:Vc(Me,I,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:Z.image.url,alt:"",style:{filter:_}})}),P&&((fe=se==null?void 0:se.image)==null?void 0:fe.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${L}`),style:Vc(ve,U,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:""})}),!P&&((z=ye==null?void 0:ye.image)==null?void 0:z.url)&&a.jsx("div",{className:Ct(`${o}-stage`,`${o}-foreground`),style:Uu($e),children:a.jsx("img",{className:`${o}-image`,src:ye.image.url,alt:ye.image.name??""})}),ie&&v.length>1&&!P&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-prev`),onClick:()=>ke("prev"),"aria-label":`Show previous image (${oe+1} of ${v.length})`}),a.jsx("button",{type:"button",className:Ct(`${o}-nav`,`${o}-nav-next`),onClick:()=>ke("next"),"aria-label":`Show next image (${Re+1} of ${v.length})`})]})]})]})}const Kx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
17212
17212
  import cn from 'classnames';
17213
17213
  import { CommonComponentProps } from '../props';
17214
17214
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -17969,7 +17969,7 @@ a:active .${e}-button .${e}-icon-image,
17969
17969
  height: calc(1em * var(--${e}-icon-scale, 1));
17970
17970
  width: calc(1em * var(--${e}-icon-scale, 1));
17971
17971
  }
17972
- `}function ls(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 Gc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(pn,{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 d=F.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function ob({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=F.useScopedStyles(),l=s.useMemo(()=>ib(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:y="text-icon",gap:m=0,iconSize:g=0,iconWidthC:f=0,dimensions:x=!1,padding:R={top:0,right:0,bottom:0,left:0},cornerRadius:b=0,boxShadow:S={top:0,left:0,right:0,bottom:0},boxShadowColor:G="rgba(0, 0, 0, 0)",innerBoxShadow:D={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:j="rgba(0, 0, 0, 0)",stroke:P=0,blur:M=0,backgroundColor:K="#000000",textColor:T="#ffffff",borderColor:L="#ffffff",iconColor:_="#ffffff",hoverEffect:z="none",fontFamily:$,fontSettings:k,fontSize:W,lineHeight:w,letterSpacing:U=0,wordSpacing:C=0,textAppearance:O,stateOverrides:V,minWidth:se=0,minHeight:ie=0,width:N=0,height:de=0}=e,X=F.buildColorVars(r,{backgroundColor:K,textColor:T,borderColor:L,iconColor:_,boxShadowColor:G,innerBoxShadowColor:j},Qx,eb,V),ce=i&&i!=="default"?`${r}-state-${i}`:"",oe=t&&!n?`${r}-editing`:"",fe=z!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${z}`:"",Pe=z==="reveal"||z==="swipe",xe=z==="content-roll",pe=z==="reveal"&&(!t||n),Z=x===!0,re=d==="a"?v??p:p,Ie=d==="c",we=d!=="b",Me={fontSettings:{fontFamily:$,fontWeight:(k==null?void 0:k.fontWeight)??400,fontStyle:(k==null?void 0:k.fontStyle)??"normal"},fontSize:W??.01,lineHeight:w,letterSpacing:U,wordSpacing:C,textAppearance:O,color:T},be={...we?dn(Qt(Me,t)):{},[`--${r}-box-shadow-x`]:F.scalingValue(S.left,t),[`--${r}-box-shadow-y`]:F.scalingValue(S.top,t),[`--${r}-box-shadow-blur`]:F.scalingValue(S.right,t),[`--${r}-box-shadow-spread`]:F.scalingValue(S.bottom,t),[`--${r}-inner-box-shadow-x`]:F.scalingValue(D.left,t),[`--${r}-inner-box-shadow-y`]:F.scalingValue(D.top,t),[`--${r}-inner-box-shadow-blur`]:F.scalingValue(D.right,t),[`--${r}-inner-box-shadow-spread`]:F.scalingValue(D.bottom,t),[`--${r}-backdrop-blur`]:M>0?`blur(${F.scalingValue(M,t)})`:void 0,paddingTop:F.scalingValue(R.top,t),paddingRight:F.scalingValue(R.right,t),paddingBottom:F.scalingValue(R.bottom,t),paddingLeft:F.scalingValue(R.left,t),borderRadius:F.scalingValue(b,t),borderWidth:F.scalingValue(P,t),...Ie?{}:{justifyContent:ss[re],textAlign:re},...Ie&&!xe?{gap:F.scalingValue(m,t)}:{},...Z?{width:F.scalingValue(N,t),height:F.scalingValue(de,t)}:{minWidth:F.scalingValue(se,t),minHeight:F.scalingValue(ie,t),...Ie?{width:"100%"}:{}}};let Ce;const h={display:"inline-flex",alignItems:"center",justifyContent:Ie?ss[re]:ss[d==="a"?re:"center"],gap:Ie?F.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:re}:{}};if(d==="b"){const ee=()=>Gc(r,u,g>0?"fixed":"fill",100,g,t);Ce=xe?ls(r,ee,`${r}-icon-roll`,void 0,h):ee()}else if(d==="c"){const ee=()=>{const ve=a.jsx("span",{className:`${r}-text`,style:{textAlign:re},children:c}),B=Gc(r,u,f>0?"fixed":"fill",100,f,t);return y==="icon-text"?a.jsxs(a.Fragment,{children:[B,ve]}):a.jsxs(a.Fragment,{children:[ve,B]})};Ce=xe?ls(r,ee,`${r}-icon-text-roll`,void 0,h):ee()}else Ce=xe?ls(r,()=>c,`${r}-label-roll`,void 0,h):Pe?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=pe?ee=>tb(ee,r):void 0,Y=pe?ee=>nb(ee,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:X,children:a.jsx("div",{className:`${r}-wrapper ${ce} ${oe}`.trim(),children:a.jsx("div",{className:`${r}-button ${fe}`.trim(),style:be,onMouseEnter:q,onMouseLeave:Y,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const rb=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17972
+ `}function ls(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 Gc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(pn,{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 d=F.scalingValue(o,r);return a.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return a.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function ob({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=F.useScopedStyles(),l=s.useMemo(()=>ib(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:y="text-icon",gap:m=0,iconSize:g=0,iconWidthC:f=0,dimensions:x=!1,padding:P={top:0,right:0,bottom:0,left:0},cornerRadius:b=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:j="rgba(0, 0, 0, 0)",innerBoxShadow:H={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:B="rgba(0, 0, 0, 0)",stroke:k=0,blur:W=0,backgroundColor:U="#000000",textColor:$="#ffffff",borderColor:I="#ffffff",iconColor:O="#ffffff",hoverEffect:_="none",fontFamily:C,fontSettings:L,fontSize:D,lineHeight:S,letterSpacing:K=0,wordSpacing:T=0,textAppearance:N,stateOverrides:V,minWidth:ae=0,minHeight:ie=0,width:M=0,height:de=0}=e,X=F.buildColorVars(r,{backgroundColor:U,textColor:$,borderColor:I,iconColor:O,boxShadowColor:j,innerBoxShadowColor:B},Qx,eb,V),le=i&&i!=="default"?`${r}-state-${i}`:"",ne=t&&!n?`${r}-editing`:"",he=_!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${_}`:"",ke=_==="reveal"||_==="swipe",ye=_==="content-roll",pe=_==="reveal"&&(!t||n),Z=x===!0,oe=d==="a"?v??p:p,Re=d==="c",$e=d!=="b",Me={fontSettings:{fontFamily:C,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:D??.01,lineHeight:S,letterSpacing:K,wordSpacing:T,textAppearance:N,color:$},Se={...$e?dn(Qt(Me,t)):{},[`--${r}-box-shadow-x`]:F.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:F.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:F.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:F.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:F.scalingValue(H.left,t),[`--${r}-inner-box-shadow-y`]:F.scalingValue(H.top,t),[`--${r}-inner-box-shadow-blur`]:F.scalingValue(H.right,t),[`--${r}-inner-box-shadow-spread`]:F.scalingValue(H.bottom,t),[`--${r}-backdrop-blur`]:W>0?`blur(${F.scalingValue(W,t)})`:void 0,paddingTop:F.scalingValue(P.top,t),paddingRight:F.scalingValue(P.right,t),paddingBottom:F.scalingValue(P.bottom,t),paddingLeft:F.scalingValue(P.left,t),borderRadius:F.scalingValue(b,t),borderWidth:F.scalingValue(k,t),...Re?{}:{justifyContent:ss[oe],textAlign:oe},...Re&&!ye?{gap:F.scalingValue(m,t)}:{},...Z?{width:F.scalingValue(M,t),height:F.scalingValue(de,t)}:{minWidth:F.scalingValue(ae,t),minHeight:F.scalingValue(ie,t),...Re?{width:"100%"}:{}}};let Ce;const h={display:"inline-flex",alignItems:"center",justifyContent:Re?ss[oe]:ss[d==="a"?oe:"center"],gap:Re?F.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const ee=()=>Gc(r,u,g>0?"fixed":"fill",100,g,t);Ce=ye?ls(r,ee,`${r}-icon-roll`,void 0,h):ee()}else if(d==="c"){const ee=()=>{const fe=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),z=Gc(r,u,f>0?"fixed":"fill",100,f,t);return y==="icon-text"?a.jsxs(a.Fragment,{children:[z,fe]}):a.jsxs(a.Fragment,{children:[fe,z]})};Ce=ye?ls(r,ee,`${r}-icon-text-roll`,void 0,h):ee()}else Ce=ye?ls(r,()=>c,`${r}-label-roll`,void 0,h):ke?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=pe?ee=>tb(ee,r):void 0,Y=pe?ee=>nb(ee,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:X,children:a.jsx("div",{className:`${r}-wrapper ${le} ${ne}`.trim(),children:a.jsx("div",{className:`${r}-button ${he}`.trim(),style:Se,onMouseEnter:q,onMouseLeave:Y,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const rb=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
17973
17973
  import { SvgImage } from '../helpers/SvgImage/SvgImage';
17974
17974
  import { CommonComponentProps } from '../props';
17975
17975
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -18799,7 +18799,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18799
18799
  pointer-events: auto;
18800
18800
  flex-shrink: 0;
18801
18801
  }
18802
- `}const Wn=500,Ko=650,bn="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb=1e4,gb=650,hb=500;function fb(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 Yu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 yb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Yu(i,n):null}function vb(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 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 Xc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const xb=.03;function Ku(e){return e.width*xb}const cs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function jr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Hs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Sb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Hs(e,t.width,t.height)}function wb(e,t){if(Na(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 $b(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 Cb({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=>Na(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 No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Ku(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function fa(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function Tb(e,t,n){const{left:i,width:o}=n,r=Ku(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 Zu(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=fa(e,"left",i),d=fa(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lb(e,t,n,i){const{start:o,end:r}=Zu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Ib(e,t,n){const i=No(e,t,n),o=fa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Na(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Rb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Na(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 Pb({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const R=s.useRef(null),b=s.useRef(null),S=s.useRef(null),G=s.useRef(new Map),[D,j]=s.useState(0),P=s.useRef(null),M=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),_=s.useRef(!1),z=s.useRef(!1),$=s.useRef(null),k=s.useRef(null),W=s.useRef(null),w=s.useRef(()=>{}),U=s.useRef(null),C=s.useRef(null),O=s.useRef(null),V=s.useRef(!1),[se,ie]=s.useState(null),[N,de]=s.useState(cs),[X,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Pe,xe]=s.useState(0),[pe,Z]=s.useState(0),[le,re]=s.useState(!1),[Ie,we]=s.useState(null),[Me,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[ve,B]=s.useState(!1),I=s.useRef(!1),[Q,ne]=s.useState(!1),[H,te]=s.useState(!1),ke=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?Na(J):!1,je=pe!==0||le,it=!l&&(!r||!!d),qe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?tr(u,p,-1):Je(n,-1),$e=et?tr(u,p,1):Je(n,1),He=Ie===-1&&je?et&&Me!==null?tr(u,Me,-1):be!==null?Je(be,-1):null:null,De=Ie===1&&je?et&&Me!==null?tr(u,Me,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&qe?(()=>{const A=et?Xc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&qe?(()=>{const A=et?Xc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ft=he??Ve,rt=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const ze=G.current,mt=ze.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(ze.set(A,{width:Te,height:Ae}),j(Nt=>Nt+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=G.current.get(A.url);return Sb(b.current,Te)},[D,X]),Fe=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=b.current;Te&&ie(qc(Te))},[J,Oe]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{z.current=A,re(A)},[]),We=s.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),ot=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{We(),Ze(!1)},Ko+32)},[We,Ze]),nt=s.useCallback(()=>{const A=R.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:cs.width,height:typeof window<"u"?window.innerHeight:cs.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!le)return`translate(${pe}px, 0px)`;if(le&&Ie!==null){const Ae=Oe(A);if(!Ae)return;const{x:ze,y:mt}=Lb(Ae,Te,Ie,N);return`translate(${ze}px, ${mt}px)`}if(le)return"translate(0px, 0px)"}},[je,Q,le,pe,Ie,N,Oe]),Ne=s.useCallback(()=>{const A=k.current;k.current=null,We(),Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&x()},[We,Ze,f,x]),st=s.useCallback(()=>{We(),$.current=window.setTimeout(()=>{k.current!==null&&Ne()},Ko+32)},[We,Ne]),ut=s.useCallback(()=>{We(),k.current=null,Ze(!1),we(null),ye(null),Ce(null),Z(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[We,Ze]),Be=s.useCallback(A=>{if(!(!qe||!se)){if(z.current){if(k.current===A){W.current=A,Ne();return}ut()}We(),Ee(A),k.current=A,we(A),Ze(!0),st()}},[qe,se,Ne,ut,We,Ee,Ze,st]);w.current=Be;const pt=s.useCallback(()=>{U.current=null,V.current=!1,C.current!==null&&(window.clearInterval(C.current),C.current=null),O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),Tt=s.useCallback(A=>{C.current!==null&&window.clearInterval(C.current);const Te=V.current?hb:gb;C.current=window.setInterval(()=>{w.current(A)},Te)},[]),Lt=s.useCallback(A=>{U.current!==A&&(pt(),U.current=A,V.current=!1,w.current(A),Tt(A),O.current=window.setTimeout(()=>{O.current=null,U.current===A&&(V.current=!0,Tt(A))},mb))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?G.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Hs(A,Ae.width,Ae.height));return}const ze=S.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:Nt,height:ht}=bb(ze);if(Nt&&ht){rt(Te,Nt,ht),ie(Hs(A,Nt,ht));return}}const mt=qc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,rt]),Et=s.useCallback(A=>{if(S.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),ce(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=R.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=S.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,D]),s.useEffect(()=>{const A=new Set,Te=[],Ae=ze=>{!(ze!=null&&ze.url)||A.has(ze.url)||(A.add(ze.url),Te.push(ze))};t.forEach(Ae),u.forEach(ze=>ze.items.forEach(Ae)),Te.forEach(ze=>{G.current.has(ze.url)||wb(ze,rt)})},[t,u,rt]),s.useEffect(()=>{if(oe!=="opening"||!se)return;if(!y){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,se,y]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),Wn);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{ke.current===n&&ge.current===(J==null?void 0:J.url)||(We(),k.current=null,we(null),ye(null),Ce(null),xe(0),Z(0),Ze(!1),te(!1),ne(!1),M.current=0,K.current=0,T.current="none",L.current=!1,P.current=null,_.current=!1,S.current=null,Fe(),ke.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,We,Fe]),s.useLayoutEffect(()=>{const A=W.current;A!==null&&(W.current=null,requestAnimationFrame(()=>{w.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){I.current=!1,B(!1);return}if(oe!=="open"||I.current)return;if(!Ge&&!$e){I.current=!0;return}B(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),I.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),k.current=St,we(St),Ze(!0),st()},Ae=ht=>{if(Math.abs(ht)>pb&&qe){Te(ht);return}k.current=null,we(null),ye(null),Ce(null),Ze(!0),Z(0),ot()},ze=ht=>{if(ht.touches.length!==1||z.current)return;const St=ht.touches[0];_.current=!0,P.current={x:St.clientX,y:St.clientY},T.current="none",K.current=0,L.current=!1},mt=ht=>{if(!P.current||ht.touches.length!==1||z.current)return;const St=ht.touches[0],qt=St.clientX-P.current.x,At=St.clientY-P.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!qe)return;T.current="horizontal"}else if(At>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,Z(qt),ht.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),M.current=At,xe(At),ht.preventDefault())},Nt=()=>{if(!P.current)return;const ht=T.current,St=L.current;if(St&&ht==="horizontal")Ae(K.current),A();else if(St&&ht==="vertical"){const qt=M.current;if(it&&qt>ub){const At=window.innerHeight;M.current=At,te(!0),xe(At),fe("closing")}else M.current=0,xe(0);A()}else ht==="horizontal"&&Math.abs(K.current)>0&&(Ae(K.current),A());P.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[oe,qe,Ze,ot,We,it,st,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&se&&(ee(A),q(!0)),fe("closing")},[m,y,se]);s.useEffect(()=>{const A=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;pt(),Ut();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!qe)return;ze.preventDefault();const mt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&U.current===mt||Lt(mt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const mt=ze.key==="ArrowLeft"?-1:1;U.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[oe,r,d,Ut,qe,Lt,pt]),s.useEffect(()=>{oe!=="open"&&pt()},[oe,pt]);const Kt=()=>{oe==="closing"||l||Ut()},Pt=oe==="open",jt=oe==="closing",on=Pe>0?Math.max(0,1-Pe/500):1,vt=Pe>0?Math.max(.35,1-Pe/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!z.current)){if(k.current!==null){Ne();return}We(),Ze(!1)}},[We,Ze,Ne]),Xe=oe==="closing"?Y??y:y,lt=Xe&&se&&(oe==="opening"||jt)?fb(Xe,se):void 0,ct=je&&J?me(J,"center"):Pe>0?`translateY(${Pe}px)`:lt,wt=se?jr(se,N):null,It=!!(Xe&&se),gt=It&&(oe==="closing"||oe==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:ct,opacity:Pe>0?vt:It?1:oe==="opening"||jt?0:1,transition:Q&&!le?"none":le?`transform ${Ko}ms ${bn}`:H?`transform ${Wn}ms ${bn}, opacity ${Wn}ms ${bn}`:gt?`transform ${Wn}ms ${bn}`:oe==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:Ye&&Pt&&!je?"auto":"none",touchAction:Ye&&Pt?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const ze=Oe(A);if(!ze)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Ie!==null?Zu(ze,mt,Ie,N):{start:Ae==="far"?fa(ze,Te,N):No(ze,Te,N)},ht=jr(Nt,N),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!ve?Ib(ze,Te,N):null,At=Ae==="far"&&je&&Ie===(Te==="left"?-1:1),sn=Q&&!le?!1:le,gn=Ae==="adjacent"&&Pt&&ve&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${Ko}ms ${bn}`:`transform ${Ko}ms ${bn}, opacity ${Wn}ms ${bn}`:gn?`transform ${Wn}ms ${bn}`:oe==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=Oe(A);return Ae?Tb(No(Ae,Te,N),Te,N):null},Xt=A=>Te=>{if(!l){if(_.current){_.current=!1;return}Te.stopPropagation(),Be(A)}},Dt=Ge?Gt(Ge,"left"):null,zt=$e?Gt($e,"right"):null,Bt=Dt?jr(Dt,N):null,bt=zt?jr(zt,N):null;return a.jsxs("div",{ref:R,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Vr,{media:tt,style:Mt(tt,"left","far"),onMeasure:rt,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:Ge,style:Mt(Ge,"left"),onMeasure:rt,onTransitionEnd:Le},`prev-${Ge.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:$e,style:Mt($e,"right"),onMeasure:rt,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Vr,{media:ft,style:Mt(ft,"right","far"),onMeasure:rt,onTransitionEnd:Le},`far-next-${ft.url}`),se&&J&&(Ye?a.jsx(Rb,{src:J.url,phase:oe,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}const kb=20,Eb=.18;function Mb(e){return`
18802
+ `}const Wn=500,Ko=650,bn="cubic-bezier(0.22, 1, 0.36, 1)",ub=72,pb=50,mb=1e4,gb=650,hb=500;function fb(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 Yu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=pa(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 yb(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Yu(i,n):null}function vb(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 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 Xc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return tr(e,i,n)}const xb=.03;function Ku(e){return e.width*xb}const cs={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function jr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Hs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,d=o/r;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(r-u)/2}}const c=r*l;return{width:c,height:r,left:i.left+(o-c)/2,top:i.top}}function Sb(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Hs(e,t.width,t.height)}function wb(e,t){if(Na(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 $b(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 Cb({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=>Na(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 No(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Ku(n);return t==="left"?{left:l+c-i,top:r,width:i,height:o}:{left:l+d-c,top:r,width:i,height:o}}function fa(e,t,n){const i=No(e,t,n);return{...i,left:2*i.left-e.left}}function Tb(e,t,n){const{left:i,width:o}=n,r=Ku(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 Zu(e,t,n,i){const o=No(e,"left",i),r=No(e,"right",i),l=fa(e,"left",i),d=fa(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:d,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:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lb(e,t,n,i){const{start:o,end:r}=Zu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Ib(e,t,n){const i=No(e,t,n),o=fa(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Na(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Rb({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:r,onTransitionEnd:l}){const d=s.useRef(null);return s.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),a.jsx("div",{style:i,onTransitionEnd:l,children:a.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:r,onClick:c=>c.stopPropagation(),style:o},e)})}function Vr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Na(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 Pb({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:x}){const P=s.useRef(null),b=s.useRef(null),w=s.useRef(null),j=s.useRef(new Map),[H,B]=s.useState(0),k=s.useRef(null),W=s.useRef(0),U=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),O=s.useRef(!1),_=s.useRef(!1),C=s.useRef(null),L=s.useRef(null),D=s.useRef(null),S=s.useRef(()=>{}),K=s.useRef(null),T=s.useRef(null),N=s.useRef(null),V=s.useRef(!1),[ae,ie]=s.useState(null),[M,de]=s.useState(cs),[X,le]=s.useState(0),[ne,he]=s.useState("opening"),[ke,ye]=s.useState(0),[pe,Z]=s.useState(0),[se,oe]=s.useState(!1),[Re,$e]=s.useState(null),[Me,ve]=s.useState(null),[Se,Ce]=s.useState(null),[h,q]=s.useState(!1),[Y,ee]=s.useState(null),[fe,z]=s.useState(!1),R=s.useRef(!1),[Q,te]=s.useState(!1),[ce,G]=s.useState(!1),Ie=s.useRef(n),xe=s.useRef(void 0),J=t[n],He=J?Na(J):!1,je=pe!==0||se,ct=!l&&(!r||!!d),Ve=c&&!l,et=u.length>1,Ze=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ye=et?tr(u,p,-1):Ze(n,-1),be=et?tr(u,p,1):Ze(n,1),Oe=Re===-1&&je?et&&Me!==null?tr(u,Me,-1):Se!==null?Ze(Se,-1):null:null,ze=Re===1&&je?et&&Me!==null?tr(u,Me,1):Se!==null?Ze(Se,1):null:null,Qe=Oe&&Oe.url!==(Ye==null?void 0:Ye.url)?Oe:null,ge=ze&&ze.url!==(be==null?void 0:be.url)?ze:null,_e=Ye&&Ve?(()=>{const A=et?Xc(u,p,-1):t.length>2?Ze((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ye.url?A:null})():null,Xe=be&&Ve?(()=>{const A=et?Xc(u,p,1):t.length>2?Ze((n+1)%t.length,1):null;return A&&A.url!==be.url?A:null})():null,tt=Qe??_e,ft=ge??Xe,ot=s.useCallback((A,Te,Ae)=>{if(!A||!Te||!Ae)return;const Be=j.current,mt=Be.get(A);(mt==null?void 0:mt.width)===Te&&(mt==null?void 0:mt.height)===Ae||(Be.set(A,{width:Te,height:Ae}),B(Nt=>Nt+1))},[]),De=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=j.current.get(A.url);return Sb(b.current,Te)},[H,X]),Fe=s.useCallback(()=>{if(!J)return;const A=De(J);if(A){ie(A);return}const Te=b.current;Te&&ie(qc(Te))},[J,De]),Ee=s.useCallback(A=>{if(et){const Te=u.length;ve((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ve(null))},[et,u.length,p,t.length,n]),Je=s.useCallback(A=>{_.current=A,oe(A)},[]),We=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),it=s.useCallback(()=>{We(),C.current=window.setTimeout(()=>{We(),Je(!1)},Ko+32)},[We,Je]),nt=s.useCallback(()=>{const A=P.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:cs.width,height:typeof window<"u"?window.innerHeight:cs.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(je){if(Q&&!se)return`translate(${pe}px, 0px)`;if(se&&Re!==null){const Ae=De(A);if(!Ae)return;const{x:Be,y:mt}=Lb(Ae,Te,Re,M);return`translate(${Be}px, ${mt}px)`}if(se)return"translate(0px, 0px)"}},[je,Q,se,pe,Re,M,De]),Ne=s.useCallback(()=>{const A=L.current;L.current=null,We(),Je(!1),$e(null),ve(null),Ce(null),Z(0),te(!1),I.current=!1,U.current=0,$.current="none",A===-1?f():A===1&&x()},[We,Je,f,x]),at=s.useCallback(()=>{We(),C.current=window.setTimeout(()=>{L.current!==null&&Ne()},Ko+32)},[We,Ne]),ut=s.useCallback(()=>{We(),L.current=null,Je(!1),$e(null),ve(null),Ce(null),Z(0),te(!1),I.current=!1,U.current=0,$.current="none"},[We,Je]),Ge=s.useCallback(A=>{if(!(!Ve||!ae)){if(_.current){if(L.current===A){D.current=A,Ne();return}ut()}We(),Ee(A),L.current=A,$e(A),Je(!0),at()}},[Ve,ae,Ne,ut,We,Ee,Je,at]);S.current=Ge;const pt=s.useCallback(()=>{K.current=null,V.current=!1,T.current!==null&&(window.clearInterval(T.current),T.current=null),N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),Tt=s.useCallback(A=>{T.current!==null&&window.clearInterval(T.current);const Te=V.current?hb:gb;T.current=window.setInterval(()=>{S.current(A)},Te)},[]),Lt=s.useCallback(A=>{K.current!==A&&(pt(),K.current=A,V.current=!1,S.current(A),Tt(A),N.current=window.setTimeout(()=>{N.current=null,K.current===A&&(V.current=!0,Tt(A))},mb))},[pt,Tt]),xt=s.useCallback(()=>{const A=b.current;if(!A)return;const Te=J==null?void 0:J.url,Ae=Te?j.current.get(Te):void 0;if(Ae!=null&&Ae.width&&(Ae!=null&&Ae.height)){ie(Hs(A,Ae.width,Ae.height));return}const Be=w.current;if(Be&&Te&&(Be.src===Te||Be.currentSrc===Te)){const{width:Nt,height:ht}=bb(Be);if(Nt&&ht){ot(Te,Nt,ht),ie(Hs(A,Nt,ht));return}}const mt=qc(A);!mt.width||!mt.height||ie(mt)},[J==null?void 0:J.url,ot]),Et=s.useCallback(A=>{if(w.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),Vt=s.useCallback(()=>{nt(),xt(),le(A=>A+1)},[nt,xt]);s.useEffect(()=>{Vt();const A=b.current,Te=P.current,Ae=new ResizeObserver(()=>Vt());return A&&Ae.observe(A),Te&&Ae.observe(Te),window.addEventListener("resize",Vt),()=>{Ae.disconnect(),window.removeEventListener("resize",Vt)}},[Vt,n,v]),s.useLayoutEffect(()=>{if(!J)return;const A=w.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Fe()},[Fe,H]),s.useEffect(()=>{const A=new Set,Te=[],Ae=Be=>{!(Be!=null&&Be.url)||A.has(Be.url)||(A.add(Be.url),Te.push(Be))};t.forEach(Ae),u.forEach(Be=>Be.items.forEach(Ae)),Te.forEach(Be=>{j.current.has(Be.url)||wb(Be,ot)})},[t,u,ot]),s.useEffect(()=>{if(ne!=="opening"||!ae)return;if(!y){he("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),he("open")})});return()=>cancelAnimationFrame(A)},[ne,ae,y]),s.useEffect(()=>{if(ne!=="closing")return;const A=setTimeout(()=>g(),Wn);return()=>clearTimeout(A)},[ne,g]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Ie.current===n&&xe.current===(J==null?void 0:J.url)||(We(),L.current=null,$e(null),ve(null),Ce(null),ye(0),Z(0),Je(!1),G(!1),te(!1),W.current=0,U.current=0,$.current="none",I.current=!1,k.current=null,O.current=!1,w.current=null,Fe(),Ie.current=n,xe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Je,We,Fe]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{S.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(ne==="opening"){R.current=!1,z(!1);return}if(ne!=="open"||R.current)return;if(!Ye&&!be){R.current=!0;return}z(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{z(!0),R.current=!0})});return()=>cancelAnimationFrame(A)},[ne,Ye==null?void 0:Ye.url,be==null?void 0:be.url]),s.useEffect(()=>{if(ne!=="open")return;const A=()=>{const ht=St=>{St.stopPropagation(),St.preventDefault(),document.removeEventListener("click",ht,!0)};document.addEventListener("click",ht,!0)},Te=ht=>{const St=ht<0?1:-1;We(),Ee(St),L.current=St,$e(St),Je(!0),at()},Ae=ht=>{if(Math.abs(ht)>pb&&Ve){Te(ht);return}L.current=null,$e(null),ve(null),Ce(null),Je(!0),Z(0),it()},Be=ht=>{if(ht.touches.length!==1||_.current)return;const St=ht.touches[0];O.current=!0,k.current={x:St.clientX,y:St.clientY},$.current="none",U.current=0,I.current=!1},mt=ht=>{if(!k.current||ht.touches.length!==1||_.current)return;const St=ht.touches[0],qt=St.clientX-k.current.x,At=St.clientY-k.current.y;if($.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Ve)return;$.current="horizontal"}else if(At>0){if(!ct)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,te(!0),U.current=qt,Z(qt),ht.preventDefault();return}$.current==="vertical"&&(I.current=!0,te(!0),W.current=At,ye(At),ht.preventDefault())},Nt=()=>{if(!k.current)return;const ht=$.current,St=I.current;if(St&&ht==="horizontal")Ae(U.current),A();else if(St&&ht==="vertical"){const qt=W.current;if(ct&&qt>ub){const At=window.innerHeight;W.current=At,G(!0),ye(At),he("closing")}else W.current=0,ye(0);A()}else ht==="horizontal"&&Math.abs(U.current)>0&&(Ae(U.current),A());k.current=null,$.current="none",U.current=0,I.current=!1,te(!1)};return document.addEventListener("touchstart",Be,{passive:!0}),document.addEventListener("touchmove",mt,{passive:!1}),document.addEventListener("touchend",Nt),document.addEventListener("touchcancel",Nt),()=>{document.removeEventListener("touchstart",Be),document.removeEventListener("touchmove",mt),document.removeEventListener("touchend",Nt),document.removeEventListener("touchcancel",Nt)}},[ne,Ve,Je,it,We,ct,at,Ee]);const Ut=s.useCallback(()=>{const A=(m==null?void 0:m())??y??null;A&&ae&&(ee(A),q(!0)),he("closing")},[m,y,ae]);s.useEffect(()=>{const A=Be=>{if(Be.key==="Escape"){if(r&&d||ne==="closing")return;pt(),Ut();return}if(Be.key!=="ArrowLeft"&&Be.key!=="ArrowRight"||ne!=="open"||!Ve)return;Be.preventDefault();const mt=Be.key==="ArrowLeft"?-1:1;Be.repeat&&K.current===mt||Lt(mt)},Te=Be=>{if(Be.key!=="ArrowLeft"&&Be.key!=="ArrowRight")return;const mt=Be.key==="ArrowLeft"?-1:1;K.current===mt&&pt()},Ae=()=>{pt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",Ae),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Ae),pt()}},[ne,r,d,Ut,Ve,Lt,pt]),s.useEffect(()=>{ne!=="open"&&pt()},[ne,pt]);const Kt=()=>{ne==="closing"||l||Ut()},Pt=ne==="open",jt=ne==="closing",on=ke>0?Math.max(0,1-ke/500):1,vt=ke>0?Math.max(.35,1-ke/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!_.current)){if(L.current!==null){Ne();return}We(),Je(!1)}},[We,Je,Ne]),qe=ne==="closing"?Y??y:y,st=qe&&ae&&(ne==="opening"||jt)?fb(qe,ae):void 0,lt=je&&J?me(J,"center"):ke>0?`translateY(${ke}px)`:st,wt=ae?jr(ae,M):null,It=!!(qe&&ae),gt=It&&(ne==="closing"||ne==="open"&&h),Ot={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:lt,opacity:ke>0?vt:It?1:ne==="opening"||jt?0:1,transition:Q&&!se?"none":se?`transform ${Ko}ms ${bn}`:ce?`transform ${Wn}ms ${bn}, opacity ${Wn}ms ${bn}`:gt?`transform ${Wn}ms ${bn}`:ne==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:He&&Pt&&!je?"auto":"none",touchAction:He&&Pt?"none":void 0,zIndex:1,overflow:He?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Pt&&!je?"auto":"none"},Mt=(A,Te,Ae="adjacent")=>{const Be=De(A);if(!Be)return{display:"none"};const mt=Ae==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:Nt}=Re!==null?Zu(Be,mt,Re,M):{start:Ae==="far"?fa(Be,Te,M):No(Be,Te,M)},ht=jr(Nt,M),St=me(A,mt),qt=!je&&Ae==="adjacent"&&Pt&&!fe?Ib(Be,Te,M):null,At=Ae==="far"&&je&&Re===(Te==="left"?-1:1),sn=Q&&!se?!1:se,gn=Ae==="adjacent"&&Pt&&fe&&!je;return{position:"absolute",top:ht.top,left:ht.left,width:ht.width,height:ht.height,objectFit:"contain",transform:St??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Ae==="far"?Pt&&At?1:0:Pt?1:0,transition:sn?Ae==="far"?`transform ${Ko}ms ${bn}`:`transform ${Ko}ms ${bn}, opacity ${Wn}ms ${bn}`:gn?`transform ${Wn}ms ${bn}`:ne==="opening"||jt?`opacity ${Wn}ms ${bn}`:"none",pointerEvents:"none",zIndex:1}},Gt=(A,Te)=>{const Ae=De(A);return Ae?Tb(No(Ae,Te,M),Te,M):null},Xt=A=>Te=>{if(!l){if(O.current){O.current=!1;return}Te.stopPropagation(),Ge(A)}},Dt=Ye?Gt(Ye,"left"):null,zt=be?Gt(be,"right"):null,Bt=Dt?jr(Dt,M):null,bt=zt?jr(zt,M):null;return a.jsxs("div",{ref:P,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:ne==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Pt?on:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Pt?1:0,transition:Q?"none":`opacity ${Wn}ms ${bn}`,pointerEvents:"none"},children:a.jsx(Eu,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Pt&&tt&&a.jsx(Vr,{media:tt,style:Mt(tt,"left","far"),onMeasure:ot,onTransitionEnd:Le},`far-prev-${tt.url}`),Pt&&Ye&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:Ye,style:Mt(Ye,"left"),onMeasure:ot,onTransitionEnd:Le},`prev-${Ye.url}`),Bt&&a.jsx("div",{style:{position:"absolute",top:Bt.top,left:Bt.left,width:Bt.width,height:Bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Pt&&be&&a.jsxs(a.Fragment,{children:[a.jsx(Vr,{media:be,style:Mt(be,"right"),onMeasure:ot,onTransitionEnd:Le},`next-${be.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Pt&&ft&&a.jsx(Vr,{media:ft,style:Mt(ft,"right","far"),onMeasure:ot,onTransitionEnd:Le},`far-next-${ft.url}`),ae&&J&&(He?a.jsx(Rb,{src:J.url,phase:ne,onMediaElement:Et,wrapperStyle:Ot,videoStyle:_t,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Et,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Ot},`${n}-${J.url}`))]})}const kb=20,Eb=.18;function Mb(e){return`
18803
18803
  .${e}-wrapper {
18804
18804
  box-sizing: border-box;
18805
18805
  max-width: 100%;
@@ -18887,7 +18887,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
18887
18887
  pointer-events: auto;
18888
18888
  }
18889
18889
  ${db(e)}
18890
- `}function Ab(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,d=i?o:r;return d>0?l/d:1}function Fb(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 Nb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:F.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:F.scalingValue(i*Eb,n??!1),[`--${t}-image-aspect`]:Ab(e)}}function _b(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 Wb(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 Hb(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Yu(d,o):void 0)}}function Ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=F.useScopedStyles(),c=s.useMemo(()=>Mb(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,y=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=F.scalingValue(y,n??!1),g=`max(${m}, ${kb}px)`,{objectFitMode:f,imageStyle:x}=Wb(e),R=_b(e,n),b=s.useRef(null),[S,G]=s.useState(!1),[D,j]=s.useState([]),[P,M]=s.useState(0),[K,T]=s.useState(0),[L,_]=s.useState(null),[z,$]=s.useState({title1:"",title2:"",title3:""}),k=(!n||i)&&!S,W=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},w=W.sizeType??"none",U=k&&w!=="none"?`${d}-item-image-hover-${w}`:void 0,C=(W.value??120)/100,O=s.useCallback(pe=>{!pe||w!=="scale"||(pe.style.transformOrigin=Nh(pe))},[w]),V=s.useCallback(pe=>{if(pe){if(f==="contain"){const Z=Fb(pe);if(Z){const le=pe.closest(`.${d}-item-image`);le instanceof HTMLElement&&le.style.setProperty(`--${d}-item-media-aspect`,String(Z))}}O(pe)}},[d,O,f]),se={width:F.scalingValue(v,n??!1),...R,...Nb(e,d,n),[`--${d}-image-hover-scale`]:String(C)},ie=(()=>{const pe={},Z=b.current?getComputedStyle(b.current).getPropertyValue("--cntrl-article-width").trim():"";return Z&&(pe["--cntrl-article-width"]=Z),pe})(),N=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),de=s.useMemo(()=>vb(u),[u]),X=s.useMemo(()=>$b(u),[u]),ce=(pe,Z)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const le=de.findIndex(Ie=>Ie.gridIndex===pe);if(le<0)return;const re=de[le];T(le),j(re.items),M(0),$(re.entry),_(Z??null),G(!0)},oe=s.useCallback(()=>{G(!1),_(null)},[]),fe=s.useCallback(()=>{const pe=de[K];return!pe||!b.current?L:yb(b.current,pe.gridIndex,f)??L},[de,K,L,f]),Pe=s.useCallback(pe=>{if(de.length>1){const Z=de.length,le=(K+pe+Z)%Z,re=de[le];T(le),j(re.items),M(0),$(re.entry);return}M(Z=>(Z+pe+D.length)%D.length)},[de,K,D.length]),xe=de.length>1||D.length>1;return s.useEffect(()=>{if(!S||typeof document>"u")return;const pe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pe}},[S]),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:c}}),a.jsx(Cb,{mediaList:X}),a.jsx("div",{ref:b,className:`${d}-wrapper ${d}-type-${p}`,style:se,children:u.map((pe,Z)=>{var Ie,we;const le=!!((Ie=pe.image)!=null&&Ie.url),re=Hb(!!N,le,Z,d,f,ce);return a.jsxs("div",{className:`${d}-item`,children:[pe.title?a.jsx("span",{className:`${d}-item-title`,onClick:re,style:re?{cursor:"pointer"}:void 0,children:pe.title}):null,(we=pe.image)!=null&&we.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,U].filter(Boolean).join(" "),children:pe.image.type==="video"?a.jsx("video",{ref:V,src:pe.image.url,"data-waterfall-index":Z,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:re,onLoadedData:Me=>V(Me.currentTarget)}):a.jsx("img",{ref:V,src:pe.image.url,alt:pe.image.name??"","data-waterfall-index":Z,style:x,onClick:re,onLoad:Me=>V(Me.currentTarget)})}):null,Z<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!S&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:g,height:"100%"}})})]},Z)})}),S&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const pe=(l?document.getElementById(l):null)??document.body;return ai.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(Pb,{prefix:d,items:D,index:P,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:de,entryIdx:K,layoutId:r,sourceRect:L,resolveCloseSourceRect:fe,onClose:oe,onPrev:()=>Pe(-1),onNext:()=>Pe(1)})}),pe)})()]})}const Db=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18890
+ `}function Ab(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,d=i?o:r;return d>0?l/d:1}function Fb(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 Nb(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:F.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:F.scalingValue(i*Eb,n??!1),[`--${t}-image-aspect`]:Ab(e)}}function _b(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 Wb(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 Hb(e,t,n,i,o,r){if(!(!e||!t))return l=>{var c;const d=((c=l.currentTarget.closest(`.${i}-item`))==null?void 0:c.querySelector(`[data-waterfall-index="${n}"]`))??(l.currentTarget instanceof HTMLImageElement||l.currentTarget instanceof HTMLVideoElement?l.currentTarget:null);r(n,d?Yu(d,o):void 0)}}function Ob({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=F.useScopedStyles(),c=s.useMemo(()=>Mb(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,y=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=F.scalingValue(y,n??!1),g=`max(${m}, ${kb}px)`,{objectFitMode:f,imageStyle:x}=Wb(e),P=_b(e,n),b=s.useRef(null),[w,j]=s.useState(!1),[H,B]=s.useState([]),[k,W]=s.useState(0),[U,$]=s.useState(0),[I,O]=s.useState(null),[_,C]=s.useState({title1:"",title2:"",title3:""}),L=(!n||i)&&!w,D=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},S=D.sizeType??"none",K=L&&S!=="none"?`${d}-item-image-hover-${S}`:void 0,T=(D.value??120)/100,N=s.useCallback(pe=>{!pe||S!=="scale"||(pe.style.transformOrigin=Nh(pe))},[S]),V=s.useCallback(pe=>{if(pe){if(f==="contain"){const Z=Fb(pe);if(Z){const se=pe.closest(`.${d}-item-image`);se instanceof HTMLElement&&se.style.setProperty(`--${d}-item-media-aspect`,String(Z))}}N(pe)}},[d,N,f]),ae={width:F.scalingValue(v,n??!1),...P,...Nb(e,d,n),[`--${d}-image-hover-scale`]:String(T)},ie=(()=>{const pe={},Z=b.current?getComputedStyle(b.current).getPropertyValue("--cntrl-article-width").trim():"";return Z&&(pe["--cntrl-article-width"]=Z),pe})(),M=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),de=s.useMemo(()=>vb(u),[u]),X=s.useMemo(()=>$b(u),[u]),le=(pe,Z)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const se=de.findIndex(Re=>Re.gridIndex===pe);if(se<0)return;const oe=de[se];$(se),B(oe.items),W(0),C(oe.entry),O(Z??null),j(!0)},ne=s.useCallback(()=>{j(!1),O(null)},[]),he=s.useCallback(()=>{const pe=de[U];return!pe||!b.current?I:yb(b.current,pe.gridIndex,f)??I},[de,U,I,f]),ke=s.useCallback(pe=>{if(de.length>1){const Z=de.length,se=(U+pe+Z)%Z,oe=de[se];$(se),B(oe.items),W(0),C(oe.entry);return}W(Z=>(Z+pe+H.length)%H.length)},[de,U,H.length]),ye=de.length>1||H.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const pe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pe}},[w]),s.useEffect(()=>{!n||o||i||j(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&j(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Cb,{mediaList:X}),a.jsx("div",{ref:b,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((pe,Z)=>{var Re,$e;const se=!!((Re=pe.image)!=null&&Re.url),oe=Hb(!!M,se,Z,d,f,le);return a.jsxs("div",{className:`${d}-item`,children:[pe.title?a.jsx("span",{className:`${d}-item-title`,onClick:oe,style:oe?{cursor:"pointer"}:void 0,children:pe.title}):null,($e=pe.image)!=null&&$e.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,K].filter(Boolean).join(" "),children:pe.image.type==="video"?a.jsx("video",{ref:V,src:pe.image.url,"data-waterfall-index":Z,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:oe,onLoadedData:Me=>V(Me.currentTarget)}):a.jsx("img",{ref:V,src:pe.image.url,alt:pe.image.name??"","data-waterfall-index":Z,style:x,onClick:oe,onLoad:Me=>V(Me.currentTarget)})}):null,Z<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!w&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:g,height:"100%"}})})]},Z)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const pe=(l?document.getElementById(l):null)??document.body;return si.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(Pb,{prefix:d,items:H,index:k,entry:_,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:de,entryIdx:U,layoutId:r,sourceRect:I,resolveCloseSourceRect:he,onClose:ne,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),pe)})()]})}const Db=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
18891
18891
  import type React from 'react';
18892
18892
  import { createPortal } from 'react-dom';
18893
18893
  import { CommonComponentProps } from '../props';
@@ -19401,7 +19401,7 @@ export function Waterfall({
19401
19401
  </>
19402
19402
  );
19403
19403
  }
19404
- `,zb="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>'),gi={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 Bb(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const _o=Ci.filter(e=>e!=="count"),jb=_o.reduce((e,t)=>({...e,...Bb(t)}),{}),Vb=_o.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ds(e){return _o.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Gb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(_o.map(e=>[$l[e],Cl(e)]))},Gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Xb=[{title:"Salton Sea from Above",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],qb={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:Xb},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:{...gi.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"]}}},...jb},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:zb,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Vb},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,...ds({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,...ds({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,...ds({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:[Gb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Ub={element:Ob,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"},..._o.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",..._o.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:qb,sourceCode:Db},wo=500,Ju="cubic-bezier(0.25, 1, 0.5, 1)",Yb=300,Kb=5,Zb=.15,Jb=.4,Qb=100,ro=100,Uc={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},eS={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}},us={offset:{x:0,y:0},linkColor:"#cccccc"},Yc={sizeType:"drag",value:3},tS="left";function nS(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:tS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function nr(e,t){return t<=0?0:(e%t+t)%t}function iS(e,t,n,i){if(!i)return{position:nr(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 oS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function rS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const d={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},c={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function aS(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 sS(e,t){return`
19404
+ `,zb="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Bb(e){const t={};return t[yt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[yt(e,"fontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[yt(e,"lineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[yt(e,"letterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[yt(e,"wordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[yt(e,"textAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[yt(e,"textAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const _o=Ci.filter(e=>e!=="count"),jb=_o.reduce((e,t)=>({...e,...Bb(t)}),{}),Vb=_o.reduce((e,t)=>({...e,[yt(t,"fontFamily")]:"Arial",[yt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[yt(t,"letterSpacing")]:0,[yt(t,"wordSpacing")]:0,[yt(t,"textAlign")]:"left",[yt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ds(e){return _o.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[yt(n,"fontSize")]=i),o!==void 0&&(t[yt(n,"lineHeight")]=o),t},{})}const Gb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(_o.map(e=>[$l[e],Cl(e)]))},Gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Xb=[{title:"Salton Sea from Above",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Gr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],qb={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:Xb},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:{...hi.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"]}}},...jb},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:zb,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Vb},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,...ds({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,...ds({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,...ds({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:[Gb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Ub={element:Ob,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"},..._o.map(e=>({path:`${yt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",..._o.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${yt(t,"fontFamily")}`}),{})},schema:qb,sourceCode:Db},wo=500,Ju="cubic-bezier(0.25, 1, 0.5, 1)",Yb=300,Kb=5,Zb=.15,Jb=.4,Qb=100,ro=100,Uc={color:"#000000",hover:"#cccccc"},Zo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},eS={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}},us={offset:{x:0,y:0},linkColor:"#cccccc"},Yc={sizeType:"drag",value:3},tS="left";function nS(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:tS,color:(e==null?void 0:e.titleColor)??"#000000"};return Qt(n,t)}function ao(e,t,n){return`${e}: ${F.scalingValue(t/1440,n)};`}function nr(e,t){return t<=0?0:(e%t+t)%t}function iS(e,t,n,i){if(!i)return{position:nr(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 oS(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function rS(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),r=i(ro,0),l=i(0,ro);e.removeChild(n);const d={x:(r.x-o.x)/ro,y:(r.y-o.y)/ro},c={x:(l.x-o.x)/ro,y:(l.y-o.y)/ro},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function aS(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 sS(e,t){return`
19405
19405
  .${e}-wrapper {
19406
19406
  position: relative;
19407
19407
  width: 100%;
@@ -19671,7 +19671,7 @@ export function Waterfall({
19671
19671
  from { clip-path: inset(100% 0 0 0); }
19672
19672
  to { clip-path: inset(0 0 0 0); }
19673
19673
  }
19674
- `}function lS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=nS(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Yc,p=u.sizeType??"drag",v=u.value??Yc.value,y=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=eS[f],R=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,b=$e=>F.scalingValue($e*R,n),S=(e==null?void 0:e.show)??"always",G=(e==null?void 0:e.controls)??null,D=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,j=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)??Uc.color,K=(e==null?void 0:e.controlsHoverColor)??Uc.hover,T=(e==null?void 0:e.navColor)??Zo.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,_=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,z=(e==null?void 0:e.linkColor)??us.linkColor,$=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,k=y==="horizontal",W=p==="click",w=p==="drag",U=p==="auto"&&(!n||!!i),C=!n,O=m==="slide",V=g==="classic",se=S!=="never"&&D>0,ie=S==="on hover",N=F.scalingValue(D,n),de={width:N,height:N,maxWidth:N},X=O&&c>1,[ce,oe]=s.useState(0),[fe,Pe]=s.useState(X?1:0),[xe,pe]=s.useState(!1),[Z,le]=s.useState(!1),[re,Ie]=s.useState(!1),[we,Me]=s.useState(0),[ye,be]=s.useState(!1),[Ce,h]=s.useState(!1),q=s.useRef(!1),Y=s.useRef(fe);Y.current=fe;const ee=s.useRef(null),ve=s.useRef(0),B=s.useRef(null),I=s.useRef(null),Q=s.useRef(null),ne=s.useRef(null),H=s.useCallback($e=>{q.current=$e,pe($e)},[]),te=s.useCallback($e=>{if(c<2||$e===0)return;const He=$e>0?1:-1,De=Math.abs($e);if(be(!0),H(!0),!O){oe(ft=>nr(ft+$e,c));return}let Qe=Y.current;const he=X&&(Qe===0||Qe===c+1),_e=he?ce+1:null;he&&(Qe=ce+1);let Ve=De;for(;Ve>0;){const ft=iS(Qe,He,c,X);if(Qe=ft.position,Ve-=1,ft.hitBoundary){ve.current=Ve*He;break}}const tt=De-Ve;if(tt>0&&oe(ft=>nr(ft+tt*He,c)),Y.current=Qe,_e!==null){if(Y.current=_e,Qe===_e){le(!0),Pe(Qe);return}ee.current=Qe,le(!0),Pe(_e);return}le(!1),Pe(Qe)},[ce,c,X,O,H]),ke=s.useCallback($e=>{te($e)},[te]),ge=s.useCallback($e=>{if(c<2)return;const He=nr($e,c);if(!(He===ce&&!q.current)&&(be(!0),H(!0),oe(He),O)){const De=He+(X?1:0);ee.current=null,ve.current=0,Y.current=De,le(!1),Pe(De)}},[ce,c,X,O,H]);s.useEffect(()=>{if(!xe)return;const $e=window.setTimeout(()=>{if(X&&(fe===0||fe===c+1)){ee.current=null,le(!0),Pe(ce+1);return}H(!1)},wo);return()=>window.clearTimeout($e)},[ce,c,X,xe,H,fe]),s.useEffect(()=>{if(!Z)return;let $e=0;const He=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{const De=ee.current;ee.current=null;const Qe=ve.current;if(ve.current=0,le(!1),De!==null){Y.current=De,Pe(De);return}if(Qe!==0){te(Qe);return}H(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame($e)}},[te,H,Z]);const J=`${X}:${c}`,Ye=s.useRef(J);s.useEffect(()=>{if(Ye.current===J)return;Ye.current=J;const $e=c>0?Math.min(ce,c-1):0;Q.current=null,ne.current=null,Ie(!1),Me(0),oe($e),le(!0),Pe($e+(X?1:0))},[ce,c,X,J]),s.useEffect(()=>{if(!ye)return;const $e=window.setTimeout(()=>be(!1),Yb);return()=>window.clearTimeout($e)},[ye,ce]),s.useEffect(()=>{if(!U||c<2)return;const $e=Math.max(v,.1)*1e3,He=window.setInterval(()=>{C&&Ce||ke(1)},$e);return()=>window.clearInterval(He)},[v,c,ke,U,Ce,C]);const je=s.useCallback($e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;Q.current=null,ne.current=null;const De=B.current;if(De!=null&&De.hasPointerCapture($e.pointerId)&&De.releasePointerCapture($e.pointerId),!He.isActive){O&&Me(0);return}const he=!($e.timeStamp-He.lastTime>Qb)&&Math.abs(He.velocity)>Jb,_e=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*Zb;if(Ie(!1),!he&&!_e){Me(0);return}const Ve=_e?He.offset-He.baseOffset:He.velocity;let tt=1;_e&&He.size>0&&(tt=Math.max(1,Math.round(Math.abs(Ve)/He.size))),Me(0),te(Ve<0?tt:-tt)},[te,O]);s.useEffect(()=>{const $e=He=>{ne.current===null||He.pointerId!==ne.current||je(He)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[je]);const it=$e=>{const He=B.current;if(!w||c<2||!He||$e.pointerType==="mouse"&&$e.button!==0)return;ee.current=null,ve.current=0,q.current&&H(!1);let De=0;const Qe=I.current;if(O&&Qe){const he=k?Qe.offsetWidth:Qe.offsetHeight;if(he>0){const _e=oS(Qe,k);let Ve=Y.current;X&&(Ve===0||Ve===c+1)?(Ve=ce+1,Y.current=Ve,le(!0),Pe(Ve),De=0):De=_e+Ve*he,Me(De)}}He.setPointerCapture($e.pointerId),ne.current=$e.pointerId,Q.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:rS(He,`${r}-axis-probe`),size:k?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:$e.timeStamp,velocity:0}},qe=$e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){je($e);return}const De=$e.clientX-He.startClientX,Qe=$e.clientY-He.startClientY,he=He.axes?aS(He.axes,De,Qe):{x:De,y:Qe},_e=k?he.x:he.y,Ve=k?he.y:he.x,tt=He.baseOffset+_e;if(!He.isActive){if(Math.max(Math.abs(_e),Math.abs(Ve))<Kb)return;if(Math.abs(Ve)>Math.abs(_e)){const rt=B.current;rt!=null&&rt.hasPointerCapture(He.pointerId)&&rt.releasePointerCapture(He.pointerId),Q.current=null,ne.current=null,O&&Me(0);return}He.isActive=!0,Ie(!0)}const ft=$e.timeStamp-He.lastTime;ft>0&&(He.velocity=(tt-He.offset)/ft,He.lastTime=$e.timeStamp),He.offset=tt,O&&Me(tt)},et=$e=>{je($e)},Je=k?`translate3d(calc(${-fe*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${we}px), 0)`,Ge=X?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!k}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:B,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:w,[`${r}-track-draggable-vertical`]:w&&!k}),onPointerDown:it,onPointerMove:qe,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:$e=>{ne.current===$e.pointerId&&je($e)},children:a.jsx("div",{ref:I,className:Ct(`${r}-list`,{[`${r}-list-slide`]:O,[`${r}-list-slide-vertical`]:O&&!k,[`${r}-list-fade`]:!O}),style:O?{transform:Je,transition:re||Z?"none":`transform ${wo}ms ${Ju}`}:void 0,children:Ge.map(($e,He)=>{const De=X?nr(He-1,c):He,he=X&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${De}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!O&&De===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Ct(`${r}-slider-image`,{[`${r}-contain`]:$e.image.objectFit==="contain",[`${r}-cover`]:$e.image.objectFit==="cover"}),src:$e.image.url,alt:$e.image.name??"",draggable:!1})})})},he)})})}),se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:k,[`${r}-arrow-prev-vertical`]:!k,[`${r}-hover-arrow`]:ie}),style:{color:M,"--arrow-hover-color":K,...de},children:a.jsxs("button",{onClick:$e=>{$e.stopPropagation(),ke(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(j,n)}, ${F.scalingValue(P*(k?1:-1),n)}) rotate(${k?"0deg":"90deg"})`},children:[G&&a.jsx(pn,{url:G,fill:M,hoverFill:K,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:de}),!G&&a.jsx(Kc,{color:M,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:k,[`${r}-arrow-next-vertical`]:!k,[`${r}-hover-arrow`]:ie}),style:{color:M,"--arrow-hover-color":K,...de},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),ke(1)},style:{transform:`translate(${F.scalingValue(j*(k?-1:1),n)}, ${F.scalingValue(P,n)}) rotate(${k?"0deg":"90deg"})`},children:[G&&a.jsx(pn,{url:G,fill:M,hoverFill:K,className:`${r}-arrow-img`,style:de}),!G&&a.jsx(Kc,{color:M,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),W&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>ke(1)}),V&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:k,[`${r}-pagination-inside-left`]:!k}),style:k?{bottom:b(x.inset)}:{left:b(x.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!k,[`${r}-animate-dots`]:ye}),style:{backgroundColor:_,gap:b(x.gapInactive-x.activeDot+x.dot),...k?{height:b(x.activeDot+x.paddingY*2),paddingTop:b(x.paddingY),paddingBottom:b(x.paddingY),paddingLeft:b(x.paddingActive),paddingRight:b(x.paddingActive)}:{width:b(x.activeDot+x.paddingY*2),paddingLeft:b(x.paddingY),paddingRight:b(x.paddingY),paddingTop:b(x.paddingActive),paddingBottom:b(x.paddingActive)},borderRadius:b(x.borderRadius),transform:`translate(${F.scalingValue(Zo.offset.x,n)}, ${F.scalingValue(Zo.offset.y,n)})`},children:d.map(($e,He)=>{const De=He===ce,Qe=De?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(He),className:`${r}-pagination-item`,style:{width:b(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:De?L:T,width:b(Qe)}})},He)})},`${f}-${y}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:F.scalingValue($,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map(($e,He)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===ce&&n,[`${r}-active`]:He===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(wo/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":z,"--link-hover-color":z,position:"relative",top:F.scalingValue(us.offset.y,n),left:F.scalingValue(us.offset.x,n)},children:a.jsx(Ki,{content:$e.imageCaption})})},He))})]})]})]})}function Kc({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 cS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19674
+ `}function lS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=F.useScopedStyles(),l=nS(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Yc,p=u.sizeType??"drag",v=u.value??Yc.value,y=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=eS[f],P=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,b=be=>F.scalingValue(be*P,n),w=(e==null?void 0:e.show)??"always",j=(e==null?void 0:e.controls)??null,H=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,k=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,W=(e==null?void 0:e.controlsColor)??Uc.color,U=(e==null?void 0:e.controlsHoverColor)??Uc.hover,$=(e==null?void 0:e.navColor)??Zo.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??Zo.colors.pagination,O=(e==null?void 0:e.navBackgroundColor)??Zo.colors.background,_=(e==null?void 0:e.linkColor)??us.linkColor,C=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,L=y==="horizontal",D=p==="click",S=p==="drag",K=p==="auto"&&(!n||!!i),T=!n,N=m==="slide",V=g==="classic",ae=w!=="never"&&H>0,ie=w==="on hover",M=F.scalingValue(H,n),de={width:M,height:M,maxWidth:M},X=N&&c>1,[le,ne]=s.useState(0),[he,ke]=s.useState(X?1:0),[ye,pe]=s.useState(!1),[Z,se]=s.useState(!1),[oe,Re]=s.useState(!1),[$e,Me]=s.useState(0),[ve,Se]=s.useState(!1),[Ce,h]=s.useState(!1),q=s.useRef(!1),Y=s.useRef(he);Y.current=he;const ee=s.useRef(null),fe=s.useRef(0),z=s.useRef(null),R=s.useRef(null),Q=s.useRef(null),te=s.useRef(null),ce=s.useCallback(be=>{q.current=be,pe(be)},[]),G=s.useCallback(be=>{if(c<2||be===0)return;const Oe=be>0?1:-1,ze=Math.abs(be);if(Se(!0),ce(!0),!N){ne(ft=>nr(ft+be,c));return}let Qe=Y.current;const ge=X&&(Qe===0||Qe===c+1),_e=ge?le+1:null;ge&&(Qe=le+1);let Xe=ze;for(;Xe>0;){const ft=iS(Qe,Oe,c,X);if(Qe=ft.position,Xe-=1,ft.hitBoundary){fe.current=Xe*Oe;break}}const tt=ze-Xe;if(tt>0&&ne(ft=>nr(ft+tt*Oe,c)),Y.current=Qe,_e!==null){if(Y.current=_e,Qe===_e){se(!0),ke(Qe);return}ee.current=Qe,se(!0),ke(_e);return}se(!1),ke(Qe)},[le,c,X,N,ce]),Ie=s.useCallback(be=>{G(be)},[G]),xe=s.useCallback(be=>{if(c<2)return;const Oe=nr(be,c);if(!(Oe===le&&!q.current)&&(Se(!0),ce(!0),ne(Oe),N)){const ze=Oe+(X?1:0);ee.current=null,fe.current=0,Y.current=ze,se(!1),ke(ze)}},[le,c,X,N,ce]);s.useEffect(()=>{if(!ye)return;const be=window.setTimeout(()=>{if(X&&(he===0||he===c+1)){ee.current=null,se(!0),ke(le+1);return}ce(!1)},wo);return()=>window.clearTimeout(be)},[le,c,X,ye,ce,he]),s.useEffect(()=>{if(!Z)return;let be=0;const Oe=requestAnimationFrame(()=>{be=requestAnimationFrame(()=>{const ze=ee.current;ee.current=null;const Qe=fe.current;if(fe.current=0,se(!1),ze!==null){Y.current=ze,ke(ze);return}if(Qe!==0){G(Qe);return}ce(!1)})});return()=>{cancelAnimationFrame(Oe),cancelAnimationFrame(be)}},[G,ce,Z]);const J=`${X}:${c}`,He=s.useRef(J);s.useEffect(()=>{if(He.current===J)return;He.current=J;const be=c>0?Math.min(le,c-1):0;Q.current=null,te.current=null,Re(!1),Me(0),ne(be),se(!0),ke(be+(X?1:0))},[le,c,X,J]),s.useEffect(()=>{if(!ve)return;const be=window.setTimeout(()=>Se(!1),Yb);return()=>window.clearTimeout(be)},[ve,le]),s.useEffect(()=>{if(!K||c<2)return;const be=Math.max(v,.1)*1e3,Oe=window.setInterval(()=>{T&&Ce||Ie(1)},be);return()=>window.clearInterval(Oe)},[v,c,Ie,K,Ce,T]);const je=s.useCallback(be=>{const Oe=Q.current;if(!Oe||Oe.pointerId!==be.pointerId)return;Q.current=null,te.current=null;const ze=z.current;if(ze!=null&&ze.hasPointerCapture(be.pointerId)&&ze.releasePointerCapture(be.pointerId),!Oe.isActive){N&&Me(0);return}const ge=!(be.timeStamp-Oe.lastTime>Qb)&&Math.abs(Oe.velocity)>Jb,_e=Oe.size>0&&Math.abs(Oe.offset-Oe.baseOffset)>Oe.size*Zb;if(Re(!1),!ge&&!_e){Me(0);return}const Xe=_e?Oe.offset-Oe.baseOffset:Oe.velocity;let tt=1;_e&&Oe.size>0&&(tt=Math.max(1,Math.round(Math.abs(Xe)/Oe.size))),Me(0),G(Xe<0?tt:-tt)},[G,N]);s.useEffect(()=>{const be=Oe=>{te.current===null||Oe.pointerId!==te.current||je(Oe)};return window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be),()=>{window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)}},[je]);const ct=be=>{const Oe=z.current;if(!S||c<2||!Oe||be.pointerType==="mouse"&&be.button!==0)return;ee.current=null,fe.current=0,q.current&&ce(!1);let ze=0;const Qe=R.current;if(N&&Qe){const ge=L?Qe.offsetWidth:Qe.offsetHeight;if(ge>0){const _e=oS(Qe,L);let Xe=Y.current;X&&(Xe===0||Xe===c+1)?(Xe=le+1,Y.current=Xe,se(!0),ke(Xe),ze=0):ze=_e+Xe*ge,Me(ze)}}Oe.setPointerCapture(be.pointerId),te.current=be.pointerId,Q.current={pointerId:be.pointerId,startClientX:be.clientX,startClientY:be.clientY,axes:rS(Oe,`${r}-axis-probe`),size:L?Oe.offsetWidth:Oe.offsetHeight,isActive:!1,baseOffset:ze,offset:ze,lastTime:be.timeStamp,velocity:0}},Ve=be=>{const Oe=Q.current;if(!Oe||Oe.pointerId!==be.pointerId)return;if(be.pointerType==="mouse"&&be.buttons===0){je(be);return}const ze=be.clientX-Oe.startClientX,Qe=be.clientY-Oe.startClientY,ge=Oe.axes?aS(Oe.axes,ze,Qe):{x:ze,y:Qe},_e=L?ge.x:ge.y,Xe=L?ge.y:ge.x,tt=Oe.baseOffset+_e;if(!Oe.isActive){if(Math.max(Math.abs(_e),Math.abs(Xe))<Kb)return;if(Math.abs(Xe)>Math.abs(_e)){const ot=z.current;ot!=null&&ot.hasPointerCapture(Oe.pointerId)&&ot.releasePointerCapture(Oe.pointerId),Q.current=null,te.current=null,N&&Me(0);return}Oe.isActive=!0,Re(!0)}const ft=be.timeStamp-Oe.lastTime;ft>0&&(Oe.velocity=(tt-Oe.offset)/ft,Oe.lastTime=be.timeStamp),Oe.offset=tt,N&&Me(tt)},et=be=>{je(be)},Ze=L?`translate3d(calc(${-he*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-he*100}% + ${$e}px), 0)`,Ye=X?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:sS(r,n)}}),a.jsxs("div",{className:Ct(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!L}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:z,className:Ct(`${r}-track`,{[`${r}-track-draggable`]:S,[`${r}-track-draggable-vertical`]:S&&!L}),onPointerDown:ct,onPointerMove:Ve,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:be=>{te.current===be.pointerId&&je(be)},children:a.jsx("div",{ref:R,className:Ct(`${r}-list`,{[`${r}-list-slide`]:N,[`${r}-list-slide-vertical`]:N&&!L,[`${r}-list-fade`]:!N}),style:N?{transform:Ze,transition:oe||Z?"none":`transform ${wo}ms ${Ju}`}:void 0,children:Ye.map((be,Oe)=>{const ze=X?nr(Oe-1,c):Oe,ge=X&&(Oe===0||Oe===c+1)?`clone-${Oe===0?"start":"end"}`:`slide-${ze}`;return a.jsx("div",{className:Ct(`${r}-slide`,{[`${r}-is-active`]:!N&&ze===le}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:Ct(`${r}-slider-image`,{[`${r}-contain`]:be.image.objectFit==="contain",[`${r}-cover`]:be.image.objectFit==="cover"}),src:be.image.url,alt:be.image.name??"",draggable:!1})})})},ge)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-prev`]:L,[`${r}-arrow-prev-vertical`]:!L,[`${r}-hover-arrow`]:ie}),style:{color:W,"--arrow-hover-color":U,...de},children:a.jsxs("button",{onClick:be=>{be.stopPropagation(),Ie(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${F.scalingValue(B,n)}, ${F.scalingValue(k*(L?1:-1),n)}) rotate(${L?"0deg":"90deg"})`},children:[j&&a.jsx(pn,{url:j,fill:W,hoverFill:U,className:Ct(`${r}-arrow-img`,`${r}-mirror`),style:de}),!j&&a.jsx(Kc,{color:W,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:Ct(`${r}-arrow`,{[`${r}-arrow-next`]:L,[`${r}-arrow-next-vertical`]:!L,[`${r}-hover-arrow`]:ie}),style:{color:W,"--arrow-hover-color":U,...de},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:be=>{be.stopPropagation(),Ie(1)},style:{transform:`translate(${F.scalingValue(B*(L?-1:1),n)}, ${F.scalingValue(k,n)}) rotate(${L?"0deg":"90deg"})`},children:[j&&a.jsx(pn,{url:j,fill:W,hoverFill:U,className:`${r}-arrow-img`,style:de}),!j&&a.jsx(Kc,{color:W,className:Ct(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),D&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ie(1)}),V&&a.jsx("div",{className:Ct(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:L,[`${r}-pagination-inside-left`]:!L}),style:L?{bottom:b(x.inset)}:{left:b(x.inset)},children:a.jsx("div",{className:Ct(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!L,[`${r}-animate-dots`]:ve}),style:{backgroundColor:O,gap:b(x.gapInactive-x.activeDot+x.dot),...L?{height:b(x.activeDot+x.paddingY*2),paddingTop:b(x.paddingY),paddingBottom:b(x.paddingY),paddingLeft:b(x.paddingActive),paddingRight:b(x.paddingActive)}:{width:b(x.activeDot+x.paddingY*2),paddingLeft:b(x.paddingY),paddingRight:b(x.paddingY),paddingTop:b(x.paddingActive),paddingBottom:b(x.paddingActive)},borderRadius:b(x.borderRadius),transform:`translate(${F.scalingValue(Zo.offset.x,n)}, ${F.scalingValue(Zo.offset.y,n)})`},children:d.map((be,Oe)=>{const ze=Oe===le,Qe=ze?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>xe(Oe),className:`${r}-pagination-item`,style:{width:b(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:ze?I:$,width:b(Qe)}})},Oe)})},`${f}-${y}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:F.scalingValue(C,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((be,Oe)=>a.jsx("div",{className:Ct(`${r}-caption-text`,{[`${r}-with-pointer-events`]:Oe===le&&n,[`${r}-active`]:Oe===le}),style:{...l,width:"max-content",transitionDuration:`${Math.round(wo/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":_,"--link-hover-color":_,position:"relative",top:F.scalingValue(us.offset.y,n),left:F.scalingValue(us.offset.x,n)},children:a.jsx(Ki,{content:be.imageCaption})})},Oe))})]})]})]})}function Kc({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 cS=`import React, { useCallback, useEffect, useRef, useState } from 'react';
19675
19675
  import cn from 'classnames';
19676
19676
  import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
19677
19677
  import { scalingValue } from '../utils/scalingValue';
@@ -21069,7 +21069,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
21069
21069
  width: var(--cntrl-article-width, 100vw) !important;
21070
21070
  height: var(--cntrl-viewport-height, 100vh) !important;
21071
21071
  }
21072
- `}const hS="rgba(28,31,34,0.9)",Kn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",fS=72,yS=50,vS={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},xS=[];function bS(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 SS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function wS(e){const[t]=e.media;return t!=null&&t.url?t:null}function $S(e){if(!Array.isArray(e)||e.length===0)return[];if(bS(e)){const t=[];for(const n of e){const i=SS(n);if(!i)continue;const o=wS(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 Os(e){return e.type==="video"}function CS(e){e.pause(),e.removeAttribute("src"),e.load()}function Xr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function TS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const LS=1140/1440;function IS(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 RS(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 PS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function kS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{CS(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function ES({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),R=s.useRef("none"),b=s.useRef(!1),S=s.useRef(!1),G=s.useRef(!1),D=s.useRef(null),[j,P]=s.useState(null),[M,K]=s.useState("opening"),[T,L]=s.useState(0),[_,z]=s.useState(0),[$,k]=s.useState(!1),[W,w]=s.useState(!1),[U,C]=s.useState(!1),O=s.useRef(n),V=t[n],se=V?Os(V):!1,ie=_!==0||$,N=s.useCallback(ye=>{G.current=ye,k(ye)},[]),de=s.useCallback(()=>{D.current!==null&&(window.clearTimeout(D.current),D.current=null)},[]),X=s.useCallback(()=>{de(),D.current=window.setTimeout(()=>{de(),N(!1)},Kn+32)},[de,N]),ce=s.useCallback(()=>{const ye=y.current,be=m.current;if(!ye)return;const Ce=ye.getBoundingClientRect(),h=Ce.width,q=Ce.height;if(!h||!q)return;if(i==="cover"){P({width:h,height:q,left:Ce.left,top:Ce.top});return}if(!be){P(Xr(ye));return}const{width:Y,height:ee}=TS(be);if(!Y||!ee){P(Xr(ye));return}const ve=Y/ee,B=h/q;if(ve>B){const I=h/ve;P({width:h,height:I,left:Ce.left,top:Ce.top+(q-I)/2})}else{const I=q*ve;P({width:I,height:q,left:Ce.left+(h-I)/2,top:Ce.top})}},[i]);s.useEffect(()=>{ce();const ye=y.current;if(!ye)return;const be=new ResizeObserver(()=>ce());return be.observe(ye),()=>be.disconnect()},[ce,n]),s.useEffect(()=>{M==="opening"&&j&&K("open")},[M,j]),s.useEffect(()=>{if(M!=="closing")return;const ye=setTimeout(()=>r(),Kn);return()=>clearTimeout(ye)},[M,r]),s.useEffect(()=>()=>{de()},[de]),s.useLayoutEffect(()=>{if(O.current===n)return;de(),L(0),z(0),N(!1),C(!1),w(!1),f.current=0,x.current=0,R.current="none",b.current=!1,g.current=null,S.current=!1;const ye=y.current;ye&&P(Xr(ye)),O.current=n},[n,N,de]),s.useEffect(()=>{if(M!=="open")return;let ye=null;const be=()=>{ye&&(document.removeEventListener("click",ye,!0),ye=null)},Ce=()=>{be(),ye=B=>{B.stopPropagation(),B.preventDefault(),be()},document.addEventListener("click",ye,!0)},h=B=>{de(),G.current=!1,k(!1),z(0),w(!1),b.current=!1,x.current=0,R.current="none";const I=y.current;I&&P(Xr(I)),B<0?d():l()},q=B=>{if(Math.abs(B)>yS&&t.length>1){h(B);return}N(!0),z(0),X()},Y=B=>{if(B.touches.length!==1||G.current)return;const I=B.touches[0];S.current=!0,g.current={x:I.clientX,y:I.clientY},R.current="none",x.current=0,b.current=!1},ee=B=>{if(!g.current||B.touches.length!==1||G.current)return;const I=B.touches[0],Q=I.clientX-g.current.x,ne=I.clientY-g.current.y;if(R.current==="none"){if(Math.abs(Q)<10&&Math.abs(ne)<10)return;if(Math.abs(Q)>Math.abs(ne)){if(t.length<=1)return;R.current="horizontal"}else if(ne>0)R.current="vertical";else return}if(R.current==="horizontal"){b.current=!0,w(!0),x.current=Q,z(Q),B.preventDefault();return}R.current==="vertical"&&(b.current=!0,w(!0),f.current=ne,L(ne),B.preventDefault())},ve=()=>{if(!g.current)return;const B=R.current,I=b.current;if(I&&B==="horizontal")q(x.current),Ce();else if(I&&B==="vertical")if(f.current>fS){const ne=window.innerHeight;f.current=ne,C(!0),L(ne),K("closing")}else f.current=0,L(0),Ce();else B==="horizontal"&&Math.abs(x.current)>0&&(q(x.current),Ce());g.current=null,R.current="none",x.current=0,b.current=!1,w(!1)};return document.addEventListener("touchstart",Y,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve),()=>{document.removeEventListener("touchstart",Y),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),be()}},[M,t.length,d,l,N,X,de]),s.useEffect(()=>{const ye=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),M!=="closing"&&K("closing"))};return window.addEventListener("keydown",ye,!0),()=>window.removeEventListener("keydown",ye,!0)},[M]);const oe=()=>{M!=="closing"&&K("closing")},fe=M==="open",Pe=M==="closing",xe=T>0?Math.max(0,1-T/500):1,pe=T>0?Math.max(.35,1-T/500):1,Z=ye=>{if(ye.stopPropagation(),S.current){S.current=!1;return}if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientY-be.top,h=Math.min(52,be.height*.2);if(!(Ce>be.height-h)){if(ye.clientX-be.left<be.width/2){l();return}d()}},le=ye=>{if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientX-be.left,h=ye.clientY-be.top,q=Math.min(52,be.height*.2);if(h>be.height-q){ye.currentTarget.style.cursor="default";return}ye.currentTarget.style.cursor=Ce<be.width/2?"w-resize":"e-resize"},re=s.useCallback(ye=>{ye.propertyName!=="transform"||!G.current||(de(),N(!1))},[de,N]),Ie=ie?`translateX(${_}px)`:T>0?`translateY(${T}px)`:void 0,we={position:"fixed",top:j==null?void 0:j.top,left:j==null?void 0:j.left,width:j==null?void 0:j.width,height:j==null?void 0:j.height,objectFit:i==="cover"?"cover":"contain",transform:Ie,opacity:T>0?pe:M==="opening"||Pe?0:1,transition:W&&!$?"none":$?`transform ${Kn}ms ${Oi}`:U?`transform ${Kn}ms ${Oi}, opacity ${Kn}ms ${Oi}`:M==="opening"||Pe?`opacity ${Kn}ms ${Oi}`:"none",pointerEvents:se&&fe&&!ie?"auto":"none",touchAction:se&&fe?"none":void 0,zIndex:9998},Me=j?{position:"fixed",top:j.top,height:j.height,width:j.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:oe,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?xe:0,transition:W?"none":`opacity ${Kn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:y,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 ${Kn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,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 ${Kn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),j&&V&&(se?a.jsx(kS,{src:V.url,phase:M,mediaRef:m,mediaStyle:we,onLoadedMetadata:ce,onClick:Z,onMouseMove:le,onTransitionEnd:re},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:ce,onTransitionEnd:re,style:we},`${n}-${V.url}`)),fe&&Me&&t.length>1&&!se&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:j.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(S.current){S.current=!1;return}ye.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:j.left+j.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(S.current){S.current=!1;return}ye.stopPropagation(),d()}})]})]})}function Qc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Os(t)?"video":"image"}`,y=r.display==="cover",m=RS(r),g=M=>F.scalingValue(M,l??!1),f=n??mo,x=o?{width:"100%",maxWidth:"100%"}:{width:g(f),maxWidth:"100%"},R=i?{borderRadius:g(i)}:{},b={...x,...y?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...R},S={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:R},D={className:v,style:S,onClick:p?M=>{M.stopPropagation(),p()}:void 0},j=Math.max(d,zi),P=Os(t)?a.jsx("video",{...D,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...D,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[y?a.jsx("div",{style:b,children:P}):P,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&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(j)}})]})}function MS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),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"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function AS(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function ed({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"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:t(n)}})}function td({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function ps({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[v,y]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>y(f.offsetHeight);x();const R=new ResizeObserver(x);return R.observe(f),()=>R.disconnect()},[m,g]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const nd=45;function id(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 FS(e){const t=id(e,"--cntrl-viewport-height",window.innerHeight),n=id(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function NS(e,t,n){const{top:i,centerY:o}=FS(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function _S(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=NS(u,n,c);return Math.exp(-(p*p)/(2*nd*nd))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function WS(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(_S(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function HS(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function OS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var ot;const{prefix:l}=F.useScopedStyles(),d=s.useMemo(()=>gS(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??mo,y=(e==null?void 0:e.titleWidth)??LS,m=IS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??pS,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,R=(e==null?void 0:e.titleLeftPadding)??0,b=(e==null?void 0:e.titleRightPadding)??0,S=AS(e==null?void 0:e.transition),G=(e==null?void 0:e.lightbox)??"on",D=p==="b",j=S==="fade"||S==="retype",{setTitleRef:P,dominantIndex:M}=WS(c.length,j,f),K=((ot=c[M])==null?void 0:ot.title)??"",T=HS(K,S==="retype"),L=S==="fade"||S==="retype",_=S==="retype"?T:K,z=D?void 0:{width:F.scalingValue(v,n??!1)},$=G==="on"&&(!n||i||o),k=o??!1,W=(e==null?void 0:e.galleryPaddingRight)??0,w=(e==null?void 0:e.galleryPaddingLeft)??0,U=(e==null?void 0:e.galleryPaddingBetween)??0,C=nt=>F.scalingValue(nt,n??!1),V={width:C(y)},se=p==="a"?W:w,ie=D?{width:"100%"}:{width:`calc(100% - ${C(v)} - ${C(se)})`,...p==="c"?{marginLeft:"auto"}:{}},N=Math.max(W,zi),de=Math.max(w,zi),X=Math.max(U,zi),ce=Math.max(x,zi),oe=Math.max(R,zi),fe=Math.max(b,zi),Pe=Math.max(0,(u??1)-(v??mo)),xe=p==="a"?Math.max(0,(u??1)-(v??mo)-W):p==="c"?Math.max(0,(u??1)-(v??mo)-w):p==="b"?u??1:1,pe=k&&(p==="a"||p==="b"||p==="c")&&f==="top",Z=k&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),le=k&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),re=c.length>1,Ie=D?void 0:C((p==="c"?w:W)+(v??mo)),we=p==="c"&&Ie?{left:Ie}:void 0,Me=p==="a"&&Ie?{right:Ie}:void 0,ye=D?{left:0,width:"100%"}:p==="a"?{right:C(W),width:C(v)}:{left:C(w),width:C(v)},{titleColor:be,titleFontFamily:Ce,titleFontSettings:h,titleFontSize:q,titleLineHeight:Y,titleLetterSpacing:ee,titleWordSpacing:ve,titleAlign:B,titleTextAppearance:I,lightboxCounterColor:Q,lightboxCounterFontFamily:ne,lightboxCounterFontSettings:H,lightboxCounterFontSize:te,lightboxCounterLineHeight:ke,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ye}=e??{},je={fontSettings:{fontFamily:Ce,fontWeight:(h==null?void 0:h.fontWeight)??400,fontStyle:(h==null?void 0:h.fontStyle)??"normal"},fontSize:q??.01,lineHeight:Y,letterSpacing:ee??0,wordSpacing:ve??0,textAlign:B??"left",textAppearance:I,color:be??"#000000"},qe=dn(Qt(je,n)),et=V,Je=Jc(q,Y,l,n),Ge=Zc(q,Y,`${l}-title`,`${l}-text-tight-leading`),$e={fontSettings:{fontFamily:ne,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:te??.01,lineHeight:ke,letterSpacing:ge??0,wordSpacing:J??0,textAppearance:Ye,color:Q??"#DEDDDD"},De={...dn(Qt($e,n)),...Jc(te,ke,l,n)},Qe=Zc(te,ke,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=F.buildColorVars(l,{titleColor:be??"#000000",lightboxCounterColor:Q??"#DEDDDD"},vS,xS),_e=s.useRef(null),[Ve,tt]=s.useState(!1),[ft,rt]=s.useState([]),[Oe,Fe]=s.useState(0),Ee=s.useCallback((nt,me)=>{$&&(rt(nt),Fe(me),tt(!0))},[$]),Ze=s.useCallback(()=>{tt(!1)},[]),We=s.useMemo(()=>{const nt={...he},me=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return me&&(nt["--cntrl-article-width"]=me),nt},[he,Ve]);return s.useEffect(()=>{if(!Ve||G!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[Ve,G]),s.useEffect(()=>{!n||o||i||tt(!1)},[n,o,i]),s.useEffect(()=>{G==="off"&&tt(!1)},[G]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:_e,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?C(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?C(R):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?C(b):void 0},children:[L&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(ps,{P:l,title:_,position:f,titleRef:()=>{},titleClassName:`${Ge} ${l}-single-title`,titleContainerStyle:{...Je,...ie},titleTextBoxStyle:et,titleStyle:qe,showTextBoxOutline:k,topPaddingControl:pe?ed({P:l,scaled:C,height:ce,paired:!1}):void 0})}),c.map((nt,me)=>{const Ne=$S(nt.gallery),st=me<c.length-1,ut=Ne.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Be={P:l,position:f,titleRef:P(me),titleClassName:Ge,titleContainerStyle:Je,titleTextBoxStyle:L?{maxWidth:"100%"}:et,titleStyle:qe,showTextBoxOutline:k&&!L,topPaddingControl:pe&&!L?ed({P:l,scaled:C,height:ce,paired:re}):void 0};return a.jsxs("div",{"data-item-index":me,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:st?C(U):void 0},children:[Z&&td({P:l,controlKey:"titleLeftPadding",scaled:C,width:oe,maxFraction:xe,side:"left",paired:re,anchorStyle:we}),le&&td({P:l,controlKey:"titleRightPadding",scaled:C,width:fe,maxFraction:xe,side:"right",paired:re,anchorStyle:Me}),k&&st&&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:C(X),...ye}}),D?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,imgWidth:v||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ne.length-1,showControls:k,onMediaClick:$&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(ps,{...Be,title:L?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(ps,{...Be,title:L?"":nt.title}),Ne.length>0&&a.jsx(MS,{P:l,layoutType:p,galleryWidthStyle:z,galleryPaddingRight:W,galleryPaddingLeft:w,galleryPaddingRightWidth:N,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Pe,showControls:k,scaled:C,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:U,showPaddingAfter:Lt<Ne.length-1,showControls:k,onMediaClick:$&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})})]})]},me)})]})}),Ve&&G==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return ai.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(ES,{prefix:l,items:ft,index:Oe,imageDisplay:PS(e.lightboxImageDisplay),isEditor:n,onClose:Ze,onPrev:()=>Fe(me=>(me-1+ft.length)%ft.length),onNext:()=>Fe(me=>(me+1)%ft.length),counterClassName:Qe,counterStyle:De,backgroundColor:e.backgroundColor??hS})}),nt)})()]})}const DS=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
21072
+ `}const hS="rgba(28,31,34,0.9)",Kn=500,Oi="cubic-bezier(0.22, 1, 0.36, 1)",fS=72,yS=50,vS={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},xS=[];function bS(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 SS(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function wS(e){const[t]=e.media;return t!=null&&t.url?t:null}function $S(e){if(!Array.isArray(e)||e.length===0)return[];if(bS(e)){const t=[];for(const n of e){const i=SS(n);if(!i)continue;const o=wS(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 Os(e){return e.type==="video"}function CS(e){e.pause(),e.removeAttribute("src"),e.load()}function Xr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function TS(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const LS=1140/1440;function IS(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 RS(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 PS(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function kS({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d}){return s.useEffect(()=>{const c=n.current;if(c)return()=>{CS(c)}},[e,n]),a.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:r,onMouseMove:l,onTransitionEnd:d,style:i})}function ES({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),x=s.useRef(0),P=s.useRef("none"),b=s.useRef(!1),w=s.useRef(!1),j=s.useRef(!1),H=s.useRef(null),[B,k]=s.useState(null),[W,U]=s.useState("opening"),[$,I]=s.useState(0),[O,_]=s.useState(0),[C,L]=s.useState(!1),[D,S]=s.useState(!1),[K,T]=s.useState(!1),N=s.useRef(n),V=t[n],ae=V?Os(V):!1,ie=O!==0||C,M=s.useCallback(ve=>{j.current=ve,L(ve)},[]),de=s.useCallback(()=>{H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),X=s.useCallback(()=>{de(),H.current=window.setTimeout(()=>{de(),M(!1)},Kn+32)},[de,M]),le=s.useCallback(()=>{const ve=y.current,Se=m.current;if(!ve)return;const Ce=ve.getBoundingClientRect(),h=Ce.width,q=Ce.height;if(!h||!q)return;if(i==="cover"){k({width:h,height:q,left:Ce.left,top:Ce.top});return}if(!Se){k(Xr(ve));return}const{width:Y,height:ee}=TS(Se);if(!Y||!ee){k(Xr(ve));return}const fe=Y/ee,z=h/q;if(fe>z){const R=h/fe;k({width:h,height:R,left:Ce.left,top:Ce.top+(q-R)/2})}else{const R=q*fe;k({width:R,height:q,left:Ce.left+(h-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{le();const ve=y.current;if(!ve)return;const Se=new ResizeObserver(()=>le());return Se.observe(ve),()=>Se.disconnect()},[le,n]),s.useEffect(()=>{W==="opening"&&B&&U("open")},[W,B]),s.useEffect(()=>{if(W!=="closing")return;const ve=setTimeout(()=>r(),Kn);return()=>clearTimeout(ve)},[W,r]),s.useEffect(()=>()=>{de()},[de]),s.useLayoutEffect(()=>{if(N.current===n)return;de(),I(0),_(0),M(!1),T(!1),S(!1),f.current=0,x.current=0,P.current="none",b.current=!1,g.current=null,w.current=!1;const ve=y.current;ve&&k(Xr(ve)),N.current=n},[n,M,de]),s.useEffect(()=>{if(W!=="open")return;let ve=null;const Se=()=>{ve&&(document.removeEventListener("click",ve,!0),ve=null)},Ce=()=>{Se(),ve=z=>{z.stopPropagation(),z.preventDefault(),Se()},document.addEventListener("click",ve,!0)},h=z=>{de(),j.current=!1,L(!1),_(0),S(!1),b.current=!1,x.current=0,P.current="none";const R=y.current;R&&k(Xr(R)),z<0?d():l()},q=z=>{if(Math.abs(z)>yS&&t.length>1){h(z);return}M(!0),_(0),X()},Y=z=>{if(z.touches.length!==1||j.current)return;const R=z.touches[0];w.current=!0,g.current={x:R.clientX,y:R.clientY},P.current="none",x.current=0,b.current=!1},ee=z=>{if(!g.current||z.touches.length!==1||j.current)return;const R=z.touches[0],Q=R.clientX-g.current.x,te=R.clientY-g.current.y;if(P.current==="none"){if(Math.abs(Q)<10&&Math.abs(te)<10)return;if(Math.abs(Q)>Math.abs(te)){if(t.length<=1)return;P.current="horizontal"}else if(te>0)P.current="vertical";else return}if(P.current==="horizontal"){b.current=!0,S(!0),x.current=Q,_(Q),z.preventDefault();return}P.current==="vertical"&&(b.current=!0,S(!0),f.current=te,I(te),z.preventDefault())},fe=()=>{if(!g.current)return;const z=P.current,R=b.current;if(R&&z==="horizontal")q(x.current),Ce();else if(R&&z==="vertical")if(f.current>fS){const te=window.innerHeight;f.current=te,T(!0),I(te),U("closing")}else f.current=0,I(0),Ce();else z==="horizontal"&&Math.abs(x.current)>0&&(q(x.current),Ce());g.current=null,P.current="none",x.current=0,b.current=!1,S(!1)};return document.addEventListener("touchstart",Y,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",fe),document.addEventListener("touchcancel",fe),()=>{document.removeEventListener("touchstart",Y),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",fe),document.removeEventListener("touchcancel",fe),Se()}},[W,t.length,d,l,M,X,de]),s.useEffect(()=>{const ve=Se=>{Se.key==="Escape"&&(Se.preventDefault(),Se.stopPropagation(),W!=="closing"&&U("closing"))};return window.addEventListener("keydown",ve,!0),()=>window.removeEventListener("keydown",ve,!0)},[W]);const ne=()=>{W!=="closing"&&U("closing")},he=W==="open",ke=W==="closing",ye=$>0?Math.max(0,1-$/500):1,pe=$>0?Math.max(.35,1-$/500):1,Z=ve=>{if(ve.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Se=ve.currentTarget.getBoundingClientRect(),Ce=ve.clientY-Se.top,h=Math.min(52,Se.height*.2);if(!(Ce>Se.height-h)){if(ve.clientX-Se.left<Se.width/2){l();return}d()}},se=ve=>{if(t.length<=1)return;const Se=ve.currentTarget.getBoundingClientRect(),Ce=ve.clientX-Se.left,h=ve.clientY-Se.top,q=Math.min(52,Se.height*.2);if(h>Se.height-q){ve.currentTarget.style.cursor="default";return}ve.currentTarget.style.cursor=Ce<Se.width/2?"w-resize":"e-resize"},oe=s.useCallback(ve=>{ve.propertyName!=="transform"||!j.current||(de(),M(!1))},[de,M]),Re=ie?`translateX(${O}px)`:$>0?`translateY(${$}px)`:void 0,$e={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:Re,opacity:$>0?pe:W==="opening"||ke?0:1,transition:D&&!C?"none":C?`transform ${Kn}ms ${Oi}`:K?`transform ${Kn}ms ${Oi}, opacity ${Kn}ms ${Oi}`:W==="opening"||ke?`opacity ${Kn}ms ${Oi}`:"none",pointerEvents:ae&&he&&!ie?"auto":"none",touchAction:ae&&he?"none":void 0,zIndex:9998},Me=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:W==="open"?"none":void 0},onClick:ne,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:he?ye:0,transition:D?"none":`opacity ${Kn}ms ${Oi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:y,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:he?1:0,transition:`opacity ${Kn}ms ${Oi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:he?1:0,transition:`opacity ${Kn}ms ${Oi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&V&&(ae?a.jsx(kS,{src:V.url,phase:W,mediaRef:m,mediaStyle:$e,onLoadedMetadata:le,onClick:Z,onMouseMove:se,onTransitionEnd:oe},`${n}-${V.url}`):a.jsx("img",{ref:m,src:V.url,alt:V.name,onLoad:le,onTransitionEnd:oe,style:$e},`${n}-${V.url}`)),he&&Me&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:B.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ve=>{if(w.current){w.current=!1;return}ve.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ve=>{if(w.current){w.current=!1;return}ve.stopPropagation(),d()}})]})]})}function Qc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Os(t)?"video":"image"}`,y=r.display==="cover",m=RS(r),g=W=>F.scalingValue(W,l??!1),f=n??mo,x=o?{width:"100%",maxWidth:"100%"}:{width:g(f),maxWidth:"100%"},P=i?{borderRadius:g(i)}:{},b={...x,...y?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...P},w={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:P},H={className:v,style:w,onClick:p?W=>{W.stopPropagation(),p()}:void 0},B=Math.max(d,zi),k=Os(t)?a.jsx("video",{...H,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...H,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[y?a.jsx("div",{style:b,children:k}):k,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(B)}})]})}function MS({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),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"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&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(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function AS(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function ed({P:e,scaled:t,height:n,paired:i}){return a.jsx("div",{"data-controls":"titleTopPadding",...i?{"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:t(n)}})}function td({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:r,paired:l,anchorStyle:d}){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%",...d}})}function ps({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:r,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=s.useRef(null),[v,y]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>y(f.offsetHeight);x();const P=new ResizeObserver(x);return P.observe(f),()=>P.disconnect()},[m,g]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${v}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const nd=45;function id(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 FS(e){const t=id(e,"--cntrl-viewport-height",window.innerHeight),n=id(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function NS(e,t,n){const{top:i,centerY:o}=FS(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const r=e.top+e.height/2;return Math.abs(r-o)}function _S(e,t,n){const i=Array.from({length:t},(l,d)=>{const c=e.current[d];if(!c)return 0;const u=c.getBoundingClientRect(),p=NS(u,n,c);return Math.exp(-(p*p)/(2*nd*nd))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function WS(e,t,n){const i=s.useRef([]),[{opacities:o,dominantIndex:r},l]=s.useState(()=>({opacities:Array.from({length:e},(c,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 c=0;const u=()=>{l(_S(i,e,n))},p=()=>{c||(c=window.requestAnimationFrame(()=>{c=0,u()}))};return u(),window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p,{passive:!0}),()=>{c&&window.cancelAnimationFrame(c),window.removeEventListener("scroll",p),window.removeEventListener("resize",p)}},[t,e,n]),{setTitleRef:c=>u=>{i.current[c]=u},opacities:o,dominantIndex:r}}function HS(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),d=Math.max(r.length,l.length);if(d===0||o.current===e)return;let c=0;const u=window.setInterval(()=>{c+=1;const p=[...l.slice(0,c),...r.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function OS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var it;const{prefix:l}=F.useScopedStyles(),d=s.useMemo(()=>gS(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??mo,y=(e==null?void 0:e.titleWidth)??LS,m=IS(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??pS,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,P=(e==null?void 0:e.titleLeftPadding)??0,b=(e==null?void 0:e.titleRightPadding)??0,w=AS(e==null?void 0:e.transition),j=(e==null?void 0:e.lightbox)??"on",H=p==="b",B=w==="fade"||w==="retype",{setTitleRef:k,dominantIndex:W}=WS(c.length,B,f),U=((it=c[W])==null?void 0:it.title)??"",$=HS(U,w==="retype"),I=w==="fade"||w==="retype",O=w==="retype"?$:U,_=H?void 0:{width:F.scalingValue(v,n??!1)},C=j==="on"&&(!n||i||o),L=o??!1,D=(e==null?void 0:e.galleryPaddingRight)??0,S=(e==null?void 0:e.galleryPaddingLeft)??0,K=(e==null?void 0:e.galleryPaddingBetween)??0,T=nt=>F.scalingValue(nt,n??!1),V={width:T(y)},ae=p==="a"?D:S,ie=H?{width:"100%"}:{width:`calc(100% - ${T(v)} - ${T(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},M=Math.max(D,zi),de=Math.max(S,zi),X=Math.max(K,zi),le=Math.max(x,zi),ne=Math.max(P,zi),he=Math.max(b,zi),ke=Math.max(0,(u??1)-(v??mo)),ye=p==="a"?Math.max(0,(u??1)-(v??mo)-D):p==="c"?Math.max(0,(u??1)-(v??mo)-S):p==="b"?u??1:1,pe=L&&(p==="a"||p==="b"||p==="c")&&f==="top",Z=L&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),se=L&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),oe=c.length>1,Re=H?void 0:T((p==="c"?S:D)+(v??mo)),$e=p==="c"&&Re?{left:Re}:void 0,Me=p==="a"&&Re?{right:Re}:void 0,ve=H?{left:0,width:"100%"}:p==="a"?{right:T(D),width:T(v)}:{left:T(S),width:T(v)},{titleColor:Se,titleFontFamily:Ce,titleFontSettings:h,titleFontSize:q,titleLineHeight:Y,titleLetterSpacing:ee,titleWordSpacing:fe,titleAlign:z,titleTextAppearance:R,lightboxCounterColor:Q,lightboxCounterFontFamily:te,lightboxCounterFontSettings:ce,lightboxCounterFontSize:G,lightboxCounterLineHeight:Ie,lightboxCounterLetterSpacing:xe,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:He}=e??{},je={fontSettings:{fontFamily:Ce,fontWeight:(h==null?void 0:h.fontWeight)??400,fontStyle:(h==null?void 0:h.fontStyle)??"normal"},fontSize:q??.01,lineHeight:Y,letterSpacing:ee??0,wordSpacing:fe??0,textAlign:z??"left",textAppearance:R,color:Se??"#000000"},Ve=dn(Qt(je,n)),et=V,Ze=Jc(q,Y,l,n),Ye=Zc(q,Y,`${l}-title`,`${l}-text-tight-leading`),be={fontSettings:{fontFamily:te,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:G??.01,lineHeight:Ie,letterSpacing:xe??0,wordSpacing:J??0,textAppearance:He,color:Q??"#DEDDDD"},ze={...dn(Qt(be,n)),...Jc(G,Ie,l,n)},Qe=Zc(G,Ie,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ge=F.buildColorVars(l,{titleColor:Se??"#000000",lightboxCounterColor:Q??"#DEDDDD"},vS,xS),_e=s.useRef(null),[Xe,tt]=s.useState(!1),[ft,ot]=s.useState([]),[De,Fe]=s.useState(0),Ee=s.useCallback((nt,me)=>{C&&(ot(nt),Fe(me),tt(!0))},[C]),Je=s.useCallback(()=>{tt(!1)},[]),We=s.useMemo(()=>{const nt={...ge},me=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return me&&(nt["--cntrl-article-width"]=me),nt},[ge,Xe]);return s.useEffect(()=>{if(!Xe||j!=="on"||typeof document>"u")return;const nt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=nt}},[Xe,j]),s.useEffect(()=>{!n||o||i||tt(!1)},[n,o,i]),s.useEffect(()=>{j==="off"&&tt(!1)},[j]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:ge,children:a.jsxs("div",{ref:_e,className:`${l}-wrapper`,style:{width:F.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?T(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?T(P):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?T(b):void 0},children:[I&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(ps,{P:l,title:O,position:f,titleRef:()=>{},titleClassName:`${Ye} ${l}-single-title`,titleContainerStyle:{...Ze,...ie},titleTextBoxStyle:et,titleStyle:Ve,showTextBoxOutline:L,topPaddingControl:pe?ed({P:l,scaled:T,height:le,paired:!1}):void 0})}),c.map((nt,me)=>{const Ne=$S(nt.gallery),at=me<c.length-1,ut=Ne.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),Ge={P:l,position:f,titleRef:k(me),titleClassName:Ye,titleContainerStyle:Ze,titleTextBoxStyle:I?{maxWidth:"100%"}:et,titleStyle:Ve,showTextBoxOutline:L&&!I,topPaddingControl:pe&&!I?ed({P:l,scaled:T,height:le,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":me,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:at?T(K):void 0},children:[Z&&td({P:l,controlKey:"titleLeftPadding",scaled:T,width:ne,maxFraction:ye,side:"left",paired:oe,anchorStyle:$e}),se&&td({P:l,controlKey:"titleRightPadding",scaled:T,width:he,maxFraction:ye,side:"right",paired:oe,anchorStyle:Me}),L&&at&&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:T(X),...ve}}),H?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,imgWidth:v||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:K,showPaddingAfter:Lt<Ne.length-1,showControls:L,onMediaClick:C&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(ps,{...Ge,title:I?"":nt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(ps,{...Ge,title:I?"":nt.title}),Ne.length>0&&a.jsx(MS,{P:l,layoutType:p,galleryWidthStyle:_,galleryPaddingRight:D,galleryPaddingLeft:S,galleryPaddingRightWidth:M,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:ke,showControls:L,scaled:T,children:Ne.map(({displayMedia:pt,lightboxMedia:Tt},Lt)=>{const xt=Tt?ut.findIndex(Et=>Et.url===Tt.url):-1;return a.jsx(Qc,{P:l,media:pt,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:K,showPaddingAfter:Lt<Ne.length-1,showControls:L,onMediaClick:C&&xt>=0?()=>Ee(ut,xt):void 0},`${pt.url}-${Lt}`)})})]})]},me)})]})}),Xe&&j==="on"&&typeof document<"u"&&e&&(()=>{const nt=(r?document.getElementById(r):null)??document.body;return si.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(ES,{prefix:l,items:ft,index:De,imageDisplay:PS(e.lightboxImageDisplay),isEditor:n,onClose:Je,onPrev:()=>Fe(me=>(me-1+ft.length)%ft.length),onNext:()=>Fe(me=>(me+1)%ft.length),counterClassName:Qe,counterStyle:ze,backgroundColor:e.backgroundColor??hS})}),nt)})()]})}const DS=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
21073
21073
  import { createPortal } from 'react-dom';
21074
21074
  import type React from 'react';
21075
21075
  import { CommonComponentProps } from '../props';
@@ -23167,7 +23167,7 @@ ${t}
23167
23167
  `}function Rr(e){return Number(e.toFixed(4))}function rd(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 gs(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 aw(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 sw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function lw(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 tp(e,t){return(1-e)/(1-e*Math.cos(t))}function cw(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)*tp(e,i)))}return t||1}function dw(e,t){return e?1:1+ep*(.35+t)}function uw(e,t,n,i){const o=t*dw(n,i);return Math.max(0,(e-o)/2)}function np(e,t,n){const i=tp(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function ip(e,t,n){return e/2+t*n}function pw(e,t,n){return e(t-n/2)}function mw(e,t){return e*t}function op(e){return Math.round(e*1e3)}function rp(e,t,n){const i=Math.cos(e),o=Math.cos(ow*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Rr(t+(n-t)*r)}function ap(e){return rp(e,ew,tw)}function gw(e){return rp(e,nw,iw)}function sp(e,t){if(!t)return"none";const n=gw(e);return n<=0?"none":`blur(${n}px)`}function hw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=np(i,o,r*Math.PI*2),p=r*Math.PI*2,v=ip(t,n,c),y=Rr(u),m=`calc(${e(v)} - var(--helix-base-w) * ${y} / 2)`,g=`calc(var(--helix-base-w) * ${y})`,f=l?`height: calc(var(--helix-base-h) * ${y});`:"";return`left: ${m}; width: ${g}; ${f} z-index: ${op(u)}; transform: translateY(-50%); opacity: ${ap(p)}; filter: ${sp(p,d)};`}function fw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=od;u+=1){const p=u/od;c.push(` ${Rr(p*100)}% { ${hw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
23168
23168
  ${c.join(`
23169
23169
  `)}
23170
- }`}function lp(e,t){return(e%t+t)%t}function yw(e,t){return Ml(e,t)/t}function Ml(e,t){return lp(e,t)}function vw(e,t){return Math.floor(e/t)}function xw(e,t,n,i){return vw(e,t)*n+Ml(e,t)*i}function bw(e,t,n){const i=n==="left"?1-e:e;return`${Rr(-i*t)}s`}function ad(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function cp(e){const t=e%1;return t<0?t+1:t}function Sw(e,t,n){const i=t/Qu,o=n==="left"?-e*i:e*i;return cp(o)}function ww({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=F.useScopedStyles(),r=s.useRef(null),l=gs((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),XS),d=gs(e==null?void 0:e.imageWidth,qS),c=gs(e==null?void 0:e.turnHeight,US),u=rd(e==null?void 0:e.itemsPerTurn,YS,3,40),p=rd(e==null?void 0:e.turns,KS,1,30),v=Math.min(QS,Math.max(0,ZS)),y=Math.min(1,Math.max(0,JS)),m=Math.max(0,(e==null?void 0:e.speed)??Qu),g=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,R=(e==null?void 0:e.blur)!=="off",b=s.useMemo(()=>aw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),S=b.display==="cover",G=ie=>F.scalingValue(ie,n??!1),D=s.useMemo(()=>cw(v),[v]),j=s.useMemo(()=>uw(l,d,S,y),[l,d,S,y]),P=s.useMemo(()=>rw(o,fw(o,G,l,j,v,D,S,R)),[o,l,j,v,D,S,R,n]),M=s.useMemo(()=>(t??[]).filter(ie=>{var N;return!!((N=ie.image)!=null&&N.url)}),[t]),K=c/u,T=d*sw(b),L=Math.min(VS,p*u),_=GS*u,z=L+_*2,k=Math.max(0,p-1)*c+(u-1)*K,W=m>0,w=f==="scroll"&&W,U=f==="autoplay"&&W&&(n?!!i:!0),[C,O]=s.useState(0);s.useEffect(()=>{if(!w)return;const ie=r.current;if(!ie)return;const N=()=>{const X=ie.getBoundingClientRect(),ce=window.innerHeight||document.documentElement.clientHeight,oe=ce+X.height;oe<=0||O(Math.min(1,Math.max(0,(ce-X.top)/oe)))};N(),window.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N);const de=new ResizeObserver(N);return de.observe(ie),()=>{window.removeEventListener("scroll",N),window.removeEventListener("resize",N),de.disconnect()}},[w]);const V=w?Sw(C,m,g):0,se=W&&f==="autoplay"?360/(m*jS):0;return M.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:P}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:G(l),marginInline:"auto"}})]}):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(k),marginInline:"auto"},children:Array.from({length:z},(ie,N)=>{const de=N-_,ce=M[lp(de,M.length)].image,oe=Ml(de,u),fe=yw(de,u),Pe=w?cp(fe+V):fe,xe=xw(de,u,c,K),pe=y===0?0:(ad(oe+7.3)-.5)*y*K,Z=S?1:1+(ad(oe+3.1)-.5)*2*ep*(.35+y),le=Pe*Math.PI*2,{offset:re,scale:Ie}=np(v,D,le),we=d*Z,Me=mw(we,Ie),ye=ip(l,j,re),be={"--helix-base-w":G(we),...S?{"--helix-base-h":G(T)}:{}},Ce={top:G(xe+pe),transform:"translateY(-50%)",...be,...U?{animationDuration:`${Rr(se)}s`,animationDelay:bw(fe,se,g),animationDirection:g==="left"?"reverse":"normal"}:{left:pw(G,ye,Me),width:G(Me),...S?{height:G(T*Ie)}:{},zIndex:op(Ie),opacity:ap(le),filter:sp(le,R)}},h=x>0?{borderRadius:G(x)}:{},q=S?{...h,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:h,Y=lw(ce)?a.jsx("video",{className:`${o}-media`,style:q,src:ce.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:q,src:ce.url,alt:ce.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:U?`${o}-item`:`${o}-item ${o}-item-static`,style:Ce,children:S?a.jsx("div",{className:`${o}-cover`,style:h,children:Y}):Y},`${p}-${u}-${de}`)})})]})}const $w=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23170
+ }`}function lp(e,t){return(e%t+t)%t}function yw(e,t){return Ml(e,t)/t}function Ml(e,t){return lp(e,t)}function vw(e,t){return Math.floor(e/t)}function xw(e,t,n,i){return vw(e,t)*n+Ml(e,t)*i}function bw(e,t,n){const i=n==="left"?1-e:e;return`${Rr(-i*t)}s`}function ad(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function cp(e){const t=e%1;return t<0?t+1:t}function Sw(e,t,n){const i=t/Qu,o=n==="left"?-e*i:e*i;return cp(o)}function ww({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=F.useScopedStyles(),r=s.useRef(null),l=gs((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),XS),d=gs(e==null?void 0:e.imageWidth,qS),c=gs(e==null?void 0:e.turnHeight,US),u=rd(e==null?void 0:e.itemsPerTurn,YS,3,40),p=rd(e==null?void 0:e.turns,KS,1,30),v=Math.min(QS,Math.max(0,ZS)),y=Math.min(1,Math.max(0,JS)),m=Math.max(0,(e==null?void 0:e.speed)??Qu),g=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,P=(e==null?void 0:e.blur)!=="off",b=s.useMemo(()=>aw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=b.display==="cover",j=ie=>F.scalingValue(ie,n??!1),H=s.useMemo(()=>cw(v),[v]),B=s.useMemo(()=>uw(l,d,w,y),[l,d,w,y]),k=s.useMemo(()=>rw(o,fw(o,j,l,B,v,H,w,P)),[o,l,B,v,H,w,P,n]),W=s.useMemo(()=>(t??[]).filter(ie=>{var M;return!!((M=ie.image)!=null&&M.url)}),[t]),U=c/u,$=d*sw(b),I=Math.min(VS,p*u),O=GS*u,_=I+O*2,L=Math.max(0,p-1)*c+(u-1)*U,D=m>0,S=f==="scroll"&&D,K=f==="autoplay"&&D&&(n?!!i:!0),[T,N]=s.useState(0);s.useEffect(()=>{if(!S)return;const ie=r.current;if(!ie)return;const M=()=>{const X=ie.getBoundingClientRect(),le=window.innerHeight||document.documentElement.clientHeight,ne=le+X.height;ne<=0||N(Math.min(1,Math.max(0,(le-X.top)/ne)))};M(),window.addEventListener("scroll",M,{passive:!0}),window.addEventListener("resize",M);const de=new ResizeObserver(M);return de.observe(ie),()=>{window.removeEventListener("scroll",M),window.removeEventListener("resize",M),de.disconnect()}},[S]);const V=S?Sw(T,m,g):0,ae=D&&f==="autoplay"?360/(m*jS):0;return W.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:j(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:j(l),height:j(L),marginInline:"auto"},children:Array.from({length:_},(ie,M)=>{const de=M-O,le=W[lp(de,W.length)].image,ne=Ml(de,u),he=yw(de,u),ke=S?cp(he+V):he,ye=xw(de,u,c,U),pe=y===0?0:(ad(ne+7.3)-.5)*y*U,Z=w?1:1+(ad(ne+3.1)-.5)*2*ep*(.35+y),se=ke*Math.PI*2,{offset:oe,scale:Re}=np(v,H,se),$e=d*Z,Me=mw($e,Re),ve=ip(l,B,oe),Se={"--helix-base-w":j($e),...w?{"--helix-base-h":j($)}:{}},Ce={top:j(ye+pe),transform:"translateY(-50%)",...Se,...K?{animationDuration:`${Rr(ae)}s`,animationDelay:bw(he,ae,g),animationDirection:g==="left"?"reverse":"normal"}:{left:pw(j,ve,Me),width:j(Me),...w?{height:j($*Re)}:{},zIndex:op(Re),opacity:ap(se),filter:sp(se,P)}},h=x>0?{borderRadius:j(x)}:{},q=w?{...h,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:h,Y=lw(le)?a.jsx("video",{className:`${o}-media`,style:q,src:le.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:q,src:le.url,alt:le.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:K?`${o}-item`:`${o}-item ${o}-item-static`,style:Ce,children:w?a.jsx("div",{className:`${o}-cover`,style:h,children:Y}):Y},`${p}-${u}-${de}`)})})]})}const $w=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
23171
23171
  import { CommonComponentProps } from '../props';
23172
23172
  import { scalingValue } from '../utils/scalingValue';
23173
23173
  import { useScopedStyles } from '../utils/useScopedStyles';
@@ -23705,7 +23705,7 @@ export function Helix({
23705
23705
  </>
23706
23706
  );
23707
23707
  }
23708
- `,Cw=["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"],Tw={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:Cw.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"]}]}]},Lw={element:ww,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:Tw,sourceCode:$w,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Sn=300,en=300,Iw=8/1440,ho=.004,Rw=50,Pw=1440,Vi=Rw/Pw;function kw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Ew(e){return e==="center"||e==="right"?e:"left"}function Mw(e){return e==="left"||e==="right"?e:"center"}function Aw(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Fw(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 dp(e,t){const n=(Fw(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 Nw(e,t,n){switch(dp(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 _w(e,t){switch(dp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function Ww(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 sd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function up(e){const t=e.link;if(t&&typeof t=="object"){const i=sd(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=sd(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 Ds(e,t){const n=e.label||"Link",i=up(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const d=i.value.replace(/^#/,"");return{label:n,href:d?`#${d}`:"",target:i.target}}const o=Ww(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const fi=24,hi=fi*.125,pp=fi*.125,hs=(fi-(3*hi+2*pp))/2,ld=hi+pp;function Hw({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${fi} ${fi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:hs,width:fi,height:hi,rx:hi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:hs+ld,width:fi,height:hi,rx:hi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:hs+2*ld,width:fi,height:hi,rx:hi/2})]})}function Ow(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Dw(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function cd(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 dd(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)),...Dw(t.fontSize,t.lineHeight,e,n)},className:Ow(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function ud(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 pd(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 mp(e){const n=Math.max(Vi,e.fontSize??Vi),{start:i,end:o}=pd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=pd(e.textPaddingLeft,e.textPaddingRight,1,Vi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function zw(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function Bw(e){return e.position?zw(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function jw(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const Vw=[["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 gp(e){var o,r;const t=e,n={};for(const[l,d]of Vw)e[d]!==void 0||t[l]===void 0||(n[d]=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 md(e){var o,r,l,d,c,u,p,v,y,m,g,f,x,R,b,S,G,D;e=gp(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 j=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((d=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:d.linkColor)??e.linkColor;j!==void 0&&(n.openLinkColor=j)}if(e.compactIconColor===void 0){const j=((u=(c=e.stateOverrides)==null?void 0:c.compact)==null?void 0:u.iconColor)??e.iconColor;j!==void 0&&(n.compactIconColor=j)}if(e.compactCloseButtonColor===void 0){const j=((v=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:v.closeButtonColor)??e.closeButtonColor;j!==void 0&&(n.compactCloseButtonColor=j)}if(e.compactLinkColor===void 0){const j=((m=(y=e.stateOverrides)==null?void 0:y.compact)==null?void 0:m.linkColor)??e.linkColor;j!==void 0&&(n.compactLinkColor=j)}if(e.compactLogoColor===void 0){const j=((f=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:f.logoColor)??e.logoColor;j!==void 0&&(n.compactLogoColor=j)}if(e.openLogoColor===void 0){const j=((R=(x=e.stateOverrides)==null?void 0:x.open)==null?void 0:R.logoColor)??e.logoColor;j!==void 0&&(n.openLogoColor=j)}if(e.compactBackgroundColor===void 0){const j=((S=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:S.backgroundColor)??((D=(G=t.stateOverrides)==null?void 0:G.compact)==null?void 0:D.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;j!==void 0&&(n.compactBackgroundColor=j)}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=(j,P)=>{if(e[j]!==void 0)return;const M=e[P];M!==void 0&&(n[j]=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 Gw(e,t){const n=mp({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 Xw(e,t){return{paddingLeft:F.scalingValue(e.effectivePaddingLeft,t),paddingRight:F.scalingValue(e.effectivePaddingRight,t),paddingTop:F.scalingValue(e.effectivePaddingTop,t),paddingBottom:F.scalingValue(e.effectivePaddingBottom,t)}}function qw(e,t,n,i){const o=Math.max(Vi,n??Vi),r=Math.max(t.effectivePaddingTop,ho),l=Math.max(t.effectivePaddingBottom,ho),d=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),c=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,ho),p=Math.max(t.effectivePaddingRight,ho),v=Math.max(0,t.panelSize-t.effectivePaddingRight-Vi),y=Math.max(0,t.panelSize-t.effectivePaddingLeft-Vi);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(d),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(c),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(v),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(y),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const Uw={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"},Yw=["hover","open"],Kw={top:"flex-start",center:"center",bottom:"flex-end"},Zw={left:"flex-start",center:"center",right:"flex-end"};function Jw(e){return`
23708
+ `,Cw=["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"],Tw={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:Cw.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"]}]}]},Lw={element:ww,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:Tw,sourceCode:$w,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Sn=300,en=300,Iw=8/1440,ho=.004,Rw=50,Pw=1440,Vi=Rw/Pw;function kw(e){if(e==="default"||e==="compact"||e==="open")return e;if(e==="onScroll")return"compact"}function Ew(e){return e==="center"||e==="right"?e:"left"}function Mw(e){return e==="left"||e==="right"?e:"center"}function Aw(e,t,n){const i=F.scalingValue(t,n);return e==="center"?`translateX(calc(-50% + ${i}))`:`translateX(${i})`}function Fw(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 dp(e,t){const n=(Fw(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 Nw(e,t,n){switch(dp(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 _w(e,t){switch(dp(e.showIn,t)){case"default and compact":return!1;default:return!0}}function Ww(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 sd(e){const t=(e??"").toLowerCase();return t==="blank"||t==="_blank"||t.includes("new")}function up(e){const t=e.link;if(t&&typeof t=="object"){const i=sd(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=sd(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 Ds(e,t){const n=e.label||"Link",i=up(e);if(i.type==="url")return{label:n,href:i.value,target:i.target};if(i.type==="anchor"){const d=i.value.replace(/^#/,"");return{label:n,href:d?`#${d}`:"",target:i.target}}const o=Ww(i.value,t),r=(i.anchor??"").replace(/^#/,""),l=r?o?`${o}#${r}`:`#${r}`:o;return{label:n,href:l,target:i.target}}const yi=24,fi=yi*.125,pp=yi*.125,hs=(yi-(3*fi+2*pp))/2,ld=fi+pp;function Hw({className:e,lineClassName:t}){return a.jsxs("svg",{className:e,viewBox:`0 0 ${yi} ${yi}`,"aria-hidden":"true",children:[a.jsx("rect",{className:`${t} ${t}-top`,x:"0",y:hs,width:yi,height:fi,rx:fi/2}),a.jsx("rect",{className:`${t} ${t}-mid`,x:"0",y:hs+ld,width:yi,height:fi,rx:fi/2}),a.jsx("rect",{className:`${t} ${t}-bot`,x:"0",y:hs+2*ld,width:yi,height:fi,rx:fi/2})]})}function Ow(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Dw(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:F.scalingValue((o-t)/2,i)}}function cd(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 dd(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)),...Dw(t.fontSize,t.lineHeight,e,n)},className:Ow(t.fontSize,t.lineHeight,`${e}-link-text`,`${e}-text-tight-leading`)}}function ud(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 pd(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 mp(e){const n=Math.max(Vi,e.fontSize??Vi),{start:i,end:o}=pd(e.textPaddingTop,e.textPaddingBottom,1,n),{start:r,end:l}=pd(e.textPaddingLeft,e.textPaddingRight,1,Vi);return{effectivePaddingLeft:r,effectivePaddingRight:l,effectivePaddingTop:i,effectivePaddingBottom:o,panelSize:1}}function zw(e){if(e==="center"||e==="center-center")return{horizontalAlign:"center",verticalAlign:"center"};const[t,n]=e.split("-");return{horizontalAlign:t,verticalAlign:n}}function Bw(e){return e.position?zw(e.position):{horizontalAlign:e.horizontalAlign??"left",verticalAlign:e.verticalAlign??"top"}}function jw(e,t){return e.textPaddingLeft!==t.textPaddingLeft||e.textPaddingRight!==t.textPaddingRight||e.textPaddingTop!==t.textPaddingTop||e.textPaddingBottom!==t.textPaddingBottom}const Vw=[["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 gp(e){var o,r;const t=e,n={};for(const[l,d]of Vw)e[d]!==void 0||t[l]===void 0||(n[d]=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 md(e){var o,r,l,d,c,u,p,v,y,m,g,f,x,P,b,w,j,H;e=gp(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 B=((r=(o=e.stateOverrides)==null?void 0:o.open)==null?void 0:r.openLinkColor)??((d=(l=e.stateOverrides)==null?void 0:l.open)==null?void 0:d.linkColor)??e.linkColor;B!==void 0&&(n.openLinkColor=B)}if(e.compactIconColor===void 0){const B=((u=(c=e.stateOverrides)==null?void 0:c.compact)==null?void 0:u.iconColor)??e.iconColor;B!==void 0&&(n.compactIconColor=B)}if(e.compactCloseButtonColor===void 0){const B=((v=(p=e.stateOverrides)==null?void 0:p.compact)==null?void 0:v.closeButtonColor)??e.closeButtonColor;B!==void 0&&(n.compactCloseButtonColor=B)}if(e.compactLinkColor===void 0){const B=((m=(y=e.stateOverrides)==null?void 0:y.compact)==null?void 0:m.linkColor)??e.linkColor;B!==void 0&&(n.compactLinkColor=B)}if(e.compactLogoColor===void 0){const B=((f=(g=e.stateOverrides)==null?void 0:g.compact)==null?void 0:f.logoColor)??e.logoColor;B!==void 0&&(n.compactLogoColor=B)}if(e.openLogoColor===void 0){const B=((P=(x=e.stateOverrides)==null?void 0:x.open)==null?void 0:P.logoColor)??e.logoColor;B!==void 0&&(n.openLogoColor=B)}if(e.compactBackgroundColor===void 0){const B=((w=(b=e.stateOverrides)==null?void 0:b.compact)==null?void 0:w.backgroundColor)??((H=(j=t.stateOverrides)==null?void 0:j.compact)==null?void 0:H.panelColor)??t.compactPanelColor??t.onScrollPanelColor??e.backgroundColor??n.backgroundColor;B!==void 0&&(n.compactBackgroundColor=B)}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=(B,k)=>{if(e[B]!==void 0)return;const W=e[k];W!==void 0&&(n[B]=W)};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 Gw(e,t){const n=mp({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 Xw(e,t){return{paddingLeft:F.scalingValue(e.effectivePaddingLeft,t),paddingRight:F.scalingValue(e.effectivePaddingRight,t),paddingTop:F.scalingValue(e.effectivePaddingTop,t),paddingBottom:F.scalingValue(e.effectivePaddingBottom,t)}}function qw(e,t,n,i){const o=Math.max(Vi,n??Vi),r=Math.max(t.effectivePaddingTop,ho),l=Math.max(t.effectivePaddingBottom,ho),d=Math.max(0,t.panelSize-t.effectivePaddingBottom-o),c=Math.max(0,t.panelSize-t.effectivePaddingTop-o),u=Math.max(t.effectivePaddingLeft,ho),p=Math.max(t.effectivePaddingRight,ho),v=Math.max(0,t.panelSize-t.effectivePaddingRight-Vi),y=Math.max(0,t.panelSize-t.effectivePaddingLeft-Vi);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(d),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(c),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(v),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(y),className:`${e}-control-anchor`,style:{top:0,right:0,width:i(p),height:"100%"}})]})}const Uw={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"},Yw=["hover","open"],Kw={top:"flex-start",center:"center",bottom:"flex-end"},Zw={left:"flex-start",center:"center",right:"flex-end"};function Jw(e){return`
23709
23709
  .${e}-root {
23710
23710
  position: relative;
23711
23711
  display: block;
@@ -24273,7 +24273,7 @@ export function Helix({
24273
24273
  word-spacing ${en}ms ease,
24274
24274
  padding ${en}ms ease;
24275
24275
  }
24276
- `}function Qw(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function e$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function t$(e){const t=e$(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 n$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function i$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function gd(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 o$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:d}=n,c=e.currentTarget.getAttribute("href")??"",u=n$(c),p=e.currentTarget.target==="_blank";if(r&&d){e.preventDefault(),e.stopPropagation();const v=Ds(r,l),y=up(r);d({mode:y.type==="url"?"url":"page",href:v.href||c,page:y.type==="page"?y.value:void 0,url:y.type==="url"?y.value:void 0,anchor:y.type==="anchor"?y.value.replace(/^#/,""):(y.anchor??"").replace(/^#/,""),target:v.target}),t();return}if(i){e.preventDefault(),gd(u),t();return}!p&&u&&i$(c)&&gd(u)&&e.preventDefault(),t()}const r$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function a$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function s$(e){const t={},n=a$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of r$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function hd(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 l$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:d=[],layoutId:c,pages:u,onLinkNavigate:p,onUpdateSettings:v,onOpenChange:y}){const{prefix:m}=F.useScopedStyles(),g=s.useRef(null),f=s.useRef(null),x=s.useRef(0),R=s.useRef(null),b=s.useRef(c),S=s.useMemo(()=>Jw(m),[m]),[G,D]=s.useState(!1),[j,P]=s.useState(!1),[M,K]=s.useState(!1),T=kw(r),L=s.useMemo(()=>new Set(d),[d]),_=Wt=>!!(Wt&&L.has(Wt)),$=!!(t&&!i&&T==="open"&&!_("open"))||!(t&&!i)&&G,k=!_("compact")&&!_("onScroll"),W=!t||!!i&&!n,w=o&&o!=="default"?o:void 0,U=k&&T==="compact"?"compact":"default",[C,O]=s.useState(U),[V,se]=s.useState(!1),ie=!n;U!==C&&(O(U),ie&&se(!0));const N=gp(e),{logo:de,logoMaxHeight:X=120/1440,logoPosition:ce="left",panelHeight:oe=60/1440,backgroundColor:fe="#b3b3b3",logoColor:Pe="#000000",position:xe,horizontalAlign:pe,verticalAlign:Z,iconColor:le="#000000",showIcon:re="on",iconSize:Ie=16/1440,linkColor:we="#000000",openLinkColor:Me="#000000",compactIconColor:ye="#000000",compactCloseButtonColor:be="#000000",compactLinkColor:Ce="#000000",compactLogoColor:h="#000000",compactBackgroundColor:q="#ffffff",compactLogoMaxHeight:Y=120/1440,compactLogoPosition:ee,compactPanelHeight:ve=60/1440,compactShowIcon:B="on",compactIconSize:I=16/1440,compactNavTextWidth:Q,compactNavTextPosition:ne,compactNavTextOffset:H,compactNavGap:te,compactNavPaddingLeft:ke=10/1440,compactNavPaddingRight:ge=10/1440,compactFontFamily:J,compactFontSettings:Ye,compactFontSize:je,compactLineHeight:it,compactLetterSpacing:qe=0,compactWordSpacing:et=0,compactTextAlign:Je="left",compactTextAppearance:Ge,openLogoColor:$e="#000000",menuBackgroundColor:He="#ffffff",overlayColor:De="rgba(0, 0, 0, 0.45)",closeButtonColor:Qe="#000000",effect:he="fade",textWidth:_e=280/1440,navTextWidth:Ve,navTextPosition:tt="center",navTextOffset:ft=0,gap:rt=0,navGap:Oe,navPaddingLeft:Fe=10/1440,navPaddingRight:Ee=10/1440,textPaddingLeft:Ze=10/1440,textPaddingRight:We=10/1440,textPaddingTop:ot=10/1440,textPaddingBottom:nt=10/1440,fontFamily:me,fontSettings:Ne,fontSize:st,lineHeight:ut,letterSpacing:Be=0,wordSpacing:pt=0,textAlign:Tt="left",textAppearance:Lt,openFontFamily:xt,openFontSettings:Et,openFontSize:Vt,openLineHeight:Ut,openLetterSpacing:Kt,openWordSpacing:Pt,openTextAlign:jt,openTextAppearance:on,stateOverrides:vt,link:Le}=N,{horizontalAlign:Xe,verticalAlign:lt}=Bw({position:xe,horizontalAlign:pe,verticalAlign:Z}),ct=U==="compact",wt=ct?Y:X,It=Ew(ct?ee:ce),gt=ct?ve:oe,Ot=ct?I:Ie,_t=ct?Q:Ve,Mt=Mw(ct?ne:tt),Gt=(ct?H:ft)??0,Xt=ct?te:Oe,Dt=ct?ke:Fe,zt=ct?ge:Ee,Bt=_t??_e,bt=$||(ct?B:re)!=="off",A=F.buildColorVars(m,{iconColor:le,closeButtonColor:Qe,linkColor:we,openLinkColor:Me,compactIconColor:ye,compactCloseButtonColor:be,compactLinkColor:Ce,compactLogoColor:h,compactBackgroundColor:q,openLogoColor:$e,menuBackgroundColor:He,overlayColor:De,backgroundColor:fe,logoColor:Pe},Uw,Yw,vt),Te=cd(ct?{fontFamily:J,fontSettings:Ye,fontSize:je,lineHeight:it,letterSpacing:qe,wordSpacing:et,textAlign:Je,textAppearance:Ge}:{fontFamily:me,fontSettings:Ne,fontSize:st,lineHeight:ut,letterSpacing:Be,wordSpacing:pt,textAlign:Tt,textAppearance:Lt}),Ae=cd({fontFamily:xt,fontSettings:Et,fontSize:Vt,lineHeight:Ut,letterSpacing:Kt,wordSpacing:Pt,textAlign:jt,textAppearance:on},Te),ze=dd(m,Te,t),mt=dd(m,Ae,t),Nt={...mt.css,whiteSpace:"pre-wrap"},ht=mt.className,St=Wt=>F.scalingValue(Wt,t),qt=Xt??rt,At=Math.max(Dt,ho),sn=Math.max(zt,ho),gn=Math.max(0,1-Ot),Xn=Math.max(0,1-Ot),yn=n??!1,qn=yn&&!$,ki=s.useMemo(()=>mp({textPaddingLeft:Ze,textPaddingRight:We,textPaddingTop:ot,textPaddingBottom:nt,fontSize:Ae.fontSize}),[Ze,We,ot,nt,Ae.fontSize]),Ji=Wt=>{const Yt=a.jsx("span",{className:ht,style:Nt,children:ud(Wt)});return hd(m,Yt,_e,yn,St)},Go={...Xw(ki,t),alignItems:Zw[Xe],justifyContent:Kw[lt]},un=s.useRef(e),An=s.useRef(c);s.useEffect(()=>{if(!v||!t){un.current=e,An.current=c;return}if(An.current!==c){un.current=e,An.current=c;const Mi=md(e);Mi!==e&&v(Mi);return}const Wt=md(e),Yt=un.current,vn=Yt!==e,Nn=vn?Gw(Wt,Yt):Wt;un.current=e;const Yn=Wt!==e,li=vn&&jw(Wt,Nn);!Yn&&!li||v(Nn)},[e,v,t,c]);const Rn=F.scalingValue(Ot,t),Un={width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,maxWidth:Rn,maxHeight:Rn},Qi={...ze.css,textDecoration:"none"},Xo=ze.className,eo=(de==null?void 0:de.mode)!=="Off",Se=(de==null?void 0:de.icon)??"",Ke=t$(Se),E=St(Math.min(wt,gt)),ue=!!(eo&&Se&&It==="right")?"left":"right",Re=Array.isArray(Le)?Le:[],Ue=[U!=="default"?`${m}-state-${U}`:"",T==="open"?`${m}-state-open`:"",w&&w!==U&&w!==T?`${m}-state-${w}`:""].filter(Boolean).join(" "),dt=t&&!i?`${m}-editor`:"",Rt=W?`${m}-interactive`:"",Ft=ie&&(U!==C||V)?`${m}-nav-state-anim`:"",rn=$?`${m}-open`:"",nn=s.useMemo(()=>s$(g.current),[j,$,c]),Fn=()=>{D(!1)},si=(Wt,Yt)=>{o$(Wt,Fn,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p})},to=()=>{t&&!i||D(Wt=>!Wt)},Ei=()=>{R.current!==null&&(window.clearTimeout(R.current),R.current=null)};s.useEffect(()=>{if(!V)return;const Wt=window.setTimeout(()=>{se(!1)},en);return()=>window.clearTimeout(Wt)},[V,U]),s.useEffect(()=>{if($){Ei(),P(!0);return}return x.current+=1,K(!1),Ei(),R.current=window.setTimeout(()=>{R.current=null,P(!1)},Sn),Ei},[$]),s.useLayoutEffect(()=>{b.current!==c&&(b.current=c,x.current+=1,Ei(),D(!1),K(!1),P(!1))},[c]),s.useLayoutEffect(()=>{var vn;if(!j||!$)return;const Wt=x.current+1;x.current=Wt,K(!1),(vn=f.current)==null||vn.offsetHeight;const Yt=requestAnimationFrame(()=>{x.current===Wt&&K(!0)});return()=>{cancelAnimationFrame(Yt)}},[j,$]),s.useEffect(()=>{y==null||y($)},[$,y]),s.useEffect(()=>{if(!$)return;const Wt=Yt=>{Yt.key==="Escape"&&(t&&i||Fn())};return window.addEventListener("keydown",Wt),()=>window.removeEventListener("keydown",Wt)},[$,t,i]),s.useEffect(()=>{t&&!i&&T!=="open"&&D(!1)},[t,i,T]),s.useEffect(()=>{i&&D(!1)},[i]);const Pr=yn&&$,_a=Wt=>Re.filter(Yt=>_w(Yt,c)).map((Yt,vn)=>{const{label:Nn,href:Yn,target:li}=Ds(Yt,u),Mi=Yn?a.jsx("a",{href:Yn,target:li,rel:li==="_blank"?"noopener noreferrer":void 0,className:`${Wt} ${m}-has-href`,onClick:Wa=>si(Wa,Yt),children:Ji(Nn)}):a.jsx("span",{className:Wt,children:Ji(Nn)});return a.jsxs(s.Fragment,{children:[vn>0&&a.jsx("div",{"data-controls":Pr?"gap":void 0,"data-controls-axis":"y",className:Pr?`${m}-gap-control`:void 0,style:{height:St(rt)}}),Mi]},vn)}),Tp=j?a.jsxs("div",{ref:f,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${he}`,M?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Rt,Ue].filter(Boolean).join(" "),style:{...A,...nn},"aria-hidden":!M,children:[a.jsx("button",{type:"button",className:`${m}-backdrop`,onClick:Fn,"aria-label":"Close menu"}),a.jsxs("nav",{className:`${m}-panel`,style:Go,"aria-label":"Menu",children:[yn&&qw(m,ki,Ae.fontSize,St),_a(`${m}-link`)]})]}):null,Lp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:to,"aria-expanded":$,"aria-label":$?"Close menu":"Open menu",children:a.jsx(Hw,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),kr=Wt=>{const Yt=Wt==="left",vn=Yt?Dt:zt,Nn=Yt?At:sn,Yn=Yt?gn:Xn,li=ct?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:St(vn),flexShrink:0},children:qn?a.jsx("div",{"data-controls":li,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(Yn),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:St(Nn),height:"100%"}}):null})},Ip=(Wt,Yt)=>{const{label:vn,href:Nn,target:Yn}=Ds(Wt,u),li=a.jsx("span",{className:Xo,style:Qi,children:ud(vn)}),Mi=hd(m,li,Bt,qn,St),Wa=Nn?a.jsx("a",{href:Nn,target:Yn,rel:Yn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:kp=>si(kp,Wt),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":qn?ct?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:qn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:St(qt),flexShrink:0}}),Wa]},Yt)},Rp={...A,height:F.scalingValue(gt,t),minHeight:F.scalingValue(gt,t),[`--${m}-panel-height`]:F.scalingValue(gt,t)},Pp=l&&U==="default"&&T!=="open"&&!i?St(oe+Iw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${Ue} ${dt} ${Rt} ${Ft}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Pp,...A},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Rp,children:[eo&&Se?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${It}`,children:[It==="left"?kr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Ke?` ${m}-nav-logo-tinted`:""}`,style:{height:E,...Ke?{[`--${m}-logo-image`]:Qw(Se)}:{}},children:[a.jsx("img",{src:Se,alt:"",className:`${m}-nav-logo-img`}),Ke?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),It==="right"?kr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Mt}`,style:{transform:Aw(Mt,Gt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Re.filter(Wt=>Nw(Wt,U,c)).map((Wt,Yt)=>Ip(Wt,Yt))})})]})}),Tp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${ue}`,children:[ue==="left"?kr("left"):null,bt?a.jsx("div",{className:`${m}-root ${rn}`.trim(),style:Un,children:Lp()}):null,ue==="right"?kr("right"):null]})]})}const c$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
24276
+ `}function Qw(e){return`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function e$(e){const t=e.trim().toLowerCase();return t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")?!0:t.includes(".svg")}function t$(e){const t=e$(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 n$(e){const t=e.indexOf("#");if(t===-1)return"";try{return decodeURIComponent(e.slice(t+1))}catch{return e.slice(t+1)}}function i$(e){if(!e||e.startsWith("#"))return!0;try{return new URL(e,window.location.href).pathname===window.location.pathname}catch{return!1}}function gd(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 o$(e,t,n={}){const{isEditor:i,isPreviewMode:o,item:r,pages:l,onLinkNavigate:d}=n,c=e.currentTarget.getAttribute("href")??"",u=n$(c),p=e.currentTarget.target==="_blank";if(r&&d){e.preventDefault(),e.stopPropagation();const v=Ds(r,l),y=up(r);d({mode:y.type==="url"?"url":"page",href:v.href||c,page:y.type==="page"?y.value:void 0,url:y.type==="url"?y.value:void 0,anchor:y.type==="anchor"?y.value.replace(/^#/,""):(y.anchor??"").replace(/^#/,""),target:v.target}),t();return}if(i){e.preventDefault(),gd(u),t();return}!p&&u&&i$(c)&&gd(u)&&e.preventDefault(),t()}const r$=["--cntrl-article-width","--cntrl-article-top","--cntrl-article-left","--cntrl-viewport-height"];function a$(e){let t=e;for(;t;){if(getComputedStyle(t).getPropertyValue("--cntrl-article-width").trim())return t;t=t.parentElement}return e}function s$(e){const t={},n=a$(e);if(!n)return t;const i=getComputedStyle(n);for(const o of r$){const r=i.getPropertyValue(o).trim();r&&(t[o]=r)}return t}function hd(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 l$({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,activeEvent:o,currentState:r,isSwitchClone:l=!1,unavailableStates:d=[],layoutId:c,pages:u,onLinkNavigate:p,onUpdateSettings:v,onOpenChange:y}){const{prefix:m}=F.useScopedStyles(),g=s.useRef(null),f=s.useRef(null),x=s.useRef(0),P=s.useRef(null),b=s.useRef(c),w=s.useMemo(()=>Jw(m),[m]),[j,H]=s.useState(!1),[B,k]=s.useState(!1),[W,U]=s.useState(!1),$=kw(r),I=s.useMemo(()=>new Set(d),[d]),O=Wt=>!!(Wt&&I.has(Wt)),C=!!(t&&!i&&$==="open"&&!O("open"))||!(t&&!i)&&j,L=!O("compact")&&!O("onScroll"),D=!t||!!i&&!n,S=o&&o!=="default"?o:void 0,K=L&&$==="compact"?"compact":"default",[T,N]=s.useState(K),[V,ae]=s.useState(!1),ie=!n;K!==T&&(N(K),ie&&ae(!0));const M=gp(e),{logo:de,logoMaxHeight:X=120/1440,logoPosition:le="left",panelHeight:ne=60/1440,backgroundColor:he="#b3b3b3",logoColor:ke="#000000",position:ye,horizontalAlign:pe,verticalAlign:Z,iconColor:se="#000000",showIcon:oe="on",iconSize:Re=16/1440,linkColor:$e="#000000",openLinkColor:Me="#000000",compactIconColor:ve="#000000",compactCloseButtonColor:Se="#000000",compactLinkColor:Ce="#000000",compactLogoColor:h="#000000",compactBackgroundColor:q="#ffffff",compactLogoMaxHeight:Y=120/1440,compactLogoPosition:ee,compactPanelHeight:fe=60/1440,compactShowIcon:z="on",compactIconSize:R=16/1440,compactNavTextWidth:Q,compactNavTextPosition:te,compactNavTextOffset:ce,compactNavGap:G,compactNavPaddingLeft:Ie=10/1440,compactNavPaddingRight:xe=10/1440,compactFontFamily:J,compactFontSettings:He,compactFontSize:je,compactLineHeight:ct,compactLetterSpacing:Ve=0,compactWordSpacing:et=0,compactTextAlign:Ze="left",compactTextAppearance:Ye,openLogoColor:be="#000000",menuBackgroundColor:Oe="#ffffff",overlayColor:ze="rgba(0, 0, 0, 0.45)",closeButtonColor:Qe="#000000",effect:ge="fade",textWidth:_e=280/1440,navTextWidth:Xe,navTextPosition:tt="center",navTextOffset:ft=0,gap:ot=0,navGap:De,navPaddingLeft:Fe=10/1440,navPaddingRight:Ee=10/1440,textPaddingLeft:Je=10/1440,textPaddingRight:We=10/1440,textPaddingTop:it=10/1440,textPaddingBottom:nt=10/1440,fontFamily:me,fontSettings:Ne,fontSize:at,lineHeight:ut,letterSpacing:Ge=0,wordSpacing:pt=0,textAlign:Tt="left",textAppearance:Lt,openFontFamily:xt,openFontSettings:Et,openFontSize:Vt,openLineHeight:Ut,openLetterSpacing:Kt,openWordSpacing:Pt,openTextAlign:jt,openTextAppearance:on,stateOverrides:vt,link:Le}=M,{horizontalAlign:qe,verticalAlign:st}=Bw({position:ye,horizontalAlign:pe,verticalAlign:Z}),lt=K==="compact",wt=lt?Y:X,It=Ew(lt?ee:le),gt=lt?fe:ne,Ot=lt?R:Re,_t=lt?Q:Xe,Mt=Mw(lt?te:tt),Gt=(lt?ce:ft)??0,Xt=lt?G:De,Dt=lt?Ie:Fe,zt=lt?xe:Ee,Bt=_t??_e,bt=C||(lt?z:oe)!=="off",A=F.buildColorVars(m,{iconColor:se,closeButtonColor:Qe,linkColor:$e,openLinkColor:Me,compactIconColor:ve,compactCloseButtonColor:Se,compactLinkColor:Ce,compactLogoColor:h,compactBackgroundColor:q,openLogoColor:be,menuBackgroundColor:Oe,overlayColor:ze,backgroundColor:he,logoColor:ke},Uw,Yw,vt),Te=cd(lt?{fontFamily:J,fontSettings:He,fontSize:je,lineHeight:ct,letterSpacing:Ve,wordSpacing:et,textAlign:Ze,textAppearance:Ye}:{fontFamily:me,fontSettings:Ne,fontSize:at,lineHeight:ut,letterSpacing:Ge,wordSpacing:pt,textAlign:Tt,textAppearance:Lt}),Ae=cd({fontFamily:xt,fontSettings:Et,fontSize:Vt,lineHeight:Ut,letterSpacing:Kt,wordSpacing:Pt,textAlign:jt,textAppearance:on},Te),Be=dd(m,Te,t),mt=dd(m,Ae,t),Nt={...mt.css,whiteSpace:"pre-wrap"},ht=mt.className,St=Wt=>F.scalingValue(Wt,t),qt=Xt??ot,At=Math.max(Dt,ho),sn=Math.max(zt,ho),gn=Math.max(0,1-Ot),Xn=Math.max(0,1-Ot),yn=n??!1,qn=yn&&!C,ki=s.useMemo(()=>mp({textPaddingLeft:Je,textPaddingRight:We,textPaddingTop:it,textPaddingBottom:nt,fontSize:Ae.fontSize}),[Je,We,it,nt,Ae.fontSize]),Ji=Wt=>{const Yt=a.jsx("span",{className:ht,style:Nt,children:ud(Wt)});return hd(m,Yt,_e,yn,St)},Go={...Xw(ki,t),alignItems:Zw[qe],justifyContent:Kw[st]},un=s.useRef(e),An=s.useRef(c);s.useEffect(()=>{if(!v||!t){un.current=e,An.current=c;return}if(An.current!==c){un.current=e,An.current=c;const Mi=md(e);Mi!==e&&v(Mi);return}const Wt=md(e),Yt=un.current,vn=Yt!==e,Nn=vn?Gw(Wt,Yt):Wt;un.current=e;const Yn=Wt!==e,ci=vn&&jw(Wt,Nn);!Yn&&!ci||v(Nn)},[e,v,t,c]);const Rn=F.scalingValue(Ot,t),Un={width:Rn,height:Rn,minWidth:Rn,minHeight:Rn,maxWidth:Rn,maxHeight:Rn},Qi={...Be.css,textDecoration:"none"},Xo=Be.className,eo=(de==null?void 0:de.mode)!=="Off",we=(de==null?void 0:de.icon)??"",Ke=t$(we),E=St(Math.min(wt,gt)),ue=!!(eo&&we&&It==="right")?"left":"right",Pe=Array.isArray(Le)?Le:[],Ue=[K!=="default"?`${m}-state-${K}`:"",$==="open"?`${m}-state-open`:"",S&&S!==K&&S!==$?`${m}-state-${S}`:""].filter(Boolean).join(" "),dt=t&&!i?`${m}-editor`:"",Rt=D?`${m}-interactive`:"",Ft=ie&&(K!==T||V)?`${m}-nav-state-anim`:"",rn=C?`${m}-open`:"",nn=s.useMemo(()=>s$(g.current),[B,C,c]),Fn=()=>{H(!1)},li=(Wt,Yt)=>{o$(Wt,Fn,{isEditor:t,isPreviewMode:i,item:Yt,pages:u,onLinkNavigate:p})},to=()=>{t&&!i||H(Wt=>!Wt)},Ei=()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)};s.useEffect(()=>{if(!V)return;const Wt=window.setTimeout(()=>{ae(!1)},en);return()=>window.clearTimeout(Wt)},[V,K]),s.useEffect(()=>{if(C){Ei(),k(!0);return}return x.current+=1,U(!1),Ei(),P.current=window.setTimeout(()=>{P.current=null,k(!1)},Sn),Ei},[C]),s.useLayoutEffect(()=>{b.current!==c&&(b.current=c,x.current+=1,Ei(),H(!1),U(!1),k(!1))},[c]),s.useLayoutEffect(()=>{var vn;if(!B||!C)return;const Wt=x.current+1;x.current=Wt,U(!1),(vn=f.current)==null||vn.offsetHeight;const Yt=requestAnimationFrame(()=>{x.current===Wt&&U(!0)});return()=>{cancelAnimationFrame(Yt)}},[B,C]),s.useEffect(()=>{y==null||y(C)},[C,y]),s.useEffect(()=>{if(!C)return;const Wt=Yt=>{Yt.key==="Escape"&&(t&&i||Fn())};return window.addEventListener("keydown",Wt),()=>window.removeEventListener("keydown",Wt)},[C,t,i]),s.useEffect(()=>{t&&!i&&$!=="open"&&H(!1)},[t,i,$]),s.useEffect(()=>{i&&H(!1)},[i]);const Pr=yn&&C,_a=Wt=>Pe.filter(Yt=>_w(Yt,c)).map((Yt,vn)=>{const{label:Nn,href:Yn,target:ci}=Ds(Yt,u),Mi=Yn?a.jsx("a",{href:Yn,target:ci,rel:ci==="_blank"?"noopener noreferrer":void 0,className:`${Wt} ${m}-has-href`,onClick:Wa=>li(Wa,Yt),children:Ji(Nn)}):a.jsx("span",{className:Wt,children:Ji(Nn)});return a.jsxs(s.Fragment,{children:[vn>0&&a.jsx("div",{"data-controls":Pr?"gap":void 0,"data-controls-axis":"y",className:Pr?`${m}-gap-control`:void 0,style:{height:St(ot)}}),Mi]},vn)}),Tp=B?a.jsxs("div",{ref:f,"data-selection":"none",className:[`${m}-lightbox`,`${m}-full-lightbox ${m}-effect-${ge}`,W?`${m}-lightbox-active`:"",`${m}-lightbox-editor`,n?`${m}-lightbox-edit-mode`:"",Rt,Ue].filter(Boolean).join(" "),style:{...A,...nn},"aria-hidden":!W,children:[a.jsx("button",{type:"button",className:`${m}-backdrop`,onClick:Fn,"aria-label":"Close menu"}),a.jsxs("nav",{className:`${m}-panel`,style:Go,"aria-label":"Menu",children:[yn&&qw(m,ki,Ae.fontSize,St),_a(`${m}-link`)]})]}):null,Lp=()=>a.jsx("button",{type:"button",className:`${m}-toggle`,onClick:to,"aria-expanded":C,"aria-label":C?"Close menu":"Open menu",children:a.jsx(Hw,{className:`${m}-icon`,lineClassName:`${m}-icon-line`})}),kr=Wt=>{const Yt=Wt==="left",vn=Yt?Dt:zt,Nn=Yt?At:sn,Yn=Yt?gn:Xn,ci=lt?Yt?"compactNavPaddingLeft":"compactNavPaddingRight":Yt?"navPaddingLeft":"navPaddingRight";return a.jsx("div",{className:Yt?`${m}-nav-padding-left`:`${m}-nav-padding-right`,style:{width:St(vn),flexShrink:0},children:qn?a.jsx("div",{"data-controls":ci,"data-controls-axis":"x","data-controls-variant":"column-padding",...Yt?{}:{"data-controls-reverse":""},"data-controls-min":"0","data-controls-max-fraction":String(Yn),className:`${m}-control-anchor`,style:{top:0,[Yt?"left":"right"]:0,width:St(Nn),height:"100%"}}):null})},Ip=(Wt,Yt)=>{const{label:vn,href:Nn,target:Yn}=Ds(Wt,u),ci=a.jsx("span",{className:Xo,style:Qi,children:ud(vn)}),Mi=hd(m,ci,Bt,qn,St),Wa=Nn?a.jsx("a",{href:Nn,target:Yn,rel:Yn==="_blank"?"noopener noreferrer":void 0,className:`${m}-nav-link ${m}-has-href`,onClick:kp=>li(kp,Wt),children:Mi}):a.jsx("span",{className:`${m}-nav-link`,children:Mi});return a.jsxs(s.Fragment,{children:[Yt>0&&a.jsx("div",{"data-controls":qn?lt?"compactNavGap":"navGap":void 0,"data-controls-axis":"x",className:qn?`${m}-gap-control ${m}-nav-gap-control`:`${m}-nav-gap-control}`,style:{width:St(qt),flexShrink:0}}),Wa]},Yt)},Rp={...A,height:F.scalingValue(gt,t),minHeight:F.scalingValue(gt,t),[`--${m}-panel-height`]:F.scalingValue(gt,t)},Pp=l&&K==="default"&&$!=="open"&&!i?St(ne+Iw):"0px";return a.jsxs("div",{ref:g,className:`${m}-root ${Ue} ${dt} ${Rt} ${Ft}`.trim(),style:{width:"100%",height:"100%",lineHeight:0,fontSize:0,marginTop:Pp,...A},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:w}}),a.jsx("div",{className:`${m}-nav-slide`,children:a.jsxs("div",{className:`${m}-nav-bar`,style:Rp,children:[eo&&we?a.jsxs("div",{className:`${m}-nav-logo ${m}-nav-logo-${It}`,children:[It==="left"?kr("left"):null,a.jsxs("div",{className:`${m}-nav-logo-inner${Ke?` ${m}-nav-logo-tinted`:""}`,style:{height:E,...Ke?{[`--${m}-logo-image`]:Qw(we)}:{}},children:[a.jsx("img",{src:we,alt:"",className:`${m}-nav-logo-img`}),Ke?a.jsx("span",{className:`${m}-nav-logo-tint`,"aria-hidden":"true"}):null]}),It==="right"?kr("right"):null]}):null,a.jsx("nav",{className:`${m}-nav-links ${m}-nav-links-${Mt}`,style:{transform:Aw(Mt,Gt,t)},"aria-label":"Navigation",children:a.jsx("div",{className:`${m}-nav-links-inner`,children:Pe.filter(Wt=>Nw(Wt,K,c)).map((Wt,Yt)=>Ip(Wt,Yt))})})]})}),Tp,a.jsxs("div",{className:`${m}-nav-toggle-wrap ${m}-nav-toggle-wrap-${ue}`,children:[ue==="left"?kr("left"):null,bt?a.jsx("div",{className:`${m}-root ${rn}`.trim(),style:Un,children:Lp()}):null,ue==="right"?kr("right"):null]})]})}const c$=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
24277
24277
  import { CommonComponentProps } from '../props';
24278
24278
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
24279
24279
  import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
@@ -26572,7 +26572,7 @@ export function Burger({
26572
26572
  </div>
26573
26573
  );
26574
26574
  }
26575
- `;function Jo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function mi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Al(e){return{[mi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[mi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[mi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[mi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[mi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[mi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[mi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[mi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const d$=Al(""),u$=Al("open"),p$=Al("compact"),m$=["__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"],g$=["__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"],h$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},fs={fontWeight:400,fontStyle:"normal"},qr={d:"Always",t:"Open Only",m:"Open Only"},f$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],y$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],v$={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:"Link Default",titleByState:{default:"Link Default",hover:"Link 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:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link 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:"Link Default",titleByState:{open:"Link Default","open-hover":"Link 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"]}},textWidth:{type:"number",scope:"layout",title:"Text 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:[...f$]}},stateOverrides:{type:"object",scope:"common"},gap:Jo("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:Jo("Text padding left"),textPaddingRight:Jo("Text padding right"),textPaddingTop:Jo("Text padding top"),textPaddingBottom:Jo("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}},...d$,...u$,...p$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:qr}],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:fs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:fs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:fs,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:"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,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","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:m$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:g$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:h$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...y$],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"]},x$={element:l$,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:v$,sourceCode:c$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},fd=120,yd=3,b$=.12,Fl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ya(e){return e<0?0:e>1?1:e}function vd(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 S$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,v=u.y*t.height;p<n&&(n=p),p>o&&(o=p),v<i&&(i=v),v>r&&(r=v)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function w$(e){return e.map(([t,n])=>({x:t,y:n}))}function ys(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function $$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ya(n[o]),l=ya(n[o+1]);l>r&&i.push({x0:r,x1:l})}return C$(i)}function C$(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 T$(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 L$(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 I$(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 R$(e,t,n,i){let o=null;for(let r=0;r<yd;r+=1){const l=ya(t+(n-t)*r/Math.max(1,yd-1)),d=$$(e,l),c=i==="avoid"?L$(d):d;if(o=o===null?c:T$(o,c),o.length===0)return[]}return o??[]}function xd(e,t="stretch",n=Fl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=xr(l);if(d.length)return t==="viewbox"?$o(d,n):ys(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",v),u.appendChild(y);let m=0;try{m=y.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let f=0;f<fd;f+=1){const x=y.getPointAtLength(f/fd*m);g.push({x:x.x,y:x.y})}p.push(g)}return p.length?t==="viewbox"?$o(p,n):ys(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"?$o([r],n):ys([r])}const Nl={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"},zs="0 0 100 100",va=100,Bs=16,P$=12,k$=16,vs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,E$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,bd=Math.PI/4,M$=8,A$=Math.PI/18,F$=8,fo=24,yo=[];function N$(){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 xs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function _$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function W$(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 ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Sd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=xs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?xs(c,i):_$(c))}if(!l.length){const c=o!=="custom"?Nl[o]:void 0;c?l=xs(Li(c),Fl):l=N$()}}return o==="circle"?W$(l,r):l}function wd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function js(e){const t=e==="rectangle"||e==="custom"?void 0:Nl[e];return t?$o(xr(Li(t)),Fl):[w$([[0,0],[1,0],[1,1],[0,1]])]}function H$(e){const t=e.match(E$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function wn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Vs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function O$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(O$)}))}function ln(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 ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function D$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),y=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*y+v*m,f=-v*y+p*m,x=g*g/(d*d)+f*f/(c*c);if(x>1){const U=Math.sqrt(x);d*=U,c*=U}const R=o===r?-1:1,b=d*d*f*f+c*c*g*g,S=Math.max(0,d*d*c*c-b),G=b===0?0:R*Math.sqrt(S/b),D=G*d*f/c,j=-G*c*g/d,P=p*D-v*j+(e.x+l.x)/2,M=v*D+p*j+(e.y+l.y)/2,K=Math.atan2((f-j)/c,(g-D)/d);let L=Math.atan2((-f-j)/c,(-g-D)/d)-K;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const _=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),z=L/_,$=4/3*Math.tan(z/4),k=(U,C)=>({x:P+p*d*U-v*c*C,y:M+v*d*U+p*c*C}),W=[];let w=K;for(let U=0;U<_;U+=1){const C=w+z,O=Math.cos(w),V=Math.sin(w),se=Math.cos(C),ie=Math.sin(C);W.push({c1:k(O-$*V,V+$*O),c2:k(se+$*ie,ie-$*se),p:U===_-1?cn(l):k(se,ie)}),w=C}return W}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=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},v=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};vs.lastIndex=0;let y=vs.exec(t);for(;y!==null;){const m=y[1],g=m.toUpperCase(),f=m!==g,x=H$(y[2]),R=b=>f?{x:r.x+x[b],y:r.y+x[b+1]}:{x:x[b],y:x[b+1]};if(g==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(g==="M"){for(let b=0;b+1<x.length;b+=2){const S=R(b);b===0&&(u(),l=cn(S)),p(S)}d=null,c=null}else if(g==="L"){for(let b=0;b+1<x.length;b+=2)p(R(b));d=null,c=null}else if(g==="H"){for(const b of x)p({x:f?r.x+b:b,y:r.y});d=null,c=null}else if(g==="V"){for(const b of x)p({x:r.x,y:f?r.y+b:b});d=null,c=null}else if(g==="C"){for(let b=0;b+5<x.length;b+=6){const S=R(b),G=R(b+2),D=R(b+4);v(S),p(D,G),d=G}c=null}else if(g==="S"){for(let b=0;b+3<x.length;b+=4){const S=d?Vs(d,r):cn(r),G=R(b),D=R(b+2);v(S),p(D,G),d=G}c=null}else if(g==="Q")for(let b=0;b+3<x.length;b+=4){const S=R(b),G=R(b+2);v(wn(r,S,2/3)),p(G,wn(G,S,2/3)),c=S,d=null}else if(g==="T")for(let b=0;b+1<x.length;b+=2){const S=c?Vs(c,r):cn(r),G=R(b);v(wn(r,S,2/3)),p(G,wn(G,S,2/3)),c=S,d=null}else if(g==="A")for(let b=0;b+6<x.length;b+=7){const S=f?{x:r.x+x[b+5],y:r.y+x[b+6]}:{x:x[b+5],y:x[b+6]};for(const G of D$(r,x[b],x[b+1],x[b+2],x[b+3]!==0,x[b+4]!==0,S))v(G.c1),p(G.p,G.c2);d=null,c=null}y=vs.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 hp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Vo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Cd(e,t){if(Vo(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 Wo(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(Cd(r,l)),r=l;if(n.closed){const l=Cd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fp(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 Gs(e,t,n){if(Vo(e,t))return wn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function xr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fp(n)){if(Vo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Bs;r+=1)i.push(Gs(o.from,o.to,r/Bs))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of xr(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 z$(e){const t=Si(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 yp(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 vp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=P$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/k$)),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:cn(r),...yp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xp(e,t,n=1){if(!e.length)return!1;const i=Si(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function B$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,v=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+v/c}})}function j$(e,t){if(!e.length)return e;const n=Si(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function bp(e){const t={x:0,y:0,width:va,height:va},n=e!=="custom"?Nl[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(vp(js("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=j$(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:zs}}function Ur(e,t){return t>0?Math.round(e/t)*t:e}function V$(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,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Td(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function G$(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((d,c)=>c-d);for(const d of l)i=Sp(i,r,d)}),i}function X$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=Vs(o,c.p)}return d}function q$(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 U$(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 d=zn(e),c=d[t].nodes,u=n+1;if(Vo(r,l))return c.splice(u,0,{p:wn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,y=wn(r.p,p,i),m=wn(p,v,i),g=wn(v,l.p,i),f=wn(y,m,i),x=wn(m,g,i),R=wn(f,x,i),b=(n+1)%o.nodes.length;return c[n].out=y,c[b].in=g,c.splice(u,0,{p:R,in:f,out:x}),{contours:d,nodeIndex:u}}function Sp(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 Ld(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,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,v=!!Vn(l[u].out,l[u].p),y=!!Vn(l[p].in,l[p].p);if(hp(d)||v||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=yp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function Y$(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Id(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fp(i)){const l=Vo(r.from,r.to)?1:Bs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Y$(t,Gs(r.from,r.to,c),Gs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function K$(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 Rd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Pd(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function Z$(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 J$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Xs(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 Q$(e,t){const n=Xs(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function qs(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 kd(e,t,n,i,o){if(e.axis===null)return Q$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return qs(o(r)[t],t,i)}function eC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(kd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(kd(n,"y",l,i,o)),r}function tC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return Xs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Xs(i(p),r)}function nC(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,v=Math.hypot(u,p);if(v<1e-6)return{point:e,guides:yo};const y=Math.atan2(p,u),m=Math.round(y/bd)*bd;let g=o?m:null,f=!1;if(!o){const j=[];n&&j.push({angle:Math.atan2(n.y,n.x),smooth:!0}),j.push({angle:m,smooth:!1});for(const P of j){const M=J$(P.angle-y);if(!(Math.abs(M)>A$)&&!(Math.abs(Math.sin(M))*v>M$)){g=P.angle,f=P.smooth;break}}}const x=i!==null&&i>0&&Math.abs(v-i)<=F$;if(g===null&&!x)return{point:e,guides:yo};const R=g??y,b=x?i:v,S={x:Math.cos(R),y:Math.sin(R)},G=b+(g===null?0:fo),D=x?b:f?fo:0;return{point:l({x:d.x+S.x*b,y:d.y+S.y*b}),guides:[{kind:"angle",a:{x:d.x-S.x*D,y:d.y-S.y*D},b:{x:d.x+S.x*G,y:d.y+S.y*G}}]}}const Us=.1,Ys=8,iC=4,Ed=10,xa=(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}}},wp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ks=(e,t)=>{const n=xa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Ed,y:n.y+o*Ed}},Zs=(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),Gi=(e,t,n)=>{const i=Zs(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,vo=(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)<iC?.5:ya(r)},oC=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Zs(e,n),p=Zs(t,n),v=Math.min(Ys,Math.max(Us,p>0?r*(u/p):r)),y=Gi(t,n,v);return{focalX:vo(t.width,y.width,d-t.x,{clamp:!1}),focalY:vo(t.height,y.height,c-t.y,{clamp:!1}),scale:v}},Md=1.08,Yr=14,Kr=8;function rC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:v,onCommit:y}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),R=s.useRef({focalX:c,focalY:u,scale:p});R.current={focalX:c,focalY:u,scale:p};const b=l==="image";s.useEffect(()=>{var z;b&&((z=m.current)==null||z.focus({preventScroll:!0}))},[b]);const S=s.useCallback((z,$)=>{var W;const k=(W=m.current)==null?void 0:W.getBoundingClientRect();return!k||k.width<=0||k.height<=0?{x:0,y:0}:{x:(z-k.left)/k.width*t.width,y:($-k.top)/k.height*t.height}},[t.width,t.height]),G=z=>{var k,W;if(!i)return;z.stopPropagation(),z.preventDefault(),(k=m.current)==null||k.focus({preventScroll:!0});const $=Gi(n,i,p);f.current={pointerId:z.pointerId,origin:S(z.clientX,z.clientY),startX:Dn(n.width,$.width,c),startY:Dn(n.height,$.height,u),width:$.width,height:$.height,moved:!1},(W=m.current)==null||W.setPointerCapture(z.pointerId)},D=(z,$)=>{var se,ie;if(!i)return;z.stopPropagation(),z.preventDefault(),(se=m.current)==null||se.focus({preventScroll:!0});const k=Gi(n,i,p),W=Dn(n.width,k.width,c),w=Dn(n.height,k.height,u),U={minX:W,minY:w,maxX:W+k.width,maxY:w+k.height},C=xa(U,wp($)),O=xa(U,$),V=Math.hypot(O.x-C.x,O.y-C.y);!isFinite(V)||V<=0||(x.current={pointerId:z.pointerId,anchor:C,startDistance:V,startScale:p,startX:W,startY:w,moved:!1},(ie=m.current)==null||ie.setPointerCapture(z.pointerId))},j=z=>{if(!i)return;const $=x.current;if($&&z.pointerId===$.pointerId){z.stopPropagation(),z.preventDefault();const W=S(z.clientX,z.clientY),w={x:W.x-n.x,y:W.y-n.y},U=Math.hypot(w.x-$.anchor.x,w.y-$.anchor.y),C=Math.min(Ys,Math.max(Us,$.startScale*(U/$.startDistance)));if(!$.moved&&Math.abs(C-$.startScale)<1e-4)return;$.moved=!0;const O=C/$.startScale,V=$.anchor.x+($.startX-$.anchor.x)*O,se=$.anchor.y+($.startY-$.anchor.y)*O,ie=Gi(n,i,C);v({focalX:vo(n.width,ie.width,V),focalY:vo(n.height,ie.height,se),scale:C});return}const k=f.current;if(k&&z.pointerId===k.pointerId){z.stopPropagation(),z.preventDefault();const W=S(z.clientX,z.clientY),w=W.x-k.origin.x,U=W.y-k.origin.y;if(!k.moved&&w===0&&U===0)return;k.moved=!0,v({focalX:vo(n.width,k.width,k.startX+w),focalY:vo(n.height,k.height,k.startY+U),scale:p})}},P=z=>{var W,w;const $=f.current;if($&&z.pointerId===$.pointerId){f.current=null,z.stopPropagation(),(W=m.current)!=null&&W.hasPointerCapture($.pointerId)&&m.current.releasePointerCapture($.pointerId),$.moved&&y(R.current);return}const k=x.current;k&&z.pointerId===k.pointerId&&(x.current=null,z.stopPropagation(),(w=m.current)!=null&&w.hasPointerCapture(k.pointerId)&&m.current.releasePointerCapture(k.pointerId),k.moved&&y(R.current))},M=z=>{if(z.key==="Escape"){z.stopPropagation(),d("none");return}if(z.key==="="||z.key==="+"||z.key==="-"||z.key==="_"){z.preventDefault(),z.stopPropagation();const $=z.key==="="||z.key==="+",k=Math.min(Ys,Math.max(Us,p*($?Md:1/Md))),W={focalX:c,focalY:u,scale:k};v(W),y(W)}},K=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const z=i??{width:n.width,height:n.height},$=Gi(n,z,p);return!($.width>0)||!($.height>0)?null:{x:n.x+Dn(n.width,$.width,c),y:n.y+Dn(n.height,$.height,u),width:$.width,height:$.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),_=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${b?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:M,onPointerMove:j,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:()=>d("none")}),b&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),b&&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}),K.map(z=>{const $=Ks(_,z),k=z==="ne"||z==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:$.x-Kr/2,y:$.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${k?` ${e}-editor-scale-grab-nesw`:""}`,x:$.x-Yr/2,y:$.y-Yr/2,width:Yr,height:Yr,onPointerDown:W=>D(W,z)})]},z)})]})]})}const Js=10,aC=Js*2,Hn=7,sC=4,lo=9,lC=3.5,Ad=1.08,cC=.05,Zr=14,dC=1,Jr=14,Qr=8;function uC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:v}){const y=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const f=s.useRef(null),x=s.useRef(null),R=s.useRef(null),b=s.useRef(null),[S,G]=s.useState([]),[D,j]=s.useState(yo),[P,M]=s.useState(null),K=s.useCallback(h=>{j(q=>Z$(q,h)?q:h)},[]),T=d==="shape";s.useEffect(()=>{var h;T&&((h=y.current)==null||h.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||G(h=>h.length?[]:h)},[T]);const L=S.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const _=n.width>0?t.width/n.width:1,z=n.height>0?t.height/n.height:1,$=Math.min(_,z),k=r&&l?$:_,W=r&&l?$:z,w=r&&l?(t.width-n.width*$)/2:0,U=r&&l?(t.height-n.height*$)/2:0,C=s.useCallback(h=>r?{x:w+(h.x-n.x)*k,y:U+(h.y-n.y)*W}:{x:h.x-n.x,y:h.y-n.y},[r,n,k,W,w,U]),O=s.useCallback(h=>r?{x:n.x+(k>0?(h.x-w)/k:0),y:n.y+(W>0?(h.y-U)/W:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,k,W,w,U]),V=s.useMemo(()=>O({x:t.width/2,y:t.height/2}),[O,t.width,t.height]),se=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();if(!Y||Y.width<=0||Y.height<=0)return{x:0,y:0};if(r){const ve=(h-Y.left)/Y.width*t.width,B=(q-Y.top)/Y.height*t.height;return{x:n.x+(k>0?(ve-w)/k:0),y:n.y+(W>0?(B-U)/W:0)}}return{x:n.x+(h-Y.left),y:n.y+(q-Y.top)}},[r,n,t.width,t.height,k,W,w,U]),ie=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();return!Y||Y.width<=0||Y.height<=0?{x:0,y:0}:{x:(h-Y.left)/Y.width*t.width,y:(q-Y.top)/Y.height*t.height}},[t.width,t.height]),N=s.useCallback((h,q)=>{const Y=l&&!(q!=null&&q.preserveShape)?B$(h,n,t,w,U,k,W):h;v(Y,q)},[v,l,n,t,w,U,k,W]),de=s.useCallback(()=>{M(null)},[]),X=s.useCallback((h,q,Y)=>{if(!Y||f.current||x.current||R.current||b.current){de();return}const ee=ie(h,q),ve=ln(g.current,C);for(const te of ve)for(const ke of te.nodes)if(Math.hypot(ke.p.x-ee.x,ke.p.y-ee.y)<=lo){de();return}const B=Id(ve,ee);if(!B||B.distance>Js){de();return}const I=ve[B.contour],Q=I==null?void 0:I.nodes[B.segment],ne=I==null?void 0:I.nodes[(B.segment+1)%((I==null?void 0:I.nodes.length)??1)],H=!!(Q&&ne&&!Vo(Q,ne));M(te=>te&&te.curved===H&&Math.hypot(te.point.x-B.point.x,te.point.y-B.point.y)<.25?te:{point:B.point,curved:H})},[ie,C,de]),ce=h=>{var je;const q=h.metaKey||h.ctrlKey,Y=R.current;if(Y&&h.pointerId===Y.pointerId){if(h.stopPropagation(),h.preventDefault(),Y.startDistance<=0)return;const it=se(h.clientX,h.clientY),qe=Math.hypot(it.x-Y.origin.x,it.y-Y.origin.y),et=Math.max(cC,qe/Y.startDistance);if(!Y.moved&&Math.abs(et-1)<1e-4)return;Y.moved=!0,p($d(Y.startContours,Y.origin,et));return}const ee=x.current;if(ee&&h.pointerId===ee.pointerId){h.stopPropagation(),h.preventDefault();const it=se(h.clientX,h.clientY),{bbox:qe}=ee,et=qe.maxX-qe.minX,Je=qe.maxY-qe.minY,Ge=it.x-ee.origin.x,$e=it.y-ee.origin.y;let He=Ge,De=$e;if(isFinite(et)&&isFinite(Je))if(r){let he=n.x,_e=n.x+n.width,Ve=n.y,tt=n.y+n.height;l&&(k>0&&(he=n.x+(0-w)/k,_e=n.x+(t.width-w)/k),W>0&&(Ve=n.y+(0-U)/W,tt=n.y+(t.height-U)/W));const ft=Math.min(he,_e-et),rt=Math.max(he,_e-et),Oe=Math.min(Ve,tt-Je),Fe=Math.max(Ve,tt-Je),Ee=Math.min(rt,Math.max(ft,qe.minX+Ge)),Ze=Math.min(Fe,Math.max(Oe,qe.minY+$e));He=Ee-qe.minX,De=Ze-qe.minY}else{const he=qe.minX-n.x,_e=qe.minY-n.y,Ve=Math.min(0,t.width-et),tt=Math.max(0,t.width-et),ft=Math.min(0,t.height-Je),rt=Math.max(0,t.height-Je),Oe=Math.min(tt,Math.max(Ve,he+Ge)),Fe=Math.min(rt,Math.max(ft,_e+$e));He=Oe-he,De=Fe-_e}const Qe=[];if(!q&&isFinite(et)&&isFinite(Je)){const he=C({x:qe.minX+et/2+He,y:qe.minY+Je/2+De}),_e={x:t.width/2,y:t.height/2};Math.abs(he.x-_e.x)<=Zr&&(He=V.x-qe.minX-et/2,Qe.push(qs(_e.x,"x",t))),Math.abs(he.y-_e.y)<=Zr&&(De=V.y-qe.minY-Je/2,Qe.push(qs(_e.y,"y",t)))}if(!ee.moved&&He===0&&De===0)return;ee.moved=!0,K(Qe.length?Qe:yo),p(ln(ee.startContours,he=>({x:he.x+He,y:he.y+De})),{carryImage:!0});return}const ve=b.current;if(ve&&h.pointerId===ve.pointerId){h.stopPropagation(),h.preventDefault();const it=se(h.clientX,h.clientY);let qe=it.x-ve.origin.x,et=it.y-ve.origin.y;if(h.shiftKey&&(Math.abs(qe)>Math.abs(et)?et=0:qe=0),!ve.moved&&qe===0&&et===0)return;ve.moved=!0,p(Td(ve.startContours,ve.selection,qe,et));return}const B=f.current;if(!B||h.pointerId!==B.pointerId){X(h.clientX,h.clientY,S.length>0||T);return}de(),h.stopPropagation(),h.preventDefault();const I=se(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=q?[]:K$(g.current,{contour:B.contour,node:B.node}),et=q||!B.center?[]:[B.center],Je=Pd(Rd(qe,et.map(He=>He.x),"x"),it,"x",C,Zr),Ge=Pd(Rd(qe,et.map(He=>He.y),"y"),it,"y",C,Zr),$e=q?it:{x:(Je==null?void 0:Je.value)??Ur(it.x,o),y:(Ge==null?void 0:Ge.value)??Ur(it.y,o)};if(h.shiftKey&&(Math.abs($e.x-B.anchor.x)>Math.abs($e.y-B.anchor.y)?$e.y=B.anchor.y:$e.x=B.anchor.x),!B.moved&&$e.x===B.anchor.x&&$e.y===B.anchor.y)return;B.moved=!0,K(eC($e,Je,Ge,t,C)),p(V$(g.current,B.contour,B.node,$e));return}const Q=(je=g.current[B.contour])==null?void 0:je.nodes[B.node],ne=B.mirror&&!h.altKey,H=ne||q?null:B.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,te=Q?C(Q.p):null,ke=H?C(H):null,ge=Q&&(!q||h.shiftKey)?nC(I,Q.p,ne||q?null:tC(g.current[B.contour],B.node,B.kind,C),te&&ke?Math.hypot(ke.x-te.x,ke.y-te.y):null,h.shiftKey,C,O):{point:I,guides:yo},J=ge.guides.length?ge.point:q?I:{x:Ur(I.x,o),y:Ur(I.y,o)},Ye=B.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!B.moved&&Ye&&J.x===Ye.x&&J.y===Ye.y||(B.moved=!0,K(ge.guides),p(X$(g.current,B.contour,B.node,B.kind,J,ne)))},oe=h=>{K(yo);const q=R.current;if(q&&h.pointerId===q.pointerId){R.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(q.pointerId)&&H.releasePointerCapture(q.pointerId),q.moved&&N(g.current,{preserveShape:!0});return}const Y=x.current;if(Y&&h.pointerId===Y.pointerId){x.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(Y.pointerId)&&H.releasePointerCapture(Y.pointerId),Y.moved?N(g.current,{preserveShape:!0}):G([]);return}const ee=b.current;if(ee&&h.pointerId===ee.pointerId){b.current=null,h.stopPropagation();const H=y.current;H!=null&&H.hasPointerCapture(ee.pointerId)&&H.releasePointerCapture(ee.pointerId),ee.moved&&N(g.current);return}const ve=f.current;if(!ve||h.pointerId!==ve.pointerId)return;f.current=null,h.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(ve.pointerId)&&B.releasePointerCapture(ve.pointerId);const I=Math.hypot(h.clientX-ve.clientOrigin.x,h.clientY-ve.clientOrigin.y);if(ve.moved||I>sC){ve.moved&&N(g.current);return}if(!ve.toggleOnRelease||h.type!=="pointerup")return;const ne=Ld(g.current,ve.contour,ve.node);ne!==g.current&&(p(ne),N(ne))},fe=h=>{h.stopPropagation()},Pe=h=>{var q,Y;h.stopPropagation(),h.preventDefault(),de(),(q=y.current)==null||q.focus({preventScroll:!0}),x.current={pointerId:h.pointerId,origin:se(h.clientX,h.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(Y=y.current)==null||Y.setPointerCapture(h.pointerId)},xe=(h,q)=>{var I,Q;h.stopPropagation(),h.preventDefault(),de(),(I=y.current)==null||I.focus({preventScroll:!0}),G([]),c("shape");const Y=Si(i),ee=xa(Y,wp(q)),ve=Ks(Y,q),B=Math.hypot(ve.x-ee.x,ve.y-ee.y);!isFinite(B)||B<=0||(R.current={pointerId:h.pointerId,corner:q,origin:ee,startDistance:B,startContours:zn(i),moved:!1},(Q=y.current)==null||Q.setPointerCapture(h.pointerId))},pe=(h,q,Y,ee)=>{var I,Q,ne,H;h.stopPropagation(),h.preventDefault(),de(),(I=y.current)==null||I.focus({preventScroll:!0});const ve=(Q=i[Y])==null?void 0:Q.nodes[ee];if(!ve)return;if(h.altKey){const te=q==="anchor"?Sp(i,Y,ee):q$(i,Y,ee,q);if(te===i)return;G(q==="anchor"?[]:[{contour:Y,node:ee}]),p(te),N(te);return}const B=h.metaKey||h.ctrlKey;if(q==="anchor"&&h.shiftKey&&!B){G(te=>te.some(ke=>ke.contour===Y&&ke.node===ee)?te.filter(ke=>!(ke.contour===Y&&ke.node===ee)):[...te,{contour:Y,node:ee}]);return}if(q==="anchor"&&!B&&S.length>1&&S.some(te=>te.contour===Y&&te.node===ee)){b.current={pointerId:h.pointerId,origin:se(h.clientX,h.clientY),startContours:zn(i),selection:S,moved:!1},(ne=y.current)==null||ne.setPointerCapture(h.pointerId);return}G([{contour:Y,node:ee}]),f.current={kind:q,contour:Y,node:ee,pointerId:h.pointerId,origin:se(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:ve.p,center:z$(i),mirror:q!=="anchor"&&!!(ve.in&&ve.out),toggleOnRelease:B,moved:!1},(H=y.current)==null||H.setPointerCapture(h.pointerId)},Z=h=>{h.stopPropagation(),h.preventDefault(),de();const q=ln(i,C),Y=Id(q,ie(h.clientX,h.clientY));if(!Y||Y.distance>Js)return;const{contours:ee,nodeIndex:ve}=U$(i,Y.contour,Y.segment,Y.t);ve<0||(G([{contour:Y.contour,node:ve}]),p(ee),N(ee))},le=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const B=Si(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const I={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},ne=h.key==="="||h.key==="+"?Ad:1/Ad,H=$d(i,I,ne);p(H),N(H,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),G([]),c("none");return}if(!S.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const B=G$(i,S);if(B===i)return;G([]),p(B),N(B);return}const q=o>0?o:dC,Y=h.shiftKey?q*10:q,ee={ArrowLeft:[-Y,0],ArrowRight:[Y,0],ArrowUp:[0,-Y],ArrowDown:[0,Y]}[h.key];if(!ee)return;h.preventDefault(),h.stopPropagation();const ve=Td(i,S,ee[0],ee[1]);p(ve),N(ve)},re=s.useMemo(()=>Wo(ln(i,C)),[i,C]),Ie=s.useMemo(()=>Si(i),[i]),we=C({x:Ie.minX,y:Ie.minY}),Me={width:C({x:Ie.maxX,y:Ie.minY}).x-we.x,height:C({x:Ie.minX,y:Ie.maxY}).y-we.y},ye=T&&S.length===0&&isFinite(Ie.minX)&&isFinite(Ie.maxX)&&Ie.maxX>Ie.minX&&Ie.maxY>Ie.minY,be=S.length>0||T,Ce=be;return a.jsxs("svg",{ref:y,className:`${e}-editor${be?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:le,onPointerDown:()=>{var h;return(h=y.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:ce,onPointerLeave:de,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,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([]),c("none")},onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:re}),Ce&&D.map((h,q)=>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}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:re,fillRule:"evenodd",onPointerDown:Pe,onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:re,style:{strokeWidth:aC},onClick:Z}),Ce&&P&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:P.point.x-Hn/2,y:P.point.y-Hn/2,width:Hn,height:Hn,rx:P.curved?Hn/2:0}),Ce&&i.map((h,q)=>h.nodes.map((Y,ee)=>{const ve=S.some(I=>I.contour===q&&I.node===ee),B=C(Y.p);return a.jsxs("g",{children:[ve&&S.length===1&&["in","out"].map(I=>{const Q=Y[I];if(!Q)return null;const ne=C(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:lC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:lo,onPointerDown:H=>pe(H,I,q,ee),onClick:fe})]},I)}),a.jsx("rect",{className:`${e}-editor-anchor${ve?` ${e}-editor-anchor-selected`:""}`,x:B.x-Hn/2,y:B.y-Hn/2,width:Hn,height:Hn,rx:hp(Y)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-lo,y:B.y-lo,width:lo*2,height:lo*2,onPointerDown:I=>pe(I,"anchor",q,ee),onClick:fe,onDoubleClick:I=>{I.stopPropagation(),I.preventDefault();const Q=Ld(i,q,ee);p(Q),N(Q)}})]},`${q}-${ee}`)})),ye&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:Me.width,height:Me.height}),["nw","ne","se","sw"].map(h=>{const q=C(Ks(Ie,h)),Y=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Qr/2,y:q.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${Y?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Jr/2,y:q.y-Jr/2,width:Jr,height:Jr,onPointerDown:ee=>xe(ee,h),onClick:fe})]},h)})]})]})}const pC=4e3,mC=/^(?:https?:|mailto:|tel:)/i;function $p(e){return!!e&&typeof e=="object"&&e.type==="link"}function gC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!mC.test(t)))return t}function hC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if($p(c)){o(c.children??[],gC(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Fd(e){return{...e.fontFamily&&{fontFamily:zo(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 fC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if($p(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function yC(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 d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,f=m.y*i;g<d&&(d=g),g>c&&(c=g),f<u&&(u=f),f>p&&(p=f)}const v=(d+c)/2,y=(u+p)/2;return l.map(m=>{const g=m.x*n,f=m.y*i,x=g-v,R=f-y,b=Math.sqrt(x*x+R*R);if(b<1e-6)return m;const G=Math.max(0,b+r*t)/b;return{x:(v+x*G)/n,y:(y+R*G)/i}})})}const bs=2,Ss=2;function vC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<bs+Ss)return null;const d=Math.min(r.length-Ss,l.length-Ss);let c=-1;for(let u=d;u>=bs;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<bs?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function Nd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:v}=e,y=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,f=e.lineHeight*l,x=e.spaceWidth*l,R=Math.max(0,e.shapeMargin??0),b=[],S=t.map((k,W)=>({token:k,originalIndex:W,width:n[W],kind:"whole"}));if(!S.length||d<=0||f<=0)return{segments:b,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const G=Math.max(1,x*.5),D=f*b$,j=yC(i,R,d,c,o);let P=0,M=0,K=0,T=S[0].token.para,L=0,_=0,z=null;for(;P<S.length&&K<pC;){const k=M+f>c;if(k&&!u)break;const W=S[P].token.para;if(W>T+1){M+=f*(W-T-1),T=W-1,K+=1;continue}let w=k?[{x0:0,x1:d}]:R$(j,(M+D)/c,(M+f-D)/c,o).map(C=>({x0:C.x0*d,x1:C.x1*d}));p>0&&v>0&&!k&&w.length&&(z===null&&(z=K,L=w[0].x0,_=M),K-z<v&&(w=I$(w,{x0:L,x1:L+p})));const U=w.reduce((C,O)=>Math.max(C,O.x1-O.x0),0);for(const C of w){const O=C.x1-C.x0;if(O<G)continue;if(P>=S.length||S[P].token.para!==W)break;const V=P;let se=0;for(;P<S.length&&S[P].token.para===W;){const ie=S[P],N=P===V,de=ie.width*l,X=N?de:x+de;if(se+X<=O){se+=X,P+=1;continue}if(N&&O>=U-.5&&de>d-.5){se+=X,P+=1;continue}if(y){const oe=O-se-(N?0:x),fe=vC(ie,m,oe,l,g);if(fe){const Pe={token:{...ie.token,text:fe.fragmentText},originalIndex:ie.originalIndex,width:fe.fragmentWidth,kind:"fragment"},xe={token:{...ie.token,text:fe.remainderText},originalIndex:ie.originalIndex,width:fe.remainderWidth,kind:"remainder"};S.splice(P,1,Pe,xe),se+=(N?0:x)+fe.fragmentWidth*l,P+=1}}break}if(P>V){const ie=P>=S.length||S[P].token.para!==W;b.push({top:M,left:C.x0,width:O,from:V,to:P,justify:r==="justify"&&!ie})}if(P>=S.length||S[P].token.para!==W)break}T=W,M+=f,K+=1}let $=0;if(P>0){const k=S[P-1];$=k.kind==="fragment"?k.originalIndex:k.originalIndex+1}return{segments:b,placed:$,height:b.length?M:0,capLeft:L,capTop:_,renderTokens:S.map(k=>k.token)}}const xC=.12,bC=2,SC=10,ws=.25,wC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},$C=(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,CC=(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 d=wC(e);(!r||!$C(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},$s=(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})))},Qo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function TC(){return typeof document>"u"?null:document.body}function LC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:v,padding:y,hyphenate:m,showOverflowIndicator:g,dropCapLines:f,dropCapSize:x,showGuides:R,typography:b,imageUrl:S,imageFocalX:G,imageFocalY:D,imageScale:j,imageCustomPath:P,pathDragActive:M,pathCarryImage:K,onCarryImageConsumed:T,pathEditor:L,imageEditor:_}){var ot,nt;const z=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[$,k]=s.useState(null),W=s.useRef(null),[w,U]=s.useState({width:0,height:0}),[C,O]=s.useState(0),[V,se]=s.useState(null),[ie,N]=s.useState(0),[de,X]=s.useState("none");s.useEffect(()=>{!L&&!_&&X("none")},[L,_]);const[ce,oe]=s.useState(null);s.useEffect(()=>{if(!S||typeof Image>"u"){oe(null);return}let me=!1;const Ne=new Image;return Ne.onload=()=>{me||oe({width:Ne.naturalWidth,height:Ne.naturalHeight})},Ne.src=S,()=>{me=!0}},[S]);const fe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Pe=s.useMemo(()=>hC(fe),[fe]),xe=s.useMemo(()=>fC(fe),[fe]),pe=f>0&&x>1?((nt=(ot=Pe[0])==null?void 0:ot.text)==null?void 0:nt.charAt(0))??"":"",Z=(L==null?void 0:L.contours)??null,le=s.useMemo(()=>{let me=[];if(Z){const Ne=xr(Z);Ne.length&&(me=$o(Ne,r))}if(!me.length){const Ne=i.trim(),st=Ne?xd(Ne,o,r):null;st&&st.length?me=st:me=js(n==="custom"?"rectangle":n)}return n==="circle"?$s(me,w):me},[Z,n,i,o,r,w.width,w.height]),re=L==null?void 0:L.onConvert,Ie=(L==null?void 0:L.needsConversion)??!1,we=s.useMemo(()=>{if(n==="circle")return!1;const me=Z??(i.trim()?Li(i):null);return!!(me&&xp(me,r))},[Z,i,r,n]),[Me,ye]=s.useState(null);Qo(()=>{if(!we){Me&&ye(null);return}!Me&&w.width>0&&w.height>0&&ye({width:w.width,height:w.height})},[we,w.width,w.height,Me]);const be=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return le;const me=Me??w,Ne=r.width/me.width,st=r.height/me.height;return le.map(ut=>ut.map(Be=>({x:Be.x*Ne,y:Be.y*st})))},[le,we,Me,r.width,r.height,w.width,w.height]),Ce=s.useMemo(()=>{if(Z){const ut=xr(Z);if(ut.length){const Be=$o(ut,r);return n==="circle"?$s(Be,w):Be}}const me=P.trim(),Ne=me?xd(me,o,r):null,st=Ne&&Ne.length?Ne:js(n==="custom"?"rectangle":n);return n==="circle"?$s(st,w):st},[Z,n,P,o,r,w.width,w.height]),h=s.useMemo(()=>{if(!we||w.width<=0||w.height<=0)return Ce;const me=Me??w,Ne=r.width/me.width,st=r.height/me.height;return Ce.map(ut=>ut.map(Be=>({x:Be.x*Ne,y:Be.y*st})))},[Ce,we,Me,r.width,r.height,w.width,w.height]),q=s.useRef(null),Y=s.useRef(!1);s.useEffect(()=>{if(!(!re||w.width<=0||w.height<=0)){if(we){if(q.current===i)return;const me=Z??(i.trim()?Li(i):null);if(!(me!=null&&me.length))return;const Ne=ln(me,st=>({x:r.x+(st.x-r.x)/w.width*r.width,y:r.y+(st.y-r.y)/w.height*r.height}));q.current=Wo(Ne),re(Ne);return}!Ie||!le.length||Y.current||(Y.current=!0,re(ln(vp(le),me=>({x:me.x*va,y:me.y*va}))))}},[Ie,we,re,le,Z,i,r,w.width,w.height]);const ee=s.useCallback(()=>{const me=$;if(!me)return;const Ne=me.getBoundingClientRect(),st=parseFloat(window.getComputedStyle(me).paddingTop)||0;O(Be=>Math.abs(Be-st)<.5?Be:st);const ut={width:Ne.width,height:Ne.height};U(Be=>Math.abs(Be.width-ut.width)<.5&&Math.abs(Be.height-ut.height)<.5?Be:ut)},[$]);Qo(()=>{const me=$;if(!me||typeof ResizeObserver>"u")return;ee();const Ne=new ResizeObserver(ee);return Ne.observe(me),()=>Ne.disconnect()},[$,ee]),Qo(()=>{ee()},[y,ee]),s.useEffect(()=>{const me=typeof document<"u"?document.fonts:void 0;me!=null&&me.ready&&me.ready.then(()=>{N(Ne=>Ne+1)})},[]),Qo(()=>{const me=W.current;if(!me)return;if(!Pe.length){se(null);return}const Ne=[],st=document.createDocumentFragment();for(const bt of Pe){const A=document.createElement("span");Object.assign(A.style,Fd(bt.leaf)),A.textContent=bt.text,st.appendChild(A),Ne.push(A)}const ut=document.createElement("span");ut.textContent=" ",st.appendChild(ut);const Be=document.createElement("span");Be.textContent="-",st.appendChild(Be);const pt=pe||"H",Tt=document.createElement("span");Tt.textContent=pt,Tt.style.lineHeight="1",st.appendChild(Tt),me.replaceChildren(st);const Lt=window.getComputedStyle(me),xt=parseFloat(Lt.fontSize)||16,Et=parseFloat(Lt.lineHeight),Vt=Number.isNaN(Et)?xt*1.2:Et,Ut=Math.max(Vt,xt),Kt=document.createElement("span");Kt.textContent=pt,Kt.style.lineHeight=`${Ut}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Kt.appendChild(Pt),me.appendChild(Kt);const jt=Kt.getBoundingClientRect().top,on=Pt.getBoundingClientRect().top,vt=Math.max(1,on-jt);Kt.remove();let Le=vt*.8;const lt=document.createElement("canvas").getContext("2d"),ct=bt=>`${Lt.fontStyle} ${Lt.fontWeight} ${bt}px ${Lt.fontFamily}`;if(lt){lt.font=ct(xt);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(Le=bt)}const wt=x>1?(x-1)*Ut+Le:Le;let It=xt*(wt/Le);if(lt){lt.font=ct(It);const bt=lt.measureText(pt).actualBoundingBoxAscent;bt>0&&(It=It*(wt/bt))}Tt.style.fontSize=`${It}px`,Tt.style.lineHeight=`${It}px`;const gt=document.createElement("span");gt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Tt.appendChild(gt);const Ot=Math.max(1,gt.getBoundingClientRect().top-Tt.getBoundingClientRect().top);gt.remove();const Mt=(x-1)*Ut+vt-Ot,Gt=Ne.map(bt=>bt.getBoundingClientRect().width),Xt=ut.getBoundingClientRect().width,Dt=Be.getBoundingClientRect().width,zt=pe?Tt.getBoundingClientRect().width:0,Bt=m?Ne.map(bt=>{const A=bt.firstChild;if(!(A instanceof Text)||A.data.length<4)return;const Te=document.createRange(),Ae=bt.getBoundingClientRect().left,ze=[];for(let mt=1;mt<=A.data.length;mt+=1)Te.setStart(A,0),Te.setEnd(A,mt),ze.push(Te.getBoundingClientRect().right-Ae);return ze}):[];me.replaceChildren(),se({widths:Gt,spaceWidth:Xt,dashWidth:Dt,charWidths:Bt,lineHeight:Ut,capWidth:zt,dropCapFontSize:It,dropCapTopAdjust:Mt})},[Pe,b,pe,f,x,ie,w.width,m]);const ve=V&&pe?V.capWidth+V.lineHeight*xC:0,B=Math.max(f,Math.ceil(x)),I=s.useMemo(()=>{if(!V||!Pe.length||w.width<=0||w.height<=0||!u)return 1;const me=ut=>Nd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:be,mode:l,align:d,scale:ut,allowOverflow:!1,capInset:ve*ut,capLines:pe?B:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:C});if(me(1).placed>=Pe.length)return 1;if(me(ws).placed<Pe.length)return ws;let Ne=ws,st=1;for(let ut=0;ut<SC;ut+=1){const Be=(Ne+st)/2;me(Be).placed>=Pe.length?Ne=Be:st=Be}return Ne},[V,Pe,w.width,w.height,be,l,d,u,ve,pe,B,m,C]);s.useEffect(()=>{v(I)},[I,v]);const Q=u?Math.min(p,I):1,ne=s.useMemo(()=>!V||!Pe.length||w.width<=0||w.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Pe}:Nd({tokens:Pe,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:w.width,height:w.height,rings:be,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ve*Q,capLines:pe?B:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:C}),[V,Pe,w.width,w.height,be,l,d,Q,c,ve,pe,B,m,C]),H=g&&Pe.length>0&&ne.placed<Pe.length,te=V?V.dropCapFontSize*Q:0,ke=V?V.dropCapTopAdjust*Q:0,ge=d==="justify"?"left":d,J=V?V.lineHeight*Q:0,Ye=ne.segments.length?ne.segments[ne.segments.length-1]:null,je=Ye?{top:Ye.top+J,left:Ye.left+Ye.width/2}:{top:w.height,left:w.width/2},it=!!(L&&Z&&w.width>0&&w.height>0),qe=!!_,et=(it||qe)&&w.width>0&&w.height>0,Je=CC($,et),Ge=et&&Je?TC():null,$e=s.useRef(!1),He=s.useCallback(me=>{$e.current=me},[]);s.useEffect(()=>{if(!it&&!qe)return;const me=Ne=>{const st=$;if(!st)return;const ut=st.getBoundingClientRect();Ne.clientX>=ut.left&&Ne.clientX<=ut.right&&Ne.clientY>=ut.top&&Ne.clientY<=ut.bottom&&(Ne.preventDefault(),Ne.stopPropagation(),X(pt=>pt==="shape"&&$e.current?pt:pt==="shape"&&qe?"image":it?"shape":"image"))};return document.addEventListener("dblclick",me,!0),()=>document.removeEventListener("dblclick",me,!0)},[it,qe,$]);const De=s.useMemo(()=>S&&w.width>0&&w.height>0?S$(h,w):null,[S,h,w.width,w.height]),Qe=s.useRef(null),he=(()=>{const me=Qe.current;return K||!_||!ce||!De||!me||P===me.customPath||me.shape!==n&&n!=="custom"?null:oC(me.bounds,De,ce,me.focalX,me.focalY,me.scale)})();Qo(()=>{if(M||!_||!ce||!De)return;const me=Qe.current,Ne=!!(me&&P!==me.customPath);Ne&&he&&_.onCommit(he),Ne&&K&&(T==null||T()),Qe.current={rings:h,bounds:De,focalX:(he==null?void 0:he.focalX)??G,focalY:(he==null?void 0:he.focalY)??D,scale:(he==null?void 0:he.scale)??j,customPath:P,shape:n}},[M,K,P,n,h,De,_,ce,G,D,j,he,T]);const _e=Qe.current,Ve=!!(M&&!K&&_e&&!he),tt=Ve&&_e?_e.focalX:(he==null?void 0:he.focalX)??G,ft=Ve&&_e?_e.focalY:(he==null?void 0:he.focalY)??D,rt=Ve&&_e?_e.scale:(he==null?void 0:he.scale)??j,Oe=Ve&&_e?_e.bounds:De,Fe=s.useMemo(()=>{if(!(w.width>0)||!(w.height>0))return"";let me=Sd(i,Z,o,r,n,w);if(we){const Ne=Me??w,st=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Be=>({x:Be.x*st,y:Be.y*ut}))}return wd(me,w)||vd(be,w)},[i,Z,o,r,n,w.width,w.height,we,Me,be]),Ee=s.useMemo(()=>{if(!S||!(w.width>0)||!(w.height>0))return"";let me=Sd(P,Z,o,r,n,w);if(we){const Ne=Me??w,st=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Be=>({x:Be.x*st,y:Be.y*ut}))}return wd(me,w)||vd(h,w)},[S,P,Z,o,r,n,w.width,w.height,we,Me,h]),Ze=`${z}-clip`,We=s.useMemo(()=>{if(!Oe)return null;const me=ce??{width:Oe.width,height:Oe.height},Ne=Gi(Oe,me,rt);return{x:Dn(Oe.width,Ne.width,tt),y:Dn(Oe.height,Ne.height,ft),width:Ne.width,height:Ne.height}},[Oe,ce,tt,ft,rt]);return a.jsxs("div",{className:`${e}-column`,style:{padding:y},ref:k,children:[Fe?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:w.width,height:w.height},viewBox:`0 0 ${w.width} ${w.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Fe,fillRule:"evenodd"}),S&&Ee&&Oe&&We?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ze,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Ee,fillRule:"evenodd"})})}),a.jsx("image",{href:S,x:Oe.x+We.x,y:Oe.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Ze})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...b,["--"+e+"-fit"]:Q,top:0,left:0,width:w.width,height:w.height},children:[a.jsx("div",{className:`${e}-measure`,ref:W,style:b,"aria-hidden":!0}),ne.segments.map((me,Ne)=>{const st=ne.renderTokens.slice(me.from,me.to),ut=Ne===0;return a.jsx("div",{className:`${e}-line${me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${me.top}px`,left:`${me.left}px`,width:`${me.width}px`,textAlign:me.justify?void 0:ge},children:st.map((Be,pt)=>{const Lt=pe&&ut&&me.from===0&&pt===0?Be.text.slice(1):Be.text,xt=Fd(Be.leaf),Et=Be.href?a.jsx("a",{className:`${e}-link`,href:Be.href,target:Be.target,rel:Be.target?"noopener noreferrer":void 0,style:xt,children:Lt}):a.jsx("span",{style:xt,children:Lt});return a.jsxs("span",{children:[!me.justify&&pt>0?" ":null,Et]},pt)})},`${me.from}-${me.to}-${Ne}`)}),R&&!Z&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:be.map((me,Ne)=>a.jsx("polygon",{points:me.map(st=>`${st.x},${st.y}`).join(" ")},Ne))})]}),pe&&V&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...b,top:`${ne.capTop+ke}px`,left:`${ne.capLeft}px`,fontSize:`${te}px`,lineHeight:`${te}px`},children:pe}),Ge&&Je&&(Z&&L||_)&&ai.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Je.top,left:Je.left,width:Je.width,height:Je.height,zIndex:bC,pointerEvents:"none"},children:[Z&&L&&a.jsx(uC,{P:e,box:{width:Je.width,height:Je.height},viewBox:r,contours:Z,snap:L.snap,stretchToBox:!we,uniformStretch:n==="circle",stage:de,onStageChange:X,onSelectionChange:He,onChange:L.onChange,onCommit:L.onCommit}),_&&Oe&&a.jsx(rC,{P:e,box:{width:Je.width,height:Je.height},bounds:Oe,natural:ce,imageUrl:S,maskPath:Ee,stage:de,onStageChange:X,focalX:tt,focalY:ft,scale:rt,onChange:_.onChange,onCommit:_.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:xe.map((me,Ne)=>a.jsx("p",{children:me},Ne))}),H&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:je.top,left:je.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 Cp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],IC={x:0,y:0,width:100,height:100},RC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?IC:{x:t[0],y:t[1],width:t[2],height:t[3]}},PC=e=>`
26575
+ `;function Jo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Di={fontSettings:{type:"object",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function gi(e,t){return e?`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`:t}function Al(e){return{[gi(e,"fontFamily")]:{type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},[gi(e,"fontSettings")]:{...Di.fontSettings,scope:"common",title:""},[gi(e,"fontSize")]:{...Di.fontSize,scope:"layout",title:""},[gi(e,"lineHeight")]:{...Di.lineHeight,scope:"layout",title:""},[gi(e,"letterSpacing")]:{...Di.letterSpacing,scope:"layout",title:""},[gi(e,"wordSpacing")]:{...Di.wordSpacing,scope:"layout",title:""},[gi(e,"textAlign")]:{...Di.textAlign,scope:"layout",title:""},[gi(e,"textAppearance")]:{...Di.textAppearance,scope:"layout",title:""}}}const d$=Al(""),u$=Al("open"),p$=Al("compact"),m$=["__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"],g$=["__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"],h$=["__componentName__",{type:"row",items:["textWidth","effect"]},"position","openFontFamily","openFontSettings",{type:"row",items:["openFontSize","openLineHeight","openLetterSpacing","openWordSpacing"]},"openTextAlign","openTextAppearance"],Zn={textTransform:"none",textDecoration:"none",fontVariant:"normal"},fs={fontWeight:400,fontStyle:"normal"},qr={d:"Always",t:"Open Only",m:"Open Only"},f$=["left-top","center-top","right-top","left-center","center","right-center","left-bottom","center-bottom","right-bottom"],y$=["iconColor","logoColor","closeButtonColor","linkColor","backgroundColor"],v$={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:"Link Default",titleByState:{default:"Link Default",hover:"Link 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:"Link Default",titleByState:{compact:"Link Default","compact-hover":"Link 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:"Link Default",titleByState:{open:"Link Default","open-hover":"Link 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"]}},textWidth:{type:"number",scope:"layout",title:"Text 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:[...f$]}},stateOverrides:{type:"object",scope:"common"},gap:Jo("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:Jo("Text padding left"),textPaddingRight:Jo("Text padding right"),textPaddingTop:Jo("Text padding top"),textPaddingBottom:Jo("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}},...d$,...u$,...p$},defaults:{link:[{link:{type:"page",value:"",target:"self"},label:"Home",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Works",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"About",showIn:qr},{link:{type:"page",value:"",target:"self"},label:"Contact",showIn:qr}],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:fs,textAlign:"left",openFontFamily:"Goudy Bookletter 1911",openFontSettings:fs,openTextAlign:"left",compactFontFamily:"Goudy Bookletter 1911",compactFontSettings:fs,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:"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,navTextWidth:120/375,gap:24/375,navGap:24/375,navPaddingLeft:20/375,navPaddingRight:20/375,textPaddingLeft:10/375,textPaddingRight:10/375,textPaddingTop:10/375,textPaddingBottom:10/375,fontSize:16/375,lineHeight:20/375,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:34/375,openLineHeight:20/375,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:40/375,compactLogoMaxHeight:20/375,compactShowIcon:"on",compactIconSize:16/375,compactNavTextWidth:80/375,compactNavGap:24/375,compactNavPaddingLeft:20/375,compactNavPaddingRight:20/375,compactFontSize:16/375,compactLineHeight:20/375,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},t:{textAlign:"center",position:"center",panelHeight:60/768,logoMaxHeight:30/768,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:16/768,textWidth:300/768,navTextWidth:90/768,gap:32/768,navGap:32/768,navPaddingLeft:20/768,navPaddingRight:20/768,textPaddingLeft:10/768,textPaddingRight:10/768,textPaddingTop:10/768,textPaddingBottom:10/768,fontSize:18/768,lineHeight:20/768,letterSpacing:0,wordSpacing:0,textAppearance:Zn,openFontSize:75/768,openLineHeight:20/768,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactTextAlign:"center",compactPanelHeight:40/768,compactLogoMaxHeight:20/768,compactShowIcon:"on",compactIconSize:16/768,compactNavTextWidth:80/768,compactNavGap:32/768,compactNavPaddingLeft:20/768,compactNavPaddingRight:20/768,compactFontSize:16/768,compactLineHeight:20/768,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn},d:{position:"center",panelHeight:50/1440,logoMaxHeight:30/1440,logoPosition:"left",compactLogoPosition:"left",navTextPosition:"center",navTextOffset:0,compactNavTextPosition:"center",compactNavTextOffset:0,showIcon:"on",iconSize:20/1440,textWidth:300/1440,navTextWidth:60/1440,gap:12/1440,navGap:64/1440,navPaddingLeft:10/1440,navPaddingRight:10/1440,textPaddingLeft:10/1440,textPaddingRight:10/1440,textPaddingTop:10/1440,textPaddingBottom:10/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:Zn,textAlign:"center",openFontSize:90/1440,openLineHeight:16/1440,openLetterSpacing:0,openWordSpacing:0,openTextAppearance:Zn,openTextAlign:"center",compactPanelHeight:30/1440,compactLogoMaxHeight:20/1440,compactShowIcon:"on",compactIconSize:20/1440,compactNavTextWidth:60/1440,compactNavGap:20/1440,compactNavPaddingLeft:10/1440,compactNavPaddingRight:10/1440,compactFontSize:16/1440,compactLineHeight:16/1440,compactLetterSpacing:0,compactWordSpacing:0,compactTextAppearance:Zn,compactTextAlign:"center"}},layout:["__componentName__","link","logo","logoMaxHeight","logoPosition","panelHeight","backgroundColor","logoColor","iconColor","showIcon","iconSize","linkColor","openLinkColor","compactShowIcon","compactIconColor","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:m$},{id:"compact",icon:"compact",title:"Compact",tooltip:"Compact State",layout:g$,availableWhen:{navigationPosition:["switch"]}},{id:"open",icon:"open",title:"Open",tooltip:"Open State",layout:h$},{id:"links",icon:"content",title:"Links",tooltip:"Link Settings",layout:["__componentName__","link"]}],paletteBookmark:{items:[...y$],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"]},x$={element:l$,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:v$,sourceCode:c$,assetsPaths:{content:[],parameters:[{path:"logo.icon",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"},{path:"openFontFamily"},{path:"compactFontFamily"}]},fontRelations:{fontSettings:"fontFamily",openFontSettings:"openFontFamily",compactFontSettings:"compactFontFamily"}},fd=120,yd=3,b$=.12,Fl={x:0,y:0,width:100,height:100};function $o(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function ya(e){return e<0?0:e>1?1:e}function vd(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 S$(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,v=u.y*t.height;p<n&&(n=p),p>o&&(o=p),v<i&&(i=v),v>r&&(r=v)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function w$(e){return e.map(([t,n])=>({x:t,y:n}))}function ys(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}function $$(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=ya(n[o]),l=ya(n[o+1]);l>r&&i.push({x0:r,x1:l})}return C$(i)}function C$(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 T$(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 L$(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 I$(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 R$(e,t,n,i){let o=null;for(let r=0;r<yd;r+=1){const l=ya(t+(n-t)*r/Math.max(1,yd-1)),d=$$(e,l),c=i==="avoid"?L$(d):d;if(o=o===null?c:T$(o,c),o.length===0)return[]}return o??[]}function xd(e,t="stretch",n=Fl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=Li(i),d=xr(l);if(d.length)return t==="viewbox"?$o(d,n):ys(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(v=>v.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const v of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",v),u.appendChild(y);let m=0;try{m=y.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let f=0;f<fd;f+=1){const x=y.getPointAtLength(f/fd*m);g.push({x:x.x,y:x.y})}p.push(g)}return p.length?t==="viewbox"?$o(p,n):ys(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"?$o([r],n):ys([r])}const Nl={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"},zs="0 0 100 100",va=100,Bs=16,P$=12,k$=16,vs=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,E$=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,bd=Math.PI/4,M$=8,A$=Math.PI/18,F$=8,fo=24,yo=[];function N$(){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 xs(e,t){return ln(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function _$(e){const t=Si(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:ln(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function W$(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 ln(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Sd(e,t,n,i,o,r){let l=[];if(t&&t.length)l=xs(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=Li(d);c.length&&(l=n==="viewbox"?xs(c,i):_$(c))}if(!l.length){const c=o!=="custom"?Nl[o]:void 0;c?l=xs(Li(c),Fl):l=N$()}}return o==="circle"?W$(l,r):l}function wd(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":Wo(ln(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function js(e){const t=e==="rectangle"||e==="custom"?void 0:Nl[e];return t?$o(xr(Li(t)),Fl):[w$([[0,0],[1,0],[1,1],[0,1]])]}function H$(e){const t=e.match(E$);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function wn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Vs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function cn(e){return{x:e.x,y:e.y}}function O$(e){return{p:cn(e.p),in:e.in?cn(e.in):null,out:e.out?cn(e.out):null}}function zn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(O$)}))}function ln(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 ln(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function D$(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:cn(e),c2:cn(l),p:cn(l)}];const u=i*Math.PI/180,p=Math.cos(u),v=Math.sin(u),y=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*y+v*m,f=-v*y+p*m,x=g*g/(d*d)+f*f/(c*c);if(x>1){const K=Math.sqrt(x);d*=K,c*=K}const P=o===r?-1:1,b=d*d*f*f+c*c*g*g,w=Math.max(0,d*d*c*c-b),j=b===0?0:P*Math.sqrt(w/b),H=j*d*f/c,B=-j*c*g/d,k=p*H-v*B+(e.x+l.x)/2,W=v*H+p*B+(e.y+l.y)/2,U=Math.atan2((f-B)/c,(g-H)/d);let I=Math.atan2((-f-B)/c,(-g-H)/d)-U;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const O=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),_=I/O,C=4/3*Math.tan(_/4),L=(K,T)=>({x:k+p*d*K-v*c*T,y:W+v*d*K+p*c*T}),D=[];let S=U;for(let K=0;K<O;K+=1){const T=S+_,N=Math.cos(S),V=Math.sin(S),ae=Math.cos(T),ie=Math.sin(T);D.push({c1:L(N-C*V,V+C*N),c2:L(ae+C*ie,ie-C*ae),p:K===O-1?cn(l):L(ae,ie)}),S=T}return D}function Li(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=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},v=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Vn(m,g.p)};vs.lastIndex=0;let y=vs.exec(t);for(;y!==null;){const m=y[1],g=m.toUpperCase(),f=m!==g,x=H$(y[2]),P=b=>f?{x:r.x+x[b],y:r.y+x[b+1]}:{x:x[b],y:x[b+1]};if(g==="Z")o=!0,u(),r=cn(l),d=null,c=null;else if(g==="M"){for(let b=0;b+1<x.length;b+=2){const w=P(b);b===0&&(u(),l=cn(w)),p(w)}d=null,c=null}else if(g==="L"){for(let b=0;b+1<x.length;b+=2)p(P(b));d=null,c=null}else if(g==="H"){for(const b of x)p({x:f?r.x+b:b,y:r.y});d=null,c=null}else if(g==="V"){for(const b of x)p({x:r.x,y:f?r.y+b:b});d=null,c=null}else if(g==="C"){for(let b=0;b+5<x.length;b+=6){const w=P(b),j=P(b+2),H=P(b+4);v(w),p(H,j),d=j}c=null}else if(g==="S"){for(let b=0;b+3<x.length;b+=4){const w=d?Vs(d,r):cn(r),j=P(b),H=P(b+2);v(w),p(H,j),d=j}c=null}else if(g==="Q")for(let b=0;b+3<x.length;b+=4){const w=P(b),j=P(b+2);v(wn(r,w,2/3)),p(j,wn(j,w,2/3)),c=w,d=null}else if(g==="T")for(let b=0;b+1<x.length;b+=2){const w=c?Vs(c,r):cn(r),j=P(b);v(wn(r,w,2/3)),p(j,wn(j,w,2/3)),c=w,d=null}else if(g==="A")for(let b=0;b+6<x.length;b+=7){const w=f?{x:r.x+x[b+5],y:r.y+x[b+6]}:{x:x[b+5],y:x[b+6]};for(const j of D$(r,x[b],x[b+1],x[b+2],x[b+3]!==0,x[b+4]!==0,w))v(j.c1),p(j.p,j.c2);d=null,c=null}y=vs.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 hp(e){return!!(Vn(e.in,e.p)||Vn(e.out,e.p))}function Vo(e,t){return!Vn(e.out,e.p)&&!Vn(t.in,t.p)}function Cd(e,t){if(Vo(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 Wo(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(Cd(r,l)),r=l;if(n.closed){const l=Cd(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function fp(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 Gs(e,t,n){if(Vo(e,t))return wn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function xr(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of fp(n)){if(Vo(o.from,o.to)){i.push(cn(o.from.p));continue}for(let r=0;r<Bs;r+=1)i.push(Gs(o.from,o.to,r/Bs))}n.closed||i.push(cn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Si(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of xr(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 z$(e){const t=Si(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 yp(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 vp(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=P$)return{closed:!0,nodes:t.map(r=>({p:cn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/k$)),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:cn(r),...yp(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xp(e,t,n=1){if(!e.length)return!1;const i=Si(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),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function B$(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:ln(e,u=>{const p=i+(u.x-t.x)*r,v=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+v/c}})}function j$(e,t){if(!e.length)return e;const n=Si(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),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return ln(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function bp(e){const t={x:0,y:0,width:va,height:va},n=e!=="custom"?Nl[e]:void 0,i=n?ln(Li(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):ln(vp(js("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=j$(i,t);return{shape:e,customPath:Wo(o),pathFit:"viewbox",pathViewBox:zs}}function Ur(e,t){return t>0?Math.round(e/t)*t:e}function V$(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,d=zn(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Td(e,t,n,i){var r;if(!t.length)return e;const o=zn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function G$(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((d,c)=>c-d);for(const d of l)i=Sp(i,r,d)}),i}function X$(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=zn(e),c=d[t].nodes[n];if(c[i]=cn(o),r){const p=i==="in"?"out":"in";c[p]=Vs(o,c.p)}return d}function q$(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 U$(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 d=zn(e),c=d[t].nodes,u=n+1;if(Vo(r,l))return c.splice(u,0,{p:wn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,v=l.in??l.p,y=wn(r.p,p,i),m=wn(p,v,i),g=wn(v,l.p,i),f=wn(y,m,i),x=wn(m,g,i),P=wn(f,x,i),b=(n+1)%o.nodes.length;return c[n].out=y,c[b].in=g,c.splice(u,0,{p:P,in:f,out:x}),{contours:d,nodeIndex:u}}function Sp(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 Ld(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,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,v=!!Vn(l[u].out,l[u].p),y=!!Vn(l[p].in,l[p].p);if(hp(d)||v||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=yp(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function Y$(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)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Id(e,t){let n=null;return e.forEach((i,o)=>{for(const r of fp(i)){const l=Vo(r.from,r.to)?1:Bs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Y$(t,Gs(r.from,r.to,c),Gs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function K$(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 Rd(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-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 Pd(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function Z$(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 J$(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function Xs(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 Q$(e,t){const n=Xs(e,t);return n?{kind:"align",a:{x:e.x-n.x*fo,y:e.y-n.y*fo},b:{x:t.x+n.x*fo,y:t.y+n.y*fo}}:{kind:"align",a:e,b:t}}function qs(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 kd(e,t,n,i,o){if(e.axis===null)return Q$(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return qs(o(r)[t],t,i)}function eC(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(kd(t,"x",l,i,o)),n&&e.y===n.value&&r.push(kd(n,"y",l,i,o)),r}function tC(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return Xs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return Xs(i(p),r)}function nC(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,v=Math.hypot(u,p);if(v<1e-6)return{point:e,guides:yo};const y=Math.atan2(p,u),m=Math.round(y/bd)*bd;let g=o?m:null,f=!1;if(!o){const B=[];n&&B.push({angle:Math.atan2(n.y,n.x),smooth:!0}),B.push({angle:m,smooth:!1});for(const k of B){const W=J$(k.angle-y);if(!(Math.abs(W)>A$)&&!(Math.abs(Math.sin(W))*v>M$)){g=k.angle,f=k.smooth;break}}}const x=i!==null&&i>0&&Math.abs(v-i)<=F$;if(g===null&&!x)return{point:e,guides:yo};const P=g??y,b=x?i:v,w={x:Math.cos(P),y:Math.sin(P)},j=b+(g===null?0:fo),H=x?b:f?fo:0;return{point:l({x:d.x+w.x*b,y:d.y+w.y*b}),guides:[{kind:"angle",a:{x:d.x-w.x*H,y:d.y-w.y*H},b:{x:d.x+w.x*j,y:d.y+w.y*j}}]}}const Us=.1,Ys=8,iC=4,Ed=10,xa=(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}}},wp=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ks=(e,t)=>{const n=xa(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Ed,y:n.y+o*Ed}},Zs=(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),Gi=(e,t,n)=>{const i=Zs(e,t)*n;return{width:t.width*i,height:t.height*i}},Dn=(e,t,n)=>(e-t)*n,vo=(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)<iC?.5:ya(r)},oC=(e,t,n,i,o,r)=>{const l=Gi(e,n,r),d=e.x+Dn(e.width,l.width,i),c=e.y+Dn(e.height,l.height,o),u=Zs(e,n),p=Zs(t,n),v=Math.min(Ys,Math.max(Us,p>0?r*(u/p):r)),y=Gi(t,n,v);return{focalX:vo(t.width,y.width,d-t.x,{clamp:!1}),focalY:vo(t.height,y.height,c-t.y,{clamp:!1}),scale:v}},Md=1.08,Yr=14,Kr=8;function rC({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:v,onCommit:y}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),P=s.useRef({focalX:c,focalY:u,scale:p});P.current={focalX:c,focalY:u,scale:p};const b=l==="image";s.useEffect(()=>{var _;b&&((_=m.current)==null||_.focus({preventScroll:!0}))},[b]);const w=s.useCallback((_,C)=>{var D;const L=(D=m.current)==null?void 0:D.getBoundingClientRect();return!L||L.width<=0||L.height<=0?{x:0,y:0}:{x:(_-L.left)/L.width*t.width,y:(C-L.top)/L.height*t.height}},[t.width,t.height]),j=_=>{var L,D;if(!i)return;_.stopPropagation(),_.preventDefault(),(L=m.current)==null||L.focus({preventScroll:!0});const C=Gi(n,i,p);f.current={pointerId:_.pointerId,origin:w(_.clientX,_.clientY),startX:Dn(n.width,C.width,c),startY:Dn(n.height,C.height,u),width:C.width,height:C.height,moved:!1},(D=m.current)==null||D.setPointerCapture(_.pointerId)},H=(_,C)=>{var ae,ie;if(!i)return;_.stopPropagation(),_.preventDefault(),(ae=m.current)==null||ae.focus({preventScroll:!0});const L=Gi(n,i,p),D=Dn(n.width,L.width,c),S=Dn(n.height,L.height,u),K={minX:D,minY:S,maxX:D+L.width,maxY:S+L.height},T=xa(K,wp(C)),N=xa(K,C),V=Math.hypot(N.x-T.x,N.y-T.y);!isFinite(V)||V<=0||(x.current={pointerId:_.pointerId,anchor:T,startDistance:V,startScale:p,startX:D,startY:S,moved:!1},(ie=m.current)==null||ie.setPointerCapture(_.pointerId))},B=_=>{if(!i)return;const C=x.current;if(C&&_.pointerId===C.pointerId){_.stopPropagation(),_.preventDefault();const D=w(_.clientX,_.clientY),S={x:D.x-n.x,y:D.y-n.y},K=Math.hypot(S.x-C.anchor.x,S.y-C.anchor.y),T=Math.min(Ys,Math.max(Us,C.startScale*(K/C.startDistance)));if(!C.moved&&Math.abs(T-C.startScale)<1e-4)return;C.moved=!0;const N=T/C.startScale,V=C.anchor.x+(C.startX-C.anchor.x)*N,ae=C.anchor.y+(C.startY-C.anchor.y)*N,ie=Gi(n,i,T);v({focalX:vo(n.width,ie.width,V),focalY:vo(n.height,ie.height,ae),scale:T});return}const L=f.current;if(L&&_.pointerId===L.pointerId){_.stopPropagation(),_.preventDefault();const D=w(_.clientX,_.clientY),S=D.x-L.origin.x,K=D.y-L.origin.y;if(!L.moved&&S===0&&K===0)return;L.moved=!0,v({focalX:vo(n.width,L.width,L.startX+S),focalY:vo(n.height,L.height,L.startY+K),scale:p})}},k=_=>{var D,S;const C=f.current;if(C&&_.pointerId===C.pointerId){f.current=null,_.stopPropagation(),(D=m.current)!=null&&D.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&y(P.current);return}const L=x.current;L&&_.pointerId===L.pointerId&&(x.current=null,_.stopPropagation(),(S=m.current)!=null&&S.hasPointerCapture(L.pointerId)&&m.current.releasePointerCapture(L.pointerId),L.moved&&y(P.current))},W=_=>{if(_.key==="Escape"){_.stopPropagation(),d("none");return}if(_.key==="="||_.key==="+"||_.key==="-"||_.key==="_"){_.preventDefault(),_.stopPropagation();const C=_.key==="="||_.key==="+",L=Math.min(Ys,Math.max(Us,p*(C?Md:1/Md))),D={focalX:c,focalY:u,scale:L};v(D),y(D)}},U=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const _=i??{width:n.width,height:n.height},C=Gi(n,_,p);return!(C.width>0)||!(C.height>0)?null:{x:n.x+Dn(n.width,C.width,c),y:n.y+Dn(n.height,C.height,u),width:C.width,height:C.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),O=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;return a.jsxs("svg",{ref:m,className:`${e}-editor${b?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:W,onPointerMove:B,onPointerUp:k,onPointerCancel:k,onLostPointerCapture:k,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),b&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),b&&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:j}),U.map(_=>{const C=Ks(O,_),L=_==="ne"||_==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:C.x-Kr/2,y:C.y-Kr/2,width:Kr,height:Kr}),a.jsx("rect",{className:`${e}-editor-scale-grab${L?` ${e}-editor-scale-grab-nesw`:""}`,x:C.x-Yr/2,y:C.y-Yr/2,width:Yr,height:Yr,onPointerDown:D=>H(D,_)})]},_)})]})]})}const Js=10,aC=Js*2,Hn=7,sC=4,lo=9,lC=3.5,Ad=1.08,cC=.05,Zr=14,dC=1,Jr=14,Qr=8;function uC({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:v}){const y=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const f=s.useRef(null),x=s.useRef(null),P=s.useRef(null),b=s.useRef(null),[w,j]=s.useState([]),[H,B]=s.useState(yo),[k,W]=s.useState(null),U=s.useCallback(h=>{B(q=>Z$(q,h)?q:h)},[]),$=d==="shape";s.useEffect(()=>{var h;$&&((h=y.current)==null||h.focus({preventScroll:!0}))},[$]),s.useEffect(()=>{$||j(h=>h.length?[]:h)},[$]);const I=w.length>0;s.useEffect(()=>{u==null||u(I)},[I,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const O=n.width>0?t.width/n.width:1,_=n.height>0?t.height/n.height:1,C=Math.min(O,_),L=r&&l?C:O,D=r&&l?C:_,S=r&&l?(t.width-n.width*C)/2:0,K=r&&l?(t.height-n.height*C)/2:0,T=s.useCallback(h=>r?{x:S+(h.x-n.x)*L,y:K+(h.y-n.y)*D}:{x:h.x-n.x,y:h.y-n.y},[r,n,L,D,S,K]),N=s.useCallback(h=>r?{x:n.x+(L>0?(h.x-S)/L:0),y:n.y+(D>0?(h.y-K)/D:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,L,D,S,K]),V=s.useMemo(()=>N({x:t.width/2,y:t.height/2}),[N,t.width,t.height]),ae=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();if(!Y||Y.width<=0||Y.height<=0)return{x:0,y:0};if(r){const fe=(h-Y.left)/Y.width*t.width,z=(q-Y.top)/Y.height*t.height;return{x:n.x+(L>0?(fe-S)/L:0),y:n.y+(D>0?(z-K)/D:0)}}return{x:n.x+(h-Y.left),y:n.y+(q-Y.top)}},[r,n,t.width,t.height,L,D,S,K]),ie=s.useCallback((h,q)=>{var ee;const Y=(ee=y.current)==null?void 0:ee.getBoundingClientRect();return!Y||Y.width<=0||Y.height<=0?{x:0,y:0}:{x:(h-Y.left)/Y.width*t.width,y:(q-Y.top)/Y.height*t.height}},[t.width,t.height]),M=s.useCallback((h,q)=>{const Y=l&&!(q!=null&&q.preserveShape)?B$(h,n,t,S,K,L,D):h;v(Y,q)},[v,l,n,t,S,K,L,D]),de=s.useCallback(()=>{W(null)},[]),X=s.useCallback((h,q,Y)=>{if(!Y||f.current||x.current||P.current||b.current){de();return}const ee=ie(h,q),fe=ln(g.current,T);for(const G of fe)for(const Ie of G.nodes)if(Math.hypot(Ie.p.x-ee.x,Ie.p.y-ee.y)<=lo){de();return}const z=Id(fe,ee);if(!z||z.distance>Js){de();return}const R=fe[z.contour],Q=R==null?void 0:R.nodes[z.segment],te=R==null?void 0:R.nodes[(z.segment+1)%((R==null?void 0:R.nodes.length)??1)],ce=!!(Q&&te&&!Vo(Q,te));W(G=>G&&G.curved===ce&&Math.hypot(G.point.x-z.point.x,G.point.y-z.point.y)<.25?G:{point:z.point,curved:ce})},[ie,T,de]),le=h=>{var je;const q=h.metaKey||h.ctrlKey,Y=P.current;if(Y&&h.pointerId===Y.pointerId){if(h.stopPropagation(),h.preventDefault(),Y.startDistance<=0)return;const ct=ae(h.clientX,h.clientY),Ve=Math.hypot(ct.x-Y.origin.x,ct.y-Y.origin.y),et=Math.max(cC,Ve/Y.startDistance);if(!Y.moved&&Math.abs(et-1)<1e-4)return;Y.moved=!0,p($d(Y.startContours,Y.origin,et));return}const ee=x.current;if(ee&&h.pointerId===ee.pointerId){h.stopPropagation(),h.preventDefault();const ct=ae(h.clientX,h.clientY),{bbox:Ve}=ee,et=Ve.maxX-Ve.minX,Ze=Ve.maxY-Ve.minY,Ye=ct.x-ee.origin.x,be=ct.y-ee.origin.y;let Oe=Ye,ze=be;if(isFinite(et)&&isFinite(Ze))if(r){let ge=n.x,_e=n.x+n.width,Xe=n.y,tt=n.y+n.height;l&&(L>0&&(ge=n.x+(0-S)/L,_e=n.x+(t.width-S)/L),D>0&&(Xe=n.y+(0-K)/D,tt=n.y+(t.height-K)/D));const ft=Math.min(ge,_e-et),ot=Math.max(ge,_e-et),De=Math.min(Xe,tt-Ze),Fe=Math.max(Xe,tt-Ze),Ee=Math.min(ot,Math.max(ft,Ve.minX+Ye)),Je=Math.min(Fe,Math.max(De,Ve.minY+be));Oe=Ee-Ve.minX,ze=Je-Ve.minY}else{const ge=Ve.minX-n.x,_e=Ve.minY-n.y,Xe=Math.min(0,t.width-et),tt=Math.max(0,t.width-et),ft=Math.min(0,t.height-Ze),ot=Math.max(0,t.height-Ze),De=Math.min(tt,Math.max(Xe,ge+Ye)),Fe=Math.min(ot,Math.max(ft,_e+be));Oe=De-ge,ze=Fe-_e}const Qe=[];if(!q&&isFinite(et)&&isFinite(Ze)){const ge=T({x:Ve.minX+et/2+Oe,y:Ve.minY+Ze/2+ze}),_e={x:t.width/2,y:t.height/2};Math.abs(ge.x-_e.x)<=Zr&&(Oe=V.x-Ve.minX-et/2,Qe.push(qs(_e.x,"x",t))),Math.abs(ge.y-_e.y)<=Zr&&(ze=V.y-Ve.minY-Ze/2,Qe.push(qs(_e.y,"y",t)))}if(!ee.moved&&Oe===0&&ze===0)return;ee.moved=!0,U(Qe.length?Qe:yo),p(ln(ee.startContours,ge=>({x:ge.x+Oe,y:ge.y+ze})),{carryImage:!0});return}const fe=b.current;if(fe&&h.pointerId===fe.pointerId){h.stopPropagation(),h.preventDefault();const ct=ae(h.clientX,h.clientY);let Ve=ct.x-fe.origin.x,et=ct.y-fe.origin.y;if(h.shiftKey&&(Math.abs(Ve)>Math.abs(et)?et=0:Ve=0),!fe.moved&&Ve===0&&et===0)return;fe.moved=!0,p(Td(fe.startContours,fe.selection,Ve,et));return}const z=f.current;if(!z||h.pointerId!==z.pointerId){X(h.clientX,h.clientY,w.length>0||$);return}de(),h.stopPropagation(),h.preventDefault();const R=ae(h.clientX,h.clientY);if(z.kind==="anchor"){const ct={x:z.anchor.x+(R.x-z.origin.x),y:z.anchor.y+(R.y-z.origin.y)},Ve=q?[]:K$(g.current,{contour:z.contour,node:z.node}),et=q||!z.center?[]:[z.center],Ze=Pd(Rd(Ve,et.map(Oe=>Oe.x),"x"),ct,"x",T,Zr),Ye=Pd(Rd(Ve,et.map(Oe=>Oe.y),"y"),ct,"y",T,Zr),be=q?ct:{x:(Ze==null?void 0:Ze.value)??Ur(ct.x,o),y:(Ye==null?void 0:Ye.value)??Ur(ct.y,o)};if(h.shiftKey&&(Math.abs(be.x-z.anchor.x)>Math.abs(be.y-z.anchor.y)?be.y=z.anchor.y:be.x=z.anchor.x),!z.moved&&be.x===z.anchor.x&&be.y===z.anchor.y)return;z.moved=!0,U(eC(be,Ze,Ye,t,T)),p(V$(g.current,z.contour,z.node,be));return}const Q=(je=g.current[z.contour])==null?void 0:je.nodes[z.node],te=z.mirror&&!h.altKey,ce=te||q?null:z.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,G=Q?T(Q.p):null,Ie=ce?T(ce):null,xe=Q&&(!q||h.shiftKey)?nC(R,Q.p,te||q?null:tC(g.current[z.contour],z.node,z.kind,T),G&&Ie?Math.hypot(Ie.x-G.x,Ie.y-G.y):null,h.shiftKey,T,N):{point:R,guides:yo},J=xe.guides.length?xe.point:q?R:{x:Ur(R.x,o),y:Ur(R.y,o)},He=z.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!z.moved&&He&&J.x===He.x&&J.y===He.y||(z.moved=!0,U(xe.guides),p(X$(g.current,z.contour,z.node,z.kind,J,te)))},ne=h=>{U(yo);const q=P.current;if(q&&h.pointerId===q.pointerId){P.current=null,h.stopPropagation();const ce=y.current;ce!=null&&ce.hasPointerCapture(q.pointerId)&&ce.releasePointerCapture(q.pointerId),q.moved&&M(g.current,{preserveShape:!0});return}const Y=x.current;if(Y&&h.pointerId===Y.pointerId){x.current=null,h.stopPropagation();const ce=y.current;ce!=null&&ce.hasPointerCapture(Y.pointerId)&&ce.releasePointerCapture(Y.pointerId),Y.moved?M(g.current,{preserveShape:!0}):j([]);return}const ee=b.current;if(ee&&h.pointerId===ee.pointerId){b.current=null,h.stopPropagation();const ce=y.current;ce!=null&&ce.hasPointerCapture(ee.pointerId)&&ce.releasePointerCapture(ee.pointerId),ee.moved&&M(g.current);return}const fe=f.current;if(!fe||h.pointerId!==fe.pointerId)return;f.current=null,h.stopPropagation();const z=y.current;z!=null&&z.hasPointerCapture(fe.pointerId)&&z.releasePointerCapture(fe.pointerId);const R=Math.hypot(h.clientX-fe.clientOrigin.x,h.clientY-fe.clientOrigin.y);if(fe.moved||R>sC){fe.moved&&M(g.current);return}if(!fe.toggleOnRelease||h.type!=="pointerup")return;const te=Ld(g.current,fe.contour,fe.node);te!==g.current&&(p(te),M(te))},he=h=>{h.stopPropagation()},ke=h=>{var q,Y;h.stopPropagation(),h.preventDefault(),de(),(q=y.current)==null||q.focus({preventScroll:!0}),x.current={pointerId:h.pointerId,origin:ae(h.clientX,h.clientY),startContours:zn(i),bbox:Si(i),moved:!1},(Y=y.current)==null||Y.setPointerCapture(h.pointerId)},ye=(h,q)=>{var R,Q;h.stopPropagation(),h.preventDefault(),de(),(R=y.current)==null||R.focus({preventScroll:!0}),j([]),c("shape");const Y=Si(i),ee=xa(Y,wp(q)),fe=Ks(Y,q),z=Math.hypot(fe.x-ee.x,fe.y-ee.y);!isFinite(z)||z<=0||(P.current={pointerId:h.pointerId,corner:q,origin:ee,startDistance:z,startContours:zn(i),moved:!1},(Q=y.current)==null||Q.setPointerCapture(h.pointerId))},pe=(h,q,Y,ee)=>{var R,Q,te,ce;h.stopPropagation(),h.preventDefault(),de(),(R=y.current)==null||R.focus({preventScroll:!0});const fe=(Q=i[Y])==null?void 0:Q.nodes[ee];if(!fe)return;if(h.altKey){const G=q==="anchor"?Sp(i,Y,ee):q$(i,Y,ee,q);if(G===i)return;j(q==="anchor"?[]:[{contour:Y,node:ee}]),p(G),M(G);return}const z=h.metaKey||h.ctrlKey;if(q==="anchor"&&h.shiftKey&&!z){j(G=>G.some(Ie=>Ie.contour===Y&&Ie.node===ee)?G.filter(Ie=>!(Ie.contour===Y&&Ie.node===ee)):[...G,{contour:Y,node:ee}]);return}if(q==="anchor"&&!z&&w.length>1&&w.some(G=>G.contour===Y&&G.node===ee)){b.current={pointerId:h.pointerId,origin:ae(h.clientX,h.clientY),startContours:zn(i),selection:w,moved:!1},(te=y.current)==null||te.setPointerCapture(h.pointerId);return}j([{contour:Y,node:ee}]),f.current={kind:q,contour:Y,node:ee,pointerId:h.pointerId,origin:ae(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:fe.p,center:z$(i),mirror:q!=="anchor"&&!!(fe.in&&fe.out),toggleOnRelease:z,moved:!1},(ce=y.current)==null||ce.setPointerCapture(h.pointerId)},Z=h=>{h.stopPropagation(),h.preventDefault(),de();const q=ln(i,T),Y=Id(q,ie(h.clientX,h.clientY));if(!Y||Y.distance>Js)return;const{contours:ee,nodeIndex:fe}=U$(i,Y.contour,Y.segment,Y.t);fe<0||(j([{contour:Y.contour,node:fe}]),p(ee),M(ee))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const z=Si(i);if(!isFinite(z.minX)||!isFinite(z.maxX))return;const R={x:(z.minX+z.maxX)/2,y:(z.minY+z.maxY)/2},te=h.key==="="||h.key==="+"?Ad:1/Ad,ce=$d(i,R,te);p(ce),M(ce,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),j([]),c("none");return}if(!w.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const z=G$(i,w);if(z===i)return;j([]),p(z),M(z);return}const q=o>0?o:dC,Y=h.shiftKey?q*10:q,ee={ArrowLeft:[-Y,0],ArrowRight:[Y,0],ArrowUp:[0,-Y],ArrowDown:[0,Y]}[h.key];if(!ee)return;h.preventDefault(),h.stopPropagation();const fe=Td(i,w,ee[0],ee[1]);p(fe),M(fe)},oe=s.useMemo(()=>Wo(ln(i,T)),[i,T]),Re=s.useMemo(()=>Si(i),[i]),$e=T({x:Re.minX,y:Re.minY}),Me={width:T({x:Re.maxX,y:Re.minY}).x-$e.x,height:T({x:Re.minX,y:Re.maxY}).y-$e.y},ve=$&&w.length===0&&isFinite(Re.minX)&&isFinite(Re.maxX)&&Re.maxX>Re.minX&&Re.maxY>Re.minY,Se=w.length>0||$,Ce=Se;return a.jsxs("svg",{ref:y,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=y.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:le,onPointerLeave:de,onPointerUp:ne,onPointerCancel:ne,onLostPointerCapture:ne,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:()=>{j([]),c("none")},onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:oe}),Ce&&H.map((h,q)=>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}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:oe,fillRule:"evenodd",onPointerDown:ke,onClick:Z}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:oe,style:{strokeWidth:aC},onClick:Z}),Ce&&k&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:k.point.x-Hn/2,y:k.point.y-Hn/2,width:Hn,height:Hn,rx:k.curved?Hn/2:0}),Ce&&i.map((h,q)=>h.nodes.map((Y,ee)=>{const fe=w.some(R=>R.contour===q&&R.node===ee),z=T(Y.p);return a.jsxs("g",{children:[fe&&w.length===1&&["in","out"].map(R=>{const Q=Y[R];if(!Q)return null;const te=T(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:te.x,y2:te.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:te.x,cy:te.y,r:lC}),a.jsx("circle",{className:`${e}-editor-grab`,cx:te.x,cy:te.y,r:lo,onPointerDown:ce=>pe(ce,R,q,ee),onClick:he})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${fe?` ${e}-editor-anchor-selected`:""}`,x:z.x-Hn/2,y:z.y-Hn/2,width:Hn,height:Hn,rx:hp(Y)?Hn/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-lo,y:z.y-lo,width:lo*2,height:lo*2,onPointerDown:R=>pe(R,"anchor",q,ee),onClick:he,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const Q=Ld(i,q,ee);p(Q),M(Q)}})]},`${q}-${ee}`)})),ve&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:$e.x,y:$e.y,width:Me.width,height:Me.height}),["nw","ne","se","sw"].map(h=>{const q=T(Ks(Re,h)),Y=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Qr/2,y:q.y-Qr/2,width:Qr,height:Qr}),a.jsx("rect",{className:`${e}-editor-scale-grab${Y?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Jr/2,y:q.y-Jr/2,width:Jr,height:Jr,onPointerDown:ee=>ye(ee,h),onClick:he})]},h)})]})]})}const pC=4e3,mC=/^(?:https?:|mailto:|tel:)/i;function $p(e){return!!e&&typeof e=="object"&&e.type==="link"}function gC(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!mC.test(t)))return t}function hC(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if($p(c)){o(c.children??[],gC(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const v of p.split(/\s+/))v&&t.push({text:v,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Fd(e){return{...e.fontFamily&&{fontFamily:zo(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 fC(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if($p(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function yC(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 d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,f=m.y*i;g<d&&(d=g),g>c&&(c=g),f<u&&(u=f),f>p&&(p=f)}const v=(d+c)/2,y=(u+p)/2;return l.map(m=>{const g=m.x*n,f=m.y*i,x=g-v,P=f-y,b=Math.sqrt(x*x+P*P);if(b<1e-6)return m;const j=Math.max(0,b+r*t)/b;return{x:(v+x*j)/n,y:(y+P*j)/i}})})}const bs=2,Ss=2;function vC(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<bs+Ss)return null;const d=Math.min(r.length-Ss,l.length-Ss);let c=-1;for(let u=d;u>=bs;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<bs?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function Nd(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:v}=e,y=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,f=e.lineHeight*l,x=e.spaceWidth*l,P=Math.max(0,e.shapeMargin??0),b=[],w=t.map((L,D)=>({token:L,originalIndex:D,width:n[D],kind:"whole"}));if(!w.length||d<=0||f<=0)return{segments:b,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const j=Math.max(1,x*.5),H=f*b$,B=yC(i,P,d,c,o);let k=0,W=0,U=0,$=w[0].token.para,I=0,O=0,_=null;for(;k<w.length&&U<pC;){const L=W+f>c;if(L&&!u)break;const D=w[k].token.para;if(D>$+1){W+=f*(D-$-1),$=D-1,U+=1;continue}let S=L?[{x0:0,x1:d}]:R$(B,(W+H)/c,(W+f-H)/c,o).map(T=>({x0:T.x0*d,x1:T.x1*d}));p>0&&v>0&&!L&&S.length&&(_===null&&(_=U,I=S[0].x0,O=W),U-_<v&&(S=I$(S,{x0:I,x1:I+p})));const K=S.reduce((T,N)=>Math.max(T,N.x1-N.x0),0);for(const T of S){const N=T.x1-T.x0;if(N<j)continue;if(k>=w.length||w[k].token.para!==D)break;const V=k;let ae=0;for(;k<w.length&&w[k].token.para===D;){const ie=w[k],M=k===V,de=ie.width*l,X=M?de:x+de;if(ae+X<=N){ae+=X,k+=1;continue}if(M&&N>=K-.5&&de>d-.5){ae+=X,k+=1;continue}if(y){const ne=N-ae-(M?0:x),he=vC(ie,m,ne,l,g);if(he){const ke={token:{...ie.token,text:he.fragmentText},originalIndex:ie.originalIndex,width:he.fragmentWidth,kind:"fragment"},ye={token:{...ie.token,text:he.remainderText},originalIndex:ie.originalIndex,width:he.remainderWidth,kind:"remainder"};w.splice(k,1,ke,ye),ae+=(M?0:x)+he.fragmentWidth*l,k+=1}}break}if(k>V){const ie=k>=w.length||w[k].token.para!==D;b.push({top:W,left:T.x0,width:N,from:V,to:k,justify:r==="justify"&&!ie})}if(k>=w.length||w[k].token.para!==D)break}$=D,W+=f,U+=1}let C=0;if(k>0){const L=w[k-1];C=L.kind==="fragment"?L.originalIndex:L.originalIndex+1}return{segments:b,placed:C,height:b.length?W:0,capLeft:I,capTop:O,renderTokens:w.map(L=>L.token)}}const xC=.12,bC=2,SC=10,ws=.25,wC=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},$C=(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,CC=(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 d=wC(e);(!r||!$C(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},$s=(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})))},Qo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function TC(){return typeof document>"u"?null:document.body}function LC({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:v,padding:y,hyphenate:m,showOverflowIndicator:g,dropCapLines:f,dropCapSize:x,showGuides:P,typography:b,imageUrl:w,imageFocalX:j,imageFocalY:H,imageScale:B,imageCustomPath:k,pathDragActive:W,pathCarryImage:U,onCarryImageConsumed:$,pathEditor:I,imageEditor:O}){var it,nt;const _=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[C,L]=s.useState(null),D=s.useRef(null),[S,K]=s.useState({width:0,height:0}),[T,N]=s.useState(0),[V,ae]=s.useState(null),[ie,M]=s.useState(0),[de,X]=s.useState("none");s.useEffect(()=>{!I&&!O&&X("none")},[I,O]);const[le,ne]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){ne(null);return}let me=!1;const Ne=new Image;return Ne.onload=()=>{me||ne({width:Ne.naturalWidth,height:Ne.naturalHeight})},Ne.src=w,()=>{me=!0}},[w]);const he=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),ke=s.useMemo(()=>hC(he),[he]),ye=s.useMemo(()=>fC(he),[he]),pe=f>0&&x>1?((nt=(it=ke[0])==null?void 0:it.text)==null?void 0:nt.charAt(0))??"":"",Z=(I==null?void 0:I.contours)??null,se=s.useMemo(()=>{let me=[];if(Z){const Ne=xr(Z);Ne.length&&(me=$o(Ne,r))}if(!me.length){const Ne=i.trim(),at=Ne?xd(Ne,o,r):null;at&&at.length?me=at:me=js(n==="custom"?"rectangle":n)}return n==="circle"?$s(me,S):me},[Z,n,i,o,r,S.width,S.height]),oe=I==null?void 0:I.onConvert,Re=(I==null?void 0:I.needsConversion)??!1,$e=s.useMemo(()=>{if(n==="circle")return!1;const me=Z??(i.trim()?Li(i):null);return!!(me&&xp(me,r))},[Z,i,r,n]),[Me,ve]=s.useState(null);Qo(()=>{if(!$e){Me&&ve(null);return}!Me&&S.width>0&&S.height>0&&ve({width:S.width,height:S.height})},[$e,S.width,S.height,Me]);const Se=s.useMemo(()=>{if(!$e||S.width<=0||S.height<=0)return se;const me=Me??S,Ne=r.width/me.width,at=r.height/me.height;return se.map(ut=>ut.map(Ge=>({x:Ge.x*Ne,y:Ge.y*at})))},[se,$e,Me,r.width,r.height,S.width,S.height]),Ce=s.useMemo(()=>{if(Z){const ut=xr(Z);if(ut.length){const Ge=$o(ut,r);return n==="circle"?$s(Ge,S):Ge}}const me=k.trim(),Ne=me?xd(me,o,r):null,at=Ne&&Ne.length?Ne:js(n==="custom"?"rectangle":n);return n==="circle"?$s(at,S):at},[Z,n,k,o,r,S.width,S.height]),h=s.useMemo(()=>{if(!$e||S.width<=0||S.height<=0)return Ce;const me=Me??S,Ne=r.width/me.width,at=r.height/me.height;return Ce.map(ut=>ut.map(Ge=>({x:Ge.x*Ne,y:Ge.y*at})))},[Ce,$e,Me,r.width,r.height,S.width,S.height]),q=s.useRef(null),Y=s.useRef(!1);s.useEffect(()=>{if(!(!oe||S.width<=0||S.height<=0)){if($e){if(q.current===i)return;const me=Z??(i.trim()?Li(i):null);if(!(me!=null&&me.length))return;const Ne=ln(me,at=>({x:r.x+(at.x-r.x)/S.width*r.width,y:r.y+(at.y-r.y)/S.height*r.height}));q.current=Wo(Ne),oe(Ne);return}!Re||!se.length||Y.current||(Y.current=!0,oe(ln(vp(se),me=>({x:me.x*va,y:me.y*va}))))}},[Re,$e,oe,se,Z,i,r,S.width,S.height]);const ee=s.useCallback(()=>{const me=C;if(!me)return;const Ne=me.getBoundingClientRect(),at=parseFloat(window.getComputedStyle(me).paddingTop)||0;N(Ge=>Math.abs(Ge-at)<.5?Ge:at);const ut={width:Ne.width,height:Ne.height};K(Ge=>Math.abs(Ge.width-ut.width)<.5&&Math.abs(Ge.height-ut.height)<.5?Ge:ut)},[C]);Qo(()=>{const me=C;if(!me||typeof ResizeObserver>"u")return;ee();const Ne=new ResizeObserver(ee);return Ne.observe(me),()=>Ne.disconnect()},[C,ee]),Qo(()=>{ee()},[y,ee]),s.useEffect(()=>{const me=typeof document<"u"?document.fonts:void 0;me!=null&&me.ready&&me.ready.then(()=>{M(Ne=>Ne+1)})},[]),Qo(()=>{const me=D.current;if(!me)return;if(!ke.length){ae(null);return}const Ne=[],at=document.createDocumentFragment();for(const bt of ke){const A=document.createElement("span");Object.assign(A.style,Fd(bt.leaf)),A.textContent=bt.text,at.appendChild(A),Ne.push(A)}const ut=document.createElement("span");ut.textContent=" ",at.appendChild(ut);const Ge=document.createElement("span");Ge.textContent="-",at.appendChild(Ge);const pt=pe||"H",Tt=document.createElement("span");Tt.textContent=pt,Tt.style.lineHeight="1",at.appendChild(Tt),me.replaceChildren(at);const Lt=window.getComputedStyle(me),xt=parseFloat(Lt.fontSize)||16,Et=parseFloat(Lt.lineHeight),Vt=Number.isNaN(Et)?xt*1.2:Et,Ut=Math.max(Vt,xt),Kt=document.createElement("span");Kt.textContent=pt,Kt.style.lineHeight=`${Ut}px`;const Pt=document.createElement("span");Pt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Kt.appendChild(Pt),me.appendChild(Kt);const jt=Kt.getBoundingClientRect().top,on=Pt.getBoundingClientRect().top,vt=Math.max(1,on-jt);Kt.remove();let Le=vt*.8;const st=document.createElement("canvas").getContext("2d"),lt=bt=>`${Lt.fontStyle} ${Lt.fontWeight} ${bt}px ${Lt.fontFamily}`;if(st){st.font=lt(xt);const bt=st.measureText(pt).actualBoundingBoxAscent;bt>0&&(Le=bt)}const wt=x>1?(x-1)*Ut+Le:Le;let It=xt*(wt/Le);if(st){st.font=lt(It);const bt=st.measureText(pt).actualBoundingBoxAscent;bt>0&&(It=It*(wt/bt))}Tt.style.fontSize=`${It}px`,Tt.style.lineHeight=`${It}px`;const gt=document.createElement("span");gt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Tt.appendChild(gt);const Ot=Math.max(1,gt.getBoundingClientRect().top-Tt.getBoundingClientRect().top);gt.remove();const Mt=(x-1)*Ut+vt-Ot,Gt=Ne.map(bt=>bt.getBoundingClientRect().width),Xt=ut.getBoundingClientRect().width,Dt=Ge.getBoundingClientRect().width,zt=pe?Tt.getBoundingClientRect().width:0,Bt=m?Ne.map(bt=>{const A=bt.firstChild;if(!(A instanceof Text)||A.data.length<4)return;const Te=document.createRange(),Ae=bt.getBoundingClientRect().left,Be=[];for(let mt=1;mt<=A.data.length;mt+=1)Te.setStart(A,0),Te.setEnd(A,mt),Be.push(Te.getBoundingClientRect().right-Ae);return Be}):[];me.replaceChildren(),ae({widths:Gt,spaceWidth:Xt,dashWidth:Dt,charWidths:Bt,lineHeight:Ut,capWidth:zt,dropCapFontSize:It,dropCapTopAdjust:Mt})},[ke,b,pe,f,x,ie,S.width,m]);const fe=V&&pe?V.capWidth+V.lineHeight*xC:0,z=Math.max(f,Math.ceil(x)),R=s.useMemo(()=>{if(!V||!ke.length||S.width<=0||S.height<=0||!u)return 1;const me=ut=>Nd({tokens:ke,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:S.width,height:S.height,rings:Se,mode:l,align:d,scale:ut,allowOverflow:!1,capInset:fe*ut,capLines:pe?z:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:T});if(me(1).placed>=ke.length)return 1;if(me(ws).placed<ke.length)return ws;let Ne=ws,at=1;for(let ut=0;ut<SC;ut+=1){const Ge=(Ne+at)/2;me(Ge).placed>=ke.length?Ne=Ge:at=Ge}return Ne},[V,ke,S.width,S.height,Se,l,d,u,fe,pe,z,m,T]);s.useEffect(()=>{v(R)},[R,v]);const Q=u?Math.min(p,R):1,te=s.useMemo(()=>!V||!ke.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:ke}:Nd({tokens:ke,widths:V.widths,spaceWidth:V.spaceWidth,lineHeight:V.lineHeight,width:S.width,height:S.height,rings:Se,mode:l,align:d,scale:Q,allowOverflow:c,capInset:fe*Q,capLines:pe?z:0,hyphenate:m,charWidths:V.charWidths,hyphenWidth:V.dashWidth,shapeMargin:T}),[V,ke,S.width,S.height,Se,l,d,Q,c,fe,pe,z,m,T]),ce=g&&ke.length>0&&te.placed<ke.length,G=V?V.dropCapFontSize*Q:0,Ie=V?V.dropCapTopAdjust*Q:0,xe=d==="justify"?"left":d,J=V?V.lineHeight*Q:0,He=te.segments.length?te.segments[te.segments.length-1]:null,je=He?{top:He.top+J,left:He.left+He.width/2}:{top:S.height,left:S.width/2},ct=!!(I&&Z&&S.width>0&&S.height>0),Ve=!!O,et=(ct||Ve)&&S.width>0&&S.height>0,Ze=CC(C,et),Ye=et&&Ze?TC():null,be=s.useRef(!1),Oe=s.useCallback(me=>{be.current=me},[]);s.useEffect(()=>{if(!ct&&!Ve)return;const me=Ne=>{const at=C;if(!at)return;const ut=at.getBoundingClientRect();Ne.clientX>=ut.left&&Ne.clientX<=ut.right&&Ne.clientY>=ut.top&&Ne.clientY<=ut.bottom&&(Ne.preventDefault(),Ne.stopPropagation(),X(pt=>pt==="shape"&&be.current?pt:pt==="shape"&&Ve?"image":ct?"shape":"image"))};return document.addEventListener("dblclick",me,!0),()=>document.removeEventListener("dblclick",me,!0)},[ct,Ve,C]);const ze=s.useMemo(()=>w&&S.width>0&&S.height>0?S$(h,S):null,[w,h,S.width,S.height]),Qe=s.useRef(null),ge=(()=>{const me=Qe.current;return U||!O||!le||!ze||!me||k===me.customPath||me.shape!==n&&n!=="custom"?null:oC(me.bounds,ze,le,me.focalX,me.focalY,me.scale)})();Qo(()=>{if(W||!O||!le||!ze)return;const me=Qe.current,Ne=!!(me&&k!==me.customPath);Ne&&ge&&O.onCommit(ge),Ne&&U&&($==null||$()),Qe.current={rings:h,bounds:ze,focalX:(ge==null?void 0:ge.focalX)??j,focalY:(ge==null?void 0:ge.focalY)??H,scale:(ge==null?void 0:ge.scale)??B,customPath:k,shape:n}},[W,U,k,n,h,ze,O,le,j,H,B,ge,$]);const _e=Qe.current,Xe=!!(W&&!U&&_e&&!ge),tt=Xe&&_e?_e.focalX:(ge==null?void 0:ge.focalX)??j,ft=Xe&&_e?_e.focalY:(ge==null?void 0:ge.focalY)??H,ot=Xe&&_e?_e.scale:(ge==null?void 0:ge.scale)??B,De=Xe&&_e?_e.bounds:ze,Fe=s.useMemo(()=>{if(!(S.width>0)||!(S.height>0))return"";let me=Sd(i,Z,o,r,n,S);if($e){const Ne=Me??S,at=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Ge=>({x:Ge.x*at,y:Ge.y*ut}))}return wd(me,S)||vd(Se,S)},[i,Z,o,r,n,S.width,S.height,$e,Me,Se]),Ee=s.useMemo(()=>{if(!w||!(S.width>0)||!(S.height>0))return"";let me=Sd(k,Z,o,r,n,S);if($e){const Ne=Me??S,at=r.width/Ne.width,ut=r.height/Ne.height;me=ln(me,Ge=>({x:Ge.x*at,y:Ge.y*ut}))}return wd(me,S)||vd(h,S)},[w,k,Z,o,r,n,S.width,S.height,$e,Me,h]),Je=`${_}-clip`,We=s.useMemo(()=>{if(!De)return null;const me=le??{width:De.width,height:De.height},Ne=Gi(De,me,ot);return{x:Dn(De.width,Ne.width,tt),y:Dn(De.height,Ne.height,ft),width:Ne.width,height:Ne.height}},[De,le,tt,ft,ot]);return a.jsxs("div",{className:`${e}-column`,style:{padding:y},ref:L,children:[Fe?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:S.width,height:S.height},viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Fe,fillRule:"evenodd"}),w&&Ee&&De&&We?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Je,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Ee,fillRule:"evenodd"})})}),a.jsx("image",{href:w,x:De.x+We.x,y:De.y+We.y,width:We.width,height:We.height,preserveAspectRatio:"none",clipPath:`url(#${Je})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...b,["--"+e+"-fit"]:Q,top:0,left:0,width:S.width,height:S.height},children:[a.jsx("div",{className:`${e}-measure`,ref:D,style:b,"aria-hidden":!0}),te.segments.map((me,Ne)=>{const at=te.renderTokens.slice(me.from,me.to),ut=Ne===0;return a.jsx("div",{className:`${e}-line${me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${me.top}px`,left:`${me.left}px`,width:`${me.width}px`,textAlign:me.justify?void 0:xe},children:at.map((Ge,pt)=>{const Lt=pe&&ut&&me.from===0&&pt===0?Ge.text.slice(1):Ge.text,xt=Fd(Ge.leaf),Et=Ge.href?a.jsx("a",{className:`${e}-link`,href:Ge.href,target:Ge.target,rel:Ge.target?"noopener noreferrer":void 0,style:xt,children:Lt}):a.jsx("span",{style:xt,children:Lt});return a.jsxs("span",{children:[!me.justify&&pt>0?" ":null,Et]},pt)})},`${me.from}-${me.to}-${Ne}`)}),P&&!Z&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:Se.map((me,Ne)=>a.jsx("polygon",{points:me.map(at=>`${at.x},${at.y}`).join(" ")},Ne))})]}),pe&&V&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...b,top:`${te.capTop+Ie}px`,left:`${te.capLeft}px`,fontSize:`${G}px`,lineHeight:`${G}px`},children:pe}),Ye&&Ze&&(Z&&I||O)&&si.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Ze.top,left:Ze.left,width:Ze.width,height:Ze.height,zIndex:bC,pointerEvents:"none"},children:[Z&&I&&a.jsx(uC,{P:e,box:{width:Ze.width,height:Ze.height},viewBox:r,contours:Z,snap:I.snap,stretchToBox:!$e,uniformStretch:n==="circle",stage:de,onStageChange:X,onSelectionChange:Oe,onChange:I.onChange,onCommit:I.onCommit}),O&&De&&a.jsx(rC,{P:e,box:{width:Ze.width,height:Ze.height},bounds:De,natural:le,imageUrl:w,maskPath:Ee,stage:de,onStageChange:X,focalX:tt,focalY:ft,scale:ot,onChange:O.onChange,onCommit:O.onCommit})]}),Ye),a.jsx("div",{className:`${e}-a11y`,children:ye.map((me,Ne)=>a.jsx("p",{children:me},Ne))}),ce&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:je.top,left:je.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 Cp=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],IC={x:0,y:0,width:100,height:100},RC=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?IC:{x:t[0],y:t[1],width:t[2],height:t[3]}},PC=e=>`
26576
26576
  .${e}-wrapper {
26577
26577
  box-sizing: border-box;
26578
26578
  display: flex;
@@ -26801,7 +26801,7 @@ export function Burger({
26801
26801
  clip-path: inset(50%);
26802
26802
  white-space: nowrap;
26803
26803
  }
26804
- `,kC=1;function EC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=F.useScopedStyles(),c=s.useMemo(()=>PC(d),[d]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),y=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>RC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",R=(e==null?void 0:e.textAlign)??"left",b=((e==null?void 0:e.overflowMode)??"clip")==="visible",S=((e==null?void 0:e.fitText)??"off")==="on",G=((e==null?void 0:e.hyphenate)??"off")==="on",D=F.scalingValue((e==null?void 0:e.padding)??0,u),j=(e==null?void 0:e.dropCapSize)??kC,P=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??j)),M=u&&p&&!i,K=u&&!i,[T,L]=s.useState(!1);s.useEffect(()=>{if(!u||!p){L(!1);return}const B=()=>L(!0),I=()=>L(!1),Q=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ne=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const H of Q)window.addEventListener(H,B);for(const H of ne)window.addEventListener(H,I);return()=>{for(const H of Q)window.removeEventListener(H,B);for(const H of ne)window.removeEventListener(H,I)}},[u,p]);const _=u&&p&&!i&&typeof l=="function",z=!T,$=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),W=s.useRef(""),w=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(w!==W.current)W.current=w,k.current=e??{};else if(e){const{customPath:B,shape:I,pathFit:Q,pathViewBox:ne,imageScale:H,imageFocalX:te,imageFocalY:ke,image:ge,...J}=e,Ye=k.current;for(const je of Object.keys(J))if(Ye[je]!==J[je]){k.current={...Ye,...J};break}}const[U,C]=s.useState(null),[O,V]=s.useState(!1),[se,ie]=s.useState(!1),N=s.useCallback(()=>ie(!1),[]),de=k.current.shape??y,X=s.useMemo(()=>!U||U.serialized===m?m:U.serialized,[U,m]);s.useEffect(()=>{_||(V(!1),ie(!1))},[_]),s.useEffect(()=>{!U||O||U.serialized===m&&C(null)},[U,m,O]);const ce=s.useMemo(()=>{if(!_)return null;if(U&&(U.base===m||U.serialized===m))return U.contours;const B=Li(m);return B.length?B:null},[_,U,m]),oe=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===zs&&ce&&(y==="circle"||!xp(ce,f))),fe=s.useCallback((B,I,Q)=>{const ne=Wo(B);if(C(H=>({base:H&&(H.base===m||H.serialized===m)?H.base:m,serialized:ne,contours:B})),I){const H=k.current,te=Q!=null&&Q.preserveShape?H.shape:"custom",ke={...H,shape:te,customPath:ne};k.current=ke,l==null||l(ke)}},[m,l]),Pe=s.useMemo(()=>_?{contours:oe?ce:null,snap:$,needsConversion:!oe,onConvert:B=>{const I=Wo(B);C({base:I,serialized:I,contours:B});const Q={...k.current,pathFit:"viewbox",pathViewBox:zs,customPath:I};k.current=Q,l==null||l(Q)},onChange:(B,I)=>{V(!0),ie(!!(I!=null&&I.carryImage)),fe(B,!1)},onCommit:(B,I)=>{fe(B,!0,I),V(!1)}}:null,[_,oe,ce,$,l,fe]),xe=x==="avoid"&&!!(e!=null&&e.image),pe=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]),[Z,le]=s.useState(null),re=Z??pe,Ie=s.useCallback(B=>le(B),[]),we=s.useCallback(B=>{le(B);const I={...k.current,imageFocalX:B.focalX,imageFocalY:B.focalY,imageScale:B.scale};k.current=I,l==null||l(I)},[l]);s.useEffect(()=>{Z&&Math.abs(Z.focalX-pe.focalX)<1e-9&&Math.abs(Z.focalY-pe.focalY)<1e-9&&Math.abs(Z.scale-pe.scale)<1e-9&&le(null)},[Z,pe]);const Me=s.useMemo(()=>!_||!xe?null:{onChange:Ie,onCommit:we},[_,xe,Ie,we]),[ye,be]=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,be(B))},[]),q=s.useMemo(()=>S&&typeof ye=="number"?ye:1,[ye,S]),Y=B=>`calc(${B} * var(--${d}-fit, 1))`,ee=s.useMemo(()=>{var Q,ne,H,te,ke;const B=(e==null?void 0:e.textFontSize)??.012,I=Math.max((e==null?void 0:e.textLineHeight)??B,B);return{fontFamily:zo(e==null?void 0:e.textFontFamily),fontWeight:(Q=e==null?void 0:e.textFontSettings)==null?void 0:Q.fontWeight,fontStyle:(ne=e==null?void 0:e.textFontSettings)==null?void 0:ne.fontStyle,fontSize:Y(F.scalingValue(B,u)),lineHeight:Y(F.scalingValue(I,u)),letterSpacing:Y(F.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Y(F.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(H=e==null?void 0:e.textTextAppearance)==null?void 0:H.textTransform,textDecoration:(te=e==null?void 0:e.textTextAppearance)==null?void 0:te.textDecoration,fontVariant:(ke=e==null?void 0:e.textTextAppearance)==null?void 0:ke.fontVariant}},[e,u,d]),ve={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...ve},children:a.jsx(LC,{P:d,item:v,shape:de,customPath:m,pathFit:g,viewBox:f,mode:x,align:R,allowOverflow:b,fitEnabled:S,scale:q,onFitScale:h,padding:D,hyphenate:G,showOverflowIndicator:K,dropCapLines:P,dropCapSize:j,showGuides:(M||_)&&z,typography:ee,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:re.focalX,imageFocalY:re.focalY,imageScale:re.scale,imageCustomPath:X,pathDragActive:O,pathCarryImage:se,onCarryImageConsumed:N,pathEditor:z?Pe:null,imageEditor:z?Me:null})})]})}const MC=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
26804
+ `,kC=1;function EC({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=F.useScopedStyles(),c=s.useMemo(()=>PC(d),[d]),u=n??!1,p=!!r||!!o,v=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),y=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>RC(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",P=(e==null?void 0:e.textAlign)??"left",b=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",j=((e==null?void 0:e.hyphenate)??"off")==="on",H=F.scalingValue((e==null?void 0:e.padding)??0,u),B=(e==null?void 0:e.dropCapSize)??kC,k=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??B)),W=u&&p&&!i,U=u&&!i,[$,I]=s.useState(!1);s.useEffect(()=>{if(!u||!p){I(!1);return}const z=()=>I(!0),R=()=>I(!1),Q=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],te=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const ce of Q)window.addEventListener(ce,z);for(const ce of te)window.addEventListener(ce,R);return()=>{for(const ce of Q)window.removeEventListener(ce,z);for(const ce of te)window.removeEventListener(ce,R)}},[u,p]);const O=u&&p&&!i&&typeof l=="function",_=!$,C=Math.max(0,(e==null?void 0:e.pathSnap)??0),L=s.useRef(e??{}),D=s.useRef(""),S=[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(S!==D.current)D.current=S,L.current=e??{};else if(e){const{customPath:z,shape:R,pathFit:Q,pathViewBox:te,imageScale:ce,imageFocalX:G,imageFocalY:Ie,image:xe,...J}=e,He=L.current;for(const je of Object.keys(J))if(He[je]!==J[je]){L.current={...He,...J};break}}const[K,T]=s.useState(null),[N,V]=s.useState(!1),[ae,ie]=s.useState(!1),M=s.useCallback(()=>ie(!1),[]),de=L.current.shape??y,X=s.useMemo(()=>!K||K.serialized===m?m:K.serialized,[K,m]);s.useEffect(()=>{O||(V(!1),ie(!1))},[O]),s.useEffect(()=>{!K||N||K.serialized===m&&T(null)},[K,m,N]);const le=s.useMemo(()=>{if(!O)return null;if(K&&(K.base===m||K.serialized===m))return K.contours;const z=Li(m);return z.length?z:null},[O,K,m]),ne=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===zs&&le&&(y==="circle"||!xp(le,f))),he=s.useCallback((z,R,Q)=>{const te=Wo(z);if(T(ce=>({base:ce&&(ce.base===m||ce.serialized===m)?ce.base:m,serialized:te,contours:z})),R){const ce=L.current,G=Q!=null&&Q.preserveShape?ce.shape:"custom",Ie={...ce,shape:G,customPath:te};L.current=Ie,l==null||l(Ie)}},[m,l]),ke=s.useMemo(()=>O?{contours:ne?le:null,snap:C,needsConversion:!ne,onConvert:z=>{const R=Wo(z);T({base:R,serialized:R,contours:z});const Q={...L.current,pathFit:"viewbox",pathViewBox:zs,customPath:R};L.current=Q,l==null||l(Q)},onChange:(z,R)=>{V(!0),ie(!!(R!=null&&R.carryImage)),he(z,!1)},onCommit:(z,R)=>{he(z,!0,R),V(!1)}}:null,[O,ne,le,C,l,he]),ye=x==="avoid"&&!!(e!=null&&e.image),pe=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]),[Z,se]=s.useState(null),oe=Z??pe,Re=s.useCallback(z=>se(z),[]),$e=s.useCallback(z=>{se(z);const R={...L.current,imageFocalX:z.focalX,imageFocalY:z.focalY,imageScale:z.scale};L.current=R,l==null||l(R)},[l]);s.useEffect(()=>{Z&&Math.abs(Z.focalX-pe.focalX)<1e-9&&Math.abs(Z.focalY-pe.focalY)<1e-9&&Math.abs(Z.scale-pe.scale)<1e-9&&se(null)},[Z,pe]);const Me=s.useMemo(()=>!O||!ye?null:{onChange:Re,onCommit:$e},[O,ye,Re,$e]),[ve,Se]=s.useState(void 0),Ce=s.useRef(void 0),h=s.useCallback(z=>{const R=Ce.current;R!==void 0&&Math.abs(R-z)<.005||(Ce.current=z,Se(z))},[]),q=s.useMemo(()=>w&&typeof ve=="number"?ve:1,[ve,w]),Y=z=>`calc(${z} * var(--${d}-fit, 1))`,ee=s.useMemo(()=>{var Q,te,ce,G,Ie;const z=(e==null?void 0:e.textFontSize)??.012,R=Math.max((e==null?void 0:e.textLineHeight)??z,z);return{fontFamily:zo(e==null?void 0:e.textFontFamily),fontWeight:(Q=e==null?void 0:e.textFontSettings)==null?void 0:Q.fontWeight,fontStyle:(te=e==null?void 0:e.textFontSettings)==null?void 0:te.fontStyle,fontSize:Y(F.scalingValue(z,u)),lineHeight:Y(F.scalingValue(R,u)),letterSpacing:Y(F.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Y(F.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(ce=e==null?void 0:e.textTextAppearance)==null?void 0:ce.textTransform,textDecoration:(G=e==null?void 0:e.textTextAppearance)==null?void 0:G.textDecoration,fontVariant:(Ie=e==null?void 0:e.textTextAppearance)==null?void 0:Ie.fontVariant}},[e,u,d]),fe={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...fe},children:a.jsx(LC,{P:d,item:v,shape:de,customPath:m,pathFit:g,viewBox:f,mode:x,align:P,allowOverflow:b,fitEnabled:w,scale:q,onFitScale:h,padding:H,hyphenate:j,showOverflowIndicator:U,dropCapLines:k,dropCapSize:B,showGuides:(W||O)&&_,typography:ee,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:oe.focalX,imageFocalY:oe.focalY,imageScale:oe.scale,imageCustomPath:X,pathDragActive:N,pathCarryImage:ae,onCarryImageConsumed:M,pathEditor:_?ke:null,imageEditor:_?Me:null})})]})}const MC=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
26805
26805
  import type React from 'react';
26806
26806
  import { CommonComponentProps } from '../props';
26807
26807
  import { scalingValue, useScopedStyles } from '../utils/index';