@cntrl-site/components 1.0.65-alpha.1 → 1.0.65-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +103 -59
- package/dist/index.mjs +1608 -1546
- 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"),ut=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function su(e){return e.type==="object"&&e.version===1}const lu="ControlSlider-module__wrapper___sHEkd",cu="ControlSlider-module__hoverArrow___A-dOH",du="ControlSlider-module__sliderItem___QQSkR",uu="ControlSlider-module__sliderImage___9hRl-",pu="ControlSlider-module__arrow___05ghY",mu="ControlSlider-module__arrowVertical___tBfVN",gu="ControlSlider-module__nextArrow___-30Yc",hu="ControlSlider-module__arrowInner___aEra3",fu="ControlSlider-module__arrowIcon___S4ztF",yu="ControlSlider-module__arrowImg___2dwJW",vu="ControlSlider-module__mirror___brd6U",xu="ControlSlider-module__pagination___bicLF",bu="ControlSlider-module__paginationInner___bT-P-",wu="ControlSlider-module__paginationVertical___zYqKw",Su="ControlSlider-module__paginationItem___nTRbk",$u="ControlSlider-module__dot___p1Qun",Cu="ControlSlider-module__activeDot___LHFaj",Tu="ControlSlider-module__paginationInsideBottom___R3FWn",Lu="ControlSlider-module__paginationInsideTop___V-qb-",Ru="ControlSlider-module__paginationOutsideBottom___14w8D",Iu="ControlSlider-module__paginationOutsideTop___SCLqB",Pu="ControlSlider-module__paginationInsideLeft___yOBRZ",Eu="ControlSlider-module__paginationInsideRight___Rtt3o",Mu="ControlSlider-module__paginationOutsideLeft___lahaw",ku="ControlSlider-module__paginationOutsideRight___EtuQa",Au="ControlSlider-module__imgWrapper___UjEgB",Fu="ControlSlider-module__captionBlock___dJ6-j",_u="ControlSlider-module__captionTextWrapper___HFlpf",Wu="ControlSlider-module__captionText___uGBVc",Nu="ControlSlider-module__active___WZK4G",Hu="ControlSlider-module__withPointerEvents___t-18M",Ou="ControlSlider-module__topLeftAlignment___zjnGM",Du="ControlSlider-module__topCenterAlignment___gD1xW",Bu="ControlSlider-module__topRightAlignment___NMapS",ju="ControlSlider-module__middleLeftAlignment___OnUrY",zu="ControlSlider-module__middleCenterAlignment___Tdkl0",Vu="ControlSlider-module__middleRightAlignment___wEbfX",Gu="ControlSlider-module__bottomLeftAlignment___cTP2-",qu="ControlSlider-module__bottomCenterAlignment___c54fB",Xu="ControlSlider-module__bottomRightAlignment___kEwrz",Uu="ControlSlider-module__clickOverlay___DZA28",Yu="ControlSlider-module__contain___pLyq7",Ku="ControlSlider-module__cover___KdDat",ct={wrapper:lu,hoverArrow:cu,sliderItem:du,sliderImage:uu,arrow:pu,arrowVertical:mu,nextArrow:gu,arrowInner:hu,arrowIcon:fu,arrowImg:yu,mirror:vu,pagination:xu,paginationInner:bu,paginationVertical:wu,paginationItem:Su,dot:$u,activeDot:Cu,paginationInsideBottom:Tu,paginationInsideTop:Lu,paginationOutsideBottom:Ru,paginationOutsideTop:Iu,paginationInsideLeft:Pu,paginationInsideRight:Eu,paginationOutsideLeft:Mu,paginationOutsideRight:ku,imgWrapper:Au,captionBlock:Fu,captionTextWrapper:_u,captionText:Wu,active:Nu,withPointerEvents:Hu,topLeftAlignment:Ou,topCenterAlignment:Du,topRightAlignment:Bu,middleLeftAlignment:ju,middleCenterAlignment:zu,middleRightAlignment:Vu,bottomLeftAlignment:Gu,bottomCenterAlignment:qu,bottomRightAlignment:Xu,clickOverlay:Uu,contain:Yu,cover:Ku};function Zu(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 Ju(e,t,n){return t&&Zu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var js="(prefers-reduced-motion: reduce)",Wi=1,Qu=2,ji=3,to=4,Oo=5,vr=6,Rr=7,ep={CREATED:Wi,MOUNTED:Qu,IDLE:ji,MOVING:to,SCROLLING:Oo,DRAGGING:vr,DESTROYED:Rr};function Hn(e){e.length=0}function ti(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(ti(arguments,1)))}var Tc=setTimeout,Da=function(){};function zs(e){return requestAnimationFrame(e)}function Or(e,t){return typeof t===e}function Co(e){return!ss(e)&&Or("object",e)}var as=Array.isArray,Lc=qt(Or,"function"),Kn=qt(Or,"string"),Do=qt(Or,"undefined");function ss(e){return e===null}function Rc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Bo(e){return as(e)?e:[e]}function xn(e,t){Bo(e).forEach(t)}function ls(e,t){return e.indexOf(t)>-1}function xr(e,t){return e.push.apply(e,Bo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Kn(t)?t.split(" "):t,!0)}function jo(e,t){xn(t,e.appendChild.bind(e))}function cs(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function To(e,t){return Rc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ic(e,t){var n=e?ti(e.children):[];return t?n.filter(function(i){return To(i,t)}):n}function zo(e,t){return t?Ic(e,t)[0]:e.firstElementChild}var Lo=Object.keys;function yi(e,t,n){return e&&(n?Lo(e).reverse():Lo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ro(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ti(arguments,1).forEach(function(t){yi(t,function(n,i){as(n)?e[i]=n.slice():Co(n)?e[i]=qn({},Co(e[i])?e[i]:{},n):e[i]=n})}),e}function Vs(e,t){xn(t||Lo(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Co(t)?yi(t,function(i,o){$t(e,o,i)}):xn(e,function(i){ss(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Hi(e,t,n){var i=document.createElement(e);return t&&(Kn(t)?In(i,t):$t(i,t)),n&&jo(n,i),i}function wn(e,t,n){if(Do(n))return getComputedStyle(e)[t];ss(n)||(e.style[t]=""+n)}function Io(e,t){wn(e,"display",t)}function Pc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Gs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function bi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ec(e){return zo(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mc(e,t){return e&&e.querySelector(t)}function ds(e,t){return t?ti(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Ba(e){return e.timeStamp}function si(e){return Kn(e)?e:e?e+"px":""}var Vo="splide",us="data-"+Vo;function bo(e,t){if(!e)throw new Error("["+Vo+"] "+(t||""))}var Zn=Math.min,Ir=Math.max,Pr=Math.floor,Po=Math.ceil,dn=Math.abs;function kc(e,t,n){return dn(e-t)<n}function br(e,t,n,i){var o=Zn(t,n),r=Ir(t,n);return i?o<e&&e<r:o<=e&&e<=r}function ki(e,t,n){var i=Zn(t,n),o=Ir(t,n);return Zn(Ir(i,e),o)}function ja(e){return+(e>0)-+(e<0)}function za(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ps(e){return e<10?"0"+e:""+e}var qs={};function tp(e){return""+e+ps(qs[e]=(qs[e]||0)+1)}function Ac(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,x){var g="addEventListener"in p,m=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,x,c,m])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===b&&(!c||x[3]===c)?(x[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){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(b){var x=b.split(".");c(u,x[0],x[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ni="mounted",Va="ready",On="move",no="moved",ms="click",Fc="active",_c="inactive",Wc="visible",Nc="hidden",en="refresh",ln="updated",zi="resize",Dr="resized",Hc="drag",Oc="dragging",Dc="dragged",Br="scroll",$i="scrolled",np="overflow",gs="destroy",Bc="arrows:mounted",jc="arrows:updated",zc="pagination:mounted",Vc="pagination:updated",hs="navigation:mounted",fs="autoplay:play",Gc="autoplay:playing",ys="autoplay:pause",vs="lazyload:loaded",qc="sk",Xc="sh",Er="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ac();function i(r,l){n.bind(t,Bo(r).join(" "),function(d){l.apply(l,as(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ti(arguments,1))}return e&&e.event.on(gs,n.destroy),Ro(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function jr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Zn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return x();d=zs(p)}}function b(C){C||m(),r=o()-(C?l*e:0),c=!1,d=zs(p)}function x(){c=!0}function g(){r=o(),l=0,n&&n(l)}function m(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function h(C){e=C}function f(){return c}return{start:b,rewind:g,pause:x,cancel:m,set:h,isPaused:f}}function ip(e){var t=e;function n(o){t=o}function i(o){return ls(Bo(o),t)}return{set:n,is:i}}function op(e,t){var n=jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function rp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Ac(),d=[];function c(){var m=n.mediaQuery==="min";Lo(o).sort(function(h,f){return m?+h-+f:+f-+h}).forEach(function(h){p(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),p(r,js),b()}function u(m){m&&l.destroy()}function p(m,h){var f=matchMedia(h);l.bind(f,"change",b),d.push([m,f])}function b(){var m=i.is(Rr),h=n.direction,f=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});Vs(n),g(f),n.destroy?e.destroy(n.destroy==="completely"):m?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function x(m){matchMedia(js).matches&&(m?qn(n,r):Vs(n,Lo(r)))}function g(m,h,f){qn(n,m),h&&qn(Object.getPrototypeOf(n),m),(f||!i.is(Wi))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:x,set:g}}var zr="Arrow",Vr=zr+"Left",Gr=zr+"Right",Uc=zr+"Up",Yc=zr+"Down",Xs="rtl",qr="ttb",ra={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Uc,Gr],ArrowRight:[Yc,Vr]};function ap(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===Xs&&!l?1:d===qr?0:-1;return ra[r]&&ra[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ra[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===Xs?1:-1)}return{resolve:i,orient:o}}var _n="role",Oi="tabindex",sp="disabled",$n="aria-",Go=$n+"controls",Kc=$n+"current",Us=$n+"selected",yn=$n+"label",xs=$n+"labelledby",Zc=$n+"hidden",bs=$n+"orientation",Eo=$n+"roledescription",Ys=$n+"live",Ks=$n+"busy",Zs=$n+"atomic",ws=[_n,Oi,sp,Go,Kc,yn,xs,Zc,bs,Eo],En=Vo+"__",ii="is-",aa=Vo,Js=En+"track",lp=En+"list",Xr=En+"slide",Jc=Xr+"--clone",cp=Xr+"__container",Ss=En+"arrows",Ur=En+"arrow",Qc=Ur+"--prev",ed=Ur+"--next",Yr=En+"pagination",td=Yr+"__page",dp=En+"progress",up=dp+"__bar",pp=En+"toggle",mp=En+"spinner",gp=En+"sr",hp=ii+"initialized",wi=ii+"active",nd=ii+"prev",id=ii+"next",Ga=ii+"visible",qa=ii+"loading",od=ii+"focus-in",rd=ii+"overflow",fp=[wi,Ga,nd,id,qa,od,rd],yp={slide:Xr,clone:Jc,arrows:Ss,arrow:Ur,prev:Qc,next:ed,pagination:Yr,page:td,spinner:mp};function vp(e,t){if(Lc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!To(n,t);)n=n.parentElement;return n}var xp=5,Qs=200,ad="touchstart mousedown",sa="touchmove mousemove",la="touchend touchcancel mouseup click";function bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],x,g,m;function h(){R(),H(),y()}function f(){o(en,C),o(en,h),o(ln,y),r(document,ad+" keydown",function(F){m=F.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,od,!!m)})}function C(F){var _=ws.concat("style");Hn(u),Fn(l,p),Fn(x,b),Pn([x,g],_),Pn(l,F?_:["style",Eo])}function y(){Fn(l,p),Fn(x,b),p=U(aa),b=U(Js),In(l,p),In(x,b),$t(l,yn,n.label),$t(l,xs,n.labelledby)}function R(){x=S("."+Js),g=zo(x,"."+lp),bo(x&&g,"A track/list element is missing."),xr(u,Ic(g,"."+Xr+":not(."+Jc+")")),yi({arrows:Ss,pagination:Yr,prev:Qc,next:ed,bar:up,toggle:pp},function(F,_){c[_]=S("."+F)}),Ro(c,{root:l,track:x,list:g,slides:u})}function H(){var F=l.id||tp(Vo),_=n.role;l.id=F,x.id=x.id||F+"-track",g.id=g.id||F+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&_&&$t(l,_n,_),$t(l,Eo,d.carousel),$t(g,_n,"presentation")}function S(F){var _=Mc(l,F);return _&&vp(_,"."+aa)===l?_:void 0}function U(F){return[F+"--"+n.type,F+"--"+n.direction,n.drag&&F+"--draggable",n.isNavigation&&F+"--nav",F===aa&&wi]}return Ro(c,{setup:h,mount:f,destroy:C})}var Vi="slide",io="loop",qo="fade";function wp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,x=p.updateOnMove,g=p.i18n,m=p.pagination,h=p.slideFocus,f=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),R=n>-1,H=zo(i,"."+cp),S;function U(){R||(i.id=u.id+"-slide"+ps(t+1),$t(i,_n,m?"tabpanel":"group"),$t(i,Eo,g.slide),$t(i,yn,y||za(g.slideLabel,[t+1,e.length]))),F()}function F(){d(i,"click",qt(l,ms,$)),d(i,"keydown",qt(l,qc,$)),r([no,Xc,$i],N),r(hs,B),x&&r(On,L)}function _(){S=!0,o.destroy(),Fn(i,fp),Pn(i,ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var v=e.splides.map(function(w){var P=w.splide.Components.Slides.getAt(t);return P?P.slide.id:""}).join(" ");$t(i,yn,za(g.slideX,(R?n:t)+1)),$t(i,Go,v),$t(i,_n,h?"button":""),h&&Pn(i,Eo)}function L(){S||N()}function N(){if(!S){var v=e.index;k(),Z(),An(i,nd,t===v-1),An(i,id,t===v+1)}}function k(){var v=K();v!==Gs(i,wi)&&(An(i,wi,v),$t(i,Kc,b&&v||""),l(v?Fc:_c,$))}function Z(){var v=D(),w=!v&&(!K()||R);if(e.state.is([to,Oo])||$t(i,Zc,w||""),$t(ds(i,p.focusableNodes||""),Oi,w?-1:""),h&&$t(i,Oi,w?-1:0),v!==Gs(i,Ga)&&(An(i,Ga,v),l(v?Wc:Nc,$)),!v&&document.activeElement===i){var P=c.Slides.getAt(e.index);P&&Pc(P.slide)}}function E(v,w,P){wn(P&&H||i,v,w)}function K(){var v=e.index;return v===t||p.cloneStatus&&v===n}function D(){if(e.is(qo))return K();var v=hn(c.Elements.track),w=hn(i),P=f("left",!0),Q=f("right",!0);return Pr(v[P])<=Po(w[P])&&Pr(w[Q])<=Po(v[Q])}function j(v,w){var P=dn(v-t);return!R&&(p.rewind||e.is(io))&&(P=Zn(P,e.length-P)),P<=w}var $={index:t,slideIndex:n,slide:i,container:H,isClone:R,mount:U,destroy:_,update:N,style:E,isWithin:j};return $}function Sp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){x(),o(en,g),o(en,x)}function x(){c.forEach(function(N,k){h(N,k,-1)})}function g(){S(function(N){N.destroy()}),Hn(p)}function m(){S(function(N){N.update()})}function h(N,k,Z){var E=wp(e,k,Z,N);E.mount(),p.push(E),p.sort(function(K,D){return K.index-D.index})}function f(N){return N?U(function(k){return!k.isClone}):p}function C(N){var k=t.Controller,Z=k.toIndex(N),E=k.hasFocus()?1:n.perPage;return U(function(K){return br(K.index,Z,Z+E-1)})}function y(N){return U(N)[0]}function R(N,k){xn(N,function(Z){if(Kn(Z)&&(Z=Ec(Z)),Rc(Z)){var E=c[k];E?cs(Z,E):jo(u,Z),In(Z,n.classes.slide),_(Z,qt(r,zi))}}),r(en)}function H(N){bi(U(N).map(function(k){return k.slide})),r(en)}function S(N,k){f(k).forEach(N)}function U(N){return p.filter(Lc(N)?N:function(k){return Kn(N)?To(k.slide,N):ls(Bo(N),k.index)})}function F(N,k,Z){S(function(E){E.style(N,k,Z)})}function _(N,k){var Z=ds(N,"img"),E=Z.length;E?Z.forEach(function(K){l(K,"load error",function(){--E||k()})}):k()}function B(N){return N?c.length:p.length}function L(){return p.length>n.perPage}return{mount:b,destroy:g,update:m,register:h,get:f,getIn:C,getAt:y,add:R,remove:H,forEach:S,filter:U,style:F,getLength:B,isEnough:L}}function $p(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,x=u.list,g=d.getAt,m=d.style,h,f,C;function y(){R(),r(window,"resize load",op(qt(l,zi))),o([ln,en],R),o(zi,H)}function R(){h=n.direction===qr,wn(p,"maxWidth",si(n.width)),wn(b,c("paddingLeft"),S(!1)),wn(b,c("paddingRight"),S(!0)),H(!0)}function H($){var v=hn(p);($||f.width!==v.width||f.height!==v.height)&&(wn(b,"height",U()),m(c("marginRight"),si(n.gap)),m("width",_()),m("height",B(),!0),f=v,l(Dr),C!==(C=j())&&(An(p,rd,C),l(np,C)))}function S($){var v=n.padding,w=c($?"right":"left");return v&&si(v[w]||(Co(v)?0:v))||"0px"}function U(){var $="";return h&&($=F(),bo($,"height or heightRatio is missing."),$="calc("+$+" - "+S(!1)+" - "+S(!0)+")"),$}function F(){return si(n.height||hn(x).width*n.heightRatio)}function _(){return n.autoWidth?null:si(n.fixedWidth)||(h?"":L())}function B(){return si(n.fixedHeight)||(h?n.autoHeight?null:L():F())}function L(){var $=si(n.gap);return"calc((100%"+($&&" + "+$)+")/"+(n.perPage||1)+($&&" - "+$)+")"}function N(){return hn(x)[c("width")]}function k($,v){var w=g($||0);return w?hn(w.slide)[c("width")]+(v?0:K()):0}function Z($,v){var w=g($);if(w){var P=hn(w.slide)[c("right")],Q=hn(x)[c("left")];return dn(P-Q)+(v?0:K())}return 0}function E($){return Z(e.length-1)-Z(0)+k(0,$)}function K(){var $=g(0);return $&&parseFloat(wn($.slide,c("marginRight")))||0}function D($){return parseFloat(wn(b,c("padding"+($?"Right":"Left"))))||0}function j(){return e.is(qo)||E(!0)>N()}return{mount:y,resize:H,listSize:N,slideSize:k,sliderSize:E,totalSize:Z,getPadding:D,isOverflow:j}}var Cp=2;function Tp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,b),o([ln,zi],g),(u=f())&&(m(u),t.Layout.resize(!0))}function b(){x(),p()}function x(){bi(c),Hn(c),i.destroy()}function g(){var C=f();u!==C&&(u<C||!C)&&i.emit(en)}function m(C){var y=l.get().slice(),R=y.length;if(R){for(;y.length<C;)xr(y,y);xr(y.slice(-C),y.slice(0,C)).forEach(function(H,S){var U=S<C,F=h(H.slide,S);U?cs(F,y[0].slide):jo(r.list,F),xr(c,F),l.register(F,S-C+(U?0:R),H.index)})}}function h(C,y){var R=C.cloneNode(!0);return In(R,n.classes.clone),R.id=e.root.id+"-clone"+ps(y+1),R}function f(){var C=n.clones;if(!e.is(io))C=0;else if(Do(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),R=y&&Po(hn(r.track)[d("width")]/y);C=R||n[d("autoWidth")]&&e.length||n.perPage*Cp}return C}return{mount:p,destroy:x}}function Lp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,x=d.sliderSize,g=t.Direction,m=g.resolve,h=g.orient,f=t.Elements,C=f.list,y=f.track,R;function H(){R=t.Transition,o([ni,Dr,ln,en],S)}function S(){t.Controller.isBusy()||(t.Scroll.cancel(),F(e.index),t.Slides.update())}function U(w,P,Q,z){w!==P&&$(w>Q)&&(N(),_(L(E(),w>Q),!0)),l(to),r(On,P,Q,w),R.start(P,function(){l(ji),r(no,P,Q,w),z&&z()})}function F(w){_(Z(w,!0))}function _(w,P){if(!e.is(qo)){var Q=P?w:B(w);wn(C,"transform","translate"+m("X")+"("+Q+"px)"),w!==Q&&r(Xc)}}function B(w){if(e.is(io)){var P=k(w),Q=P>t.Controller.getEnd(),z=P<0;(z||Q)&&(w=L(w,Q))}return w}function L(w,P){var Q=w-j(P),z=x();return w-=h(z*(Po(dn(Q)/z)||1))*(P?1:-1),w}function N(){_(E(),!0),R.cancel()}function k(w){for(var P=t.Slides.get(),Q=0,z=1/0,T=0;T<P.length;T++){var O=P[T].index,M=dn(Z(O,!0)-w);if(M<=z)z=M,Q=O;else break}return Q}function Z(w,P){var Q=h(p(w-1)-D(w));return P?K(Q):Q}function E(){var w=m("left");return hn(C)[w]-hn(y)[w]+h(u(!1))}function K(w){return n.trimSpace&&e.is(Vi)&&(w=ki(w,0,h(x(!0)-b()))),w}function D(w){var P=n.focus;return P==="center"?(b()-c(w,!0))/2:+P*c(w)||0}function j(w){return Z(w?t.Controller.getEnd():0,!!n.trimSpace)}function $(w){var P=h(L(E(),w));return w?P>=0:P<=C[m("scrollWidth")]-hn(y)[m("width")]}function v(w,P){P=Do(P)?E():P;var Q=w!==!0&&h(P)<h(j(!1)),z=w!==!1&&h(P)>h(j(!0));return Q||z}return{mount:H,move:U,jump:F,translate:_,shift:L,cancel:N,toIndex:k,toPosition:Z,getPosition:E,getLimit:j,exceededLimit:v,reposition:S}}function Rp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,x=p.getLength,g=n.omitEnd,m=e.is(io),h=e.is(Vi),f=qt(E,!1),C=qt(E,!0),y=n.start||0,R,H=y,S,U,F;function _(){B(),o([ln,en,Er],B),o(Dr,L)}function B(){S=x(!0),U=n.perMove,F=n.perPage,R=$();var M=ki(y,0,g?R:S-1);M!==y&&(y=M,l.reposition())}function L(){R!==$()&&r(Er)}function N(M,ee,V){if(!O()){var me=Z(M),Ie=j(me);Ie>-1&&(ee||Ie!==y)&&(Q(Ie),l.move(me,Ie,H,V))}}function k(M,ee,V,me){t.Scroll.scroll(M,ee,V,function(){var Ie=j(l.toIndex(d()));Q(g?Zn(Ie,R):Ie),me&&me()})}function Z(M){var ee=y;if(Kn(M)){var V=M.match(/([+\-<>])(\d+)?/)||[],me=V[1],Ie=V[2];me==="+"||me==="-"?ee=K(y+ +(""+me+(+Ie||1)),y):me===">"?ee=Ie?v(+Ie):f(!0):me==="<"&&(ee=C(!0))}else ee=m?M:ki(M,0,R);return ee}function E(M,ee){var V=U||(T()?1:F),me=K(y+V*(M?-1:1),y,!(U||T()));return me===-1&&h&&!kc(d(),c(!M),1)?M?0:R:ee?me:j(me)}function K(M,ee,V){if(b()||T()){var me=D(M);me!==M&&(ee=M,M=me,V=!1),M<0||M>R?!U&&(br(0,M,ee,!0)||br(R,ee,M,!0))?M=v(w(M)):m?M=V?M<0?-(S%F||F):S:M:n.rewind?M=M<0?R:0:M=-1:V&&M!==ee&&(M=v(w(ee)+(M<ee?-1:1)))}else M=-1;return M}function D(M){if(h&&n.trimSpace==="move"&&M!==y)for(var ee=d();ee===u(M,!0)&&br(M,0,e.length-1,!n.rewind);)M<y?--M:++M;return M}function j(M){return m?(M+S)%S||0:M}function $(){for(var M=S-(T()||m&&U?1:F);g&&M-- >0;)if(u(S-1,!0)!==u(M,!0)){M++;break}return ki(M,0,S-1)}function v(M){return ki(T()?M:F*M,0,R)}function w(M){return T()?Zn(M,R):Pr((M>=R?S-1:M)/F)}function P(M){var ee=l.toIndex(M);return h?ki(ee,0,R):ee}function Q(M){M!==y&&(H=y,y=M)}function z(M){return M?H:y}function T(){return!Do(n.focus)||n.isNavigation}function O(){return e.state.is([to,Oo])&&!!n.waitForTransition}return{mount:_,go:N,scroll:k,getNext:f,getPrev:C,getAdjacent:E,getEnd:$,setIndex:Q,getIndex:z,toIndex:v,toPage:w,toDest:P,hasFocus:T,isBusy:O}}var Ip="http://www.w3.org/2000/svg",Pp="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 Ep(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,x=u.track,g=b,m=u.prev,h=u.next,f,C,y={};function R(){S(),o(ln,H)}function H(){U(),R()}function S(){var k=n.arrows;k&&!(m&&h)&&B(),m&&h&&(Ro(y,{prev:m,next:h}),Io(g,k?"":"none"),In(g,C=Ss+"--"+n.direction),k&&(F(),N(),$t([m,h],Go,x.id),l(Bc,m,h)))}function U(){i.destroy(),Fn(g,C),f?(bi(b?[m,h]:g),m=h=null):Pn([m,h],ws)}function F(){o([ni,no,en,$i,Er],N),r(h,"click",qt(_,">")),r(m,"click",qt(_,"<"))}function _(k){p.go(k,!0)}function B(){g=b||Hi("div",d.arrows),m=L(!0),h=L(!1),f=!0,jo(g,[m,h]),!b&&cs(g,x)}function L(k){var Z='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Ip+'" viewBox="0 0 '+er+" "+er+'" width="'+er+'" height="'+er+'" focusable="false"><path d="'+(n.arrowPath||Pp)+'" />';return Ec(Z)}function N(){if(m&&h){var k=e.index,Z=p.getPrev(),E=p.getNext(),K=Z>-1&&k<Z?c.last:c.prev,D=E>-1&&k>E?c.first:c.next;m.disabled=Z<0,h.disabled=E<0,$t(m,yn,K),$t(h,yn,D),l(jc,m,h,Z,E)}}return{arrows:y,mount:R,destroy:U,update:N}}var Mp=us+"-interval";function kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=jr(n.interval,e.go.bind(e,">"),F),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,x=p.toggle,g=n.autoplay,m,h,f=g==="pause";function C(){g&&(y(),x&&$t(x,Go,u.track.id),f||R(),U())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(B){m=B.type==="mouseenter",S()}),n.pauseOnFocus&&r(b,"focusin focusout",function(B){h=B.type==="focusin",S()}),x&&r(x,"click",function(){f?R():H(!0)}),o([On,Br,en],d.rewind),o(On,_)}function R(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=f=!1,U(),l(fs))}function H(B){B===void 0&&(B=!0),f=!!B,U(),c()||(d.pause(),l(ys))}function S(){f||(m||h?H(!1):R())}function U(){x&&(An(x,wi,!f),$t(x,yn,n.i18n[f?"play":"pause"]))}function F(B){var L=u.bar;L&&wn(L,"width",B*100+"%"),l(Gc,B)}function _(B){var L=t.Slides.getAt(B);d.set(L&&+Sn(L.slide,Mp)||n.interval)}return{mount:C,destroy:d.cancel,play:R,pause:H,isPaused:c}}function Ap(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(vs,qt(d,!0)),o([ni,ln,en],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=zo(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),Io(u,c?"none":"")}return{mount:r,destroy:qt(l,!1)}}var Fp=10,_p=600,Wp=.6,Np=1.5,Hp=800;function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,x=e.is(Vi),g,m,h=1;function f(){o(On,H),o([ln,en],S)}function C(F,_,B,L,N){var k=c();if(H(),B&&(!x||!p())){var Z=t.Layout.sliderSize(),E=ja(F)*Z*Pr(dn(F)/Z)||0;F=d.toPosition(t.Controller.toDest(F%Z))+E}var K=kc(k,F,1);h=1,_=K?0:_||Ir(dn(F-k)/Np,Hp),m=L,g=jr(_,y,qt(R,k,F,N),1),l(Oo),r(Br),g.start()}function y(){l(ji),m&&m(),r($i)}function R(F,_,B,L){var N=c(),k=F+(_-F)*U(L),Z=(k-N)*h;b(N+Z),x&&!B&&p()&&(h*=Wp,dn(Z)<Fp&&C(u(p(!0)),_p,!1,m,!0))}function H(){g&&g.cancel()}function S(){g&&!g.isPaused()&&(H(),y())}function U(F){var _=n.easingFunc;return _?_(F):1-Math.pow(1-F,4)}return{mount:f,destroy:H,scroll:C,cancel:S}}var Ai={passive:!1,capture:!0};function Dp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,x=t.Elements.track,g=t.Media.reduce,m=t.Direction,h=m.resolve,f=m.orient,C=u.getPosition,y=u.exceededLimit,R,H,S,U,F,_=!1,B,L,N;function k(){l(x,sa,Da,Ai),l(x,la,Da,Ai),l(x,ad,E,Ai),l(x,"click",j,{capture:!0}),l(x,"dragstart",kn),o([ni,ln],Z)}function Z(){var ne=n.drag;ae(!ne),U=ne==="free"}function E(ne){if(B=!1,!L){var oe=Ie(ne);me(ne.target)&&(oe||!ne.button)&&(b.isBusy()?kn(ne,!0):(N=oe?x:window,F=c.is([to,Oo]),S=null,l(N,sa,K,Ai),l(N,la,D,Ai),u.cancel(),p.cancel(),$(ne)))}}function K(ne){if(c.is(vr)||(c.set(vr),r(Hc)),ne.cancelable)if(F){u.translate(R+V(T(ne)));var oe=O(ne)>Qs,ie=_!==(_=y());(oe||ie)&&$(ne),B=!0,r(Oc),kn(ne)}else P(ne)&&(F=w(ne),kn(ne))}function D(ne){c.is(vr)&&(c.set(ji),r(Dc)),F&&(v(ne),kn(ne)),d(N,sa,K),d(N,la,D),F=!1}function j(ne){!L&&B&&kn(ne,!0)}function $(ne){S=H,H=ne,R=C()}function v(ne){var oe=Q(ne),ie=z(oe),Ae=n.rewind&&n.rewindByDrag;g(!1),U?b.scroll(ie,0,n.snap):e.is(qo)?b.go(f(ja(oe))<0?Ae?"<":"-":Ae?">":"+"):e.is(Vi)&&_&&Ae?b.go(y(!0)?">":"<"):b.go(b.toDest(ie),!0),g(!0)}function w(ne){var oe=n.dragMinThreshold,ie=Co(oe),Ae=ie&&oe.mouse||0,be=(ie?oe.touch:+oe)||10;return dn(T(ne))>(Ie(ne)?be:Ae)}function P(ne){return dn(T(ne))>dn(T(ne,!0))}function Q(ne){if(e.is(io)||!_){var oe=O(ne);if(oe&&oe<Qs)return T(ne)/oe}return 0}function z(ne){return C()+ja(ne)*Zn(dn(ne)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(ne,oe){return ee(ne,oe)-ee(M(ne),oe)}function O(ne){return Ba(ne)-Ba(M(ne))}function M(ne){return H===ne&&S||H}function ee(ne,oe){return(Ie(ne)?ne.changedTouches[0]:ne)["page"+h(oe?"Y":"X")]}function V(ne){return ne/(_&&e.is(Vi)?xp:1)}function me(ne){var oe=n.noDrag;return!To(ne,"."+td+", ."+Ur)&&(!oe||!To(ne,oe))}function Ie(ne){return typeof TouchEvent<"u"&&ne instanceof TouchEvent}function ge(){return F}function ae(ne){L=ne}return{mount:k,disable:ae,isDragging:ge}}var Bp={Spacebar:" ",Right:Gr,Left:Vr,Up:Uc,Down:Yc};function $s(e){return e=Kn(e)?e:e.key,Bp[e]||e}var el="keydown";function jp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){x(),o(ln,g),o(ln,x),o(On,h)}function x(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,el,f))}function g(){l(u,el)}function m(C){p=C}function h(){var C=p;p=!0,Tc(function(){p=C})}function f(C){if(!p){var y=$s(C);y===c(Vr)?e.go("<"):y===c(Gr)&&e.go(">")}}return{mount:b,destroy:g,disable:m}}var wo=us+"-lazy",wr=wo+"-srcset",zp="["+wo+"], ["+wr+"]";function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[no,$i],p=[];function b(){n.lazyLoad&&(x(),o(en,x))}function x(){Hn(p),g(),c?C():(r(u),o(u,m),m())}function g(){t.Slides.forEach(function(y){ds(y.slide,zp).forEach(function(R){var H=Sn(R,wo),S=Sn(R,wr);if(H!==R.src||S!==R.srcset){var U=n.classes.spinner,F=R.parentElement,_=zo(F,"."+U)||Hi("span",U,F);p.push([R,y,_]),R.src||Io(R,"none")}})})}function m(){p=p.filter(function(y){var R=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,R)?h(y):!0}),p.length||r(u)}function h(y){var R=y[0];In(y[1].slide,qa),l(R,"load error",qt(f,y)),$t(R,"src",Sn(R,wo)),$t(R,"srcset",Sn(R,wr)),Pn(R,wo),Pn(R,wr)}function f(y,R){var H=y[0],S=y[1];Fn(S.slide,qa),R.type!=="error"&&(bi(y[2]),Io(H,""),d(vs,H,S),d(zi)),c&&C()}function C(){p.length&&h(p.shift())}return{mount:b,destroy:qt(Hn,p),check:m}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,x=u.go,g=t.Direction.resolve,m=c.pagination,h=[],f,C;function y(){R(),o([ln,en,Er],y);var L=n.pagination;m&&Io(m,L?"":"none"),L&&(o([On,Br,$i],B),H(),B(),r(zc,{list:f,items:h},_(e.index)))}function R(){f&&(bi(m?ti(f.children):f),Fn(f,C),Hn(h),f=null),i.destroy()}function H(){var L=e.length,N=n.classes,k=n.i18n,Z=n.perPage,E=p()?u.getEnd()+1:Po(L/Z);f=m||Hi("ul",N.pagination,c.track.parentElement),In(f,C=Yr+"--"+F()),$t(f,_n,"tablist"),$t(f,yn,k.select),$t(f,bs,F()===qr?"vertical":"");for(var K=0;K<E;K++){var D=Hi("li",null,f),j=Hi("button",{class:N.page,type:"button"},D),$=d.getIn(K).map(function(w){return w.slide.id}),v=!p()&&Z>1?k.pageX:k.slideX;l(j,"click",qt(S,K)),n.paginationKeyboard&&l(j,"keydown",qt(U,K)),$t(D,_n,"presentation"),$t(j,_n,"tab"),$t(j,Go,$.join(" ")),$t(j,yn,za(v,K+1)),$t(j,Oi,-1),h.push({li:D,button:j,page:K})}}function S(L){x(">"+L,!0)}function U(L,N){var k=h.length,Z=$s(N),E=F(),K=-1;Z===g(Gr,!1,E)?K=++L%k:Z===g(Vr,!1,E)?K=(--L+k)%k:Z==="Home"?K=0:Z==="End"&&(K=k-1);var D=h[K];D&&(Pc(D.button),x(">"+K),kn(N,!0))}function F(){return n.paginationDirection||n.direction}function _(L){return h[u.toPage(L)]}function B(){var L=_(b(!0)),N=_(b());if(L){var k=L.button;Fn(k,wi),Pn(k,Us),$t(k,Oi,-1)}if(N){var Z=N.button;In(Z,wi),$t(Z,Us,!0),$t(Z,Oi,"")}r(Vc,{list:f,items:h},L,N)}return{items:h,mount:y,destroy:R,getAt:_,update:B}}var qp=[" ","Enter"];function Xp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(m){m.isParent||(u(e,m.splide),u(m.splide,e))}),i&&p()}function d(){r.forEach(function(m){m.destroy()}),Hn(r)}function c(){d(),l()}function u(m,h){var f=Kt(m);f.on(On,function(C,y,R){h.go(h.is(io)?R:C)}),r.push(f)}function p(){var m=Kt(e),h=m.on;h(ms,x),h(qc,g),h([ni,ln],b),r.push(m),m.emit(hs,e.splides)}function b(){$t(t.Elements.list,bs,n.direction===qr?"vertical":"")}function x(m){e.go(m.index)}function g(m,h){ls(qp,$s(h))&&(x(m),kn(h))}return{setup:qt(t.Media.set,{slideFocus:Do(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Up(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ai)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,x=Ba(u),g=n.wheelMinThreshold||0,m=n.wheelSleep||0;dn(p)>g&&x-r>m&&(e.go(b?"<":">"),r=x),c(b)&&kn(u)}}function c(u){return!n.releaseWheel||e.state.is(to)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Yp=90;function Kp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Hi("span",gp),c=jr(Yp,qt(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),$t(r,Zs,!0),d.textContent="…",o(fs,qt(x,!0)),o(ys,qt(x,!1)),o([no,$i],qt(p,!0)))}function p(g){$t(r,Ks,g),g?(jo(r,d),c.start()):(bi(d),c.cancel())}function b(){Pn(r,[Ys,Zs,Ks]),bi(d)}function x(g){l&&$t(r,Ys,g?"off":"polite")}return{mount:u,disable:x,destroy:b}}var Zp=Object.freeze({__proto__:null,Media:rp,Direction:ap,Elements:bp,Slides:Sp,Layout:$p,Clones:Tp,Move:Lp,Controller:Rp,Arrows:Ep,Autoplay:kp,Cover:Ap,Scroll:Op,Drag:Dp,Keyboard:jp,LazyLoad:Vp,Pagination:Gp,Sync:Xp,Wheel:Up,Live:Kp}),Jp={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"},Qp={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:yp,i18n:Jp,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function em(e,t,n){var i=t.Slides;function o(){Kt(e).on([ni,en],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),Tc(c)}return{mount:o,start:l,cancel:Da}}function tm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,m){var h=i.toPosition(g,!0),f=i.getPosition(),C=x(g);dn(h-f)>=1&&C>=1?n.useScroll?r.scroll(h,C,!1,m):(d("transform "+C+"ms "+n.easing),i.translate(h,!0),c=m):(i.jump(g),m())}function b(){d(""),r.cancel()}function x(g){var m=n.rewindSpeed;if(e.is(Vi)&&m){var h=o.getIndex(!0),f=o.getEnd();if(h===0&&g>=f||h>=f&&g===0)return m}return n.speed}return{mount:u,start:p,cancel:b}}var nm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=ip(Wi),this.splides=[],this._o={},this._E={};var o=Kn(n)?Mc(document,n):n;bo(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,xs)||""},Qp,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,us)))}catch{bo(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;bo(l.is([Wi,Rr]),"Already mounted!"),l.set(Wi),this._C=d,this._T=o||this._T||(this.is(qo)?em:tm),this._E=i||this._E;var c=Ro({},Zp,this._E,{Transition:this._T});return yi(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),yi(d,function(u){u.mount&&u.mount()}),this.emit(ni),In(this.root,hp),l.set(ji),this.emit(Va),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(ji)&&(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(ti(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(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Wi)?Kt(this).on(Va,this.destroy.bind(this,i)):(yi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gs),o.destroy(),i&&Hn(this.splides),r.set(Rr)),this},Ju(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})(),Cs=nm;Cs.defaults={};Cs.STATES=ep;var tl=[[ni,"onMounted"],[Va,"onReady"],[On,"onMove"],[no,"onMoved"],[ms,"onClick"],[Fc,"onActive"],[_c,"onInactive"],[Wc,"onVisible"],[Nc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[zi,"onResize"],[Dr,"onResized"],[Hc,"onDrag"],[Oc,"onDragging"],[Dc,"onDragged"],[Br,"onScroll"],[$i,"onScrolled"],[gs,"onDestroy"],[Bc,"onArrowsMounted"],[jc,"onArrowsUpdated"],[zc,"onPaginationMounted"],[Vc,"onPaginationUpdated"],[hs,"onNavigationMounted"],[fs,"onAutoplayPlay"],[Gc,"onAutoplayPlaying"],[ys,"onAutoplayPause"],[vs,"onLazyLoadLoaded"]];function Ts(...e){return e.filter(Boolean).join(" ")}function Mr(e){return e!==null&&typeof e=="object"}function Xa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Xa(n,t[i]));if(Mr(e)&&Mr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Xa(e[o],t[o]))}return e===t}function im(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function om(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function Ua(e,t){const n=e;return om(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Mr(i)?n[o]=Ua(Mr(n[o])?n[o]:{},i):n[o]=i}),n}var rm=({children:e,className:t,...n})=>s.createElement("div",{className:Ts("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ls=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 Cs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ua({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Xa(this.options,e)&&(this.splide.options=e,this.options=Ua({},e));const t=this.getSlides();im(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){tl.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:Ts("splide",e),ref:this.splideRef,...this.omit(o,["options",...tl.map(r=>r[1])])},n?s.createElement(rm,null,i):i)}},Rs=({children:e,className:t,...n})=>s.createElement("li",{className:Ts("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),ut=require("classnames"),W=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Dn=require("react-dom");function su(e){return e.type==="object"&&e.version===1}const lu="ControlSlider-module__wrapper___sHEkd",cu="ControlSlider-module__hoverArrow___A-dOH",du="ControlSlider-module__sliderItem___QQSkR",uu="ControlSlider-module__sliderImage___9hRl-",pu="ControlSlider-module__arrow___05ghY",mu="ControlSlider-module__arrowVertical___tBfVN",gu="ControlSlider-module__nextArrow___-30Yc",hu="ControlSlider-module__arrowInner___aEra3",fu="ControlSlider-module__arrowIcon___S4ztF",yu="ControlSlider-module__arrowImg___2dwJW",vu="ControlSlider-module__mirror___brd6U",xu="ControlSlider-module__pagination___bicLF",bu="ControlSlider-module__paginationInner___bT-P-",wu="ControlSlider-module__paginationVertical___zYqKw",Su="ControlSlider-module__paginationItem___nTRbk",$u="ControlSlider-module__dot___p1Qun",Cu="ControlSlider-module__activeDot___LHFaj",Tu="ControlSlider-module__paginationInsideBottom___R3FWn",Lu="ControlSlider-module__paginationInsideTop___V-qb-",Ru="ControlSlider-module__paginationOutsideBottom___14w8D",Iu="ControlSlider-module__paginationOutsideTop___SCLqB",Pu="ControlSlider-module__paginationInsideLeft___yOBRZ",Eu="ControlSlider-module__paginationInsideRight___Rtt3o",Mu="ControlSlider-module__paginationOutsideLeft___lahaw",ku="ControlSlider-module__paginationOutsideRight___EtuQa",Au="ControlSlider-module__imgWrapper___UjEgB",Fu="ControlSlider-module__captionBlock___dJ6-j",_u="ControlSlider-module__captionTextWrapper___HFlpf",Wu="ControlSlider-module__captionText___uGBVc",Nu="ControlSlider-module__active___WZK4G",Hu="ControlSlider-module__withPointerEvents___t-18M",Ou="ControlSlider-module__topLeftAlignment___zjnGM",Du="ControlSlider-module__topCenterAlignment___gD1xW",Bu="ControlSlider-module__topRightAlignment___NMapS",ju="ControlSlider-module__middleLeftAlignment___OnUrY",zu="ControlSlider-module__middleCenterAlignment___Tdkl0",Vu="ControlSlider-module__middleRightAlignment___wEbfX",Gu="ControlSlider-module__bottomLeftAlignment___cTP2-",qu="ControlSlider-module__bottomCenterAlignment___c54fB",Xu="ControlSlider-module__bottomRightAlignment___kEwrz",Uu="ControlSlider-module__clickOverlay___DZA28",Yu="ControlSlider-module__contain___pLyq7",Ku="ControlSlider-module__cover___KdDat",ct={wrapper:lu,hoverArrow:cu,sliderItem:du,sliderImage:uu,arrow:pu,arrowVertical:mu,nextArrow:gu,arrowInner:hu,arrowIcon:fu,arrowImg:yu,mirror:vu,pagination:xu,paginationInner:bu,paginationVertical:wu,paginationItem:Su,dot:$u,activeDot:Cu,paginationInsideBottom:Tu,paginationInsideTop:Lu,paginationOutsideBottom:Ru,paginationOutsideTop:Iu,paginationInsideLeft:Pu,paginationInsideRight:Eu,paginationOutsideLeft:Mu,paginationOutsideRight:ku,imgWrapper:Au,captionBlock:Fu,captionTextWrapper:_u,captionText:Wu,active:Nu,withPointerEvents:Hu,topLeftAlignment:Ou,topCenterAlignment:Du,topRightAlignment:Bu,middleLeftAlignment:ju,middleCenterAlignment:zu,middleRightAlignment:Vu,bottomLeftAlignment:Gu,bottomCenterAlignment:qu,bottomRightAlignment:Xu,clickOverlay:Uu,contain:Yu,cover:Ku};function Zu(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 Ju(e,t,n){return t&&Zu(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var js="(prefers-reduced-motion: reduce)",Ni=1,Qu=2,ji=3,to=4,Oo=5,vr=6,Rr=7,ep={CREATED:Ni,MOUNTED:Qu,IDLE:ji,MOVING:to,SCROLLING:Oo,DRAGGING:vr,DESTROYED:Rr};function Hn(e){e.length=0}function ni(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(ni(arguments,1)))}var Tc=setTimeout,Da=function(){};function zs(e){return requestAnimationFrame(e)}function Or(e,t){return typeof t===e}function Co(e){return!ss(e)&&Or("object",e)}var as=Array.isArray,Lc=qt(Or,"function"),Zn=qt(Or,"string"),Do=qt(Or,"undefined");function ss(e){return e===null}function Rc(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Bo(e){return as(e)?e:[e]}function xn(e,t){Bo(e).forEach(t)}function ls(e,t){return e.indexOf(t)>-1}function xr(e,t){return e.push.apply(e,Bo(t)),e}function An(e,t,n){e&&xn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function In(e,t){An(e,Zn(t)?t.split(" "):t,!0)}function jo(e,t){xn(t,e.appendChild.bind(e))}function cs(e,t){xn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function To(e,t){return Rc(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Ic(e,t){var n=e?ni(e.children):[];return t?n.filter(function(i){return To(i,t)}):n}function zo(e,t){return t?Ic(e,t)[0]:e.firstElementChild}var Lo=Object.keys;function xi(e,t,n){return e&&(n?Lo(e).reverse():Lo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function Ro(e){return ni(arguments,1).forEach(function(t){xi(t,function(n,i){e[i]=t[i]})}),e}function qn(e){return ni(arguments,1).forEach(function(t){xi(t,function(n,i){as(n)?e[i]=n.slice():Co(n)?e[i]=qn({},Co(e[i])?e[i]:{},n):e[i]=n})}),e}function Vs(e,t){xn(t||Lo(e),function(n){delete e[n]})}function Pn(e,t){xn(e,function(n){xn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){Co(t)?xi(t,function(i,o){$t(e,o,i)}):xn(e,function(i){ss(n)||n===""?Pn(i,t):i.setAttribute(t,String(n))})}function Hi(e,t,n){var i=document.createElement(e);return t&&(Zn(t)?In(i,t):$t(i,t)),n&&jo(n,i),i}function wn(e,t,n){if(Do(n))return getComputedStyle(e)[t];ss(n)||(e.style[t]=""+n)}function Io(e,t){wn(e,"display",t)}function Pc(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function Sn(e,t){return e.getAttribute(t)}function Gs(e,t){return e&&e.classList.contains(t)}function hn(e){return e.getBoundingClientRect()}function wi(e){xn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Ec(e){return zo(new DOMParser().parseFromString(e,"text/html").body)}function kn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Mc(e,t){return e&&e.querySelector(t)}function ds(e,t){return t?ni(e.querySelectorAll(t)):[]}function Fn(e,t){An(e,t,!1)}function Ba(e){return e.timeStamp}function li(e){return Zn(e)?e:e?e+"px":""}var Vo="splide",us="data-"+Vo;function bo(e,t){if(!e)throw new Error("["+Vo+"] "+(t||""))}var Jn=Math.min,Ir=Math.max,Pr=Math.floor,Po=Math.ceil,dn=Math.abs;function kc(e,t,n){return dn(e-t)<n}function br(e,t,n,i){var o=Jn(t,n),r=Ir(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Ai(e,t,n){var i=Jn(t,n),o=Ir(t,n);return Jn(Ir(i,e),o)}function ja(e){return+(e>0)-+(e<0)}function za(e,t){return xn(t,function(n){e=e.replace("%s",""+n)}),e}function ps(e){return e<10?"0"+e:""+e}var qs={};function tp(e){return""+e+ps(qs[e]=(qs[e]||0)+1)}function Ac(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,x){var g="addEventListener"in p,m=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,x,c,m])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===b&&(!c||x[3]===c)?(x[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){xn(l,function(u){u&&xn(d,function(p){p.split(" ").forEach(function(b){var x=b.split(".");c(u,x[0],x[1])})})})}function r(){e.forEach(function(l){l[4]()}),Hn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ii="mounted",Va="ready",On="move",no="moved",ms="click",Fc="active",_c="inactive",Wc="visible",Nc="hidden",en="refresh",ln="updated",zi="resize",Dr="resized",Hc="drag",Oc="dragging",Dc="dragged",Br="scroll",Ci="scrolled",np="overflow",gs="destroy",Bc="arrows:mounted",jc="arrows:updated",zc="pagination:mounted",Vc="pagination:updated",hs="navigation:mounted",fs="autoplay:play",Gc="autoplay:playing",ys="autoplay:pause",vs="lazyload:loaded",qc="sk",Xc="sh",Er="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ac();function i(r,l){n.bind(t,Bo(r).join(" "),function(d){l.apply(l,as(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ni(arguments,1))}return e&&e.event.on(gs,n.destroy),Ro(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function jr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Jn((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return x();d=zs(p)}}function b(C){C||m(),r=o()-(C?l*e:0),c=!1,d=zs(p)}function x(){c=!0}function g(){r=o(),l=0,n&&n(l)}function m(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function h(C){e=C}function f(){return c}return{start:b,rewind:g,pause:x,cancel:m,set:h,isPaused:f}}function ip(e){var t=e;function n(o){t=o}function i(o){return ls(Bo(o),t)}return{set:n,is:i}}function op(e,t){var n=jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function rp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=Ac(),d=[];function c(){var m=n.mediaQuery==="min";Lo(o).sort(function(h,f){return m?+h-+f:+f-+h}).forEach(function(h){p(o[h],"("+(m?"min":"max")+"-width:"+h+"px)")}),p(r,js),b()}function u(m){m&&l.destroy()}function p(m,h){var f=matchMedia(h);l.bind(f,"change",b),d.push([m,f])}function b(){var m=i.is(Rr),h=n.direction,f=d.reduce(function(C,y){return qn(C,y[1].matches?y[0]:{})},{});Vs(n),g(f),n.destroy?e.destroy(n.destroy==="completely"):m?(u(!0),e.mount()):h!==n.direction&&e.refresh()}function x(m){matchMedia(js).matches&&(m?qn(n,r):Vs(n,Lo(r)))}function g(m,h,f){qn(n,m),h&&qn(Object.getPrototypeOf(n),m),(f||!i.is(Ni))&&e.emit(ln,n)}return{setup:c,destroy:u,reduce:x,set:g}}var zr="Arrow",Vr=zr+"Left",Gr=zr+"Right",Uc=zr+"Up",Yc=zr+"Down",Xs="rtl",qr="ttb",ra={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Uc,Gr],ArrowRight:[Yc,Vr]};function ap(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===Xs&&!l?1:d===qr?0:-1;return ra[r]&&ra[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ra[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===Xs?1:-1)}return{resolve:i,orient:o}}var _n="role",Oi="tabindex",sp="disabled",$n="aria-",Go=$n+"controls",Kc=$n+"current",Us=$n+"selected",yn=$n+"label",xs=$n+"labelledby",Zc=$n+"hidden",bs=$n+"orientation",Eo=$n+"roledescription",Ys=$n+"live",Ks=$n+"busy",Zs=$n+"atomic",ws=[_n,Oi,sp,Go,Kc,yn,xs,Zc,bs,Eo],En=Vo+"__",oi="is-",aa=Vo,Js=En+"track",lp=En+"list",Xr=En+"slide",Jc=Xr+"--clone",cp=Xr+"__container",Ss=En+"arrows",Ur=En+"arrow",Qc=Ur+"--prev",ed=Ur+"--next",Yr=En+"pagination",td=Yr+"__page",dp=En+"progress",up=dp+"__bar",pp=En+"toggle",mp=En+"spinner",gp=En+"sr",hp=oi+"initialized",Si=oi+"active",nd=oi+"prev",id=oi+"next",Ga=oi+"visible",qa=oi+"loading",od=oi+"focus-in",rd=oi+"overflow",fp=[Si,Ga,nd,id,qa,od,rd],yp={slide:Xr,clone:Jc,arrows:Ss,arrow:Ur,prev:Qc,next:ed,pagination:Yr,page:td,spinner:mp};function vp(e,t){if(Lc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!To(n,t);)n=n.parentElement;return n}var xp=5,Qs=200,ad="touchstart mousedown",sa="touchmove mousemove",la="touchend touchcancel mouseup click";function bp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],x,g,m;function h(){R(),H(),y()}function f(){o(en,C),o(en,h),o(ln,y),r(document,ad+" keydown",function(F){m=F.type==="keydown"},{capture:!0}),r(l,"focusin",function(){An(l,od,!!m)})}function C(F){var _=ws.concat("style");Hn(u),Fn(l,p),Fn(x,b),Pn([x,g],_),Pn(l,F?_:["style",Eo])}function y(){Fn(l,p),Fn(x,b),p=U(aa),b=U(Js),In(l,p),In(x,b),$t(l,yn,n.label),$t(l,xs,n.labelledby)}function R(){x=S("."+Js),g=zo(x,"."+lp),bo(x&&g,"A track/list element is missing."),xr(u,Ic(g,"."+Xr+":not(."+Jc+")")),xi({arrows:Ss,pagination:Yr,prev:Qc,next:ed,bar:up,toggle:pp},function(F,_){c[_]=S("."+F)}),Ro(c,{root:l,track:x,list:g,slides:u})}function H(){var F=l.id||tp(Vo),_=n.role;l.id=F,x.id=x.id||F+"-track",g.id=g.id||F+"-list",!Sn(l,_n)&&l.tagName!=="SECTION"&&_&&$t(l,_n,_),$t(l,Eo,d.carousel),$t(g,_n,"presentation")}function S(F){var _=Mc(l,F);return _&&vp(_,"."+aa)===l?_:void 0}function U(F){return[F+"--"+n.type,F+"--"+n.direction,n.drag&&F+"--draggable",n.isNavigation&&F+"--nav",F===aa&&Si]}return Ro(c,{setup:h,mount:f,destroy:C})}var Vi="slide",io="loop",qo="fade";function wp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,x=p.updateOnMove,g=p.i18n,m=p.pagination,h=p.slideFocus,f=c.Direction.resolve,C=Sn(i,"style"),y=Sn(i,yn),R=n>-1,H=zo(i,"."+cp),S;function U(){R||(i.id=u.id+"-slide"+ps(t+1),$t(i,_n,m?"tabpanel":"group"),$t(i,Eo,g.slide),$t(i,yn,y||za(g.slideLabel,[t+1,e.length]))),F()}function F(){d(i,"click",qt(l,ms,$)),d(i,"keydown",qt(l,qc,$)),r([no,Xc,Ci],N),r(hs,B),x&&r(On,L)}function _(){S=!0,o.destroy(),Fn(i,fp),Pn(i,ws),$t(i,"style",C),$t(i,yn,y||"")}function B(){var v=e.splides.map(function(w){var P=w.splide.Components.Slides.getAt(t);return P?P.slide.id:""}).join(" ");$t(i,yn,za(g.slideX,(R?n:t)+1)),$t(i,Go,v),$t(i,_n,h?"button":""),h&&Pn(i,Eo)}function L(){S||N()}function N(){if(!S){var v=e.index;k(),Z(),An(i,nd,t===v-1),An(i,id,t===v+1)}}function k(){var v=K();v!==Gs(i,Si)&&(An(i,Si,v),$t(i,Kc,b&&v||""),l(v?Fc:_c,$))}function Z(){var v=D(),w=!v&&(!K()||R);if(e.state.is([to,Oo])||$t(i,Zc,w||""),$t(ds(i,p.focusableNodes||""),Oi,w?-1:""),h&&$t(i,Oi,w?-1:0),v!==Gs(i,Ga)&&(An(i,Ga,v),l(v?Wc:Nc,$)),!v&&document.activeElement===i){var P=c.Slides.getAt(e.index);P&&Pc(P.slide)}}function M(v,w,P){wn(P&&H||i,v,w)}function K(){var v=e.index;return v===t||p.cloneStatus&&v===n}function D(){if(e.is(qo))return K();var v=hn(c.Elements.track),w=hn(i),P=f("left",!0),Q=f("right",!0);return Pr(v[P])<=Po(w[P])&&Pr(w[Q])<=Po(v[Q])}function j(v,w){var P=dn(v-t);return!R&&(p.rewind||e.is(io))&&(P=Jn(P,e.length-P)),P<=w}var $={index:t,slideIndex:n,slide:i,container:H,isClone:R,mount:U,destroy:_,update:N,style:M,isWithin:j};return $}function Sp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){x(),o(en,g),o(en,x)}function x(){c.forEach(function(N,k){h(N,k,-1)})}function g(){S(function(N){N.destroy()}),Hn(p)}function m(){S(function(N){N.update()})}function h(N,k,Z){var M=wp(e,k,Z,N);M.mount(),p.push(M),p.sort(function(K,D){return K.index-D.index})}function f(N){return N?U(function(k){return!k.isClone}):p}function C(N){var k=t.Controller,Z=k.toIndex(N),M=k.hasFocus()?1:n.perPage;return U(function(K){return br(K.index,Z,Z+M-1)})}function y(N){return U(N)[0]}function R(N,k){xn(N,function(Z){if(Zn(Z)&&(Z=Ec(Z)),Rc(Z)){var M=c[k];M?cs(Z,M):jo(u,Z),In(Z,n.classes.slide),_(Z,qt(r,zi))}}),r(en)}function H(N){wi(U(N).map(function(k){return k.slide})),r(en)}function S(N,k){f(k).forEach(N)}function U(N){return p.filter(Lc(N)?N:function(k){return Zn(N)?To(k.slide,N):ls(Bo(N),k.index)})}function F(N,k,Z){S(function(M){M.style(N,k,Z)})}function _(N,k){var Z=ds(N,"img"),M=Z.length;M?Z.forEach(function(K){l(K,"load error",function(){--M||k()})}):k()}function B(N){return N?c.length:p.length}function L(){return p.length>n.perPage}return{mount:b,destroy:g,update:m,register:h,get:f,getIn:C,getAt:y,add:R,remove:H,forEach:S,filter:U,style:F,getLength:B,isEnough:L}}function $p(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,x=u.list,g=d.getAt,m=d.style,h,f,C;function y(){R(),r(window,"resize load",op(qt(l,zi))),o([ln,en],R),o(zi,H)}function R(){h=n.direction===qr,wn(p,"maxWidth",li(n.width)),wn(b,c("paddingLeft"),S(!1)),wn(b,c("paddingRight"),S(!0)),H(!0)}function H($){var v=hn(p);($||f.width!==v.width||f.height!==v.height)&&(wn(b,"height",U()),m(c("marginRight"),li(n.gap)),m("width",_()),m("height",B(),!0),f=v,l(Dr),C!==(C=j())&&(An(p,rd,C),l(np,C)))}function S($){var v=n.padding,w=c($?"right":"left");return v&&li(v[w]||(Co(v)?0:v))||"0px"}function U(){var $="";return h&&($=F(),bo($,"height or heightRatio is missing."),$="calc("+$+" - "+S(!1)+" - "+S(!0)+")"),$}function F(){return li(n.height||hn(x).width*n.heightRatio)}function _(){return n.autoWidth?null:li(n.fixedWidth)||(h?"":L())}function B(){return li(n.fixedHeight)||(h?n.autoHeight?null:L():F())}function L(){var $=li(n.gap);return"calc((100%"+($&&" + "+$)+")/"+(n.perPage||1)+($&&" - "+$)+")"}function N(){return hn(x)[c("width")]}function k($,v){var w=g($||0);return w?hn(w.slide)[c("width")]+(v?0:K()):0}function Z($,v){var w=g($);if(w){var P=hn(w.slide)[c("right")],Q=hn(x)[c("left")];return dn(P-Q)+(v?0:K())}return 0}function M($){return Z(e.length-1)-Z(0)+k(0,$)}function K(){var $=g(0);return $&&parseFloat(wn($.slide,c("marginRight")))||0}function D($){return parseFloat(wn(b,c("padding"+($?"Right":"Left"))))||0}function j(){return e.is(qo)||M(!0)>N()}return{mount:y,resize:H,listSize:N,slideSize:k,sliderSize:M,totalSize:Z,getPadding:D,isOverflow:j}}var Cp=2;function Tp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,b),o([ln,zi],g),(u=f())&&(m(u),t.Layout.resize(!0))}function b(){x(),p()}function x(){wi(c),Hn(c),i.destroy()}function g(){var C=f();u!==C&&(u<C||!C)&&i.emit(en)}function m(C){var y=l.get().slice(),R=y.length;if(R){for(;y.length<C;)xr(y,y);xr(y.slice(-C),y.slice(0,C)).forEach(function(H,S){var U=S<C,F=h(H.slide,S);U?cs(F,y[0].slide):jo(r.list,F),xr(c,F),l.register(F,S-C+(U?0:R),H.index)})}}function h(C,y){var R=C.cloneNode(!0);return In(R,n.classes.clone),R.id=e.root.id+"-clone"+ps(y+1),R}function f(){var C=n.clones;if(!e.is(io))C=0;else if(Do(C)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),R=y&&Po(hn(r.track)[d("width")]/y);C=R||n[d("autoWidth")]&&e.length||n.perPage*Cp}return C}return{mount:p,destroy:x}}function Lp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,x=d.sliderSize,g=t.Direction,m=g.resolve,h=g.orient,f=t.Elements,C=f.list,y=f.track,R;function H(){R=t.Transition,o([ii,Dr,ln,en],S)}function S(){t.Controller.isBusy()||(t.Scroll.cancel(),F(e.index),t.Slides.update())}function U(w,P,Q,z){w!==P&&$(w>Q)&&(N(),_(L(M(),w>Q),!0)),l(to),r(On,P,Q,w),R.start(P,function(){l(ji),r(no,P,Q,w),z&&z()})}function F(w){_(Z(w,!0))}function _(w,P){if(!e.is(qo)){var Q=P?w:B(w);wn(C,"transform","translate"+m("X")+"("+Q+"px)"),w!==Q&&r(Xc)}}function B(w){if(e.is(io)){var P=k(w),Q=P>t.Controller.getEnd(),z=P<0;(z||Q)&&(w=L(w,Q))}return w}function L(w,P){var Q=w-j(P),z=x();return w-=h(z*(Po(dn(Q)/z)||1))*(P?1:-1),w}function N(){_(M(),!0),R.cancel()}function k(w){for(var P=t.Slides.get(),Q=0,z=1/0,T=0;T<P.length;T++){var O=P[T].index,E=dn(Z(O,!0)-w);if(E<=z)z=E,Q=O;else break}return Q}function Z(w,P){var Q=h(p(w-1)-D(w));return P?K(Q):Q}function M(){var w=m("left");return hn(C)[w]-hn(y)[w]+h(u(!1))}function K(w){return n.trimSpace&&e.is(Vi)&&(w=Ai(w,0,h(x(!0)-b()))),w}function D(w){var P=n.focus;return P==="center"?(b()-c(w,!0))/2:+P*c(w)||0}function j(w){return Z(w?t.Controller.getEnd():0,!!n.trimSpace)}function $(w){var P=h(L(M(),w));return w?P>=0:P<=C[m("scrollWidth")]-hn(y)[m("width")]}function v(w,P){P=Do(P)?M():P;var Q=w!==!0&&h(P)<h(j(!1)),z=w!==!1&&h(P)>h(j(!0));return Q||z}return{mount:H,move:U,jump:F,translate:_,shift:L,cancel:N,toIndex:k,toPosition:Z,getPosition:M,getLimit:j,exceededLimit:v,reposition:S}}function Rp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,x=p.getLength,g=n.omitEnd,m=e.is(io),h=e.is(Vi),f=qt(M,!1),C=qt(M,!0),y=n.start||0,R,H=y,S,U,F;function _(){B(),o([ln,en,Er],B),o(Dr,L)}function B(){S=x(!0),U=n.perMove,F=n.perPage,R=$();var E=Ai(y,0,g?R:S-1);E!==y&&(y=E,l.reposition())}function L(){R!==$()&&r(Er)}function N(E,ee,V){if(!O()){var ue=Z(E),Ie=j(ue);Ie>-1&&(ee||Ie!==y)&&(Q(Ie),l.move(ue,Ie,H,V))}}function k(E,ee,V,ue){t.Scroll.scroll(E,ee,V,function(){var Ie=j(l.toIndex(d()));Q(g?Jn(Ie,R):Ie),ue&&ue()})}function Z(E){var ee=y;if(Zn(E)){var V=E.match(/([+\-<>])(\d+)?/)||[],ue=V[1],Ie=V[2];ue==="+"||ue==="-"?ee=K(y+ +(""+ue+(+Ie||1)),y):ue===">"?ee=Ie?v(+Ie):f(!0):ue==="<"&&(ee=C(!0))}else ee=m?E:Ai(E,0,R);return ee}function M(E,ee){var V=U||(T()?1:F),ue=K(y+V*(E?-1:1),y,!(U||T()));return ue===-1&&h&&!kc(d(),c(!E),1)?E?0:R:ee?ue:j(ue)}function K(E,ee,V){if(b()||T()){var ue=D(E);ue!==E&&(ee=E,E=ue,V=!1),E<0||E>R?!U&&(br(0,E,ee,!0)||br(R,ee,E,!0))?E=v(w(E)):m?E=V?E<0?-(S%F||F):S:E:n.rewind?E=E<0?R:0:E=-1:V&&E!==ee&&(E=v(w(ee)+(E<ee?-1:1)))}else E=-1;return E}function D(E){if(h&&n.trimSpace==="move"&&E!==y)for(var ee=d();ee===u(E,!0)&&br(E,0,e.length-1,!n.rewind);)E<y?--E:++E;return E}function j(E){return m?(E+S)%S||0:E}function $(){for(var E=S-(T()||m&&U?1:F);g&&E-- >0;)if(u(S-1,!0)!==u(E,!0)){E++;break}return Ai(E,0,S-1)}function v(E){return Ai(T()?E:F*E,0,R)}function w(E){return T()?Jn(E,R):Pr((E>=R?S-1:E)/F)}function P(E){var ee=l.toIndex(E);return h?Ai(ee,0,R):ee}function Q(E){E!==y&&(H=y,y=E)}function z(E){return E?H:y}function T(){return!Do(n.focus)||n.isNavigation}function O(){return e.state.is([to,Oo])&&!!n.waitForTransition}return{mount:_,go:N,scroll:k,getNext:f,getPrev:C,getAdjacent:M,getEnd:$,setIndex:Q,getIndex:z,toIndex:v,toPage:w,toDest:P,hasFocus:T,isBusy:O}}var Ip="http://www.w3.org/2000/svg",Pp="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 Ep(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,x=u.track,g=b,m=u.prev,h=u.next,f,C,y={};function R(){S(),o(ln,H)}function H(){U(),R()}function S(){var k=n.arrows;k&&!(m&&h)&&B(),m&&h&&(Ro(y,{prev:m,next:h}),Io(g,k?"":"none"),In(g,C=Ss+"--"+n.direction),k&&(F(),N(),$t([m,h],Go,x.id),l(Bc,m,h)))}function U(){i.destroy(),Fn(g,C),f?(wi(b?[m,h]:g),m=h=null):Pn([m,h],ws)}function F(){o([ii,no,en,Ci,Er],N),r(h,"click",qt(_,">")),r(m,"click",qt(_,"<"))}function _(k){p.go(k,!0)}function B(){g=b||Hi("div",d.arrows),m=L(!0),h=L(!1),f=!0,jo(g,[m,h]),!b&&cs(g,x)}function L(k){var Z='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+Ip+'" viewBox="0 0 '+er+" "+er+'" width="'+er+'" height="'+er+'" focusable="false"><path d="'+(n.arrowPath||Pp)+'" />';return Ec(Z)}function N(){if(m&&h){var k=e.index,Z=p.getPrev(),M=p.getNext(),K=Z>-1&&k<Z?c.last:c.prev,D=M>-1&&k>M?c.first:c.next;m.disabled=Z<0,h.disabled=M<0,$t(m,yn,K),$t(h,yn,D),l(jc,m,h,Z,M)}}return{arrows:y,mount:R,destroy:U,update:N}}var Mp=us+"-interval";function kp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=jr(n.interval,e.go.bind(e,">"),F),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,x=p.toggle,g=n.autoplay,m,h,f=g==="pause";function C(){g&&(y(),x&&$t(x,Go,u.track.id),f||R(),U())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(B){m=B.type==="mouseenter",S()}),n.pauseOnFocus&&r(b,"focusin focusout",function(B){h=B.type==="focusin",S()}),x&&r(x,"click",function(){f?R():H(!0)}),o([On,Br,en],d.rewind),o(On,_)}function R(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),h=m=f=!1,U(),l(fs))}function H(B){B===void 0&&(B=!0),f=!!B,U(),c()||(d.pause(),l(ys))}function S(){f||(m||h?H(!1):R())}function U(){x&&(An(x,Si,!f),$t(x,yn,n.i18n[f?"play":"pause"]))}function F(B){var L=u.bar;L&&wn(L,"width",B*100+"%"),l(Gc,B)}function _(B){var L=t.Slides.getAt(B);d.set(L&&+Sn(L.slide,Mp)||n.interval)}return{mount:C,destroy:d.cancel,play:R,pause:H,isPaused:c}}function Ap(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(vs,qt(d,!0)),o([ii,ln,en],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=zo(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),Io(u,c?"none":"")}return{mount:r,destroy:qt(l,!1)}}var Fp=10,_p=600,Wp=.6,Np=1.5,Hp=800;function Op(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,x=e.is(Vi),g,m,h=1;function f(){o(On,H),o([ln,en],S)}function C(F,_,B,L,N){var k=c();if(H(),B&&(!x||!p())){var Z=t.Layout.sliderSize(),M=ja(F)*Z*Pr(dn(F)/Z)||0;F=d.toPosition(t.Controller.toDest(F%Z))+M}var K=kc(k,F,1);h=1,_=K?0:_||Ir(dn(F-k)/Np,Hp),m=L,g=jr(_,y,qt(R,k,F,N),1),l(Oo),r(Br),g.start()}function y(){l(ji),m&&m(),r(Ci)}function R(F,_,B,L){var N=c(),k=F+(_-F)*U(L),Z=(k-N)*h;b(N+Z),x&&!B&&p()&&(h*=Wp,dn(Z)<Fp&&C(u(p(!0)),_p,!1,m,!0))}function H(){g&&g.cancel()}function S(){g&&!g.isPaused()&&(H(),y())}function U(F){var _=n.easingFunc;return _?_(F):1-Math.pow(1-F,4)}return{mount:f,destroy:H,scroll:C,cancel:S}}var Fi={passive:!1,capture:!0};function Dp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,x=t.Elements.track,g=t.Media.reduce,m=t.Direction,h=m.resolve,f=m.orient,C=u.getPosition,y=u.exceededLimit,R,H,S,U,F,_=!1,B,L,N;function k(){l(x,sa,Da,Fi),l(x,la,Da,Fi),l(x,ad,M,Fi),l(x,"click",j,{capture:!0}),l(x,"dragstart",kn),o([ii,ln],Z)}function Z(){var ne=n.drag;ae(!ne),U=ne==="free"}function M(ne){if(B=!1,!L){var oe=Ie(ne);ue(ne.target)&&(oe||!ne.button)&&(b.isBusy()?kn(ne,!0):(N=oe?x:window,F=c.is([to,Oo]),S=null,l(N,sa,K,Fi),l(N,la,D,Fi),u.cancel(),p.cancel(),$(ne)))}}function K(ne){if(c.is(vr)||(c.set(vr),r(Hc)),ne.cancelable)if(F){u.translate(R+V(T(ne)));var oe=O(ne)>Qs,ie=_!==(_=y());(oe||ie)&&$(ne),B=!0,r(Oc),kn(ne)}else P(ne)&&(F=w(ne),kn(ne))}function D(ne){c.is(vr)&&(c.set(ji),r(Dc)),F&&(v(ne),kn(ne)),d(N,sa,K),d(N,la,D),F=!1}function j(ne){!L&&B&&kn(ne,!0)}function $(ne){S=H,H=ne,R=C()}function v(ne){var oe=Q(ne),ie=z(oe),Ae=n.rewind&&n.rewindByDrag;g(!1),U?b.scroll(ie,0,n.snap):e.is(qo)?b.go(f(ja(oe))<0?Ae?"<":"-":Ae?">":"+"):e.is(Vi)&&_&&Ae?b.go(y(!0)?">":"<"):b.go(b.toDest(ie),!0),g(!0)}function w(ne){var oe=n.dragMinThreshold,ie=Co(oe),Ae=ie&&oe.mouse||0,be=(ie?oe.touch:+oe)||10;return dn(T(ne))>(Ie(ne)?be:Ae)}function P(ne){return dn(T(ne))>dn(T(ne,!0))}function Q(ne){if(e.is(io)||!_){var oe=O(ne);if(oe&&oe<Qs)return T(ne)/oe}return 0}function z(ne){return C()+ja(ne)*Jn(dn(ne)*(n.flickPower||600),U?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function T(ne,oe){return ee(ne,oe)-ee(E(ne),oe)}function O(ne){return Ba(ne)-Ba(E(ne))}function E(ne){return H===ne&&S||H}function ee(ne,oe){return(Ie(ne)?ne.changedTouches[0]:ne)["page"+h(oe?"Y":"X")]}function V(ne){return ne/(_&&e.is(Vi)?xp:1)}function ue(ne){var oe=n.noDrag;return!To(ne,"."+td+", ."+Ur)&&(!oe||!To(ne,oe))}function Ie(ne){return typeof TouchEvent<"u"&&ne instanceof TouchEvent}function ge(){return F}function ae(ne){L=ne}return{mount:k,disable:ae,isDragging:ge}}var Bp={Spacebar:" ",Right:Gr,Left:Vr,Up:Uc,Down:Yc};function $s(e){return e=Zn(e)?e:e.key,Bp[e]||e}var el="keydown";function jp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){x(),o(ln,g),o(ln,x),o(On,h)}function x(){var C=n.keyboard;C&&(u=C==="global"?window:d,r(u,el,f))}function g(){l(u,el)}function m(C){p=C}function h(){var C=p;p=!0,Tc(function(){p=C})}function f(C){if(!p){var y=$s(C);y===c(Vr)?e.go("<"):y===c(Gr)&&e.go(">")}}return{mount:b,destroy:g,disable:m}}var wo=us+"-lazy",wr=wo+"-srcset",zp="["+wo+"], ["+wr+"]";function Vp(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[no,Ci],p=[];function b(){n.lazyLoad&&(x(),o(en,x))}function x(){Hn(p),g(),c?C():(r(u),o(u,m),m())}function g(){t.Slides.forEach(function(y){ds(y.slide,zp).forEach(function(R){var H=Sn(R,wo),S=Sn(R,wr);if(H!==R.src||S!==R.srcset){var U=n.classes.spinner,F=R.parentElement,_=zo(F,"."+U)||Hi("span",U,F);p.push([R,y,_]),R.src||Io(R,"none")}})})}function m(){p=p.filter(function(y){var R=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,R)?h(y):!0}),p.length||r(u)}function h(y){var R=y[0];In(y[1].slide,qa),l(R,"load error",qt(f,y)),$t(R,"src",Sn(R,wo)),$t(R,"srcset",Sn(R,wr)),Pn(R,wo),Pn(R,wr)}function f(y,R){var H=y[0],S=y[1];Fn(S.slide,qa),R.type!=="error"&&(wi(y[2]),Io(H,""),d(vs,H,S),d(zi)),c&&C()}function C(){p.length&&h(p.shift())}return{mount:b,destroy:qt(Hn,p),check:m}}function Gp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,x=u.go,g=t.Direction.resolve,m=c.pagination,h=[],f,C;function y(){R(),o([ln,en,Er],y);var L=n.pagination;m&&Io(m,L?"":"none"),L&&(o([On,Br,Ci],B),H(),B(),r(zc,{list:f,items:h},_(e.index)))}function R(){f&&(wi(m?ni(f.children):f),Fn(f,C),Hn(h),f=null),i.destroy()}function H(){var L=e.length,N=n.classes,k=n.i18n,Z=n.perPage,M=p()?u.getEnd()+1:Po(L/Z);f=m||Hi("ul",N.pagination,c.track.parentElement),In(f,C=Yr+"--"+F()),$t(f,_n,"tablist"),$t(f,yn,k.select),$t(f,bs,F()===qr?"vertical":"");for(var K=0;K<M;K++){var D=Hi("li",null,f),j=Hi("button",{class:N.page,type:"button"},D),$=d.getIn(K).map(function(w){return w.slide.id}),v=!p()&&Z>1?k.pageX:k.slideX;l(j,"click",qt(S,K)),n.paginationKeyboard&&l(j,"keydown",qt(U,K)),$t(D,_n,"presentation"),$t(j,_n,"tab"),$t(j,Go,$.join(" ")),$t(j,yn,za(v,K+1)),$t(j,Oi,-1),h.push({li:D,button:j,page:K})}}function S(L){x(">"+L,!0)}function U(L,N){var k=h.length,Z=$s(N),M=F(),K=-1;Z===g(Gr,!1,M)?K=++L%k:Z===g(Vr,!1,M)?K=(--L+k)%k:Z==="Home"?K=0:Z==="End"&&(K=k-1);var D=h[K];D&&(Pc(D.button),x(">"+K),kn(N,!0))}function F(){return n.paginationDirection||n.direction}function _(L){return h[u.toPage(L)]}function B(){var L=_(b(!0)),N=_(b());if(L){var k=L.button;Fn(k,Si),Pn(k,Us),$t(k,Oi,-1)}if(N){var Z=N.button;In(Z,Si),$t(Z,Us,!0),$t(Z,Oi,"")}r(Vc,{list:f,items:h},L,N)}return{items:h,mount:y,destroy:R,getAt:_,update:B}}var qp=[" ","Enter"];function Xp(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(m){m.isParent||(u(e,m.splide),u(m.splide,e))}),i&&p()}function d(){r.forEach(function(m){m.destroy()}),Hn(r)}function c(){d(),l()}function u(m,h){var f=Kt(m);f.on(On,function(C,y,R){h.go(h.is(io)?R:C)}),r.push(f)}function p(){var m=Kt(e),h=m.on;h(ms,x),h(qc,g),h([ii,ln],b),r.push(m),m.emit(hs,e.splides)}function b(){$t(t.Elements.list,bs,n.direction===qr?"vertical":"")}function x(m){e.go(m.index)}function g(m,h){ls(qp,$s(h))&&(x(m),kn(h))}return{setup:qt(t.Media.set,{slideFocus:Do(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Up(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Fi)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,x=Ba(u),g=n.wheelMinThreshold||0,m=n.wheelSleep||0;dn(p)>g&&x-r>m&&(e.go(b?"<":">"),r=x),c(b)&&kn(u)}}function c(u){return!n.releaseWheel||e.state.is(to)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Yp=90;function Kp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Hi("span",gp),c=jr(Yp,qt(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),$t(r,Zs,!0),d.textContent="…",o(fs,qt(x,!0)),o(ys,qt(x,!1)),o([no,Ci],qt(p,!0)))}function p(g){$t(r,Ks,g),g?(jo(r,d),c.start()):(wi(d),c.cancel())}function b(){Pn(r,[Ys,Zs,Ks]),wi(d)}function x(g){l&&$t(r,Ys,g?"off":"polite")}return{mount:u,disable:x,destroy:b}}var Zp=Object.freeze({__proto__:null,Media:rp,Direction:ap,Elements:bp,Slides:Sp,Layout:$p,Clones:Tp,Move:Lp,Controller:Rp,Arrows:Ep,Autoplay:kp,Cover:Ap,Scroll:Op,Drag:Dp,Keyboard:jp,LazyLoad:Vp,Pagination:Gp,Sync:Xp,Wheel:Up,Live:Kp}),Jp={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"},Qp={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:yp,i18n:Jp,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function em(e,t,n){var i=t.Slides;function o(){Kt(e).on([ii,en],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),Tc(c)}return{mount:o,start:l,cancel:Da}}function tm(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=qt(wn,l,"transition"),c;function u(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,m){var h=i.toPosition(g,!0),f=i.getPosition(),C=x(g);dn(h-f)>=1&&C>=1?n.useScroll?r.scroll(h,C,!1,m):(d("transform "+C+"ms "+n.easing),i.translate(h,!0),c=m):(i.jump(g),m())}function b(){d(""),r.cancel()}function x(g){var m=n.rewindSpeed;if(e.is(Vi)&&m){var h=o.getIndex(!0),f=o.getEnd();if(h===0&&g>=f||h>=f&&g===0)return m}return n.speed}return{mount:u,start:p,cancel:b}}var nm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=ip(Ni),this.splides=[],this._o={},this._E={};var o=Zn(n)?Mc(document,n):n;bo(o,o+" is invalid."),this.root=o,i=qn({label:Sn(o,yn)||"",labelledby:Sn(o,xs)||""},Qp,e.defaults,i||{});try{qn(i,JSON.parse(Sn(o,us)))}catch{bo(!1,"Invalid JSON")}this._o=Object.create(qn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;bo(l.is([Ni,Rr]),"Already mounted!"),l.set(Ni),this._C=d,this._T=o||this._T||(this.is(qo)?em:tm),this._E=i||this._E;var c=Ro({},Zp,this._E,{Transition:this._T});return xi(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),xi(d,function(u){u.mount&&u.mount()}),this.emit(ii),In(this.root,hp),l.set(ji),this.emit(Va),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(ji)&&(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(ni(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(en),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(Ni)?Kt(this).on(Va,this.destroy.bind(this,i)):(xi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(gs),o.destroy(),i&&Hn(this.splides),r.set(Rr)),this},Ju(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})(),Cs=nm;Cs.defaults={};Cs.STATES=ep;var tl=[[ii,"onMounted"],[Va,"onReady"],[On,"onMove"],[no,"onMoved"],[ms,"onClick"],[Fc,"onActive"],[_c,"onInactive"],[Wc,"onVisible"],[Nc,"onHidden"],[en,"onRefresh"],[ln,"onUpdated"],[zi,"onResize"],[Dr,"onResized"],[Hc,"onDrag"],[Oc,"onDragging"],[Dc,"onDragged"],[Br,"onScroll"],[Ci,"onScrolled"],[gs,"onDestroy"],[Bc,"onArrowsMounted"],[jc,"onArrowsUpdated"],[zc,"onPaginationMounted"],[Vc,"onPaginationUpdated"],[hs,"onNavigationMounted"],[fs,"onAutoplayPlay"],[Gc,"onAutoplayPlaying"],[ys,"onAutoplayPause"],[vs,"onLazyLoadLoaded"]];function Ts(...e){return e.filter(Boolean).join(" ")}function Mr(e){return e!==null&&typeof e=="object"}function Xa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Xa(n,t[i]));if(Mr(e)&&Mr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Xa(e[o],t[o]))}return e===t}function im(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function om(e,t){if(e){const n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i];if(o!=="__proto__"&&t(e[o],o)===!1)break}}return e}function Ua(e,t){const n=e;return om(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Mr(i)?n[o]=Ua(Mr(n[o])?n[o]:{},i):n[o]=i}),n}var rm=({children:e,className:t,...n})=>s.createElement("div",{className:Ts("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Ls=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 Cs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=Ua({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!Xa(this.options,e)&&(this.splide.options=e,this.options=Ua({},e));const t=this.getSlides();im(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){tl.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:Ts("splide",e),ref:this.splideRef,...this.omit(o,["options",...tl.map(r=>r[1])])},n?s.createElement(rm,null,i):i)}},Rs=({children:e,className:t,...n})=>s.createElement("li",{className:Ts("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 am="RichTextRenderer-module__link___BWeZ2",sm={link:am},lm=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))},oo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>lm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:oo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.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 Si=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:sm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:cm(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 cm(e){return{...e.fontFamily&&{fontFamily:oo(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 dm="SvgImage-module__svg___q3xE-",um="SvgImage-module__img___VsTm-",nl={svg:dm,img:um},pm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},mm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({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)}},[]),!pm(e)||!r?a.jsx("img",{src:e,alt:"",className:ut(nl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:ut(nl.svg,i),style:{"--svg":mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},gm={"top-left":ct.topLeftAlignment,"top-center":ct.topCenterAlignment,"top-right":ct.topRightAlignment,"middle-left":ct.middleLeftAlignment,"middle-center":ct.middleCenterAlignment,"middle-right":ct.middleRightAlignment,"bottom-left":ct.bottomLeftAlignment,"bottom-center":ct.bottomCenterAlignment,"bottom-right":ct.bottomRightAlignment};function hm({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:b,textAppearance:x,color:g}=n.imageCaption??{},[m,h]=s.useState(void 0),[f,C]=s.useState(null),[y,R]=s.useState(0),[H,S]=s.useState(0),{direction:U,transition:F,controls:_,pagination:B,imageCaption:L,triggers:N}=e,k=s.useRef(F.type),{x:Z,y:E}=e.controls.offset,K=D=>{o&&o.go(D)};return s.useEffect(()=>{if(!f)return;const D=new ResizeObserver(j=>{if(!o)return;const[$]=j;h({width:Math.round($.contentRect.width),height:Math.round($.contentRect.height)})});return D.observe(f),()=>D.unobserve(f)},[f]),s.useEffect(()=>{!o||k.current===F.type||(S(D=>D+1),k.current=F.type)},[F.type]),a.jsx("div",{className:ut(ct.wrapper,{[ct.editor]:i}),ref:C,children:a.jsxs("div",{className:ct.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:F.backgroundColor&&F.type==="fade in"?F.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ut(ct.captionBlock),children:a.jsx("div",{className:ct.captionTextWrapper,children:t.map((D,j)=>a.jsx("div",{className:ut(ct.captionText,gm[L.alignment],{[ct.withPointerEvents]:j===y&&i,[ct.active]:j===y}),style:{fontFamily:oo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(c,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(b.fontSize,i),lineHeight:W.scalingValue(b.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:g,transitionDuration:F.duration?`${Math.round(parseInt(F.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ct.captionTextInner,style:{"--link-hover-color":L.linkHoverColor,"--link-color":L.linkColor,position:"relative",top:W.scalingValue(L.offset.y,i),left:W.scalingValue(L.offset.x,i)},children:a.jsx(Si,{content:D.imageCaption})})},j))})}),a.jsx(Ls,{onMove:D=>{R(D.index)},ref:r,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,autoplay:N.autoPlay!==null,...N.autoPlay!==null&&{interval:parseInt(N.autoPlay)*1e3},direction:U==="horiz"||F.type==="fade in"?"ltr":"ttb",pagination:!1,drag:N.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:F.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((D,j)=>a.jsx(Rs,{children:a.jsx("div",{className:ct.sliderItem,children:a.jsx("div",{className:ct.imgWrapper,children:a.jsx("img",{className:ut(ct.sliderImage,{[ct.contain]:D.image.objectFit==="contain",[ct.cover]:D.image.objectFit==="cover"}),src:D.image.url,alt:D.image.name??""})})})},j))},H),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(ct.arrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:ct.arrowInner,style:{transform:`translate(${W.scalingValue(Z,i)}, ${W.scalingValue(E*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ut(ct.arrowImg,ct.mirror)}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg,ct.mirror)})]})}),a.jsx("div",{className:ut(ct.arrow,ct.nextArrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:ct.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${W.scalingValue(Z*(U==="horiz"?-1:1),i)}, ${W.scalingValue(E,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ct.arrowImg}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg)})]})})]}),N.triggersList.click&&a.jsx("div",{className:ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),B.isActive&&a.jsx("div",{className:ut(ct.pagination,{[ct.paginationInsideBottom]:B.position==="inside-1"&&U==="horiz",[ct.paginationInsideTop]:B.position==="inside-2"&&U==="horiz",[ct.paginationOutsideBottom]:B.position==="outside-1"&&U==="horiz",[ct.paginationOutsideTop]:B.position==="outside-2"&&U==="horiz",[ct.paginationInsideLeft]:B.position==="inside-1"&&U==="vert",[ct.paginationInsideRight]:B.position==="inside-2"&&U==="vert",[ct.paginationOutsideLeft]:B.position==="outside-1"&&U==="vert",[ct.paginationOutsideRight]:B.position==="outside-2"&&U==="vert",[ct.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ct.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${W.scalingValue(B.offset.x,i)}, ${W.scalingValue(B.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((D,j)=>a.jsx("button",{onClick:()=>{o&&o.go(j)},className:ut(ct.paginationItem),children:a.jsx("div",{className:ut(ct.dot,{[ct.activeDot]:j===y}),style:{backgroundColor:j===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},j))})})]})})}function il({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 fm={element:hm,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"]}},ym="ImageRevealSlider-module__imageRevealSlider___UE5Ob",vm="ImageRevealSlider-module__image___Qjt-e",xm="ImageRevealSlider-module__link___N-iLG",bm="ImageRevealSlider-module__cursor___2U03d",Li={imageRevealSlider:ym,image:vm,link:xm,cursor:bm};function ol(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 ca(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function wm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ca(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ca(e);r=l.height/l.width*o}else{const l=await ca(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Sm({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,b]=s.useState({x:0,y:0}),[x,g]=s.useState(1),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:R,imageWidth:H,randomRangeImageWidth:S}=e.imageSize,{revealPosition:U,visible:F}=e.position,{cursorType:_,target:B,defaultCursorScale:L,defaultCursor:N,hoverCursorScale:k,hoverCursor:Z}=e.cursor;s.useEffect(()=>{if(!i)return;const D=(v,w)=>{const P=i.getBoundingClientRect(),Q=v-P.left,z=w-P.top;if(b({x:Q,y:z}),_==="system"){h("none"),g(1);return}const T=Q,O=z,M=document.elementFromPoint(P.left+T,P.top+O);if(M&&M.closest("a")){h("none"),g(1);return}const ee=ol(T,O,r)||B==="area"?{img:Z??"none",scale:k}:{img:N??"none",scale:L};h(ee.img),g(ee.scale)},j=v=>{v.stopPropagation(),f.current={x:v.clientX,y:v.clientY},D(v.clientX,v.clientY)},$=()=>{C&&D(f.current.x,f.current.y)};return i.addEventListener("mousemove",j),window.addEventListener("scroll",$,!0),()=>{i.removeEventListener("mousemove",j),window.removeEventListener("scroll",$,!0)}},[i,C,p,_,B,Z,N,k,L,r]),s.useEffect(()=>{C||(h("none"),g(0))},[C]);const E=async(D,j,$,v={})=>{const{width:w,height:P,finalWidth:Q}=await wm(D.image.url,R,H,S);let z=0,T=0;U==="same"?(z=j/2,T=$/2):(z=v.x??Math.random()*j,T=v.y??Math.random()*$);const O=Math.min(Math.max(z,w/2),j-w/2),M=Math.min(Math.max(T,P/2),$-P/2);return{id:u.current++,url:D.image.url,link:D.link,name:D.image.name,x:O,y:M,width:Q}};s.useEffect(()=>{if(!i||t.length===0)return;const D=i.getBoundingClientRect(),j=D.width,$=D.height,v=[];(async()=>{const P=t[0],Q=await E(P,j,$);v.push(Q),l(v),c(1)})()},[R,H,S,U,i]),s.useEffect(()=>{F==="last One"&&l(D=>D.length>0?[D[D.length-1]]:[])},[F]);const K=async D=>{if(!i)return;const j=i.getBoundingClientRect(),$=D.clientX-j.left,v=D.clientY-j.top;if(B==="image"&&!ol($,v,r))return;let w=0,P=0;U==="on Click"?(w=$,P=v):U==="same"?(w=j.width/2,P=j.height/2):(w=Math.random()*j.width,P=Math.random()*j.height);const Q=t[d],z=await E(Q,j.width,j.height,{x:w,y:P});l(T=>F==="all"?[...T,z]:[z]),c(T=>T>=t.length-1?0:T+1)};return a.jsxs("div",{ref:o,onClick:K,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Li.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[r.map(D=>a.jsx("div",{className:Li.wrapper,style:{top:`${D.y}px`,left:`${D.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:D.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:B==="area"&&D.link?a.jsx("a",{href:D.link,target:"_blank",className:Li.link,children:a.jsx("img",{src:D.url,alt:D.name,className:Li.image},D.id)}):a.jsx("img",{src:D.url,alt:D.name,className:Li.image},D.id)},D.id)),C&&a.jsx("div",{className:Li.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const $m={element:Sm,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:""}]}}}},Cm="LightBox-module__hidden___9s-9x",Tm="LightBox-module__heroImage___sTxNF",Lm="LightBox-module__background___rm9ml",Rm="LightBox-module__editor___4ACaY",Im="LightBox-module__contentStyle___Bgnsq",Pm="LightBox-module__imageStyle___tLIlB",Em="LightBox-module__imgWrapper___LuFUp",Mm="LightBox-module__contain___8-yaS",km="LightBox-module__cover___hNvOG",Am="LightBox-module__caption___b6L2I",Fm="LightBox-module__captionTextInner___rCGNH",_m="LightBox-module__lightboxSplide___XFuWC",Wm="LightBox-module__arrow___iz38X",Nm="LightBox-module__arrowVertical___Zfz81",Hm="LightBox-module__nextArrow___zkAQN",Om="LightBox-module__arrowInner___p48sW",Dm="LightBox-module__arrowIcon___3VaFf",Bm="LightBox-module__arrowImg___pNV88",jm="LightBox-module__mirror___pjeXc",zm="LightBox-module__thumbsWrapper___GB-nU",Vm="LightBox-module__thumbsContainerVertical___wttk5",Gm="LightBox-module__thumbsContainer___osSma",qm="LightBox-module__thumbsAlignStart___MO6tY",Xm="LightBox-module__thumbsAlignCenter___Q4sUx",Um="LightBox-module__thumbsAlignEnd___p4y9R",Ym="LightBox-module__thumbItem___HvnF3",Km="LightBox-module__closeButton___g2khP",Zm="LightBox-module__fadeIn___0m5GW",Jm="LightBox-module__slideInLeft___gPYwC",Qm="LightBox-module__slideInRight___S-pPp",eg="LightBox-module__slideInTop___DFdAj",tg="LightBox-module__slideInBottom___m27kZ",ng="LightBox-module__fadeOut___55qBR",ig="LightBox-module__slideOutLeft___NvU7P",og="LightBox-module__slideOutRight___SK7eC",rg="LightBox-module__slideOutTop___Vgg0z",ag="LightBox-module__slideOutBottom___nJ0Ef",sg="LightBox-module__scaleSlide___vZriG",Ue={hidden:Cm,heroImage:Tm,background:Lm,editor:Rm,contentStyle:Im,imageStyle:Pm,imgWrapper:Em,contain:Mm,cover:km,caption:Am,captionTextInner:Fm,lightboxSplide:_m,arrow:Wm,arrowVertical:Nm,nextArrow:Hm,arrowInner:Om,arrowIcon:Dm,arrowImg:Bm,mirror:jm,thumbsWrapper:zm,thumbsContainerVertical:Vm,thumbsContainer:Gm,thumbsAlignStart:qm,thumbsAlignCenter:Xm,thumbsAlignEnd:Um,thumbItem:Ym,closeButton:Km,fadeIn:Zm,slideInLeft:Jm,slideInRight:Qm,slideInTop:eg,slideInBottom:tg,fadeOut:ng,slideOutLeft:ig,slideOutRight:og,slideOutTop:rg,slideOutBottom:ag,scaleSlide:sg},tr=(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% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function sd(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 lg(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 ld(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 cg(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 cd(e,t,n,i,o){const{x:r,y:l}=lg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function dg(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"?cg:ld,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:x}=cd(n,i,u,p,d),g=(b+u/2)/n*100,m=(x+p/2)/i*100;return`${g}% ${m}%`}function ug(e){return dg(e)}function kr(e){const t=e.getBoundingClientRect(),n=sd(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}=ld(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=cd(i,o,d,c,u),x=t.left+n.left,g=t.top+n.top;return{x:p+x,y:b+g,width:d,height:c}}function rl(e){const t=e.getBoundingClientRect(),n=sd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function al(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function pg(e,t){const n=(()=>{if(e==="fade in")return Ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeIn;if(e==="slide in")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeOut;if(e==="slide in")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})(),r=(()=>{if(e==="fade in")return Ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const mg=({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:Ue.heroImage,onClick:()=>c(!0)}),a.jsx(gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var he;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:x,fontSizeLineHeight:g,textAppearance:m,color:h}=i.imageCaption??{},[f,C]=s.useState(0),[y,R]=s.useState(0),[H,S]=s.useState(!1),[U,F]=s.useState(!1),[_,B]=s.useState({}),L=s.useRef(null),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(null),$=s.useRef(!1),v=s.useRef(null),[w,P]=s.useState(!1),{appear:Q,triggers:z,slider:T,thumbnail:O,controls:M,area:ee,caption:V,layout:me}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:ge,backdropDisappearClass:ae,disappearClass:ne}=pg(Q.type,Q.direction),oe=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const G=()=>{setTimeout(()=>{var pe,we;(we=(pe=L.current)==null?void 0:pe.splide)==null||we.refresh()},16)},re=()=>{R(pe=>pe+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),s.useEffect(()=>{if(!e||!O.isActive){P(!1);return}const G=v.current;if(!G)return;const re=()=>{T.direction==="horiz"?P(G.scrollWidth>G.clientWidth):P(G.scrollHeight>G.clientHeight)};re();const pe=new ResizeObserver(re);return pe.observe(G),()=>pe.disconnect()},[e,O.isActive,n.length,_,T.direction]);const ie=s.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,re=al(ee.color);G&&!l&&re>.9&&(document.body.style.backgroundColor=""),S(!0),Z.current=!0;const pe=we=>{we.target===E.current&&we.animationName&&(E.current&&K.current&&E.current.removeEventListener("animationend",K.current),K.current=null,Z.current&&(Z.current=!1,t()),S(!1))};E.current&&(K.current=pe,E.current.addEventListener("animationend",pe))},[t,ee.color,l]),Ae=(G,re,pe)=>{var we,Pe;if(G){if(z.type==="click"&&z.switch==="image")z.repeat==="close"&&f===n.length-1?ie():(we=L.current)==null||we.go("+1");else if(z.type==="click"&&z.switch==="50/50"){const Ce=G.getBoundingClientRect(),Y=re-Ce.left,xe=pe-Ce.top,ue=Ce.width,X=Ce.height;let le;T.direction==="horiz"?le=Y<ue/2?"-1":"+1":le=xe<X/2?"-1":"+1",(Pe=L.current)==null||Pe.go(le)}}},be=G=>{if($.current){$.current=!1;return}const re=n[f],pe=(re==null?void 0:re.image.objectFit)==="cover";let we,Pe;if("changedTouches"in G&&G.changedTouches.length>0)we=G.changedTouches[0].clientX,Pe=G.changedTouches[0].clientY;else if("clientX"in G)we=G.clientX,Pe=G.clientY;else return;let Ce;if(pe&&k.current){const Y=rl(k.current);Ce=we>=Y.left&&we<=Y.right&&Pe>=Y.top&&Pe<=Y.bottom}else{const Y=k.current?kr(k.current):null;if(!Y){G.target===G.currentTarget&&ie();return}Ce=we>=Y.x&&we<=Y.x+Y.width&&Pe>=Y.y&&Pe<=Y.y+Y.height}Ce?Ae(k.current,we,Pe):ie()},Me=G=>{const re=G.target;(re.classList.contains(Ue.thumbsWrapper)||re.classList.contains(Ue.thumbsContainer))&&be(G)};s.useEffect(()=>{if(!e)return;const G=re=>{var pe,we;if(re.key==="Escape"){ie();return}if(re.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(pe=L.current)==null||pe.go("+1");return}re.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=L.current)==null||we.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,ie,n.length]),s.useEffect(()=>{if(e){if(C(0),R(re=>re+1),Z.current=!1,S(!1),F(!1),B({}),!oe)return;const G=new CustomEvent("page-overlay",{detail:{itemId:oe}});window.dispatchEvent(G)}return()=>{E.current&&K.current&&(E.current.removeEventListener("animationend",K.current),K.current=null),F(!1)}},[e,oe]),s.useEffect(()=>{N.current!==null&&N.current!==T.type&&R(G=>G+1),N.current=T.type},[T.type]),s.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,pe=al(ee.color);document.body.style.overflow="hidden",F(!1);const we=Ce=>{Ce.target===E.current&&!Z.current&&Ce.animationName&&(re&&!l&&pe>.9&&(document.body.style.backgroundColor=ee.color),F(!0),E.current&&D.current&&E.current.removeEventListener("animationend",D.current),D.current=null)};E.current&&(D.current=we,E.current.addEventListener("animationend",we));const Pe=Ce=>{const Y=Ce.target;Y&&(Y.closest(`.${Ue.thumbsWrapper}`)||Y.closest(`.${Ue.thumbsContainer}`))||T.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Pe),E.current&&D.current&&(E.current.removeEventListener("animationend",D.current),D.current=null),F(!1)}},[e,l,ee.color,T.type]),s.useEffect(()=>{if(!e)return;const G=re=>{var we,Pe;if(Z.current){re.stopPropagation();return}if($.current){$.current=!1;return}const pe=re.target;if(!(pe&&(pe.closest(`.${Ue.thumbsContainer}`)||pe.closest(`.${Ue.thumbItem}`)||pe.closest(`.${Ue.arrow}`)||pe.closest(`.${Ue.closeButton}`)||pe.closest(`.${Ue.caption}`)))){if(T.type==="slide"&&z.type==="drag"&&((Pe=(we=L.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=L.current.splide.root;if(pe&&(Ce.contains(pe)||Ce===pe))return}if(re.touches.length===0&&re.changedTouches.length>0){const Ce=n[f],Y=(Ce==null?void 0:Ce.image.objectFit)==="cover",xe=re.changedTouches[0];let ue;if(Y&&k.current){const X=rl(k.current);ue=xe.clientX>=X.left&&xe.clientX<=X.right&&xe.clientY>=X.top&&xe.clientY<=X.bottom}else{const X=k.current?kr(k.current):null;if(!X)return;ue=xe.clientX>=X.x&&xe.clientX<=X.x+X.width&&xe.clientY>=X.y&&xe.clientY<=X.y+X.height}if(!ue){re.stopPropagation(),Z.current=!0;const X=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),ie()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,ie,f,n]);const q=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&z.type==="drag";s.useEffect(()=>{var le,Fe;if(!e||!q||!((Fe=(le=L.current)==null?void 0:le.splide)!=null&&Fe.root))return;const G=L.current.splide.root,re=30,pe=(fe,J)=>{if(j.current){const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);(Xe>0||Oe>0)&&($.current=!0)}},we=fe=>{j.current&&(fe.preventDefault(),pe(fe.clientX,fe.clientY))},Pe=fe=>{j.current&&fe.touches.length>0&&(fe.preventDefault(),pe(fe.touches[0].clientX,fe.touches[0].clientY))},Ce=(fe,J)=>{if(!j.current||!L.current){j.current=null;return}const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);Oe>re&&Oe>Xe&&L.current.go(J<j.current.y?"+1":"-1"),j.current=null},Y=fe=>{j.current&&Ce(fe.clientX,fe.clientY),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("pointermove",we)},xe=fe=>{if(j.current){if(fe.changedTouches.length>0){const J=fe.changedTouches[0];Ce(J.clientX,J.clientY)}document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),document.removeEventListener("touchmove",Pe)}},ue=fe=>{j.current={x:fe.clientX,y:fe.clientY},$.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",Y),document.addEventListener("pointercancel",Y)},X=fe=>{fe.touches.length>0&&(j.current={x:fe.touches[0].clientX,y:fe.touches[0].clientY},$.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",xe),document.addEventListener("touchcancel",xe))};return G.addEventListener("pointerdown",ue),G.addEventListener("touchstart",X),()=>{G.removeEventListener("pointerdown",ue),G.removeEventListener("touchstart",X),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),j.current=null,$.current=!1}},[e,q,y]);const se={backgroundColor:ee.color,backdropFilter:`blur(${ee.blur}px)`,animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:E,className:ut(Ue.background,H?ae:ge,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{...se,...U&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?E:null,className:ut(Ue.contentStyle,H?ne:Ie,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ls,{onMove:G=>C(G.index),ref:L,className:Ue.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:z.type==="drag"&&!q,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:z.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((G,re)=>{const pe=tr(me.position,me.offset,l),we=`${W.scalingValue(me.padding.top,l)} ${W.scalingValue(me.padding.right,l)} ${W.scalingValue(me.padding.bottom,l)} ${W.scalingValue(me.padding.left,l)}`,Pe=T.type==="scale"?(()=>{const{transform:Ce,...Y}=pe;return{...Y,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...pe,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(Rs,{children:a.jsx("div",{className:Ue.imgWrapper,onClick:be,children:a.jsx("img",{ref:re===f?k:null,className:ut(Ue.imageStyle,{[Ue.contain]:G.image.objectFit==="contain",[Ue.cover]:G.image.objectFit==="cover",[Ue.scaleSlide]:T.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Pe,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},re)})},y),M.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(Ue.arrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(M.offset.x,l)}, ${W.scalingValue(M.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${M.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[M.arrowsImgUrl&&a.jsx(sn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:ut(Ue.arrowImg,Ue.mirror)}),!M.arrowsImgUrl&&a.jsx(sl,{color:M.color,className:ut(Ue.arrowIcon,Ue.arrowImg,Ue.mirror)})]})}),a.jsx("div",{className:ut(Ue.arrow,Ue.nextArrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:M.color,"--arrow-hover-color":M.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(M.offset.x*(T.direction==="horiz"?-1:1),l)}, ${W.scalingValue(M.offset.y,l)}) scale(${M.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[M.arrowsImgUrl&&a.jsx(sn,{url:M.arrowsImgUrl,fill:M.color,hoverFill:M.hover,className:Ue.arrowImg}),!M.arrowsImgUrl&&a.jsx(sl,{color:M.color,className:ut(Ue.arrowIcon,Ue.arrowImg)})]})})]}),ee.closeIconUrl&&(()=>{const G=tr(ee.closeIconAlign,ee.closeIconOffset,l),re=`scale(${ee.closeIconScale})`,pe=G.transform?`${G.transform} ${re}`:re;return a.jsx("button",{className:Ue.closeButton,style:{...G,transform:pe},onClick:ie,"aria-label":"Close lightbox",children:a.jsx(sn,{url:ee.closeIconUrl,fill:ee.closeIconColor??"#000000",hoverFill:ee.closeIconHover??"#cccccc"})})})(),V&&V.isActive&&i.imageCaption&&((he=n[f])==null?void 0:he.imageCaption)&&a.jsx("div",{className:Ue.caption,style:{...tr(V.alignment,V.offset,l),fontFamily:oo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":W.scalingValue(c.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(x,l),textAlign:b,fontSize:W.scalingValue(g.fontSize,l),lineHeight:W.scalingValue(g.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:G=>G.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ue.captionTextInner,style:{"--link-color":V.linkColor,"--link-hover-color":V.linkHoverColor},children:a.jsx(Si,{content:n[f].imageCaption})})}),O.isActive&&(()=>{const[G,re]=O.position.split("-"),pe=T.direction==="horiz"?`${G}-left`:O.position,we=tr(pe,O.offset,l),Pe=()=>{if(T.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:v,className:Ue.thumbsWrapper,onClick:Ce=>Me(Ce),style:{position:l?"absolute":"fixed",...we,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ut(Ue.thumbsContainer,{[Ue.thumbsContainerVertical]:T.direction==="vert",[Ue.thumbsAlignStart]:O.align==="start",[Ue.thumbsAlignCenter]:O.align==="center",[Ue.thumbsAlignEnd]:O.align==="end"}),style:{gap:W.scalingValue(O.grid.gap,l),justifyContent:w?"flex-start":Pe()},children:n.map((Ce,Y)=>{const xe=Y===f,ue=_[Y],le=O.grid.size*(xe?O.activeState.scale:1),Fe=()=>{if(O.fit!=="fit")return{};if(!ue)return T.direction==="horiz"?{height:W.scalingValue(le,l)}:{width:W.scalingValue(le,l)};const fe=ue.width/ue.height;if(T.direction==="horiz"){const J=le,Xe=J*fe;return{width:W.scalingValue(Xe,l),height:W.scalingValue(J,l)}}else{const J=le,Xe=J/fe;return{width:W.scalingValue(J,l),height:W.scalingValue(Xe,l)}}};return a.jsx("button",{className:Ue.thumbItem,style:{...T.direction==="horiz"&&O.fit!=="fit"?{height:W.scalingValue(le,l)}:{},...T.direction==="vert"&&O.fit!=="fit"?{width:W.scalingValue(le,l)}:{},...O.fit==="cover"?{width:W.scalingValue(le,l),height:W.scalingValue(le,l)}:{},...Fe(),transition:xe?"all 0.25s ease-out":"none",opacity:xe?O.activeState.opacity/100:O.opacity/100,"--thumb-hover":O.activeState.opacity/100},onClick:fe=>{var J;fe.stopPropagation(),C(Y),(J=L.current)==null||J.go(Y)},onMouseEnter:()=>{var fe;O.triggers==="hov"&&((fe=L.current)==null||fe.go(Y))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:fe=>{const J=fe.currentTarget;J.naturalWidth&&J.naturalHeight&&B(Xe=>({...Xe,[Y]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:O.fit==="cover"?"cover":"contain",...O.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...O.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${Y}`)})})})})()]})]}),document.getElementById(r))};function sl({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 hg={element:mg,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fg(e){return`
|
|
6
|
+
*/const am="RichTextRenderer-module__link___BWeZ2",sm={link:am},lm=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))},oo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>lm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function an(e){const{color:t,...n}=e;return n}function Ut(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:oo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:W.scalingValue(e.letterSpacing,t),wordSpacing:W.scalingValue(e.wordSpacing,t),fontSize:W.scalingValue(n,t),lineHeight:i!==void 0?W.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 $i=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:sm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:cm(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 cm(e){return{...e.fontFamily&&{fontFamily:oo(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 dm="SvgImage-module__svg___q3xE-",um="SvgImage-module__img___VsTm-",nl={svg:dm,img:um},pm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},mm=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,sn=({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)}},[]),!pm(e)||!r?a.jsx("img",{src:e,alt:"",className:ut(nl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:ut(nl.svg,i),style:{"--svg":mm(e),"--fill":t,"--hover-fill":n,...o??{}}})},gm={"top-left":ct.topLeftAlignment,"top-center":ct.topCenterAlignment,"top-right":ct.topRightAlignment,"middle-left":ct.middleLeftAlignment,"middle-center":ct.middleCenterAlignment,"middle-right":ct.middleRightAlignment,"bottom-left":ct.bottomLeftAlignment,"bottom-center":ct.bottomCenterAlignment,"bottom-right":ct.bottomRightAlignment};function hm({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:b,textAppearance:x,color:g}=n.imageCaption??{},[m,h]=s.useState(void 0),[f,C]=s.useState(null),[y,R]=s.useState(0),[H,S]=s.useState(0),{direction:U,transition:F,controls:_,pagination:B,imageCaption:L,triggers:N}=e,k=s.useRef(F.type),{x:Z,y:M}=e.controls.offset,K=D=>{o&&o.go(D)};return s.useEffect(()=>{if(!f)return;const D=new ResizeObserver(j=>{if(!o)return;const[$]=j;h({width:Math.round($.contentRect.width),height:Math.round($.contentRect.height)})});return D.observe(f),()=>D.unobserve(f)},[f]),s.useEffect(()=>{!o||k.current===F.type||(S(D=>D+1),k.current=F.type)},[F.type]),a.jsx("div",{className:ut(ct.wrapper,{[ct.editor]:i}),ref:C,children:a.jsxs("div",{className:ct.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:F.backgroundColor&&F.type==="fade in"?F.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ut(ct.captionBlock),children:a.jsx("div",{className:ct.captionTextWrapper,children:t.map((D,j)=>a.jsx("div",{className:ut(ct.captionText,gm[L.alignment],{[ct.withPointerEvents]:j===y&&i,[ct.active]:j===y}),style:{fontFamily:oo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":W.scalingValue(l.width,i),letterSpacing:W.scalingValue(c,i),wordSpacing:W.scalingValue(p,i),textAlign:u,fontSize:W.scalingValue(b.fontSize,i),lineHeight:W.scalingValue(b.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:g,transitionDuration:F.duration?`${Math.round(parseInt(F.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ct.captionTextInner,style:{"--link-hover-color":L.linkHoverColor,"--link-color":L.linkColor,position:"relative",top:W.scalingValue(L.offset.y,i),left:W.scalingValue(L.offset.x,i)},children:a.jsx($i,{content:D.imageCaption})})},j))})}),a.jsx(Ls,{onMove:D=>{R(D.index)},ref:r,options:{arrows:!1,speed:F.duration?parseInt(F.duration):500,autoplay:N.autoPlay!==null,...N.autoPlay!==null&&{interval:parseInt(N.autoPlay)*1e3},direction:U==="horiz"||F.type==="fade in"?"ltr":"ttb",pagination:!1,drag:N.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:F.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((D,j)=>a.jsx(Rs,{children:a.jsx("div",{className:ct.sliderItem,children:a.jsx("div",{className:ct.imgWrapper,children:a.jsx("img",{className:ut(ct.sliderImage,{[ct.contain]:D.image.objectFit==="contain",[ct.cover]:D.image.objectFit==="cover"}),src:D.image.url,alt:D.image.name??""})})})},j))},H),_.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(ct.arrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{onClick:()=>{K("-1")},className:ct.arrowInner,style:{transform:`translate(${W.scalingValue(Z,i)}, ${W.scalingValue(M*(U==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ut(ct.arrowImg,ct.mirror)}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg,ct.mirror)})]})}),a.jsx("div",{className:ut(ct.arrow,ct.nextArrow,{[ct.arrowVertical]:U==="vert",[ct.hoverArrow]:_.show==="on hover"}),style:{color:_.color,"--arrow-hover-color":_.hover},children:a.jsxs("button",{className:ct.arrowInner,onClick:()=>K("+1"),style:{transform:`translate(${W.scalingValue(Z*(U==="horiz"?-1:1),i)}, ${W.scalingValue(M,i)}) scale(${e.controls.scale/100}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:[_.arrowsImgUrl&&a.jsx(sn,{url:_.arrowsImgUrl,fill:_.color,hoverFill:_.hover,className:ct.arrowImg}),!_.arrowsImgUrl&&a.jsx(il,{color:_.color,className:ut(ct.arrowIcon,ct.arrowImg)})]})})]}),N.triggersList.click&&a.jsx("div",{className:ct.clickOverlay,onClick:()=>{o&&o.go("+1")}}),B.isActive&&a.jsx("div",{className:ut(ct.pagination,{[ct.paginationInsideBottom]:B.position==="inside-1"&&U==="horiz",[ct.paginationInsideTop]:B.position==="inside-2"&&U==="horiz",[ct.paginationOutsideBottom]:B.position==="outside-1"&&U==="horiz",[ct.paginationOutsideTop]:B.position==="outside-2"&&U==="horiz",[ct.paginationInsideLeft]:B.position==="inside-1"&&U==="vert",[ct.paginationInsideRight]:B.position==="inside-2"&&U==="vert",[ct.paginationOutsideLeft]:B.position==="outside-1"&&U==="vert",[ct.paginationOutsideRight]:B.position==="outside-2"&&U==="vert",[ct.paginationVertical]:U==="vert"}),children:a.jsx("div",{className:ct.paginationInner,style:{backgroundColor:B.colors[2],transform:`scale(${B.scale/100}) translate(${W.scalingValue(B.offset.x,i)}, ${W.scalingValue(B.offset.y,i)}) rotate(${U==="horiz"?"0deg":"90deg"})`},children:t.map((D,j)=>a.jsx("button",{onClick:()=>{o&&o.go(j)},className:ut(ct.paginationItem),children:a.jsx("div",{className:ut(ct.dot,{[ct.activeDot]:j===y}),style:{backgroundColor:j===y?B.colors[0]:B.colors[1],"--pagination-hover-color":B.hover}})},j))})})]})})}function il({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 fm={element:hm,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"]}},ym="ImageRevealSlider-module__imageRevealSlider___UE5Ob",vm="ImageRevealSlider-module__image___Qjt-e",xm="ImageRevealSlider-module__link___N-iLG",bm="ImageRevealSlider-module__cursor___2U03d",Ri={imageRevealSlider:ym,image:vm,link:xm,cursor:bm};function ol(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 ca(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function wm(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ca(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ca(e);r=l.height/l.width*o}else{const l=await ca(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function Sm({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,b]=s.useState({x:0,y:0}),[x,g]=s.useState(1),[m,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[C,y]=s.useState(!1),{sizeType:R,imageWidth:H,randomRangeImageWidth:S}=e.imageSize,{revealPosition:U,visible:F}=e.position,{cursorType:_,target:B,defaultCursorScale:L,defaultCursor:N,hoverCursorScale:k,hoverCursor:Z}=e.cursor;s.useEffect(()=>{if(!i)return;const D=(v,w)=>{const P=i.getBoundingClientRect(),Q=v-P.left,z=w-P.top;if(b({x:Q,y:z}),_==="system"){h("none"),g(1);return}const T=Q,O=z,E=document.elementFromPoint(P.left+T,P.top+O);if(E&&E.closest("a")){h("none"),g(1);return}const ee=ol(T,O,r)||B==="area"?{img:Z??"none",scale:k}:{img:N??"none",scale:L};h(ee.img),g(ee.scale)},j=v=>{v.stopPropagation(),f.current={x:v.clientX,y:v.clientY},D(v.clientX,v.clientY)},$=()=>{C&&D(f.current.x,f.current.y)};return i.addEventListener("mousemove",j),window.addEventListener("scroll",$,!0),()=>{i.removeEventListener("mousemove",j),window.removeEventListener("scroll",$,!0)}},[i,C,p,_,B,Z,N,k,L,r]),s.useEffect(()=>{C||(h("none"),g(0))},[C]);const M=async(D,j,$,v={})=>{const{width:w,height:P,finalWidth:Q}=await wm(D.image.url,R,H,S);let z=0,T=0;U==="same"?(z=j/2,T=$/2):(z=v.x??Math.random()*j,T=v.y??Math.random()*$);const O=Math.min(Math.max(z,w/2),j-w/2),E=Math.min(Math.max(T,P/2),$-P/2);return{id:u.current++,url:D.image.url,link:D.link,name:D.image.name,x:O,y:E,width:Q}};s.useEffect(()=>{if(!i||t.length===0)return;const D=i.getBoundingClientRect(),j=D.width,$=D.height,v=[];(async()=>{const P=t[0],Q=await M(P,j,$);v.push(Q),l(v),c(1)})()},[R,H,S,U,i]),s.useEffect(()=>{F==="last One"&&l(D=>D.length>0?[D[D.length-1]]:[])},[F]);const K=async D=>{if(!i)return;const j=i.getBoundingClientRect(),$=D.clientX-j.left,v=D.clientY-j.top;if(B==="image"&&!ol($,v,r))return;let w=0,P=0;U==="on Click"?(w=$,P=v):U==="same"?(w=j.width/2,P=j.height/2):(w=Math.random()*j.width,P=Math.random()*j.height);const Q=t[d],z=await M(Q,j.width,j.height,{x:w,y:P});l(T=>F==="all"?[...T,z]:[z]),c(T=>T>=t.length-1?0:T+1)};return a.jsxs("div",{ref:o,onClick:K,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Ri.imageRevealSlider,style:{cursor:m==="none"?"default":"none"},children:[r.map(D=>a.jsx("div",{className:Ri.wrapper,style:{top:`${D.y}px`,left:`${D.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:D.width??"auto",height:"auto",cursor:m==="none"?"default":"none"},children:B==="area"&&D.link?a.jsx("a",{href:D.link,target:"_blank",className:Ri.link,children:a.jsx("img",{src:D.url,alt:D.name,className:Ri.image},D.id)}):a.jsx("img",{src:D.url,alt:D.name,className:Ri.image},D.id)},D.id)),C&&a.jsx("div",{className:Ri.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const $m={element:Sm,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:""}]}}}},Cm="LightBox-module__hidden___9s-9x",Tm="LightBox-module__heroImage___sTxNF",Lm="LightBox-module__background___rm9ml",Rm="LightBox-module__editor___4ACaY",Im="LightBox-module__contentStyle___Bgnsq",Pm="LightBox-module__imageStyle___tLIlB",Em="LightBox-module__imgWrapper___LuFUp",Mm="LightBox-module__contain___8-yaS",km="LightBox-module__cover___hNvOG",Am="LightBox-module__caption___b6L2I",Fm="LightBox-module__captionTextInner___rCGNH",_m="LightBox-module__lightboxSplide___XFuWC",Wm="LightBox-module__arrow___iz38X",Nm="LightBox-module__arrowVertical___Zfz81",Hm="LightBox-module__nextArrow___zkAQN",Om="LightBox-module__arrowInner___p48sW",Dm="LightBox-module__arrowIcon___3VaFf",Bm="LightBox-module__arrowImg___pNV88",jm="LightBox-module__mirror___pjeXc",zm="LightBox-module__thumbsWrapper___GB-nU",Vm="LightBox-module__thumbsContainerVertical___wttk5",Gm="LightBox-module__thumbsContainer___osSma",qm="LightBox-module__thumbsAlignStart___MO6tY",Xm="LightBox-module__thumbsAlignCenter___Q4sUx",Um="LightBox-module__thumbsAlignEnd___p4y9R",Ym="LightBox-module__thumbItem___HvnF3",Km="LightBox-module__closeButton___g2khP",Zm="LightBox-module__fadeIn___0m5GW",Jm="LightBox-module__slideInLeft___gPYwC",Qm="LightBox-module__slideInRight___S-pPp",eg="LightBox-module__slideInTop___DFdAj",tg="LightBox-module__slideInBottom___m27kZ",ng="LightBox-module__fadeOut___55qBR",ig="LightBox-module__slideOutLeft___NvU7P",og="LightBox-module__slideOutRight___SK7eC",rg="LightBox-module__slideOutTop___Vgg0z",ag="LightBox-module__slideOutBottom___nJ0Ef",sg="LightBox-module__scaleSlide___vZriG",Ue={hidden:Cm,heroImage:Tm,background:Lm,editor:Rm,contentStyle:Im,imageStyle:Pm,imgWrapper:Em,contain:Mm,cover:km,caption:Am,captionTextInner:Fm,lightboxSplide:_m,arrow:Wm,arrowVertical:Nm,nextArrow:Hm,arrowInner:Om,arrowIcon:Dm,arrowImg:Bm,mirror:jm,thumbsWrapper:zm,thumbsContainerVertical:Vm,thumbsContainer:Gm,thumbsAlignStart:qm,thumbsAlignCenter:Xm,thumbsAlignEnd:Um,thumbItem:Ym,closeButton:Km,fadeIn:Zm,slideInLeft:Jm,slideInRight:Qm,slideInTop:eg,slideInBottom:tg,fadeOut:ng,slideOutLeft:ig,slideOutRight:og,slideOutTop:rg,slideOutBottom:ag,scaleSlide:sg},tr=(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% + ${W.scalingValue(t.x,n)}), calc(-50% + ${W.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${W.scalingValue(t.x,n)}, calc(-50% + ${W.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${W.scalingValue(t.x,n)}), ${W.scalingValue(t.y,n)})`:i.transform=`translate(${W.scalingValue(t.x,n)}, ${W.scalingValue(t.y,n)})`,i};function sd(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 lg(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 ld(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 cg(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 cd(e,t,n,i,o){const{x:r,y:l}=lg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function dg(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"?cg:ld,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:x}=cd(n,i,u,p,d),g=(b+u/2)/n*100,m=(x+p/2)/i*100;return`${g}% ${m}%`}function ug(e){return dg(e)}function kr(e){const t=e.getBoundingClientRect(),n=sd(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}=ld(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=cd(i,o,d,c,u),x=t.left+n.left,g=t.top+n.top;return{x:p+x,y:b+g,width:d,height:c}}function rl(e){const t=e.getBoundingClientRect(),n=sd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function al(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const i=t[1].split(",").map(o=>parseFloat(o.trim()));return i.length===4?i[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const i=n[1].substring(6,8);return parseInt(i,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function pg(e,t){const n=(()=>{if(e==="fade in")return Ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeIn;if(e==="slide in")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeOut;if(e==="slide in")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})(),r=(()=>{if(e==="fade in")return Ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const mg=({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:Ue.heroImage,onClick:()=>c(!0)}),a.jsx(gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var he;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:x,fontSizeLineHeight:g,textAppearance:m,color:h}=i.imageCaption??{},[f,C]=s.useState(0),[y,R]=s.useState(0),[H,S]=s.useState(!1),[U,F]=s.useState(!1),[_,B]=s.useState({}),L=s.useRef(null),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(!1),M=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(null),$=s.useRef(!1),v=s.useRef(null),[w,P]=s.useState(!1),{appear:Q,triggers:z,slider:T,thumbnail:O,controls:E,area:ee,caption:V,layout:ue}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:ge,backdropDisappearClass:ae,disappearClass:ne}=pg(Q.type,Q.direction),oe=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const G=()=>{setTimeout(()=>{var me,we;(we=(me=L.current)==null?void 0:me.splide)==null||we.refresh()},16)},re=()=>{R(me=>me+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),s.useEffect(()=>{if(!e||!O.isActive){P(!1);return}const G=v.current;if(!G)return;const re=()=>{T.direction==="horiz"?P(G.scrollWidth>G.clientWidth):P(G.scrollHeight>G.clientHeight)};re();const me=new ResizeObserver(re);return me.observe(G),()=>me.disconnect()},[e,O.isActive,n.length,_,T.direction]);const ie=s.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,re=al(ee.color);G&&!l&&re>.9&&(document.body.style.backgroundColor=""),S(!0),Z.current=!0;const me=we=>{we.target===M.current&&we.animationName&&(M.current&&K.current&&M.current.removeEventListener("animationend",K.current),K.current=null,Z.current&&(Z.current=!1,t()),S(!1))};M.current&&(K.current=me,M.current.addEventListener("animationend",me))},[t,ee.color,l]),Ae=(G,re,me)=>{var we,Pe;if(G){if(z.type==="click"&&z.switch==="image")z.repeat==="close"&&f===n.length-1?ie():(we=L.current)==null||we.go("+1");else if(z.type==="click"&&z.switch==="50/50"){const Ce=G.getBoundingClientRect(),Y=re-Ce.left,xe=me-Ce.top,pe=Ce.width,X=Ce.height;let le;T.direction==="horiz"?le=Y<pe/2?"-1":"+1":le=xe<X/2?"-1":"+1",(Pe=L.current)==null||Pe.go(le)}}},be=G=>{if($.current){$.current=!1;return}const re=n[f],me=(re==null?void 0:re.image.objectFit)==="cover";let we,Pe;if("changedTouches"in G&&G.changedTouches.length>0)we=G.changedTouches[0].clientX,Pe=G.changedTouches[0].clientY;else if("clientX"in G)we=G.clientX,Pe=G.clientY;else return;let Ce;if(me&&k.current){const Y=rl(k.current);Ce=we>=Y.left&&we<=Y.right&&Pe>=Y.top&&Pe<=Y.bottom}else{const Y=k.current?kr(k.current):null;if(!Y){G.target===G.currentTarget&&ie();return}Ce=we>=Y.x&&we<=Y.x+Y.width&&Pe>=Y.y&&Pe<=Y.y+Y.height}Ce?Ae(k.current,we,Pe):ie()},Me=G=>{const re=G.target;(re.classList.contains(Ue.thumbsWrapper)||re.classList.contains(Ue.thumbsContainer))&&be(G)};s.useEffect(()=>{if(!e)return;const G=re=>{var me,we;if(re.key==="Escape"){ie();return}if(re.key==="ArrowRight"){C(Pe=>(Pe+1)%Math.max(n.length,1)),(me=L.current)==null||me.go("+1");return}re.key==="ArrowLeft"&&(C(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=L.current)==null||we.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,ie,n.length]),s.useEffect(()=>{if(e){if(C(0),R(re=>re+1),Z.current=!1,S(!1),F(!1),B({}),!oe)return;const G=new CustomEvent("page-overlay",{detail:{itemId:oe}});window.dispatchEvent(G)}return()=>{M.current&&K.current&&(M.current.removeEventListener("animationend",K.current),K.current=null),F(!1)}},[e,oe]),s.useEffect(()=>{N.current!==null&&N.current!==T.type&&R(G=>G+1),N.current=T.type},[T.type]),s.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,me=al(ee.color);document.body.style.overflow="hidden",F(!1);const we=Ce=>{Ce.target===M.current&&!Z.current&&Ce.animationName&&(re&&!l&&me>.9&&(document.body.style.backgroundColor=ee.color),F(!0),M.current&&D.current&&M.current.removeEventListener("animationend",D.current),D.current=null)};M.current&&(D.current=we,M.current.addEventListener("animationend",we));const Pe=Ce=>{const Y=Ce.target;Y&&(Y.closest(`.${Ue.thumbsWrapper}`)||Y.closest(`.${Ue.thumbsContainer}`))||T.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Pe),M.current&&D.current&&(M.current.removeEventListener("animationend",D.current),D.current=null),F(!1)}},[e,l,ee.color,T.type]),s.useEffect(()=>{if(!e)return;const G=re=>{var we,Pe;if(Z.current){re.stopPropagation();return}if($.current){$.current=!1;return}const me=re.target;if(!(me&&(me.closest(`.${Ue.thumbsContainer}`)||me.closest(`.${Ue.thumbItem}`)||me.closest(`.${Ue.arrow}`)||me.closest(`.${Ue.closeButton}`)||me.closest(`.${Ue.caption}`)))){if(T.type==="slide"&&z.type==="drag"&&((Pe=(we=L.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=L.current.splide.root;if(me&&(Ce.contains(me)||Ce===me))return}if(re.touches.length===0&&re.changedTouches.length>0){const Ce=n[f],Y=(Ce==null?void 0:Ce.image.objectFit)==="cover",xe=re.changedTouches[0];let pe;if(Y&&k.current){const X=rl(k.current);pe=xe.clientX>=X.left&&xe.clientX<=X.right&&xe.clientY>=X.top&&xe.clientY<=X.bottom}else{const X=k.current?kr(k.current):null;if(!X)return;pe=xe.clientX>=X.x&&xe.clientX<=X.x+X.width&&xe.clientY>=X.y&&xe.clientY<=X.y+X.height}if(!pe){re.stopPropagation(),Z.current=!0;const X=le=>{le.stopPropagation(),le.preventDefault(),document.removeEventListener("click",X,!0)};document.addEventListener("click",X,!0),ie()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,ie,f,n]);const q=(T.type==="scale"||T.type==="fade")&&T.direction==="vert"&&z.type==="drag";s.useEffect(()=>{var le,Fe;if(!e||!q||!((Fe=(le=L.current)==null?void 0:le.splide)!=null&&Fe.root))return;const G=L.current.splide.root,re=30,me=(fe,J)=>{if(j.current){const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);(Xe>0||Oe>0)&&($.current=!0)}},we=fe=>{j.current&&(fe.preventDefault(),me(fe.clientX,fe.clientY))},Pe=fe=>{j.current&&fe.touches.length>0&&(fe.preventDefault(),me(fe.touches[0].clientX,fe.touches[0].clientY))},Ce=(fe,J)=>{if(!j.current||!L.current){j.current=null;return}const Xe=Math.abs(fe-j.current.x),Oe=Math.abs(J-j.current.y);Oe>re&&Oe>Xe&&L.current.go(J<j.current.y?"+1":"-1"),j.current=null},Y=fe=>{j.current&&Ce(fe.clientX,fe.clientY),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("pointermove",we)},xe=fe=>{if(j.current){if(fe.changedTouches.length>0){const J=fe.changedTouches[0];Ce(J.clientX,J.clientY)}document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),document.removeEventListener("touchmove",Pe)}},pe=fe=>{j.current={x:fe.clientX,y:fe.clientY},$.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",Y),document.addEventListener("pointercancel",Y)},X=fe=>{fe.touches.length>0&&(j.current={x:fe.touches[0].clientX,y:fe.touches[0].clientY},$.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",xe),document.addEventListener("touchcancel",xe))};return G.addEventListener("pointerdown",pe),G.addEventListener("touchstart",X),()=>{G.removeEventListener("pointerdown",pe),G.removeEventListener("touchstart",X),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Y),document.removeEventListener("pointercancel",Y),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",xe),document.removeEventListener("touchcancel",xe),j.current=null,$.current=!1}},[e,q,y]);const se={backgroundColor:ee.color,backdropFilter:`blur(${ee.blur}px)`,animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Dn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:M,className:ut(Ue.background,H?ae:ge,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{...se,...U&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?M:null,className:ut(Ue.contentStyle,H?ne:Ie,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{animationDuration:`${parseInt(Q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Ls,{onMove:G=>C(G.index),ref:L,className:Ue.lightboxSplide,options:{arrows:!1,speed:T.duration?parseInt(T.duration):500,direction:T.direction==="horiz"||T.type==="fade"||T.type==="scale"?"ltr":"ttb",pagination:!1,drag:z.type==="drag"&&!q,perPage:1,width:"100%",height:"100%",type:T.type==="fade"||T.type==="scale"?"fade":"loop",padding:0,rewind:z.repeat!=="close",start:0},style:{"--splide-speed":T.duration},children:n.map((G,re)=>{const me=tr(ue.position,ue.offset,l),we=`${W.scalingValue(ue.padding.top,l)} ${W.scalingValue(ue.padding.right,l)} ${W.scalingValue(ue.padding.bottom,l)} ${W.scalingValue(ue.padding.left,l)}`,Pe=T.type==="scale"?(()=>{const{transform:Ce,...Y}=me;return{...Y,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...me,position:"absolute",padding:we,boxSizing:"border-box"};return a.jsx(Rs,{children:a.jsx("div",{className:Ue.imgWrapper,onClick:be,children:a.jsx("img",{ref:re===f?k:null,className:ut(Ue.imageStyle,{[Ue.contain]:G.image.objectFit==="contain",[Ue.cover]:G.image.objectFit==="cover",[Ue.scaleSlide]:T.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Pe,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},re)})},y),E.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(Ue.arrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(E.offset.x,l)}, ${W.scalingValue(E.offset.y*(T.direction==="horiz"?1:-1),l)}) scale(${E.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[E.arrowsImgUrl&&a.jsx(sn,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:ut(Ue.arrowImg,Ue.mirror)}),!E.arrowsImgUrl&&a.jsx(sl,{color:E.color,className:ut(Ue.arrowIcon,Ue.arrowImg,Ue.mirror)})]})}),a.jsx("div",{className:ut(Ue.arrow,Ue.nextArrow,{[Ue.arrowVertical]:T.direction==="vert"}),style:{color:E.color,"--arrow-hover-color":E.hover},children:a.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${W.scalingValue(E.offset.x*(T.direction==="horiz"?-1:1),l)}, ${W.scalingValue(E.offset.y,l)}) scale(${E.scale}) rotate(${T.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=L.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[E.arrowsImgUrl&&a.jsx(sn,{url:E.arrowsImgUrl,fill:E.color,hoverFill:E.hover,className:Ue.arrowImg}),!E.arrowsImgUrl&&a.jsx(sl,{color:E.color,className:ut(Ue.arrowIcon,Ue.arrowImg)})]})})]}),ee.closeIconUrl&&(()=>{const G=tr(ee.closeIconAlign,ee.closeIconOffset,l),re=`scale(${ee.closeIconScale})`,me=G.transform?`${G.transform} ${re}`:re;return a.jsx("button",{className:Ue.closeButton,style:{...G,transform:me},onClick:ie,"aria-label":"Close lightbox",children:a.jsx(sn,{url:ee.closeIconUrl,fill:ee.closeIconColor??"#000000",hoverFill:ee.closeIconHover??"#cccccc"})})})(),V&&V.isActive&&i.imageCaption&&((he=n[f])==null?void 0:he.imageCaption)&&a.jsx("div",{className:Ue.caption,style:{...tr(V.alignment,V.offset,l),fontFamily:oo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":W.scalingValue(c.width,l),letterSpacing:W.scalingValue(p,l),wordSpacing:W.scalingValue(x,l),textAlign:b,fontSize:W.scalingValue(g.fontSize,l),lineHeight:W.scalingValue(g.lineHeight,l),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:h},onClick:G=>G.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:Ue.captionTextInner,style:{"--link-color":V.linkColor,"--link-hover-color":V.linkHoverColor},children:a.jsx($i,{content:n[f].imageCaption})})}),O.isActive&&(()=>{const[G,re]=O.position.split("-"),me=T.direction==="horiz"?`${G}-left`:O.position,we=tr(me,O.offset,l),Pe=()=>{if(T.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:v,className:Ue.thumbsWrapper,onClick:Ce=>Me(Ce),style:{position:l?"absolute":"fixed",...we,...T.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ut(Ue.thumbsContainer,{[Ue.thumbsContainerVertical]:T.direction==="vert",[Ue.thumbsAlignStart]:O.align==="start",[Ue.thumbsAlignCenter]:O.align==="center",[Ue.thumbsAlignEnd]:O.align==="end"}),style:{gap:W.scalingValue(O.grid.gap,l),justifyContent:w?"flex-start":Pe()},children:n.map((Ce,Y)=>{const xe=Y===f,pe=_[Y],le=O.grid.size*(xe?O.activeState.scale:1),Fe=()=>{if(O.fit!=="fit")return{};if(!pe)return T.direction==="horiz"?{height:W.scalingValue(le,l)}:{width:W.scalingValue(le,l)};const fe=pe.width/pe.height;if(T.direction==="horiz"){const J=le,Xe=J*fe;return{width:W.scalingValue(Xe,l),height:W.scalingValue(J,l)}}else{const J=le,Xe=J/fe;return{width:W.scalingValue(J,l),height:W.scalingValue(Xe,l)}}};return a.jsx("button",{className:Ue.thumbItem,style:{...T.direction==="horiz"&&O.fit!=="fit"?{height:W.scalingValue(le,l)}:{},...T.direction==="vert"&&O.fit!=="fit"?{width:W.scalingValue(le,l)}:{},...O.fit==="cover"?{width:W.scalingValue(le,l),height:W.scalingValue(le,l)}:{},...Fe(),transition:xe?"all 0.25s ease-out":"none",opacity:xe?O.activeState.opacity/100:O.opacity/100,"--thumb-hover":O.activeState.opacity/100},onClick:fe=>{var J;fe.stopPropagation(),C(Y),(J=L.current)==null||J.go(Y)},onMouseEnter:()=>{var fe;O.triggers==="hov"&&((fe=L.current)==null||fe.go(Y))},children:a.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:fe=>{const J=fe.currentTarget;J.naturalWidth&&J.naturalHeight&&B(Xe=>({...Xe,[Y]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:O.fit==="cover"?"cover":"contain",...O.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...O.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${Y}`)})})})})()]})]}),document.getElementById(r))};function sl({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 hg={element:mg,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Lightbox.png"},defaultSize:{d:{width:440,height:550},t:{width:235,height:293},m:{width:265,height:331}},fontSettingsPaths:{content:[],parameters:[{path:"styles.imageCaption.fontSettings"}]},assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"settings.thumbnailBlock.cover.url",placeholderEnabled:!0},{path:"settings.controls.arrowsImgUrl"},{path:"settings.area.closeIconUrl"}]},schema:{type:"object",properties:{settings:{type:"object",properties:{thumbnailBlock:{display:{type:"settings-block",triggerEvent:"close"},type:"object",properties:{cover:{title:"COVER",icon:"cover",tooltip:"Cover Image",type:"object",properties:{url:{type:"string",display:{type:"cover-image-input"}}}}}},lightboxBlock:{display:{type:"settings-block",triggerEvent:"open"},type:"object",properties:{appear:{title:"APPEAR",icon:"transition",tooltip:"Appearance",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide in","fade in","mix"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]},direction:{type:"string",title:"From",display:{type:"direction-control"},enum:["top","left","right","bottom"]}}},triggers:{title:"TRIGGERS",icon:"target",tooltip:"Triggers",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["click","drag"]},switch:{type:"string",display:{type:"ratio-group"},enum:["image","50/50"]},repeat:{type:"string",title:"Repeat",display:{visible:!1,type:"ratio-group"},enum:["close","loop"]}}},slider:{title:"SLIDER",icon:"horizontal-resize",tooltip:"Slider",type:"object",properties:{type:{type:"string",display:{type:"ratio-group"},enum:["slide","fade","scale"]},direction:{type:"string",display:{type:"ratio-group"},enum:["horiz","vert"]},duration:{type:"string",label:"T",display:{type:"step-selector"},enum:["100ms","250ms","500ms","1000ms","1500ms","2000ms"]}}},thumbnail:{title:"THUMB",icon:"thumbnail",tooltip:"Thumbnail",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},fit:{type:"string",display:{type:"ratio-group"},enum:["cover","fit"]},align:{type:"string",title:"Align",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},triggers:{type:"string",title:"Triggers",display:{type:"ratio-group",direction:"horizontal"},enum:["clk","hov"]},grid:{type:"object",title:"Grid",display:{type:"group"},properties:{size:{type:"number",label:"Box",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},gap:{type:"number",label:"Gap",scalingEnabled:!0,min:0,display:{type:"numeric-input"}}}},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}},activeState:{type:"object",title:"ACTIVE",display:{type:"group"},properties:{scale:{type:"number",title:"Scale",min:1,max:5,step:.1,display:{type:"range-control"}},opacity:{type:"number",title:"Opacity",label:"icon:opacity",min:0,max:100,step:1,display:{type:"numeric-input"}}}}}},layout:{title:"LAYOUT",icon:"layout",tooltip:"Layout",type:"object",properties:{position:{display:{type:"align-grid"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},padding:{type:"object",title:"Padding",display:{type:"padding-controls"},properties:{top:{min:0,step:1,type:"number"},left:{min:0,step:1,type:"number"},right:{min:0,step:1,type:"number"},bottom:{min:0,step:1,type:"number"}}}}},controls:{title:"CONTROLS",icon:"controls",tooltip:"Controls",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},arrowsImgUrl:{type:["string","null"],display:{type:"settings-image-input"}},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},scale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},color:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},hover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},area:{title:"AREA",icon:"area",tooltip:"Area",type:"object",properties:{color:{type:"string",display:{type:"settings-color-picker",format:"single"}},blur:{type:"number",label:"icon:blur",display:{type:"numeric-input"}},closeIconUrl:{type:["string","null"],title:"Close Icon",display:{type:"settings-image-input"}},closeIconAlign:{display:{type:"align-grid",direction:"horizontal"},type:"string",enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},closeIconScale:{type:"number",title:"Scale",min:.5,max:5,step:.1,display:{type:"range-control"}},closeIconOffset:{type:"object",title:"Offset",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},closeIconColor:{title:"Color",type:"string",display:{type:"settings-color-picker",format:"single"}},closeIconHover:{title:"Hover",type:"string",display:{type:"settings-color-picker",format:"single"}}}},caption:{title:"DESC",icon:"text-icon",tooltip:"Description",type:"object",properties:{isActive:{type:"boolean",display:{type:"setting-toggle"}},alignment:{type:"string",display:{type:"align-grid"},enum:["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]},offset:{title:"Offset",type:"object",display:{type:"group"},properties:{x:{type:"number",label:"X",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}},y:{type:"number",label:"Y",scalingEnabled:!0,display:{type:"numeric-input",visible:!0}}}},linkColor:{title:"Link",type:"string",display:{type:"settings-color-picker",format:"single"}},linkHoverColor:{title:"Link Hov",type:"string",display:{type:"settings-color-picker",format:"single"}}}}}}},default:{d:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"slide in",duration:"1000ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.01,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:0,bottom:.06,left:0}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},linkColor:"#cccccc",linkHoverColor:"#cccccc"}}},m:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"horiz",duration:"1000ms"},thumbnail:{isActive:!0,position:"bottom-center",fit:"fit",align:"start",triggers:"hov",grid:{size:.1,gap:.05},offset:{x:.01,y:-.05},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.05,bottom:.06,left:.05}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}},t:{thumbnailBlock:{cover:{url:"https://cdn.cntrl.site/component-assets/Cover.jpg"}},lightboxBlock:{appear:{type:"fade in",duration:"500ms",direction:"bottom"},triggers:{type:"click",switch:"image",repeat:"loop"},slider:{type:"slide",direction:"vert",duration:"1000ms"},thumbnail:{isActive:!0,position:"middle-left",fit:"fit",align:"start",triggers:"hov",grid:{size:.05,gap:.01},offset:{x:.03,y:0},opacity:50,activeState:{scale:1,opacity:100}},layout:{position:"middle-center",offset:{x:0,y:0},padding:{top:.06,right:.1,bottom:.06,left:.1}},controls:{isActive:!1,arrowsImgUrl:null,offset:{x:0,y:0},scale:1,color:"#000000",hover:"#cccccc"},area:{color:"rgba(28,31,34,0.9)",blur:0,closeIconUrl:null,closeIconColor:"#000000",closeIconHover:"#cccccc",closeIconAlign:"top-right",closeIconOffset:{x:0,y:0},closeIconScale:1},caption:{isActive:!0,alignment:"middle-center",offset:{x:0,y:0},hover:"#cccccc"}}}},displayRules:[{if:{name:"lightboxBlock.appear.type",value:"slide in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.slider.direction",value:"vert"},then:{name:"properties.lightboxBlock.properties.thumbnail.properties.align.display.direction",value:"vertical"}},{if:{name:"lightboxBlock.appear.type",value:"mix"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!0}},{if:{name:"lightboxBlock.appear.type",value:"fade in"},then:{name:"properties.lightboxBlock.properties.appear.properties.direction.display.visible",value:!1}},{if:[{name:"lightboxBlock.triggers.type",value:"click"},{name:"lightboxBlock.triggers.switch",value:"image"}],then:{name:"properties.lightboxBlock.properties.triggers.properties.repeat.display.visible",value:!0}}]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{label:"Description",placeholder:"Add Caption...",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/2.jpg",name:"Slider-1.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/3.jpg",name:"Slider-2.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/4.jpg",name:"Slider-3.png"},imageCaption:[{type:"paragraph",children:[{text:""}]}]}]},styles:{type:"object",properties:{imageCaption:{dataName:"caption",type:"object",properties:{fontSettings:{type:"object",display:{type:"font-settings"},properties:{fontFamily:{type:"string"},fontWeight:{type:"number"},fontStyle:{type:"string"}}},widthSettings:{display:{type:"text-width-control"},type:"object",properties:{width:{type:"number"},sizing:{type:"string",enum:["auto","manual"]}}},fontSizeLineHeight:{type:"object",display:{type:"font-size-line-height"},properties:{fontSize:{type:"number"},lineHeight:{type:"number"}}},letterSpacing:{display:{type:"letter-spacing-input"},type:"number"},wordSpacing:{display:{type:"word-spacing-input"},type:"number"},textAlign:{display:{type:"text-align-control"},type:"string",enum:["left","center","right","justify"]},textAppearance:{display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},color:{display:{type:"style-panel-color-picker"},type:"string"}}}},default:{imageCaption:{widthSettings:{width:.13,sizing:"auto"},fontSettings:{fontFamily:"Arial",fontWeight:400,fontStyle:"normal"},fontSizeLineHeight:{fontSize:.02,lineHeight:.02},letterSpacing:0,wordSpacing:0,textAlign:"left",textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},color:"#000000"}}}},required:["settings","content","styles"]}};function nr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function fg(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 yg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=W.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:x,gap:g,fieldsGap:m,buttonCorners:h,buttonStroke:f,buttonPadding:C,isButtonFullWidth:y,inputCorners:R,inputStroke:H,inputPadding:S,inputColor:U,inputTextColor:F,inputBorderColor:_,placeholderColor:B,buttonColor:L,buttonTextColor:N,buttonBorderColor:k,labelTextColor:Z,successColor:
|
|
158
|
+
`}function yg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=W.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:x,gap:g,fieldsGap:m,buttonCorners:h,buttonStroke:f,buttonPadding:C,isButtonFullWidth:y,inputCorners:R,inputStroke:H,inputPadding:S,inputColor:U,inputTextColor:F,inputBorderColor:_,placeholderColor:B,buttonColor:L,buttonTextColor:N,buttonBorderColor:k,labelTextColor:Z,successColor:M,errorColor:K,fontFamily:D,inputFontSettings:j,inputFontSize:$,inputLineHeight:v,inputLetterSpacing:w,inputWordSpacing:P,inputTextAppearance:Q,buttonFontSettings:z,buttonFontSize:T,buttonLineHeight:O,buttonLetterSpacing:E,buttonWordSpacing:ee,buttonTextAppearance:V,labelFontSettings:ue,labelFontSize:Ie,labelLineHeight:ge,labelLetterSpacing:ae,labelWordSpacing:ne,labelTextAppearance:oe,statusFontSettings:ie,statusFontSize:Ae,statusLineHeight:be,statusLetterSpacing:Me,statusWordSpacing:q,statusTextAppearance:se,successMessage:he,errorMessage:G,stateOverrides:re}=e,me=u==="B",we=b.slice(0,Math.min(p,b.length)),Pe={fontSettings:{fontFamily:D,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:$??.01,lineHeight:v,letterSpacing:w??0,wordSpacing:P??0,textAppearance:Q,color:F},Ce=an(Ut(Pe,t)),Y=W.scalingValue(H??0,t),xe=W.scalingValue((v??$??.01)+((S==null?void 0:S.top)??0)+((S==null?void 0:S.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),pe={...Ce,borderStyle:"solid",borderRadius:u==="C"?0:W.scalingValue(R??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:Y,borderLeftWidth:0}:{borderWidth:Y},paddingTop:W.scalingValue((S==null?void 0:S.top)??0,t),paddingRight:W.scalingValue((S==null?void 0:S.right)??0,t),paddingBottom:W.scalingValue((S==null?void 0:S.bottom)??0,t),paddingLeft:W.scalingValue((S==null?void 0:S.left)??0,t),height:xe,minHeight:xe},X={fontSettings:{fontFamily:D,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:T??.01,lineHeight:O,letterSpacing:E??0,wordSpacing:ee??0,textAppearance:V,color:N},le=an(Ut(X,t)),Fe=W.scalingValue(f??0,t),fe={fontSettings:{fontFamily:D,fontWeight:(ue==null?void 0:ue.fontWeight)??400,fontStyle:(ue==null?void 0:ue.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:ge,letterSpacing:ae??0,wordSpacing:ne??0,textAppearance:oe,color:Z},J=Ut(fe,t),Xe={fontSettings:{fontFamily:D,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:be,letterSpacing:Me??0,wordSpacing:q??0,textAppearance:se,color:M},Oe=an(Ut(Xe,t)),dt=W.buildColorVars(c,{inputColor:U,inputTextColor:F,inputBorderColor:_,placeholderColor:B!=null&&B.trim()?B:"#cccccc",buttonColor:L,buttonTextColor:N,buttonBorderColor:k,labelTextColor:Z,successColor:M,errorColor:K},vg,xg,re),[nt,ht]=s.useState(()=>Object.fromEntries(we.map(ke=>[ke.name,""]))),[st,ze]=s.useState("idle"),[Se,_e]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":st,Ye=r==="error"?G:Se,de=r==="filled",ve=s.useMemo(()=>{if(!de)return nt;let ke=null;for(const qe of we)(nt[qe.name]??"").trim().length>0||(ke=ke??{...nt},ke[qe.name]="Filled");return ke??nt},[nt,de,we]),Ee=Be==="error"?W.getFormFieldValidationError(we,ve):null,Ze=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),Ve=o==null?void 0:o.submitUrl,at=(ke,qe)=>{ht(We=>({...We,[ke]:qe}))},Je=async ke=>{if(ke.preventDefault(),!d)return;const qe=Object.fromEntries(we.map(tt=>{var rt;return[tt.name,((rt=nt[tt.name])==null?void 0:rt.trim())??""]}).filter(([,tt])=>tt));if(!Ve){ze("error"),_e("No integrations were found for this form.");return}if(Object.keys(qe).length===0)return;const We=W.getFormFieldValidationError(we,nt);if(We){ze("error"),_e(We);return}ze("submitting"),_e(null);try{const tt=await fetch(Ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qe)});if(!tt.ok){const rt=await tt.text();throw new Error(rt||`Request failed: ${tt.status}`)}ze("success"),ht(Object.fromEntries(we.map(rt=>[rt.name,""])))}catch(tt){ze("error"),_e(tt instanceof Error?tt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Ze}`.trim(),style:dt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:fg(c)}}),a.jsxs("form",{onSubmit:Je,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:we.map((ke,qe)=>a.jsxs(s.Fragment,{children:[qe>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:W.scalingValue(m??0,t)}}),a.jsxs("div",{className:`${c}-field-group${me?` ${c}-labeled`:""}`,children:[me&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:ke.label||ke.name}),ke.type==="textarea"?a.jsx("textarea",{name:ke.name,autoComplete:"off",value:ve[ke.name]??"",onChange:We=>at(ke.name,We.target.value),placeholder:ke.placeholder,className:`${c}-input`,style:pe,rows:1,"data-filled":de||(ve[ke.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:ke.type==="phone"?"tel":ke.type==="email"?"email":"text",name:ke.name,autoComplete:"off",value:ve[ke.name]??"",onChange:We=>at(ke.name,We.target.value),placeholder:ke.placeholder,required:ke.isRequired??ke.type==="email",className:`${c}-input`,style:pe,"data-filled":de||(ve[ke.name]??"").trim().length>0})]})]},qe))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:W.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:W.scalingValue(h??0,t),borderWidth:Fe,paddingTop:W.scalingValue((C==null?void 0:C.top)??0,t),paddingRight:W.scalingValue((C==null?void 0:C.right)??0,t),paddingBottom:W.scalingValue((C==null?void 0:C.bottom)??0,t),paddingLeft:W.scalingValue((C==null?void 0:C.left)??0,t),pointerEvents:d?"auto":void 0,...le,...y?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:a.jsx("span",{className:`${c}-overlay-anchor`,style:y?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:st==="submitting"?"...":x})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Oe},children:he}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Oe},role:"alert",children:Ee??Ye??G})]})}const vg={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"},xg=["hover","focus","filled","success","error"],bg=`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';
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${or(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const Lg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=W.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:x,inputFontSize:g,inputLineHeight:m,inputLetterSpacing:h,inputWordSpacing:f,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:R,buttonLineHeight:H,buttonLetterSpacing:S,buttonWordSpacing:U,buttonTextAppearance:F,statusFontSettings:_,statusFontSize:B,statusLineHeight:L,statusLetterSpacing:N,statusWordSpacing:k,statusTextAppearance:Z,iconMaxWidth:
|
|
983
|
+
`}const Lg=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=W.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:x,inputFontSize:g,inputLineHeight:m,inputLetterSpacing:h,inputWordSpacing:f,inputTextAppearance:C,buttonFontSettings:y,buttonFontSize:R,buttonLineHeight:H,buttonLetterSpacing:S,buttonWordSpacing:U,buttonTextAppearance:F,statusFontSettings:_,statusFontSize:B,statusLineHeight:L,statusLetterSpacing:N,statusWordSpacing:k,statusTextAppearance:Z,iconMaxWidth:M,minHeight:K,corners:D,stroke:j,stateOverrides:$,inputPadding:v,buttonPadding:w,successMessage:P="Thanks for subscribing!",errorMessage:Q="Please, fill all required fields."}=e,z=d.slice(0,Math.min(p,d.length)),[T,O]=s.useState(()=>Object.fromEntries(z.map(fe=>[fe.name,""]))),[E,ee]=s.useState("idle"),[V,ue]=s.useState(null),Ie=o==="success"?"success":o==="error"?"error":E,ge=o==="error"?Q:V,ae=o==="filled",ne=s.useMemo(()=>{if(!ae)return T;let fe=null;for(const J of z)(T[J.name]??"").trim().length>0||(fe=fe??{...T},fe[J.name]="Filled");return fe??T},[ae,T,z]),oe=Ie==="error"?W.getFormFieldValidationError(z,ne):null,ie=o&&o!=="default"?`${r}-state-${o}`:"",Ae=z.some(fe=>(ne[fe.name]??"").trim().length>0),be=ie!==`${r}-state-filled`&&Ae?`${r}-state-filled`:"",Me=`${ie} ${be}`.trim(),q=i==null?void 0:i.submitUrl,se=u??"",he=(c==null?void 0:c.icon)??"",G=(c==null?void 0:c.mode)==="On",re=se||"Submit",me={fontSettings:{fontFamily:b,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:g??.01,lineHeight:m,letterSpacing:h??0,wordSpacing:f??0,textAppearance:C,color:e.inputTextColor??"#111111"},we={fontSettings:{fontFamily:b,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:R??.01,lineHeight:H,letterSpacing:S??0,wordSpacing:U??0,textAppearance:F,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:b,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:B??.01,lineHeight:L,letterSpacing:N??0,wordSpacing:k??0,textAppearance:Z,color:e.successColor??"#22c55e"},Ce=an(Ut(me,t)),Y=an(Ut(we,t)),xe=an(Ut(Pe,t)),pe=W.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(me==null?void 0:me.color)??"#111111",buttonTextColor:e.buttonTextColor??(we==null?void 0:we.color)??"#ffffff"},Rg,Ig,$),X={borderRadius:W.scalingValue(D,t),borderWidth:W.scalingValue(j,t),borderStyle:"solid"},le={borderLeftWidth:W.scalingValue(j,t)},Fe=async fe=>{if(fe.preventDefault(),!l)return;const J=Object.fromEntries(z.map(Oe=>{var dt;return[Oe.name,((dt=T[Oe.name])==null?void 0:dt.trim())??""]}).filter(([,Oe])=>Oe));if(!q){ee("error"),ue("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Xe=W.getFormFieldValidationError(z,T);if(Xe){ee("error"),ue(Xe);return}ee("submitting"),ue(null);try{const Oe=await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Oe.ok){const dt=await Oe.text();throw new Error(dt||`Request failed: ${Oe.status}`)}ee("success"),O(Object.fromEntries(z.map(dt=>[dt.name,""])))}catch(Oe){ee("error"),ue(Oe instanceof Error?Oe.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${Me}`.trim(),style:pe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Tg(r)}}),a.jsxs("form",{onSubmit:Fe,className:`${r}-form`,style:{...X,height:W.scalingValue(K,t),minHeight:W.scalingValue(K,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:z.map(fe=>a.jsx("input",{type:fe.type==="email"?"email":fe.type==="phone"?"tel":"text",name:fe.name,autoComplete:"off",value:ne[fe.name]??"",onChange:J=>O(Xe=>({...Xe,[fe.name]:J.target.value})),placeholder:fe.placeholder,required:fe.isRequired??fe.type==="email",className:`${r}-input`,style:{...Ce,paddingRight:W.scalingValue(v.right,t),paddingLeft:W.scalingValue(v.left,t),paddingTop:W.scalingValue(v.top,t),paddingBottom:W.scalingValue(v.bottom,t)}},fe.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":re,style:{...Y,...le,paddingRight:W.scalingValue(w.right,t),paddingLeft:W.scalingValue(w.left,t),paddingTop:W.scalingValue(w.top,t),paddingBottom:W.scalingValue(w.bottom,t),pointerEvents:l?"auto":void 0},children:E==="submitting"?"...":G?he&&a.jsx(sn,{url:he,className:`${r}-submitBtnIcon`,style:{maxWidth:W.scalingValue(M??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):se})})]}),Ie==="success"&&a.jsx("p",{className:`${r}-success`,style:{...xe},children:P}),Ie==="error"&&a.jsx("p",{className:`${r}-error`,style:{...xe},role:"alert",children:oe??ge??Q})]})},Rg={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"},Ig=["hover","focus","filled","success","error"],Pg=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const Wg=30,Ng=20,ua=3,Hg=12,Og=32,Dg=3,Bg=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")},jg=(e,t)=>Array.from({length:t},()=>e).flat(),zg=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},dd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),ll=(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=dd(d);return c<=0?0:c+r*Math.max(0,t-1)},Vg=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=dd(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},Gg=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},qg=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Gg(i,e))},Xg=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??"")},Ug=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Yg=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,Z,
|
|
1692
|
+
`}const Wg=30,Ng=20,ua=3,Hg=12,Og=32,Dg=3,Bg=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")},jg=(e,t)=>Array.from({length:t},()=>e).flat(),zg=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},dd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),ll=(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=dd(d);return c<=0?0:c+r*Math.max(0,t-1)},Vg=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=dd(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},Gg=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},qg=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Gg(i,e))},Xg=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??"")},Ug=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Yg=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,Z,M,K;const p=s.useRef(null),b=!!((k=e.image)!=null&&k.url&&Xg(e.image));s.useLayoutEffect(()=>{d&&Ug(p.current)&&(u==null||u())},[d,(Z=e.image)==null?void 0:Z.url,u]);const x=n.display==="cover",g=n.ratioValue??"1:1",m=n.reversed??!1,[h,f]=g.split(":").map(Number),R=(m?f:h)/(m?h:f),H=i/R,S=H>o?o:H,U=H>o?o*R:i,F=c(U),_=c(S),B={borderRadius:c(r)},L=x?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...B}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...B},N=((M=e.image)==null?void 0:M.url)&&(b?a.jsx("video",{ref:D=>{p.current=D},src:e.image.url,style:L,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:((K=e.image)==null?void 0:K.name)??"",style:L,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...x?{width:F}:{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,...x?{width:F,height:_,overflow:"hidden",...B}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:N&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:ut(`${t}-marquee-link`,!x&&`${t}-marquee-link-contain`),children:N}):N})})},Kg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>_g(r,c),[r,c]),{speed:p,direction:b,pauseOnHover:x,gap:g,imageMaxWidth:m,imageMaxHeight:h,hoverEffect:f,cornerRadius:C=0}=e,y=s.useMemo(()=>zg(e.imageFit),[e.imageFit]),R=(t==null?void 0:t.length)??0,H=!!o,S=!n||!!i,U=S&&f!=="off"&&f!=="randomize"?`${r}-image-hover-${f}`:void 0,F=n?!!i:!0,B=((t==null?void 0:t.length)??0)>0&&(F||!!n),L=Math.max(0,p)*Wg,N=be=>W.scalingValue(be,n??!1),k=s.useRef(null),Z=s.useRef(null),M=s.useRef(null),[K,D]=s.useState(0),j=F&&x==="on",[$,v]=s.useState(!1),[w,P]=s.useState({}),Q=s.useRef(w);Q.current=w;const z=s.useRef(null),T=s.useRef(0),O=s.useRef(null),E=s.useMemo(()=>(t??[]).map(be=>{var Me;return((Me=be.image)==null?void 0:Me.url)??""}).join("\0"),[t]),[ee,V]=s.useState(ua),ue=s.useMemo(()=>{const be=t??[];return be.length===0||!(F||!!n)?be:jg(be,ee)},[t,F,ee,n]),Ie=s.useMemo(()=>(t??[]).filter(be=>{var Me;return!!((Me=be.image)!=null&&Me.url)}).length,[t]),ge=B?Dg:1;s.useLayoutEffect(()=>{T.current=0,P({}),z.current=null,V(ua),d(0)},[E]),s.useEffect(()=>{if(!S||f!=="randomize")return;const be=k.current;if(!be)return;const Me=G=>{P(re=>{const me=Array.from(G).filter(Pe=>Pe in re&&!qg(be,Pe));if(me.length===0)return re;const we={...re};return me.forEach(Pe=>{delete we[Pe]}),we})},q=new IntersectionObserver(G=>{const re=new Set;for(const me of G){const we=me.target.dataset.marqueeItemIndex,Pe=we!==void 0?Number(we):NaN;Number.isNaN(Pe)||re.add(Pe)}re.size>0&&Me(re)},{root:be,threshold:0});Object.keys(w).forEach(G=>{const re=Number(G);be.querySelectorAll(`[data-marquee-item-index="${re}"]`).forEach(me=>q.observe(me))});const se={current:0},he=()=>{const G=Object.keys(Q.current);G.length!==0&&(Me(G.map(Number)),se.current=requestAnimationFrame(he))};return Object.keys(Q.current).length>0&&(se.current=requestAnimationFrame(he)),()=>{cancelAnimationFrame(se.current),q.disconnect()}},[f,w,S]),s.useLayoutEffect(()=>{if(!B)return;const be=k.current,Me=M.current;if(!be||!Me)return;const q={current:0},se=()=>{const re=be.getBoundingClientRect().width||be.offsetWidth,me=Vg(Me),we=z.current,Pe=typeof we=="number"&&Math.abs(we-me)<=.25;z.current=me;let Ce=ee,Y=0;if((F||n)&&R>0&&re>0){const X=ll(Me,R);if(X>=Og){Y=X;const le=Math.min(Hg,Math.max(ua,Math.ceil(re/X)+1));Ce=le,le!==ee&&V(le)}}const pe=Ce!==ee&&Y>0?Y*Ce:me>0?me:Y>0?Y*Ce:(()=>{const X=ll(Me,R);return X>0?X*Ce:0})();pe>0?d(X=>X<=0?pe:!Pe||Math.round(X)===Math.round(pe)?X:pe):!Pe&&l<=0&&(cancelAnimationFrame(q.current),q.current=requestAnimationFrame(se))},he=()=>{cancelAnimationFrame(q.current),q.current=requestAnimationFrame(se)};O.current=he,he();const G=new ResizeObserver(he);return G.observe(be),G.observe(Me),()=>{O.current=null,cancelAnimationFrame(q.current),G.disconnect()}},[F,B,l,E,ee,R,n]),s.useLayoutEffect(()=>{if(!B||c<=0)return;const be=Z.current;be&&Bg(be)},[B,c,b,L]),s.useLayoutEffect(()=>{if(!B||l<=0){D(0);return}const be=Z.current,Me=M.current;if(!be||!Me)return;const q=()=>{const he=be.offsetHeight||be.getBoundingClientRect().height,G=Array.from(Me.children).reduce((me,we)=>Math.max(me,we.offsetHeight||we.getBoundingClientRect().height),0),re=he>0?he:G;D(re>0?re:0)};q();const se=new ResizeObserver(q);return se.observe(be),se.observe(Me),()=>se.disconnect()},[B,ge,ue,n,g,m,h,l,y,w]),s.useLayoutEffect(()=>{if(!n||!H||!B||typeof window>"u")return;const be=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(be)},[n,H,B,b,l,K,g,ue]);const ae=()=>{j&&v(!0)},ne=()=>{j&&v(!1)},oe=s.useCallback(()=>{var be;T.current=Math.min(Ie,T.current+1),(be=O.current)==null||be.call(O)},[Ie]),ie=s.useCallback((be,Me)=>{P(q=>{const se=q[be]??Me,he=(t??[]).filter(re=>re!==se);if(he.length===0)return q;const G=he[Math.floor(Math.random()*he.length)];return{...q,[be]:G}})},[t]),Ae=(be,Me,q,se)=>{const he=S&&f==="randomize"&&y.display==="cover"?w[q]??be:be,G=`max(${N(g)}, ${Ng}px)`,re=`calc(-0.5 * (${G} + ${N(g)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":q,onMouseEnter:S&&f==="randomize"&&y.display==="cover"?()=>ie(q,be):void 0,children:[a.jsx(Yg,{item:he,prefix:r,imageFit:y,imageMaxWidth:m,imageMaxHeight:h,cornerRadius:C,imageHoverClass:U,isEditor:n,isFirstSet:se,scaled:N,onFirstSetImageDone:oe}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:re,width:G,height:"100%"}})]},`${Me}-${q}`)};if(B){const be=F?j&&$?"paused":"running":"paused",Me=c>0&&L>0?c/L*1e3:0,q=`${Math.max(0,Me)/1e3}s`;return a.jsxs("div",{ref:k,className:ut(`${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":b,onMouseEnter:ae,onMouseLeave:ne,style:{WebkitAnimationDuration:q,animationDuration:q,WebkitAnimationPlayState:be,animationPlayState:be},children:Array.from({length:ge},(se,he)=>a.jsx("div",{ref:he===0?M:void 0,className:ut(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:N(g),paddingRight:N(g)},"aria-hidden":he>0,children:ue.map((G,re)=>Ae(G,he,re,he===0&&re<R))},`set-${he}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:ut(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:N(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((be,Me)=>Ae(be,0,Me))},"marquee-static")]})},Zg=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2601,7 +2601,7 @@ ${o}
|
|
|
2601
2601
|
left: -9999px;
|
|
2602
2602
|
top: 0;
|
|
2603
2603
|
}
|
|
2604
|
-
`}const th=30,pa=3,nh=12,ih=3,Ya=.72,oh=100,rh=10,ah=e=>Math.max(0,e)/oh,sh=e=>Math.max(0,e)/rh,lh=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")},ch=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Ri={ctx:void 0},dh=()=>Ri.ctx!==void 0?Ri.ctx:typeof document>"u"?(Ri.ctx=null,Ri.ctx):(Ri.ctx=document.createElement("canvas").getContext("2d"),Ri.ctx),uh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ph=e=>{e.style.transform=""},mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},gh=(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)},hh=96,fh=(e,t,n)=>{if(t<=0||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 b=p*c,x=b+c;o[p+1]=x,r[p+1]=r[p]+(d(b)+d(x))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},yh=(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=(g,m)=>{if(m-g<=1)return[g,m];const h=g+m>>1;return l[h]<=r?c(h,m):c(g,h)},[u,p]=c(0,l.length-1),b=l[p]-l[u],x=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*x)},vh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,b)=>{const x=b/c*e,g=(b+1)/c*e,m=g-x,h=l(x),f=l(g),C=x+m/3,y=h+d(x)*m/3,R=g-m/3,H=f-d(g)*m/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${R.toFixed(2)} ${H.toFixed(2)} ${g.toFixed(2)} ${f.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},xh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ya}em`},u=((g=e.image)==null?void 0:g.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),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((m,h)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:m===" "?" ":m})},h))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),x=a.jsxs(a.Fragment,{children:[p,b]});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:x}):x})},bh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:x,curveAmplitude:g,curveFrequency:m,textFontFamily:h,textFontSettings:f,textFontSize:C,textLineHeight:y,textLetterSpacing:R,textWordSpacing:H,textTextAppearance:S,textColor:U,backgroundColor:F,ribbonWidth:_}=e,B=_??y,L=x==="curve",N=ah(g),k=sh(m),Z=s.useMemo(()=>eh(o,d,L),[o,d,L]),E=s.useMemo(()=>Ut({fontSettings:{fontFamily:h,fontWeight:f.fontWeight,fontStyle:f.fontStyle},letterSpacing:R,wordSpacing:H,fontSize:C,lineHeight:y,textAppearance:S,color:U},n),[h,f,R,H,C,y,S,U,n]),K=de=>W.scalingValue(de,n??!1),D=((t==null?void 0:t.length)??0)>0,j=n?!!i:!0,$=D&&(j||!!n),v=Math.max(0,c)*th,w=j&&p==="on",[P,Q]=s.useState(!1),z=j?w&&P?"paused":"running":"paused",T=z==="running"&&v>0&&d>0,O=s.useRef(null),M=s.useRef(null),ee=s.useRef(null),V=s.useRef(null),me=s.useRef(null),Ie=s.useRef(null),ge=s.useRef(T),ae=s.useRef(null);ge.current=T;const[ne,oe]=s.useState(0),[ie,Ae]=s.useState(0),[be,Me]=s.useState(0),[q,se]=s.useState(0),[he,G]=s.useState(0),re=s.useMemo(()=>(t??[]).map(de=>{var ve;return`${de.text}\0${((ve=de.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[pe,we]=s.useState(pa),Pe=s.useMemo(()=>{const de=t??[];return de.length===0||!(j||n)?de:ch(de,pe)},[t,j,pe,n]),Ce=$?ih:1;s.useLayoutEffect(()=>{we(pa),l(0)},[re]),s.useLayoutEffect(()=>{var Ze;const de=Ie.current;if(!de)return;const ve=()=>{const Ve=getComputedStyle(de),at=parseFloat(Ve.fontSize)||0;if(at<=0)return;const Je=dh();if(!Je){oe(at*Ya),Ae(0);return}Je.font=`${Ve.fontStyle} ${Ve.fontWeight} ${at}px ${Ve.fontFamily}`;const ke=Je.measureText("H"),qe=ke.actualBoundingBoxAscent>0?ke.actualBoundingBoxAscent:at*Ya,We=Math.max(0,ke.actualBoundingBoxDescent||0),tt=ke.fontBoundingBoxAscent||0,rt=ke.fontBoundingBoxDescent||0;oe(Tt=>Math.abs(Tt-qe)>.5?qe:Tt);const lt=tt>0||rt>0?(rt-We-(tt-qe))/2:0;Ae(Tt=>Math.abs(Tt-lt)>.25?lt:Tt)};ve();const Ee=typeof document<"u"?document.fonts:void 0;(Ze=Ee==null?void 0:Ee.ready)==null||Ze.then(ve).catch(()=>{});const Ge=new ResizeObserver(ve);return Ge.observe(de),()=>Ge.disconnect()},[E.fontFamily,E.fontWeight,E.fontStyle,E.fontSize,E.lineHeight]),s.useLayoutEffect(()=>{if(!$)return;const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.offsetWidth||de.getBoundingClientRect().width,at=ve.offsetWidth||ve.getBoundingClientRect().width;if(D&&Ve>0&&at>0){const Je=at/pe;if(Je>0){const ke=Math.min(nh,Math.max(pa,Math.ceil(Ve/Je)+1));if(ke!==pe){we(ke);return}}}at>0&&l(at)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[$,re,pe,D,ne]),s.useLayoutEffect(()=>{const de=me.current;if(!de)return;const ve={id:0},Ee=()=>{const Ze=de.offsetHeight;Ze>0&&G(Ve=>Math.abs(Ve-Ze)>.5?Ze:Ve)};ve.id=requestAnimationFrame(Ee);const Ge=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(Ee)});return Ge.observe(de),()=>{cancelAnimationFrame(ve.id),Ge.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!L){Me(0),se(0);return}const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.offsetWidth,at=ve.offsetHeight;Ve>0&&se(Je=>Math.abs(Je-Ve)>.5?Ve:Je),at>0&&Me(Je=>Math.abs(Je-at)>.5?at:Je)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[L,re,ne,y,C,$]),s.useLayoutEffect(()=>{if(!$||d<=0)return;const de=ee.current;de&&lh(de)},[$,d,u,v]),s.useLayoutEffect(()=>{if(!L||!D)return;const de=O.current;if(!de)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const ke of ve.itemsCache)for(const qe of ke.glyphs)ph(qe.inner)},Ge=()=>{const ke=M.current??de;ve.itemsCache=Array.from(de.querySelectorAll("[data-marquee-text-item]"),qe=>{const We=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const rt=tt.firstElementChild;rt&&We.push({inner:rt,layoutLocalX:gh(tt,ke)})}),{item:qe,glyphs:We}}),ve.cacheDirty=!1},Ze=()=>{ve.cacheDirty&&Ge();const qe=(M.current??de).offsetWidth||1,We=qe*N,tt=2*Math.PI*k/qe,rt=`${qe}|${We}|${tt}`;rt!==ve.lutKey&&(ve.lutKey=rt,ve.lut=fh(We,tt,hh));const lt=ee.current,Tt=lt?mh(getComputedStyle(lt).transform):0,Xt=de.getBoundingClientRect(),Zt=Xt.left,xt=Xt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ve.itemsCache){const vt=Bt.getBoundingClientRect();if(!(vt.right<Zt||vt.left>xt+wt))for(const Ft of At){const Wt=Ft.layoutLocalX+Tt,Yt=ve.lut?yh(ve.lut,Wt):Wt,Jt=tt*Yt,Ct=We*Math.sin(Jt),Nt=We*tt*Math.cos(Jt),rn=Math.atan(Nt)*(180/Math.PI);uh(Ft.inner,Yt-Wt,Ct,rn)}}},Ve=()=>{ve.cancelled||(ve.raf=0,Ze(),ge.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Ve)))},at=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Ve))};ae.current=at,at();const Je=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}at()};return document.addEventListener("visibilitychange",Je),()=>{ve.cancelled=!0,ae.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",Je),Ee()}},[L,N,k,D,r,re,pe,ne]),s.useLayoutEffect(()=>{var de;(de=ae.current)==null||de.call(ae)},[T]);const Y=()=>{w&&Q(!0)},xe=()=>{w&&Q(!1)},ue=L?N*100:0,X=K(B),le={minHeight:X,...L?{paddingTop:`${ue}%`,paddingBottom:`${ue}%`}:{}},Fe={height:X,...L?{visibility:"hidden"}:{backgroundColor:F}},fe={gap:K(b),minHeight:X},J=q*N,Xe=he>0?he:be,Oe=Math.max(be,Xe),dt=L&&q>0&&Oe>0?vh(q,J,k,J+Oe/2):"",nt=J*2+Oe,ht=dt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${nt}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:dt,fill:"none",stroke:F,strokeWidth:Xe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,st=a.jsx("div",{ref:me,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),ze=(de,ve,Ee)=>a.jsx(xh,{item:de,prefix:o,textCss:E,capHeightPx:ne,opticalOffsetY:ie,imageGapPx:K(b),isCurve:L},`${ve}-${Ee}`),Se=a.jsx("span",{ref:Ie,"aria-hidden":!0,className:`${o}-cap-ref`,style:E,children:"H"}),_e=d>0&&v>0?d/v*1e3:0,Be=`${Math.max(0,_e)/1e3}s`,Ye=$?a.jsx("div",{ref:ee,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:Y,onMouseLeave:xe,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:z,animationPlayState:z},children:Array.from({length:Ce},(de,ve)=>a.jsx("div",{ref:ve===0?V:void 0,className:`${o}-marquee-set`,style:{...fe,paddingRight:K(b)},"aria-hidden":ve>0,children:Pe.map((Ee,Ge)=>ze(Ee,ve,Ge))},`set-${ve}`))}):a.jsx("div",{ref:V,className:ut(`${o}-marquee-set`,`${o}-marquee-static`),style:fe,children:t==null?void 0:t.map((de,ve)=>ze(de,0,ve))});return a.jsxs("div",{ref:O,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),Se,a.jsxs("div",{ref:M,className:`${o}-marquee-wrapper`,style:le,children:[st,ht,Ye]})]})},wh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2604
|
+
`}const th=30,pa=3,nh=12,ih=3,Ya=.72,oh=100,rh=10,ah=e=>Math.max(0,e)/oh,sh=e=>Math.max(0,e)/rh,lh=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")},ch=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Ii={ctx:void 0},dh=()=>Ii.ctx!==void 0?Ii.ctx:typeof document>"u"?(Ii.ctx=null,Ii.ctx):(Ii.ctx=document.createElement("canvas").getContext("2d"),Ii.ctx),uh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ph=e=>{e.style.transform=""},mh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},gh=(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)},hh=96,fh=(e,t,n)=>{if(t<=0||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 b=p*c,x=b+c;o[p+1]=x,r[p+1]=r[p]+(d(b)+d(x))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},yh=(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=(g,m)=>{if(m-g<=1)return[g,m];const h=g+m>>1;return l[h]<=r?c(h,m):c(g,h)},[u,p]=c(0,l.length-1),b=l[p]-l[u],x=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*x)},vh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,b)=>{const x=b/c*e,g=(b+1)/c*e,m=g-x,h=l(x),f=l(g),C=x+m/3,y=h+d(x)*m/3,R=g-m/3,H=f-d(g)*m/3;return`C${C.toFixed(2)} ${y.toFixed(2)} ${R.toFixed(2)} ${H.toFixed(2)} ${g.toFixed(2)} ${f.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},xh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ya}em`},u=((g=e.image)==null?void 0:g.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),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((m,h)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:m===" "?" ":m})},h))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),x=a.jsxs(a.Fragment,{children:[p,b]});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:x}):x})},bh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=W.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:x,curveAmplitude:g,curveFrequency:m,textFontFamily:h,textFontSettings:f,textFontSize:C,textLineHeight:y,textLetterSpacing:R,textWordSpacing:H,textTextAppearance:S,textColor:U,backgroundColor:F,ribbonWidth:_}=e,B=_??y,L=x==="curve",N=ah(g),k=sh(m),Z=s.useMemo(()=>eh(o,d,L),[o,d,L]),M=s.useMemo(()=>Ut({fontSettings:{fontFamily:h,fontWeight:f.fontWeight,fontStyle:f.fontStyle},letterSpacing:R,wordSpacing:H,fontSize:C,lineHeight:y,textAppearance:S,color:U},n),[h,f,R,H,C,y,S,U,n]),K=de=>W.scalingValue(de,n??!1),D=((t==null?void 0:t.length)??0)>0,j=n?!!i:!0,$=D&&(j||!!n),v=Math.max(0,c)*th,w=j&&p==="on",[P,Q]=s.useState(!1),z=j?w&&P?"paused":"running":"paused",T=z==="running"&&v>0&&d>0,O=s.useRef(null),E=s.useRef(null),ee=s.useRef(null),V=s.useRef(null),ue=s.useRef(null),Ie=s.useRef(null),ge=s.useRef(T),ae=s.useRef(null);ge.current=T;const[ne,oe]=s.useState(0),[ie,Ae]=s.useState(0),[be,Me]=s.useState(0),[q,se]=s.useState(0),[he,G]=s.useState(0),re=s.useMemo(()=>(t??[]).map(de=>{var ve;return`${de.text}\0${((ve=de.image)==null?void 0:ve.url)??""}`}).join("\0"),[t]),[me,we]=s.useState(pa),Pe=s.useMemo(()=>{const de=t??[];return de.length===0||!(j||n)?de:ch(de,me)},[t,j,me,n]),Ce=$?ih:1;s.useLayoutEffect(()=>{we(pa),l(0)},[re]),s.useLayoutEffect(()=>{var Ze;const de=Ie.current;if(!de)return;const ve=()=>{const Ve=getComputedStyle(de),at=parseFloat(Ve.fontSize)||0;if(at<=0)return;const Je=dh();if(!Je){oe(at*Ya),Ae(0);return}Je.font=`${Ve.fontStyle} ${Ve.fontWeight} ${at}px ${Ve.fontFamily}`;const ke=Je.measureText("H"),qe=ke.actualBoundingBoxAscent>0?ke.actualBoundingBoxAscent:at*Ya,We=Math.max(0,ke.actualBoundingBoxDescent||0),tt=ke.fontBoundingBoxAscent||0,rt=ke.fontBoundingBoxDescent||0;oe(Tt=>Math.abs(Tt-qe)>.5?qe:Tt);const lt=tt>0||rt>0?(rt-We-(tt-qe))/2:0;Ae(Tt=>Math.abs(Tt-lt)>.25?lt:Tt)};ve();const Ee=typeof document<"u"?document.fonts:void 0;(Ze=Ee==null?void 0:Ee.ready)==null||Ze.then(ve).catch(()=>{});const Ge=new ResizeObserver(ve);return Ge.observe(de),()=>Ge.disconnect()},[M.fontFamily,M.fontWeight,M.fontStyle,M.fontSize,M.lineHeight]),s.useLayoutEffect(()=>{if(!$)return;const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.offsetWidth||de.getBoundingClientRect().width,at=ve.offsetWidth||ve.getBoundingClientRect().width;if(D&&Ve>0&&at>0){const Je=at/me;if(Je>0){const ke=Math.min(nh,Math.max(pa,Math.ceil(Ve/Je)+1));if(ke!==me){we(ke);return}}}at>0&&l(at)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[$,re,me,D,ne]),s.useLayoutEffect(()=>{const de=ue.current;if(!de)return;const ve={id:0},Ee=()=>{const Ze=de.offsetHeight;Ze>0&&G(Ve=>Math.abs(Ve-Ze)>.5?Ze:Ve)};ve.id=requestAnimationFrame(Ee);const Ge=new ResizeObserver(()=>{cancelAnimationFrame(ve.id),ve.id=requestAnimationFrame(Ee)});return Ge.observe(de),()=>{cancelAnimationFrame(ve.id),Ge.disconnect()}},[B,n]),s.useLayoutEffect(()=>{if(!L){Me(0),se(0);return}const de=O.current,ve=V.current;if(!de||!ve)return;const Ee={id:0},Ge=()=>{const Ve=de.offsetWidth,at=ve.offsetHeight;Ve>0&&se(Je=>Math.abs(Je-Ve)>.5?Ve:Je),at>0&&Me(Je=>Math.abs(Je-at)>.5?at:Je)};Ee.id=requestAnimationFrame(Ge);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ee.id),Ee.id=requestAnimationFrame(Ge)});return Ze.observe(de),Ze.observe(ve),()=>{cancelAnimationFrame(Ee.id),Ze.disconnect()}},[L,re,ne,y,C,$]),s.useLayoutEffect(()=>{if(!$||d<=0)return;const de=ee.current;de&&lh(de)},[$,d,u,v]),s.useLayoutEffect(()=>{if(!L||!D)return;const de=O.current;if(!de)return;const ve={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ee=()=>{for(const ke of ve.itemsCache)for(const qe of ke.glyphs)ph(qe.inner)},Ge=()=>{const ke=E.current??de;ve.itemsCache=Array.from(de.querySelectorAll("[data-marquee-text-item]"),qe=>{const We=[];return qe.querySelectorAll("[data-marquee-wave-node]").forEach(tt=>{const rt=tt.firstElementChild;rt&&We.push({inner:rt,layoutLocalX:gh(tt,ke)})}),{item:qe,glyphs:We}}),ve.cacheDirty=!1},Ze=()=>{ve.cacheDirty&&Ge();const qe=(E.current??de).offsetWidth||1,We=qe*N,tt=2*Math.PI*k/qe,rt=`${qe}|${We}|${tt}`;rt!==ve.lutKey&&(ve.lutKey=rt,ve.lut=fh(We,tt,hh));const lt=ee.current,Tt=lt?mh(getComputedStyle(lt).transform):0,Xt=de.getBoundingClientRect(),Zt=Xt.left,xt=Xt.right,wt=ve.lut&&ve.lut.wavelength>0?Math.max(0,(ve.lut.periodArc/ve.lut.wavelength-1)*qe):0;for(const{item:Bt,glyphs:At}of ve.itemsCache){const vt=Bt.getBoundingClientRect();if(!(vt.right<Zt||vt.left>xt+wt))for(const Ft of At){const Wt=Ft.layoutLocalX+Tt,Yt=ve.lut?yh(ve.lut,Wt):Wt,Jt=tt*Yt,Ct=We*Math.sin(Jt),Nt=We*tt*Math.cos(Jt),rn=Math.atan(Nt)*(180/Math.PI);uh(Ft.inner,Yt-Wt,Ct,rn)}}},Ve=()=>{ve.cancelled||(ve.raf=0,Ze(),ge.current&&!document.hidden&&(ve.raf=requestAnimationFrame(Ve)))},at=()=>{ve.cancelled||ve.raf||(ve.raf=requestAnimationFrame(Ve))};ae.current=at,at();const Je=()=>{if(document.hidden){cancelAnimationFrame(ve.raf),ve.raf=0;return}at()};return document.addEventListener("visibilitychange",Je),()=>{ve.cancelled=!0,ae.current=null,cancelAnimationFrame(ve.raf),document.removeEventListener("visibilitychange",Je),Ee()}},[L,N,k,D,r,re,me,ne]),s.useLayoutEffect(()=>{var de;(de=ae.current)==null||de.call(ae)},[T]);const Y=()=>{w&&Q(!0)},xe=()=>{w&&Q(!1)},pe=L?N*100:0,X=K(B),le={minHeight:X,...L?{paddingTop:`${pe}%`,paddingBottom:`${pe}%`}:{}},Fe={height:X,...L?{visibility:"hidden"}:{backgroundColor:F}},fe={gap:K(b),minHeight:X},J=q*N,Xe=he>0?he:be,Oe=Math.max(be,Xe),dt=L&&q>0&&Oe>0?vh(q,J,k,J+Oe/2):"",nt=J*2+Oe,ht=dt?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${nt}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:dt,fill:"none",stroke:F,strokeWidth:Xe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,st=a.jsx("div",{ref:ue,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),ze=(de,ve,Ee)=>a.jsx(xh,{item:de,prefix:o,textCss:M,capHeightPx:ne,opticalOffsetY:ie,imageGapPx:K(b),isCurve:L},`${ve}-${Ee}`),Se=a.jsx("span",{ref:Ie,"aria-hidden":!0,className:`${o}-cap-ref`,style:M,children:"H"}),_e=d>0&&v>0?d/v*1e3:0,Be=`${Math.max(0,_e)/1e3}s`,Ye=$?a.jsx("div",{ref:ee,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:Y,onMouseLeave:xe,style:{WebkitAnimationDuration:Be,animationDuration:Be,WebkitAnimationPlayState:z,animationPlayState:z},children:Array.from({length:Ce},(de,ve)=>a.jsx("div",{ref:ve===0?V:void 0,className:`${o}-marquee-set`,style:{...fe,paddingRight:K(b)},"aria-hidden":ve>0,children:Pe.map((Ee,Ge)=>ze(Ee,ve,Ge))},`set-${ve}`))}):a.jsx("div",{ref:V,className:ut(`${o}-marquee-set`,`${o}-marquee-static`),style:fe,children:t==null?void 0:t.map((de,ve)=>ze(de,0,ve))});return a.jsxs("div",{ref:O,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),Se,a.jsxs("div",{ref:E,className:`${o}-marquee-wrapper`,style:le,children:[st,ht,Ye]})]})},wh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2605
2605
|
import cn from 'classnames';
|
|
2606
2606
|
import { CommonComponentProps } from '../props';
|
|
2607
2607
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3531,7 +3531,7 @@ type MarqueeTextProps = {
|
|
|
3531
3531
|
pointer-events: auto;
|
|
3532
3532
|
z-index: 10;
|
|
3533
3533
|
}
|
|
3534
|
-
`}const Lh=30,cl=2,Rh=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")},Ih=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:x,stroke:g,strokeColor:m,bgColor:h,padding:f,logoMarginTop:C,logoWidth:y,logoHeight:R,captionMarginTop:H}=e,S=!!o,U=((t==null?void 0:t.length)??0)>0,F=d>0&&(!n||i),_=U&&(F||n),B=Math.max(0,d)*Lh,L=Y=>W.scalingValue(Y,n??!1),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(null),[
|
|
3534
|
+
`}const Lh=30,cl=2,Rh=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")},Ih=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:x,stroke:g,strokeColor:m,bgColor:h,padding:f,logoMarginTop:C,logoWidth:y,logoHeight:R,captionMarginTop:H}=e,S=!!o,U=((t==null?void 0:t.length)??0)>0,F=d>0&&(!n||i),_=U&&(F||n),B=Math.max(0,d)*Lh,L=Y=>W.scalingValue(Y,n??!1),N=s.useRef(null),k=s.useRef(null),Z=s.useRef(null),[M,K]=s.useState(0),[D,j]=s.useState(0),$=D>0?D:0,v=s.useMemo(()=>Th(r,$),[r,$]),[w,P]=s.useState(0),Q=F&&u==="on",[z,T]=s.useState(!1),O=s.useRef(null),[E,ee]=s.useState(0),[V,ue]=s.useState(0),Ie=s.useRef(null),ge=Y=>{var pe,X,le,Fe,fe;return{fontSettings:{fontFamily:(e==null?void 0:e[`${Y}FontFamily`])??"Arial",fontWeight:((pe=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:pe.fontWeight)??400,fontStyle:((X=e==null?void 0:e[`${Y}FontSettings`])==null?void 0:X.fontStyle)??"normal"},textAppearance:{textTransform:((le=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:le.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((fe=e==null?void 0:e[`${Y}TextAppearance`])==null?void 0:fe.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${Y}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${Y}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${Y}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${Y}LineHeight`])??.01,color:(e==null?void 0:e[`${Y}Color`])??"#000000"}},ae=ge("text"),ne=ge("caption"),oe=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(Y=>{var xe,pe;return(((xe=Y.text)==null?void 0:xe.length)??0)>0||(((pe=Y.caption)==null?void 0:pe.length)??0)>0}),[t]),ie=s.useMemo(()=>!_||(t==null?void 0:t.length)===0?1:D<=0||M<=0?cl:Math.max(cl,Math.ceil(M/D)+1),[_,t==null?void 0:t.length,D,M]);s.useLayoutEffect(()=>{if(!_)return;const Y=N.current,xe=Z.current;if(!Y||!xe)return;let pe=0;const X=()=>{const fe=Y.getBoundingClientRect().width,J=xe.getBoundingClientRect().width,Xe=Ie.current,Oe=typeof Xe=="number"&&Math.abs(Xe-J)<=.25;if(Ie.current=J,K(fe),typeof J=="number"&&J>0&&D<=0){j(J);return}Oe&&J!==D?j(J):!Oe&&D<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame(X))},le=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(X)};le();const Fe=new ResizeObserver(le);return Fe.observe(Y),Fe.observe(xe),()=>{cancelAnimationFrame(pe),Fe.disconnect()}},[F,_,D]);const Ae=$>0&&B>0?$/B*1e3:0,be=`${Math.max(0,Ae)/1e3}s`;s.useLayoutEffect(()=>{if(!_||$<=0)return;const Y=k.current;Y&&Rh(Y)},[_,$,c]),s.useLayoutEffect(()=>{if(!_){P(0);return}const Y=Z.current,xe=k.current;if(!Y||!xe)return;const pe=()=>{let le=0;for(let Fe=0;Fe<Y.children.length;Fe++){const J=Y.children[Fe].firstElementChild;J&&(le=Math.max(le,J.offsetHeight))}le<=0&&(le=xe.offsetHeight),P(le>0?le:0)};pe();const X=new ResizeObserver(pe);return X.observe(Y),X.observe(xe),()=>{X.disconnect()}},[_,ie,t,n,p,b,f,g,x,y,R,E,V]);const Me=()=>{Q&&T(!0)},q=()=>{Q&&T(!1)},se=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),he=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),G=s.useCallback((Y,xe,pe,X)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:se,width:"100%"},children:[a.jsx("div",{"data-controls":S?X==null?void 0:X.controlsName:void 0,"data-controls-axis":S?"y":void 0,className:S?`${r}-control`:void 0,style:{height:L((X==null?void 0:X.marginTop)??0)}}),a.jsx("div",{...X!=null&&X.dataMeasureKind?{"data-testimonial-measure":X.dataMeasureKind}:{},style:{...Ut(Y,n),textAlign:he,pointerEvents:"auto",...typeof(X==null?void 0:X.minHeightPx)=="number"&&X.minHeightPx>0?{minHeight:X.minHeightPx}:{}},children:a.jsx($i,{content:xe})})]},pe),[se,he,n,S,r,L]),re=s.useCallback((Y,xe,pe)=>{var X,le,Fe;return a.jsxs("div",{style:{padding:`${L(f.top)} ${L(f.right)} ${L(f.bottom)} ${L(f.left)}`,width:L(b+g*2),height:"100%",borderRadius:L(x),border:`${L(g)} solid ${m}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:h}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:se,textAlign:he},children:[Y.text&&G(ae,Y.text,"text",pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(pe==null?void 0:pe.textMinHeightPx)=="number"&&pe.textMinHeightPx>0?{minHeightPx:pe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:se,width:"100%"},children:[a.jsx("div",{"data-controls":S&&!(pe!=null&&pe.dataMeasureAttrs)?"logoMarginTop":void 0,className:S&&!(pe!=null&&pe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:L(C)}}),a.jsx("div",{style:{width:L(y),height:L(R)},children:((X=Y.logo)==null?void 0:X.url)&&a.jsx("img",{src:Y.logo.url,alt:((le=Y.logo)==null?void 0:le.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Fe=Y.logo)==null?void 0:Fe.objectFit)||"contain"}})})]}),Y.caption&&G(ne,Y.caption,"caption",{...pe!=null&&pe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(pe==null?void 0:pe.captionMinHeightPx)=="number"&&pe.captionMinHeightPx>0?{minHeightPx:pe.captionMinHeightPx}:{}})]})]},xe)},[h,H,ne,b,x,R,C,y,se,he,f.bottom,f.left,f.right,f.top,G,g,m,ae,n,S,r]),me=s.useCallback(Y=>{ee(Y.maxTextPx),ue(Y.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!oe){me({maxTextPx:0,maxCaptionPx:0});return}const Y=O.current;if(!Y)return;const xe=()=>{W.readTestimonialTextMeasure(Y,me)};xe();const pe=new ResizeObserver(xe);return pe.observe(Y),()=>{pe.disconnect()}},[oe,me,t,re]);const we=oe?{textMinHeightPx:E,captionMinHeightPx:V}:void 0,Pe=oe?a.jsx("div",{ref:O,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((Y,xe)=>re(Y,`measure-${xe}`,{dataMeasureAttrs:!0}))}):null,Ce=(Y,xe)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[re(Y,`card-${xe}`,we),S&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${L(p)})`,width:L(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},xe);if(_){const Y=F?Q&&z?"paused":"running":"paused";return a.jsxs("div",{ref:N,className:ut(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...w>0?{height:w}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:v}}),Pe,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:Me,onMouseLeave:q,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:be,WebkitAnimationDuration:be,animationPlayState:Y,WebkitAnimationPlayState:Y},children:Array.from({length:ie},(xe,pe)=>a.jsx("div",{ref:pe===0?Z:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:L(p),paddingRight:L(p)},"aria-hidden":pe>0,children:t==null?void 0:t.map((X,le)=>Ce(X,`${pe}-${le}`))},`set-${pe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:v}}),Pe,a.jsx("div",{style:{gap:L(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((Y,xe)=>Ce(Y,xe))})]})},Ph=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3535
3535
|
import cn from 'classnames';
|
|
3536
3536
|
import { CommonComponentProps } from '../props';
|
|
3537
3537
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4286,7 +4286,7 @@ type TestimonialsSettings = {
|
|
|
4286
4286
|
width: 100%;
|
|
4287
4287
|
height: 100%;
|
|
4288
4288
|
}
|
|
4289
|
-
`}const Ah=3e3,Fh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:x,imageWidth:g,imageHeight:m,controlsWidth:h,controlsColor:f,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[R,H]=s.useState(0),[S,U]=s.useState(null),[F,_]=s.useState(!1),B=s.useRef(null),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),N=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),U(null),_(!1)},[l.length]);const k=l[R],Z=S===null?null:l[S],
|
|
4289
|
+
`}const Ah=3e3,Fh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=W.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:x,imageWidth:g,imageHeight:m,controlsWidth:h,controlsColor:f,controlsHoverColor:C}=e,y=d>0&&(!n||!!i),[R,H]=s.useState(0),[S,U]=s.useState(null),[F,_]=s.useState(!1),B=s.useRef(null),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),N=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),U(null),_(!1)},[l.length]);const k=l[R],Z=S===null?null:l[S],M=ge=>{var ne,oe,ie,Ae,be;return{fontSettings:{fontFamily:(e==null?void 0:e[`${ge}FontFamily`])??"Arial",fontWeight:((ne=e==null?void 0:e[`${ge}FontSettings`])==null?void 0:ne.fontWeight)??400,fontStyle:((oe=e==null?void 0:e[`${ge}FontSettings`])==null?void 0:oe.fontStyle)??"normal"},textAppearance:{textTransform:((ie=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:ie.textTransform)??"none",textDecoration:((Ae=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:Ae.textDecoration)??"none",fontVariant:((be=e==null?void 0:e[`${ge}TextAppearance`])==null?void 0:be.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${ge}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${ge}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${ge}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${ge}WordSpacing`])??0,color:(e==null?void 0:e[`${ge}Color`])??"#000000"}},K=M("text"),D=M("caption"),j=l.length>1&&l.some(ge=>{var ae,ne;return(((ae=ge.text)==null?void 0:ae.length)??0)>0||(((ne=ge.caption)==null?void 0:ne.length)??0)>0}),$=s.useRef(null),[v,w]=s.useState(0),[P,Q]=s.useState(0),z=e.controls??{mode:"Off",icon:null},T=l.length>1,O=s.useCallback((ge,ae)=>!T||ae===ge?ge:(B.current&&window.clearTimeout(B.current),U(ge),_(!0),B.current=window.setTimeout(()=>{U(null),_(!1),B.current=null},300),ae),[T]),E=s.useCallback(()=>{T&&H(ge=>O(ge,(ge-1+l.length)%l.length))},[T,O,l.length]),ee=s.useCallback(()=>{T&&H(ge=>O(ge,(ge+1)%l.length))},[T,O,l.length]);s.useEffect(()=>{if(!y||!T)return;const ge=Math.max(300,Ah/d),ae=window.setInterval(()=>{H(ne=>O(ne,(ne+1)%l.length))},ge);return()=>{window.clearInterval(ae)}},[y,T,O,l.length,d]),s.useEffect(()=>()=>{B.current&&window.clearTimeout(B.current)},[]);const V=(ge,ae)=>{var be,Me,q,se;const ne=ae==null?void 0:ae.textMinHeightPx,oe=ae==null?void 0:ae.captionMinHeightPx,ie=ae==null?void 0:ae.dataMeasureAttrs,Ae=o&&!(ae!=null&&ae.dataMeasureAttrs)&&!(ae!=null&&ae.hideControls);return a.jsxs(a.Fragment,{children:[ge.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"textMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(b??0,n??!1)}}),a.jsx("div",{...ie&&{"data-testimonial-measure":"text"},style:{...Ut(K,n),...ne&&ne>0?{minHeight:ne}:{},textAlign:N,pointerEvents:"auto"},children:a.jsx($i,{content:ge.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"imageMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:W.scalingValue(g??0,n??!1),height:W.scalingValue(m??0,n??!1)},children:((be=ge.image)==null?void 0:be.url)&&a.jsx("img",{src:(Me=ge.image)==null?void 0:Me.url,alt:((q=ge.image)==null?void 0:q.name)??"",className:`${r}-icon`,style:{objectFit:((se=ge.image)==null?void 0:se.objectFit)||"contain"}})})]}),ge.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:L,width:"100%"},children:[a.jsx("div",{"data-controls":Ae?"captionMarginTop":void 0,className:Ae?`${r}-control`:void 0,style:{height:W.scalingValue(x??0,n??!1)}}),a.jsx("div",{...ie?{"data-testimonial-measure":"caption"}:{},style:{...Ut(D,n),...oe&&oe>0?{minHeight:oe}:{},textAlign:N,pointerEvents:"auto"},children:a.jsx($i,{content:ge.caption})})]})]})},ue=s.useCallback(ge=>{w(ge.maxTextPx),Q(ge.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!j){ue({maxTextPx:0,maxCaptionPx:0});return}const ge=$.current;if(!ge)return;const ae=()=>{W.readTestimonialTextMeasure(ge,ue)};ae();const ne=new ResizeObserver(ae);return ne.observe(ge),()=>{ne.disconnect()}},[j,ue,t]),!k)return a.jsx(a.Fragment,{});const Ie=j?{textMinHeightPx:v,captionMinHeightPx:P}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:kh(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:W.scalingValue(u??0,n??!1),alignItems:L},children:[j&&a.jsx("div",{ref:$,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((ge,ae)=>a.jsx("div",{style:{width:"100%"},children:V(ge,{dataMeasureAttrs:!0})},ae))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[Z&&F&&a.jsx("div",{className:ut(`${r}-fade-item-prev`,`${r}-fade-out`),children:V(Z,{...Ie,hideControls:!0})}),a.jsx("div",{className:ut(`${r}-fade-item-current`,F?`${r}-fade-in`:void 0),children:V(k,Ie)})]})]}),z.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:W.scalingValue(h??.02,n??!1),height:W.scalingValue(h??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:E,disabled:!T,"aria-label":"Previous testimonial",children:z.icon&&a.jsx(sn,{url:z.icon,fill:f,hoverFill:C,className:ut(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:ut(`${r}-arrow`,`${r}-next-arrow`),style:{width:W.scalingValue(h??.02,n??!1),height:W.scalingValue(h??.02,n??!1),"--arrow-hover-color":C},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ee,disabled:!T,"aria-label":"Next testimonial",children:z.icon&&a.jsx(sn,{url:z.icon,fill:f,hoverFill:C,className:`${r}-arrow-img`})})})]})]})})},_h=`import cn from 'classnames';
|
|
4290
4290
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4291
4291
|
import { CommonComponentProps } from '../props';
|
|
4292
4292
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -5129,7 +5129,7 @@ type TestimonialsSettings = {
|
|
|
5129
5129
|
z-index: 2;
|
|
5130
5130
|
width: 100%;
|
|
5131
5131
|
}
|
|
5132
|
-
`}function Bh(){return Math.random()<.5?"ltr":"ttb"}function jh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function zh(e){const t=Bh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{jh(e)})})}const bn=500,Vh=750,Bn="cubic-bezier(0.22, 1, 0.36, 1)",Gh=72,qh=50;function Xh(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 Uh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Yh(e){const[t]=e.media;return t!=null&&t.url?t:null}function ud(e){return!Array.isArray(e)||e.length===0?[]:Xh(e)?e.flatMap(t=>{const n=Uh(t);if(!n)return[];const i=Yh(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 vi(e){return e.type==="video"}function Kh(e){const t=new Set,n=[];for(const i of e){const o=ud(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 Zh({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=>vi(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 Jh(e){e.pause(),e.removeAttribute("src"),e.load()}function ml({media:e,className:t,style:n,onMediaClick:i}){return vi(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 gl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Qh(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 ef({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Jh(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 tf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(null),S=s.useRef(0),U=s.useRef(null),F=s.useRef(!1),_=s.useRef(null),B=s.useRef(null),L=s.useRef(null),N=s.useRef(()=>{}),[k,Z]=s.useState(null),[E,K]=s.useState(null),[D,j]=s.useState("opening"),[$,v]=s.useState(0),[w,P]=s.useState(0),[Q,z]=s.useState(null),[T,O]=s.useState(!1),[M,ee]=s.useState(!1),[V,me]=s.useState(!1),[Ie,ge]=s.useState(null),ae=s.useRef(n),ne=s.useRef(void 0),oe=t[n],ie=oe?vi(oe):!1,Ae=w!==0||T,be=Q!==null,Me=s.useCallback(de=>{const ve=de.currentTarget,Ee=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!Ee.width||!Ee.height||ge(Ee)},[]);s.useEffect(()=>{H.current=E},[E]),s.useEffect(()=>{const de=b.current;if(!de)return;const ve=()=>K(gl(de));ve();const Ee=new ResizeObserver(ve);return Ee.observe(de),()=>Ee.disconnect()},[]);const q=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),se=s.useCallback(()=>{const de=B.current;B.current=null,q(),U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0,ee(!1),y.current=!1,f.current=0,C.current="none",de===1?d():de===-1&&l()},[q,d,l]),he=s.useCallback(()=>{q(),B.current=null,U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0},[q]),G=s.useCallback(()=>{q(),_.current=window.setTimeout(()=>{B.current!==null&&se()},bn+32)},[q,se]),re=s.useCallback((de,ve)=>{var Ge;const Ee=((Ge=H.current)==null?void 0:Ge.width)??0;if(q(),U.current=de,z(de),F.current=!0,O(!0),ve){B.current=de;const Ze=-de*Ee;S.current=Ze,P(Ze),G();return}S.current=0,P(0),_.current=window.setTimeout(()=>{_.current=null,he()},bn+32)},[q,he,G]),pe=s.useCallback(de=>{if(!(t.length<=1)){if(F.current){if(B.current===de){L.current=de,se();return}he()}q(),U.current=de,z(de),F.current=!1,O(!1),S.current=0,P(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(de,!0)})})}},[t.length,re,se,he,q]);N.current=pe;const we=s.useCallback(de=>{de.propertyName!=="transform"||!F.current||B.current!==null&&se()},[se]),Pe=s.useCallback(()=>{const de=x.current;if(!de)return;const ve=gl(de);!ve.width||!ve.height||Z(ve)},[]);s.useEffect(()=>{Pe();const de=x.current;if(!de)return;const ve=new ResizeObserver(()=>Pe());return ve.observe(de),()=>ve.disconnect()},[Pe]),s.useEffect(()=>{D==="opening"&&k&&j("open")},[D,k]),s.useEffect(()=>{if(D!=="closing")return;const de=setTimeout(()=>r(),bn);return()=>clearTimeout(de)},[D,r]),s.useEffect(()=>()=>{q()},[q]),s.useLayoutEffect(()=>{ae.current===n&&ne.current===(oe==null?void 0:oe.url)||(q(),B.current=null,z(null),v(0),P(0),O(!1),me(!1),ee(!1),ge(null),h.current=0,f.current=0,C.current="none",y.current=!1,F.current=!1,S.current=0,U.current=null,m.current=null,R.current=!1,ae.current=n,ne.current=oe==null?void 0:oe.url)},[n,oe==null?void 0:oe.url,q]),s.useLayoutEffect(()=>{const de=L.current;de!==null&&(L.current=null,requestAnimationFrame(()=>{N.current(de)}))},[n,oe==null?void 0:oe.url]),s.useEffect(()=>{if(D!=="open")return;let de=null;const ve=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},Ee=()=>{ve(),de=Je=>{Je.stopPropagation(),Je.preventDefault(),ve()},document.addEventListener("click",de,!0)},Ge=Je=>{const ke=Je<0?1:-1;if(Math.abs(Je)>qh&&t.length>1){re(ke,!0);return}re(ke,!1)},Ze=Je=>{if(Je.touches.length!==1||F.current)return;const ke=Je.touches[0];R.current=!0,m.current={x:ke.clientX,y:ke.clientY},C.current="none",f.current=0,y.current=!1},Ve=Je=>{if(!m.current||Je.touches.length!==1||F.current)return;const ke=Je.touches[0],qe=ke.clientX-m.current.x,We=ke.clientY-m.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(We)<10)return;if(Math.abs(qe)>Math.abs(We)){if(t.length<=1)return;C.current="horizontal"}else if(We>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,ee(!0),f.current=qe;const tt=qe<0?1:-1;U.current!==tt&&(U.current=tt,z(tt)),S.current=qe,P(qe),Je.preventDefault();return}C.current==="vertical"&&(y.current=!0,ee(!0),h.current=We,v(We),Je.preventDefault())},at=()=>{if(!m.current)return;const Je=C.current,ke=y.current;if(ke&&Je==="horizontal")Ge(f.current),Ee();else if(ke&&Je==="vertical")if(h.current>Gh){const We=window.innerHeight;h.current=We,me(!0),v(We),j("closing")}else h.current=0,v(0),Ee();else Je==="horizontal"&&Math.abs(f.current)>0&&(Ge(f.current),Ee());m.current=null,C.current="none",f.current=0,y.current=!1,ee(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",at),document.addEventListener("touchcancel",at),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",at),document.removeEventListener("touchcancel",at),ve()}},[D,t.length,re]),s.useEffect(()=>{const de=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),D!=="closing"&&j("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[D]);const Ce=()=>{D!=="closing"&&j("closing")},Y=D==="open",xe=D==="closing",ue=$>0?Math.max(0,1-$/500):1,X=$>0?Math.max(.35,1-$/500):1,le=k?p?k:Qh(k,Ie):null,Fe=de=>{if(de.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientY-ve.top,Ge=Math.min(52,ve.height*.2);if(!(Ee>ve.height-Ge)){if(de.clientX-ve.left<ve.width/2){pe(-1);return}pe(1)}},fe=de=>{if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientX-ve.left,Ge=de.clientY-ve.top,Ze=Math.min(52,ve.height*.2);if(Ge>ve.height-Ze){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=Ee<ve.width/2?"w-resize":"e-resize"},J={position:"fixed",top:E==null?void 0:E.top,left:E==null?void 0:E.left,width:E==null?void 0:E.width,height:E==null?void 0:E.height,zIndex:9998},Xe=p?"cover":"contain",Oe=w!==0||$>0?`translate(${w}px, ${$}px)`:void 0,dt=M&&!T?"none":T?`transform ${bn}ms ${Bn}`:V?`transform ${bn}ms ${Bn}, opacity ${bn}ms ${Bn}`:D==="opening"||xe?`opacity ${bn}ms ${Bn}`:"none",nt={...J,transform:Oe,opacity:$>0?X:D==="opening"||xe?0:1,transition:dt,pointerEvents:"none"},ht={position:"absolute",top:((le==null?void 0:le.top)??0)-((E==null?void 0:E.top)??0),left:((le==null?void 0:le.left)??0)-((E==null?void 0:E.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Xe,pointerEvents:ie&&Y&&!Ae?"auto":"none",touchAction:ie&&Y?"none":void 0},st=(E==null?void 0:E.width)??0,ze=be?(n+Q+t.length)%t.length:null,Se=ze!==null?t[ze]:null,_e={...J,transform:be?`translateX(${Q*st+w}px)`:void 0,opacity:1,transition:T?`transform ${bn}ms ${Bn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((E==null?void 0:E.top)??0),left:((k==null?void 0:k.left)??0)-((E==null?void 0:E.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Xe,pointerEvents:"none"},Ye=le?{position:"fixed",top:le.top,height:le.height,width:le.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Y?ue:0,transition:M?"none":`opacity ${bn}ms ${Bn}`,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:x,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:Y?1:0,transition:`opacity ${bn}ms ${Bn}`,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:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Y?1:0,transition:`opacity ${bn}ms ${Bn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&E&&Se&&a.jsx("div",{style:_e,onTransitionEnd:we,children:vi(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${ze}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${ze}-${Se.url}`)}),k&&E&&oe&&a.jsx("div",{style:nt,onTransitionEnd:we,children:ie?a.jsx(ef,{src:oe.url,phase:D,mediaRef:g,mediaStyle:ht,onLoadedMetadata:Me,onClick:Fe,onMouseMove:fe},`${n}-${oe.url}`):a.jsx("img",{ref:g,src:oe.url,alt:oe.name,onLoad:Me,style:ht},`${n}-${oe.url}`)}),Y&&Ye&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ye,left:le.left,cursor:"w-resize",pointerEvents:M?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),pe(-1)}}),a.jsx("div",{style:{...Ye,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:M?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),pe(1)}})]})]})}function nf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function of({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:x=100,verticalGap:g,entriesCount:m,lightbox:h,imageDisplay:f,imageCorners:C,lightboxImageDisplay:y,slider:R,sliderTiming:H,direction:S,transition:U,titleMarginTop:F,subtitleMarginTop:_,titleColor:B,subtitleColor:L,lightboxCounterColor:N,titleFontFamily:k,titleFontSettings:Z,titleFontSize:E,titleLineHeight:K,titleLetterSpacing:D,titleWordSpacing:j,titleTextAppearance:$,subtitleFontFamily:v,subtitleFontSettings:w,subtitleFontSize:P,subtitleLineHeight:Q,subtitleLetterSpacing:z,subtitleWordSpacing:T,subtitleTextAppearance:O,lightboxCounterFontFamily:M,lightboxCounterFontSettings:ee,lightboxCounterFontSize:V,lightboxCounterLineHeight:me,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:ge,lightboxCounterTextAppearance:ae,showText:ne="always",alignEntries:oe="off",align:ie="top"}=e,Ae={fontSettings:{fontFamily:k,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:E??.01,lineHeight:K,letterSpacing:D??0,wordSpacing:j??0,textAppearance:$,color:B},Me={...an(Ut(Ae,n))},q={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:P??.01,lineHeight:Q,letterSpacing:z??0,wordSpacing:T??0,textAppearance:O,color:L},he={...an(Ut(q,n))},G={fontSettings:{fontFamily:M,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:V??.01,lineHeight:me,letterSpacing:Ie??0,wordSpacing:ge??0,textAppearance:ae,color:N},pe={...an(Ut(G,n)),...ga(V,me,u,n)},we=ma(E,K,`${u}-item-title`,`${u}-text-tight-leading`),Pe=ma(P,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=ga(E,K,u,n),Y=ga(P,Q,u,n),xe=ma(V,me,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ue=W.buildColorVars(u,{titleColor:B,subtitleColor:L,lightboxCounterColor:N},rf,af),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${ne==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),fe=m===0?1/0:m,J=(t??[]).slice(0,fe),Xe=s.useMemo(()=>h==="on"?Kh(J):[],[J,h]),Oe=b.entryWidth??.2,dt=(f==null?void 0:f.display)==="cover",nt=(f==null?void 0:f.ratioValue)??"1:1",ht=(f==null?void 0:f.reversed)??!1,[st,ze]=nt.split(":").map(Number),Be=`${ht?ze:st} / ${ht?st:ze}`,Ye=b.columnsCount,de=W.scalingValue(Oe??0,n),ve=de,Ee=!dt&&R!=="off",Ge=J.length%Ye||Ye,Ze=Ge<Ye&&J.length>0,Ve=J.length-Ge,at=Ze?Math.floor((Ye-Ge)/2)+1:1,Je=C?W.scalingValue(C,n):void 0,ke={width:ve,...dt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Ee?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",tt=oe==="on",rt=`calc(${W.scalingValue(Oe??0,n)} * (${x} / 100))`,lt=W.scalingValue(Oe*x/100,n),Tt=dt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Je?{borderRadius:Je}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Je?{borderRadius:Je}:{}},[Xt,Zt]=s.useState(0),xt=s.useRef(null),wt=U==="fade"||S==="horizontal"?"ltr":S==="vertical"?"ttb":"ltr";s.useEffect(()=>{const mt=xt.current;if(!mt)return;const Le=new ResizeObserver(De=>{Zt(Math.round(De[0].contentRect.width))});return Le.observe(mt),()=>Le.disconnect()},[]);const Bt=(()=>{const mt={...ue},Le=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(mt["--cntrl-article-width"]=Le),mt})(),[At,vt]=s.useState(!1),[Ft,Wt]=s.useState([]),[Yt,Jt]=s.useState(0),Ct=h==="on"&&(!n||i),Nt=(mt,Le)=>{n&&!i||h!=="off"&&(Wt(mt),Jt(Le),vt(!0))};s.useEffect(()=>{if(!At||h!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,h]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const rn=s.useMemo(()=>Dh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),h==="on"&&a.jsx(Zh,{mediaList:Xe}),a.jsx("div",{style:ue,children:a.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${ie} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${Ye}, ${de})`,rowGap:tt?0:W.scalingValue(g??0,n),columnGap:W.scalingValue(b.horizontalGap??0,n),width:W.scalingValue(b.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(g??0,n)}:{}},children:J.map((mt,Le)=>{var _t;const De=pl(mt.title),it=pl(mt.subtitle),gt=(((_t=mt.link)==null?void 0:_t.length)??0)>0&&h==="off"?mt.link:void 0,ft=Math.floor(Le/Ye)===Math.ceil(J.length/Ye)-1,It=Ze&&Le>=Ve?`${at+(Le-Ve)}`:void 0,pt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,jt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),We&&De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),We&&it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,Mt=gt?a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[jt,kt]}):a.jsxs(a.Fragment,{children:[jt,kt]}),Vt=ud(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Ht=a.jsx("div",{className:qe,style:ke,children:Vt.length===0?null:R==="off"?(()=>{const{displayMedia:St,lightboxMedia:A}=Vt[0],$e=A?Gt.findIndex(Re=>Re.url===A.url):-1;return a.jsx(ml,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&$e>=0?()=>Nt(Gt,$e):void 0})})():a.jsxs(a.Fragment,{children:[Ee&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>vi(St)?a.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):a.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),a.jsx(Ls,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:Vh,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{S!=="random"||U==="fade"||zh(St)},children:Vt.map(({displayMedia:St,lightboxMedia:A},$e)=>{const Re=A?Gt.findIndex(Ne=>Ne.url===A.url):-1;return a.jsx(Rs,{children:a.jsx(ml,{media:St,className:`${u}-item-${vi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&Re>=0?()=>Nt(Gt,Re):void 0})},$e)})},`${U}-${Oe}-${S}-${H}-${Xt}-${d}`)]})}),Ot=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!tt?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${de} * (${x} / 100))`:de,...It&&tt?{gridColumn:It}:{}},children:tt?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):gt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[pt,Ht]}),!We&&a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):a.jsxs(a.Fragment,{children:[pt,Ht,Ot]})})},Le)})})}),(!n||i)&&At&&typeof document<"u"&&h==="on"&&(()=>{const mt=(c?document.getElementById(c):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(tf,{prefix:u,items:Ft,index:Yt,imageDisplay:nf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Le=>(Le-1+Ft.length)%Ft.length),onNext:()=>Jt(Le=>(Le+1)%Ft.length),counterClassName:xe,counterStyle:pe})}),mt)})()]})}const rf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},af=["hover","focus","filled","success","error"],sf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5132
|
+
`}function Bh(){return Math.random()<.5?"ltr":"ttb"}function jh(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function zh(e){const t=Bh();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{jh(e)})})}const bn=500,Vh=750,Bn="cubic-bezier(0.22, 1, 0.36, 1)",Gh=72,qh=50;function Xh(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 Uh(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Yh(e){const[t]=e.media;return t!=null&&t.url?t:null}function ud(e){return!Array.isArray(e)||e.length===0?[]:Xh(e)?e.flatMap(t=>{const n=Uh(t);if(!n)return[];const i=Yh(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 bi(e){return e.type==="video"}function Kh(e){const t=new Set,n=[];for(const i of e){const o=ud(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 Zh({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=>bi(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 Jh(e){e.pause(),e.removeAttribute("src"),e.load()}function ml({media:e,className:t,style:n,onMediaClick:i}){return bi(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 gl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Qh(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 ef({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Jh(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 tf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(null),S=s.useRef(0),U=s.useRef(null),F=s.useRef(!1),_=s.useRef(null),B=s.useRef(null),L=s.useRef(null),N=s.useRef(()=>{}),[k,Z]=s.useState(null),[M,K]=s.useState(null),[D,j]=s.useState("opening"),[$,v]=s.useState(0),[w,P]=s.useState(0),[Q,z]=s.useState(null),[T,O]=s.useState(!1),[E,ee]=s.useState(!1),[V,ue]=s.useState(!1),[Ie,ge]=s.useState(null),ae=s.useRef(n),ne=s.useRef(void 0),oe=t[n],ie=oe?bi(oe):!1,Ae=w!==0||T,be=Q!==null,Me=s.useCallback(de=>{const ve=de.currentTarget,Ee=ve instanceof HTMLVideoElement?{width:ve.videoWidth,height:ve.videoHeight}:{width:ve.naturalWidth,height:ve.naturalHeight};!Ee.width||!Ee.height||ge(Ee)},[]);s.useEffect(()=>{H.current=M},[M]),s.useEffect(()=>{const de=b.current;if(!de)return;const ve=()=>K(gl(de));ve();const Ee=new ResizeObserver(ve);return Ee.observe(de),()=>Ee.disconnect()},[]);const q=s.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),se=s.useCallback(()=>{const de=B.current;B.current=null,q(),U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0,ee(!1),y.current=!1,f.current=0,C.current="none",de===1?d():de===-1&&l()},[q,d,l]),he=s.useCallback(()=>{q(),B.current=null,U.current=null,F.current=!1,z(null),O(!1),P(0),S.current=0},[q]),G=s.useCallback(()=>{q(),_.current=window.setTimeout(()=>{B.current!==null&&se()},bn+32)},[q,se]),re=s.useCallback((de,ve)=>{var Ge;const Ee=((Ge=H.current)==null?void 0:Ge.width)??0;if(q(),U.current=de,z(de),F.current=!0,O(!0),ve){B.current=de;const Ze=-de*Ee;S.current=Ze,P(Ze),G();return}S.current=0,P(0),_.current=window.setTimeout(()=>{_.current=null,he()},bn+32)},[q,he,G]),me=s.useCallback(de=>{if(!(t.length<=1)){if(F.current){if(B.current===de){L.current=de,se();return}he()}q(),U.current=de,z(de),F.current=!1,O(!1),S.current=0,P(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(de,!0)})})}},[t.length,re,se,he,q]);N.current=me;const we=s.useCallback(de=>{de.propertyName!=="transform"||!F.current||B.current!==null&&se()},[se]),Pe=s.useCallback(()=>{const de=x.current;if(!de)return;const ve=gl(de);!ve.width||!ve.height||Z(ve)},[]);s.useEffect(()=>{Pe();const de=x.current;if(!de)return;const ve=new ResizeObserver(()=>Pe());return ve.observe(de),()=>ve.disconnect()},[Pe]),s.useEffect(()=>{D==="opening"&&k&&j("open")},[D,k]),s.useEffect(()=>{if(D!=="closing")return;const de=setTimeout(()=>r(),bn);return()=>clearTimeout(de)},[D,r]),s.useEffect(()=>()=>{q()},[q]),s.useLayoutEffect(()=>{ae.current===n&&ne.current===(oe==null?void 0:oe.url)||(q(),B.current=null,z(null),v(0),P(0),O(!1),ue(!1),ee(!1),ge(null),h.current=0,f.current=0,C.current="none",y.current=!1,F.current=!1,S.current=0,U.current=null,m.current=null,R.current=!1,ae.current=n,ne.current=oe==null?void 0:oe.url)},[n,oe==null?void 0:oe.url,q]),s.useLayoutEffect(()=>{const de=L.current;de!==null&&(L.current=null,requestAnimationFrame(()=>{N.current(de)}))},[n,oe==null?void 0:oe.url]),s.useEffect(()=>{if(D!=="open")return;let de=null;const ve=()=>{de&&(document.removeEventListener("click",de,!0),de=null)},Ee=()=>{ve(),de=Je=>{Je.stopPropagation(),Je.preventDefault(),ve()},document.addEventListener("click",de,!0)},Ge=Je=>{const ke=Je<0?1:-1;if(Math.abs(Je)>qh&&t.length>1){re(ke,!0);return}re(ke,!1)},Ze=Je=>{if(Je.touches.length!==1||F.current)return;const ke=Je.touches[0];R.current=!0,m.current={x:ke.clientX,y:ke.clientY},C.current="none",f.current=0,y.current=!1},Ve=Je=>{if(!m.current||Je.touches.length!==1||F.current)return;const ke=Je.touches[0],qe=ke.clientX-m.current.x,We=ke.clientY-m.current.y;if(C.current==="none"){if(Math.abs(qe)<10&&Math.abs(We)<10)return;if(Math.abs(qe)>Math.abs(We)){if(t.length<=1)return;C.current="horizontal"}else if(We>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,ee(!0),f.current=qe;const tt=qe<0?1:-1;U.current!==tt&&(U.current=tt,z(tt)),S.current=qe,P(qe),Je.preventDefault();return}C.current==="vertical"&&(y.current=!0,ee(!0),h.current=We,v(We),Je.preventDefault())},at=()=>{if(!m.current)return;const Je=C.current,ke=y.current;if(ke&&Je==="horizontal")Ge(f.current),Ee();else if(ke&&Je==="vertical")if(h.current>Gh){const We=window.innerHeight;h.current=We,ue(!0),v(We),j("closing")}else h.current=0,v(0),Ee();else Je==="horizontal"&&Math.abs(f.current)>0&&(Ge(f.current),Ee());m.current=null,C.current="none",f.current=0,y.current=!1,ee(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ve,{passive:!1}),document.addEventListener("touchend",at),document.addEventListener("touchcancel",at),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ve),document.removeEventListener("touchend",at),document.removeEventListener("touchcancel",at),ve()}},[D,t.length,re]),s.useEffect(()=>{const de=ve=>{ve.key==="Escape"&&(ve.preventDefault(),ve.stopPropagation(),D!=="closing"&&j("closing"))};return window.addEventListener("keydown",de,!0),()=>window.removeEventListener("keydown",de,!0)},[D]);const Ce=()=>{D!=="closing"&&j("closing")},Y=D==="open",xe=D==="closing",pe=$>0?Math.max(0,1-$/500):1,X=$>0?Math.max(.35,1-$/500):1,le=k?p?k:Qh(k,Ie):null,Fe=de=>{if(de.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientY-ve.top,Ge=Math.min(52,ve.height*.2);if(!(Ee>ve.height-Ge)){if(de.clientX-ve.left<ve.width/2){me(-1);return}me(1)}},fe=de=>{if(t.length<=1)return;const ve=le??de.currentTarget.getBoundingClientRect(),Ee=de.clientX-ve.left,Ge=de.clientY-ve.top,Ze=Math.min(52,ve.height*.2);if(Ge>ve.height-Ze){de.currentTarget.style.cursor="default";return}de.currentTarget.style.cursor=Ee<ve.width/2?"w-resize":"e-resize"},J={position:"fixed",top:M==null?void 0:M.top,left:M==null?void 0:M.left,width:M==null?void 0:M.width,height:M==null?void 0:M.height,zIndex:9998},Xe=p?"cover":"contain",Oe=w!==0||$>0?`translate(${w}px, ${$}px)`:void 0,dt=E&&!T?"none":T?`transform ${bn}ms ${Bn}`:V?`transform ${bn}ms ${Bn}, opacity ${bn}ms ${Bn}`:D==="opening"||xe?`opacity ${bn}ms ${Bn}`:"none",nt={...J,transform:Oe,opacity:$>0?X:D==="opening"||xe?0:1,transition:dt,pointerEvents:"none"},ht={position:"absolute",top:((le==null?void 0:le.top)??0)-((M==null?void 0:M.top)??0),left:((le==null?void 0:le.left)??0)-((M==null?void 0:M.left)??0),width:le==null?void 0:le.width,height:le==null?void 0:le.height,objectFit:Xe,pointerEvents:ie&&Y&&!Ae?"auto":"none",touchAction:ie&&Y?"none":void 0},st=(M==null?void 0:M.width)??0,ze=be?(n+Q+t.length)%t.length:null,Se=ze!==null?t[ze]:null,_e={...J,transform:be?`translateX(${Q*st+w}px)`:void 0,opacity:1,transition:T?`transform ${bn}ms ${Bn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((M==null?void 0:M.top)??0),left:((k==null?void 0:k.left)??0)-((M==null?void 0:M.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Xe,pointerEvents:"none"},Ye=le?{position:"fixed",top:le.top,height:le.height,width:le.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:D==="open"?"none":void 0},onClick:Ce,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:Y?pe:0,transition:E?"none":`opacity ${bn}ms ${Bn}`,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:x,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:Y?1:0,transition:`opacity ${bn}ms ${Bn}`,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:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:Y?1:0,transition:`opacity ${bn}ms ${Bn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&M&&Se&&a.jsx("div",{style:_e,onTransitionEnd:we,children:bi(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${ze}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${ze}-${Se.url}`)}),k&&M&&oe&&a.jsx("div",{style:nt,onTransitionEnd:we,children:ie?a.jsx(ef,{src:oe.url,phase:D,mediaRef:g,mediaStyle:ht,onLoadedMetadata:Me,onClick:Fe,onMouseMove:fe},`${n}-${oe.url}`):a.jsx("img",{ref:g,src:oe.url,alt:oe.name,onLoad:Me,style:ht},`${n}-${oe.url}`)}),Y&&Ye&&t.length>1&&!ie&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ye,left:le.left,cursor:"w-resize",pointerEvents:E?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),me(-1)}}),a.jsx("div",{style:{...Ye,left:le.left+le.width/2,cursor:"e-resize",pointerEvents:E?"none":"auto"},onClick:de=>{if(R.current){R.current=!1;return}de.stopPropagation(),me(1)}})]})]})}function nf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function of({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=W.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:x=100,verticalGap:g,entriesCount:m,lightbox:h,imageDisplay:f,imageCorners:C,lightboxImageDisplay:y,slider:R,sliderTiming:H,direction:S,transition:U,titleMarginTop:F,subtitleMarginTop:_,titleColor:B,subtitleColor:L,lightboxCounterColor:N,titleFontFamily:k,titleFontSettings:Z,titleFontSize:M,titleLineHeight:K,titleLetterSpacing:D,titleWordSpacing:j,titleTextAppearance:$,subtitleFontFamily:v,subtitleFontSettings:w,subtitleFontSize:P,subtitleLineHeight:Q,subtitleLetterSpacing:z,subtitleWordSpacing:T,subtitleTextAppearance:O,lightboxCounterFontFamily:E,lightboxCounterFontSettings:ee,lightboxCounterFontSize:V,lightboxCounterLineHeight:ue,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:ge,lightboxCounterTextAppearance:ae,showText:ne="always",alignEntries:oe="off",align:ie="top"}=e,Ae={fontSettings:{fontFamily:k,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:M??.01,lineHeight:K,letterSpacing:D??0,wordSpacing:j??0,textAppearance:$,color:B},Me={...an(Ut(Ae,n))},q={fontSettings:{fontFamily:v,fontWeight:(w==null?void 0:w.fontWeight)??400,fontStyle:(w==null?void 0:w.fontStyle)??"normal"},fontSize:P??.01,lineHeight:Q,letterSpacing:z??0,wordSpacing:T??0,textAppearance:O,color:L},he={...an(Ut(q,n))},G={fontSettings:{fontFamily:E,fontWeight:(ee==null?void 0:ee.fontWeight)??400,fontStyle:(ee==null?void 0:ee.fontStyle)??"normal"},fontSize:V??.01,lineHeight:ue,letterSpacing:Ie??0,wordSpacing:ge??0,textAppearance:ae,color:N},me={...an(Ut(G,n)),...ga(V,ue,u,n)},we=ma(M,K,`${u}-item-title`,`${u}-text-tight-leading`),Pe=ma(P,Q,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=ga(M,K,u,n),Y=ga(P,Q,u,n),xe=ma(V,ue,`${u}-lightbox-counter`,`${u}-text-tight-leading`),pe=W.buildColorVars(u,{titleColor:B,subtitleColor:L,lightboxCounterColor:N},rf,af),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${ne==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),fe=m===0?1/0:m,J=(t??[]).slice(0,fe),Xe=s.useMemo(()=>h==="on"?Kh(J):[],[J,h]),Oe=b.entryWidth??.2,dt=(f==null?void 0:f.display)==="cover",nt=(f==null?void 0:f.ratioValue)??"1:1",ht=(f==null?void 0:f.reversed)??!1,[st,ze]=nt.split(":").map(Number),Be=`${ht?ze:st} / ${ht?st:ze}`,Ye=b.columnsCount,de=W.scalingValue(Oe??0,n),ve=de,Ee=!dt&&R!=="off",Ge=J.length%Ye||Ye,Ze=Ge<Ye&&J.length>0,Ve=J.length-Ge,at=Ze?Math.floor((Ye-Ge)/2)+1:1,Je=C?W.scalingValue(C,n):void 0,ke={width:ve,...dt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Je?{borderRadius:Je,overflow:"hidden"}:{}},qe=`${u}-item-image-wrapper${Ee?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),We=p==="d"||p==="e"||p==="f",tt=oe==="on",rt=`calc(${W.scalingValue(Oe??0,n)} * (${x} / 100))`,lt=W.scalingValue(Oe*x/100,n),Tt=dt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Je?{borderRadius:Je}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Je?{borderRadius:Je}:{}},[Xt,Zt]=s.useState(0),xt=s.useRef(null),wt=U==="fade"||S==="horizontal"?"ltr":S==="vertical"?"ttb":"ltr";s.useEffect(()=>{const mt=xt.current;if(!mt)return;const Le=new ResizeObserver(De=>{Zt(Math.round(De[0].contentRect.width))});return Le.observe(mt),()=>Le.disconnect()},[]);const Bt=(()=>{const mt={...pe},Le=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(mt["--cntrl-article-width"]=Le),mt})(),[At,vt]=s.useState(!1),[Ft,Wt]=s.useState([]),[Yt,Jt]=s.useState(0),Ct=h==="on"&&(!n||i),Nt=(mt,Le)=>{n&&!i||h!=="off"&&(Wt(mt),Jt(Le),vt(!0))};s.useEffect(()=>{if(!At||h!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,h]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const rn=s.useMemo(()=>Dh(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:rn}}),h==="on"&&a.jsx(Zh,{mediaList:Xe}),a.jsx("div",{style:pe,children:a.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${ie} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${Ye}, ${de})`,rowGap:tt?0:W.scalingValue(g??0,n),columnGap:W.scalingValue(b.horizontalGap??0,n),width:W.scalingValue(b.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:W.scalingValue(g??0,n)}:{}},children:J.map((mt,Le)=>{var _t;const De=pl(mt.title),it=pl(mt.subtitle),gt=(((_t=mt.link)==null?void 0:_t.length)??0)>0&&h==="off"?mt.link:void 0,ft=Math.floor(Le/Ye)===Math.ceil(J.length/Ye)-1,It=Ze&&Le>=Ve?`${at+(Le-Ve)}`:void 0,pt=We?a.jsxs("div",{className:`${u}-item-text-block`,children:[De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,jt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!We&&a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),De&&a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),We&&De&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(F??0,n),width:lt}})]}):null,kt=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!We&&a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),it&&a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle}),We&&it&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:W.scalingValue(_??0,n),width:lt}})]}):null,Mt=gt?a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[jt,kt]}):a.jsxs(a.Fragment,{children:[jt,kt]}),Vt=ud(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Ht=a.jsx("div",{className:qe,style:ke,children:Vt.length===0?null:R==="off"?(()=>{const{displayMedia:St,lightboxMedia:A}=Vt[0],$e=A?Gt.findIndex(Re=>Re.url===A.url):-1;return a.jsx(ml,{media:St,className:`${u}-item-${bi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&$e>=0?()=>Nt(Gt,$e):void 0})})():a.jsxs(a.Fragment,{children:[Ee&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>bi(St)?a.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):a.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),a.jsx(Ls,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:Vh,type:U==="fade"?"fade":"loop",rewind:U==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:wt},onMoved:St=>{S!=="random"||U==="fade"||zh(St)},children:Vt.map(({displayMedia:St,lightboxMedia:A},$e)=>{const Re=A?Gt.findIndex(Ne=>Ne.url===A.url):-1;return a.jsx(Rs,{children:a.jsx(ml,{media:St,className:`${u}-item-${bi(St)?"video":"image"}`.trim(),style:Tt,onMediaClick:Ct&&Re>=0?()=>Nt(Gt,Re):void 0})},$e)})},`${U}-${Oe}-${S}-${H}-${Xt}-${d}`)]})}),Ot=We?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&De?"titleMarginTop":void 0,className:o&&De?`${u}-control`:void 0,style:{height:De?W.scalingValue(F??0,n):0,width:lt}}),a.jsx("p",{className:we,style:{width:rt,...Me,...Ce},children:mt.title}),a.jsx("div",{"data-controls":o&&it?"subtitleMarginTop":void 0,className:o&&it?`${u}-control`:void 0,style:{height:it?W.scalingValue(_??0,n):0,width:lt}}),a.jsx("p",{className:Pe,style:{width:rt,...he,...Y},children:mt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!tt?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${de} * (${x} / 100))`:de,...It&&tt?{gridColumn:It}:{}},children:tt?a.jsx(a.Fragment,{children:We?a.jsxs(a.Fragment,{children:[Mt,a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Mt]})}):gt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[pt,Ht]}),!We&&a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:Ot})]}):a.jsxs(a.Fragment,{children:[pt,Ht,Ot]})})},Le)})})}),(!n||i)&&At&&typeof document<"u"&&h==="on"&&(()=>{const mt=(c?document.getElementById(c):null)??document.body;return Dn.createPortal(a.jsx("div",{style:Bt,"data-selection":"none",children:a.jsx(tf,{prefix:u,items:Ft,index:Yt,imageDisplay:nf(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Jt(Le=>(Le-1+Ft.length)%Ft.length),onNext:()=>Jt(Le=>(Le+1)%Ft.length),counterClassName:xe,counterStyle:me})}),mt)})()]})}const rf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},af=["hover","focus","filled","success","error"],sf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5133
5133
|
import '@splidejs/react-splide/css/core';
|
|
5134
5134
|
import { CommonComponentProps } from '../props';
|
|
5135
5135
|
import {
|
|
@@ -7182,7 +7182,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7182
7182
|
};
|
|
7183
7183
|
|
|
7184
7184
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7185
|
-
`,ha={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lf=["titleColor","subtitleColor","lightboxCounterColor"],cf={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:{...ha.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:{...ha.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:{...ha.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:[...lf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},df={element:of,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:cf,sourceCode:sf},uf=50,hl=10,Is="cntrl-lightbox-journal",Kr=Is,Ka=`${Is}-`,Zr=e=>`${Is}-${e}`,Ps=e=>e===Kr||e.startsWith(Ka),fl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},yl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=fl(t.get(Zr(e)));if(i)return i}const n=fl(t.get(Kr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ka))continue;const o=i.slice(Ka.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},vl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},pd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ps(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zr(t),String(e)):i.searchParams.set(Kr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},pf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Zr(e)||i===Kr:Ps(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)}},md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zr(e)):[...t.keys()].some(n=>Ps(n))},mf=(e,t)=>{if(md(t)){if(e){window.history.back();return}pf(t)}},gf=20,hf=2,fa=e=>`max(${e}, ${gf}px)`,Gi=e=>((e==null?void 0:e.image)??[]).slice(0,hf),gd=e=>e.reduce((t,n)=>t+Gi(n).length,0),ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Gi(r).length,1),i=Gi(e[t]).length;return{start:n,end:n+i-1}},yf=(e,t)=>{const n=gd(e),{start:i,end:o}=ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Sr=(e,t)=>t==="B"?e.flatMap((n,i)=>Gi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Gi(n)})),vf=(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 yf(i,o)},xl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",xf=(e,t,n)=>e==="B"?t.length>1:gd(n)>1,fn=.004,Xn=.004,Di={title1Width:.13,title2Width:.13,title3Width:.14},Un=(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},qi=(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},Mo=(e,t)=>qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Yn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:qi(e.length,n),effective:Mo(e.length,n)}},hd=(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),fd=(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),Jn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Es={title1:"1",title2:"2",title3:"3",count:"Count"},Ms=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],bf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Jn.map(e=>[Es[e],Ms(e)]))}),wf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Sf={title1:.02,title2:.02,title3:.02,count:.017},hi=(e,t)=>{const n=i=>{const o=et(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[wf[t]]}},fi=(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??Sf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function yd({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:b=0,title3MarginLeft:x=0,titleRowMarginBottom:g=0,titleHeaderLayout:m="desktop",contentMarginTop:h=0,iconMarginRight:f=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:R="#000000",closeIconHoverColor:H="#cccccc"}=n,S=W.scalingValue(h,i),U=W.scalingValue(f,i),F=W.scalingValue(g,i),_=m==="mobile",B=fi("title1",hi(n,"title1"),i),L=fi("title2",hi(n,"title2"),i),N=fi("title3",hi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Di.title1Width,title2Width:c??Di.title2Width,title3Width:u??Di.title3Width}),[d,c,u]),Z=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:x}),[b,x]),E=s.useMemo(()=>Un(e,t,B,L,N),[e,t,B,L,N]),K=s.useMemo(()=>E.map(X=>k[X.widthKey]),[E,k]),D=s.useMemo(()=>qi(E.length,K),[E.length,K]),j=s.useMemo(()=>Mo(E.length,K),[E.length,K]),$=s.useMemo(()=>E.filter(X=>X.prefix==="title1"),[E]),v=s.useMemo(()=>E.filter(X=>X.prefix==="title2"||X.prefix==="title3"),[E]),w=s.useMemo(()=>Yn($,k),[$,k]),P=s.useMemo(()=>Yn(v,k),[v,k]),Q=!!(t.title1||t.title2||t.title3),z=C!==null;if(!(Q||z))return null;const O=(p??0)>0||o,M=(X,le)=>{const Fe=E.findIndex(J=>J.prefix===X.prefix);if(!_||le==="single-row")return{effectiveWidth:j[Fe]??0,resolvedWidth:D[Fe]??0,maxWidth:cn(Fe,D)};if(le==="two-row-top"){const J=$.findIndex(Xe=>Xe.prefix===X.prefix);return{effectiveWidth:w.effective[J]??0,resolvedWidth:w.resolved[J]??0,maxWidth:cn(J,w.resolved)}}const fe=v.findIndex(J=>J.prefix===X.prefix);return{effectiveWidth:P.effective[fe]??0,resolvedWidth:P.resolved[fe]??0,maxWidth:cn(fe,P.resolved)}},ee=(X,le,Fe)=>{if(!_||Fe==="single-row"){const dt=X.findIndex(ze=>ze.prefix===le.prefix),nt=X.map(ze=>k[ze.widthKey]),ht=qi(X.length,nt);return{effectiveWidth:Mo(X.length,nt)[dt]??0,resolvedWidth:ht[dt]??0,maxWidth:cn(dt,ht)}}if(Fe==="two-row-top"){const dt=X.filter(ze=>ze.prefix==="title1"),nt=dt.findIndex(ze=>ze.prefix===le.prefix),{resolved:ht,effective:st}=Yn(dt,k);return{effectiveWidth:st[nt]??0,resolvedWidth:ht[nt]??0,maxWidth:cn(nt,ht)}}const fe=X.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),J=fe.findIndex(dt=>dt.prefix===le.prefix),{resolved:Xe,effective:Oe}=Yn(fe,k);return{effectiveWidth:Oe[J]??0,resolvedWidth:Xe[J]??0,maxWidth:cn(J,Xe)}},V=X=>fd(E,D,Z,X)+(_?0:p??0),me=()=>_?0:p??0,Ie=X=>v.slice(0,X).reduce((le,Fe,fe)=>le+(Fe.marginLeftKey?Z[Fe.marginLeftKey]??0:0)+(P.resolved[fe]??0),0),ge=X=>{const le=v[X];return Ie(X)+(le.marginLeftKey?Z[le.marginLeftKey]??0:0)+(P.resolved[X]??0)},ae=(X,le,Fe)=>{const fe=X.marginLeftKey?Z[X.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Xe,maxWidth:Oe}=Fe??M(X,le),dt=Math.max(fe,Xn),nt=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":X.prefix,style:{width:W.scalingValue(J,i),...fe>0?{marginLeft:W.scalingValue(fe,i)}:{}},children:[a.jsx("p",{className:X.className,style:X.style,children:X.text}),nt&&X.marginLeftKey?a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(-fe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}}):null,nt?a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},X.className)},ne=(X="two-row")=>{const le=E.findIndex(J=>J.prefix==="title1"),Fe=le>=0?D[le]:k.title1Width,fe=X==="two-row"&&o;return a.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},oe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),ie=X=>{const le=Un(e,X,B,L,N);return a.jsx(a.Fragment,{children:le.map(Fe=>ae(Fe,"single-row",ee(le,Fe,"single-row")))})},Ae=X=>{const le=Un(e,X,B,L,N),Fe=le.find(fe=>fe.prefix==="title1");return Fe?ae(Fe,"two-row-top",ee(le,Fe,"two-row-top")):null},be=(X,le=!1)=>{const Fe=Un(e,X,B,L,N),fe=Fe.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),J=o&≤return fe.length>0||J||(g??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[fe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:fe.map(Oe=>ae(Oe,"two-row-bottom",ee(Fe,Oe,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(g??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:F,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:X=>{X.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:R,hoverFill:i&&!r?R:H,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:U,height:"100%",pointerEvents:"auto"}})]}),q=()=>z?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,se=X=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:X})}),he=X=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[z||Q?oe():null,O?ne("two-row"):null,se(X),q()]}),G=(X,le=!1)=>a.jsxs(a.Fragment,{children:[he(Ae(X)),be(X,le)]}),re=()=>{const X=_?-1:E.findIndex(fe=>fe.prefix==="title1"),le=!_&&(o||(p??0)>0)?(()=>{const fe=p??0,J=X>=0?D[X]:k.title1Width,Xe=Math.max(fe,Xn);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:W.scalingValue(Xe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=E.flatMap((fe,J)=>{if(!fe.marginLeftKey)return[];const Xe=Z[fe.marginLeftKey]??0,Oe=hd(E,D,Z,J)+me(),dt=Math.max(Xe,Xn);return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[J]),style:{position:"absolute",top:0,left:W.scalingValue(Oe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return le?[le,...Fe]:Fe},pe=()=>E.map((X,le)=>{const Fe=cn(le,D),J=V(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),we=()=>v.flatMap((X,le)=>{if(!X.marginLeftKey)return[];const Fe=Z[X.marginLeftKey]??0,fe=Ie(le),J=Math.max(Fe,Xn),{resolvedWidth:Xe}=M(X,"two-row-bottom");return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(fe,i),width:W.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)}),Pe=()=>v.map((X,le)=>{const{maxWidth:Fe}=M(X,"two-row-bottom"),J=ge(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),Ce=()=>!o||_?null:a.jsxs(a.Fragment,{children:[re(),pe()]}),Y=!!(t.title2||t.title3||(g??0)>0||o),xe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[z||Q?oe():null,O?ne("single-row"):null,Q?se(ie(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),q(),Ce()]}),ue=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Y?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Y?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),Ce()]});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:S,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",..._?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${_?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${_?` ${e}-text-bar-cell-stacked`:""}`,style:_?void 0:{flex:1,minWidth:0,width:"100%"},children:_?ue():xe()})})})]})}function $f(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cf(e){return`
|
|
7185
|
+
`,ha={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},lf=["titleColor","subtitleColor","lightboxCounterColor"],cf={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:{...ha.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:{...ha.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:{...ha.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:[...lf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},df={element:of,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:cf,sourceCode:sf},uf=50,hl=10,Is="cntrl-lightbox-journal",Kr=Is,Ka=`${Is}-`,Zr=e=>`${Is}-${e}`,Ps=e=>e===Kr||e.startsWith(Ka),fl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},yl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=fl(t.get(Zr(e)));if(i)return i}const n=fl(t.get(Kr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ka))continue;const o=i.slice(Ka.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},vl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},pd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ps(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Zr(t),String(e)):i.searchParams.set(Kr,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},pf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Zr(e)||i===Kr:Ps(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)}},md=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Zr(e)):[...t.keys()].some(n=>Ps(n))},mf=(e,t)=>{if(md(t)){if(e){window.history.back();return}pf(t)}},gf=20,hf=2,fa=e=>`max(${e}, ${gf}px)`,Gi=e=>((e==null?void 0:e.image)??[]).slice(0,hf),gd=e=>e.reduce((t,n)=>t+Gi(n).length,0),ff=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Gi(r).length,1),i=Gi(e[t]).length;return{start:n,end:n+i-1}},yf=(e,t)=>{const n=gd(e),{start:i,end:o}=ff(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Sr=(e,t)=>t==="B"?e.flatMap((n,i)=>Gi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Gi(n)})),vf=(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 yf(i,o)},xl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",xf=(e,t,n)=>e==="B"?t.length>1:gd(n)>1,fn=.004,Xn=.004,Di={title1Width:.13,title2Width:.13,title3Width:.14},Un=(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},qi=(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},Mo=(e,t)=>qi(e,t),cn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Yn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:qi(e.length,n),effective:Mo(e.length,n)}},hd=(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),fd=(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),Qn=["title1","title2","title3","count"],et=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Es={title1:"1",title2:"2",title3:"3",count:"Count"},Ms=e=>[et(e,"fontFamily"),et(e,"fontSettings"),{type:"row",items:[et(e,"fontSize"),et(e,"lineHeight"),et(e,"letterSpacing"),et(e,"wordSpacing")]},et(e,"textAlign"),et(e,"textAppearance")],bf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Qn.map(e=>[Es[e],Ms(e)]))}),wf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Sf={title1:.02,title2:.02,title3:.02,count:.017},fi=(e,t)=>{const n=i=>{const o=et(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[wf[t]]}},yi=(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??Sf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)};function yd({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:b=0,title3MarginLeft:x=0,titleRowMarginBottom:g=0,titleHeaderLayout:m="desktop",contentMarginTop:h=0,iconMarginRight:f=0,closeIcon:C=null,closeIconMaxWidth:y=0,closeIconColor:R="#000000",closeIconHoverColor:H="#cccccc"}=n,S=W.scalingValue(h,i),U=W.scalingValue(f,i),F=W.scalingValue(g,i),_=m==="mobile",B=yi("title1",fi(n,"title1"),i),L=yi("title2",fi(n,"title2"),i),N=yi("title3",fi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Di.title1Width,title2Width:c??Di.title2Width,title3Width:u??Di.title3Width}),[d,c,u]),Z=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:x}),[b,x]),M=s.useMemo(()=>Un(e,t,B,L,N),[e,t,B,L,N]),K=s.useMemo(()=>M.map(X=>k[X.widthKey]),[M,k]),D=s.useMemo(()=>qi(M.length,K),[M.length,K]),j=s.useMemo(()=>Mo(M.length,K),[M.length,K]),$=s.useMemo(()=>M.filter(X=>X.prefix==="title1"),[M]),v=s.useMemo(()=>M.filter(X=>X.prefix==="title2"||X.prefix==="title3"),[M]),w=s.useMemo(()=>Yn($,k),[$,k]),P=s.useMemo(()=>Yn(v,k),[v,k]),Q=!!(t.title1||t.title2||t.title3),z=C!==null;if(!(Q||z))return null;const O=(p??0)>0||o,E=(X,le)=>{const Fe=M.findIndex(J=>J.prefix===X.prefix);if(!_||le==="single-row")return{effectiveWidth:j[Fe]??0,resolvedWidth:D[Fe]??0,maxWidth:cn(Fe,D)};if(le==="two-row-top"){const J=$.findIndex(Xe=>Xe.prefix===X.prefix);return{effectiveWidth:w.effective[J]??0,resolvedWidth:w.resolved[J]??0,maxWidth:cn(J,w.resolved)}}const fe=v.findIndex(J=>J.prefix===X.prefix);return{effectiveWidth:P.effective[fe]??0,resolvedWidth:P.resolved[fe]??0,maxWidth:cn(fe,P.resolved)}},ee=(X,le,Fe)=>{if(!_||Fe==="single-row"){const dt=X.findIndex(ze=>ze.prefix===le.prefix),nt=X.map(ze=>k[ze.widthKey]),ht=qi(X.length,nt);return{effectiveWidth:Mo(X.length,nt)[dt]??0,resolvedWidth:ht[dt]??0,maxWidth:cn(dt,ht)}}if(Fe==="two-row-top"){const dt=X.filter(ze=>ze.prefix==="title1"),nt=dt.findIndex(ze=>ze.prefix===le.prefix),{resolved:ht,effective:st}=Yn(dt,k);return{effectiveWidth:st[nt]??0,resolvedWidth:ht[nt]??0,maxWidth:cn(nt,ht)}}const fe=X.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),J=fe.findIndex(dt=>dt.prefix===le.prefix),{resolved:Xe,effective:Oe}=Yn(fe,k);return{effectiveWidth:Oe[J]??0,resolvedWidth:Xe[J]??0,maxWidth:cn(J,Xe)}},V=X=>fd(M,D,Z,X)+(_?0:p??0),ue=()=>_?0:p??0,Ie=X=>v.slice(0,X).reduce((le,Fe,fe)=>le+(Fe.marginLeftKey?Z[Fe.marginLeftKey]??0:0)+(P.resolved[fe]??0),0),ge=X=>{const le=v[X];return Ie(X)+(le.marginLeftKey?Z[le.marginLeftKey]??0:0)+(P.resolved[X]??0)},ae=(X,le,Fe)=>{const fe=X.marginLeftKey?Z[X.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Xe,maxWidth:Oe}=Fe??E(X,le),dt=Math.max(fe,Xn),nt=o&&le==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":X.prefix,style:{width:W.scalingValue(J,i),...fe>0?{marginLeft:W.scalingValue(fe,i)}:{}},children:[a.jsx("p",{className:X.className,style:X.style,children:X.text}),nt&&X.marginLeftKey?a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(-fe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}}):null,nt?a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Oe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:W.scalingValue(-fn/2,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}}):null]},X.className)},ne=(X="two-row")=>{const le=M.findIndex(J=>J.prefix==="title1"),Fe=le>=0?D[le]:k.title1Width,fe=X==="two-row"&&o;return a.jsx("div",{...fe?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:W.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...fe?{pointerEvents:"auto"}:{}}})},oe=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:B,"aria-hidden":"true",children:" "}),ie=X=>{const le=Un(e,X,B,L,N);return a.jsx(a.Fragment,{children:le.map(Fe=>ae(Fe,"single-row",ee(le,Fe,"single-row")))})},Ae=X=>{const le=Un(e,X,B,L,N),Fe=le.find(fe=>fe.prefix==="title1");return Fe?ae(Fe,"two-row-top",ee(le,Fe,"two-row-top")):null},be=(X,le=!1)=>{const Fe=Un(e,X,B,L,N),fe=Fe.filter(Oe=>Oe.prefix==="title2"||Oe.prefix==="title3"),J=o&≤return fe.length>0||J||(g??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[fe.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:fe.map(Oe=>ae(Oe,"two-row-bottom",ee(Fe,Oe,"two-row-bottom")))}),le&&o?a.jsxs(a.Fragment,{children:[we(),Pe()]}):null]}):null,(g??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:F,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},Me=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(y??0,i),height:W.scalingValue(y??0,i),marginRight:U,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:X=>{X.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(sn,{url:C??"",fill:R,hoverFill:i&&!r?R:H,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:U,height:"100%",pointerEvents:"auto"}})]}),q=()=>z?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:Me()}):null,se=X=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:X})}),he=X=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[z||Q?oe():null,O?ne("two-row"):null,se(X),q()]}),G=(X,le=!1)=>a.jsxs(a.Fragment,{children:[he(Ae(X)),be(X,le)]}),re=()=>{const X=_?-1:M.findIndex(fe=>fe.prefix==="title1"),le=!_&&(o||(p??0)>0)?(()=>{const fe=p??0,J=X>=0?D[X]:k.title1Width,Xe=Math.max(fe,Xn);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:W.scalingValue(Xe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=M.flatMap((fe,J)=>{if(!fe.marginLeftKey)return[];const Xe=Z[fe.marginLeftKey]??0,Oe=hd(M,D,Z,J)+ue(),dt=Math.max(Xe,Xn);return a.jsx("div",{"data-controls":fe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[J]),style:{position:"absolute",top:0,left:W.scalingValue(Oe,i),width:W.scalingValue(dt,i),height:"100%",pointerEvents:"auto"}},fe.marginLeftKey)});return le?[le,...Fe]:Fe},me=()=>M.map((X,le)=>{const Fe=cn(le,D),J=V(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),we=()=>v.flatMap((X,le)=>{if(!X.marginLeftKey)return[];const Fe=Z[X.marginLeftKey]??0,fe=Ie(le),J=Math.max(Fe,Xn),{resolvedWidth:Xe}=E(X,"two-row-bottom");return a.jsx("div",{"data-controls":X.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:W.scalingValue(fe,i),width:W.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},X.marginLeftKey)}),Pe=()=>v.map((X,le)=>{const{maxWidth:Fe}=E(X,"two-row-bottom"),J=ge(le)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":X.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:W.scalingValue(J,i),width:W.scalingValue(fn,i),height:"100%",pointerEvents:"auto"}})},`${X.widthKey}-junction`)}),Ce=()=>!o||_?null:a.jsxs(a.Fragment,{children:[re(),me()]}),Y=!!(t.title2||t.title3||(g??0)>0||o),xe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[z||Q?oe():null,O?ne("single-row"):null,Q?se(ie(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),q(),Ce()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Y?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Y?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),Ce()]});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:S,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",..._?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${_?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${_?` ${e}-text-bar-cell-stacked`:""}`,style:_?void 0:{flex:1,minWidth:0,width:"100%"},children:_?pe():xe()})})})]})}function $f(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Cf(e){return`
|
|
7186
7186
|
.${e}-wrapper {
|
|
7187
7187
|
display: grid;
|
|
7188
7188
|
align-items: start;
|
|
@@ -7502,7 +7502,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7502
7502
|
pointer-events: auto;
|
|
7503
7503
|
flex-shrink: 0;
|
|
7504
7504
|
}
|
|
7505
|
-
`}const bl={url:"",name:"",objectFit:"cover"},Tn=500,lo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Tf=72,Lf=50,Rf=1e4,If=650,Pf=500;function Ef(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 vd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Mf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?vd(i,n):null}function kf(e){return e.reduce((t,n,i)=>{const o=ks(n.gallery),l=As(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 yo(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 wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return yo(e,i,n)}const Af=.03;function xd(e){return e.width*Af}const ya={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function rr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ff(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Za(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 _f(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Za(e,t.width,t.height)}function Wf(e,t){if(ro(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 Nf(e){const t=new Set,n=[];for(const i of e){const o=ks(i.gallery),r=As(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 Hf({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=>ro(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 Xi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=xd(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 Ar(e,t,n){const i=Xi(e,t,n);return{...i,left:2*i.left-e.left}}function Of(e,t,n){const{left:i,width:o}=n,r=xd(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 bd(e,t,n,i){const o=Xi(e,"left",i),r=Xi(e,"right",i),l=Ar(e,"left",i),d=Ar(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 Df(e,t,n,i){const{start:o,end:r}=bd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Bf(e,t,n){const i=Xi(e,t,n),o=Ar(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function wd(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 ks(e){if(!e)return;if(wd(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??bl,i??o??bl]}]}function jf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function zf(e){const[t]=e.media;return t!=null&&t.url?t:null}function As(e){if(!Array.isArray(e)||e.length===0)return[];if(wd(e)){const t=[];for(const n of e){const i=jf(n);if(!i)continue;const o=zf(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 ro(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Vf({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ro(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 Gf({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 ar({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ro(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 qf({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(ya),[M,ee]=s.useState(0),[V,me]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[pe,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,ue]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ro(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?yo(u,p,-1):st(n,-1),Se=ht?yo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?yo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?yo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?wl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?wl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return _f(y.current,$e)},[S,M]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Sl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),tt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{We(),qe(!1)},lo+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:ya.width,height:typeof window<"u"?window.innerHeight:ya.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=Df(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{K.current!==null&&Tt()},lo+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Pf:If;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Rf))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(Za(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Ff(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(Za(A,Et,Qe));return}}const ot=Sl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||Wf(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){me("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),me("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Tn);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),ue(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Lf&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,ue(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,ue(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>Tf){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),me("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,ue(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),me("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?pe??x:x,it=De&&Q&&(V==="opening"||Nt)?Ef(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?rr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${lo}ms ${pn}`:X?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:pt?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?bd(Ne,ot,Ae,T):{start:Re==="far"?Ar(Ne,$e,T):Xi(Ne,$e,T)},Qe=rr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?Bf(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${lo}ms ${pn}`:`transform ${lo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?Of(Xi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?rr(Ht,T):null,St=Ot?rr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"none":`opacity ${Tn}ms ${pn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:xe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(ar,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(ar,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(Gf,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}function Xf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,x=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",m=(b==null?void 0:b.reversed)??!1,[h,f]=g.split(":").map(Number),R=`${m?f:h} / ${m?h:f}`,H=c.entryWidth??.2,S=c.columnsCount,U=W.scalingValue(H,n),F=W.scalingValue(c.horizontalGap??0,n),_=U,B=U,L={width:_,...x?{aspectRatio:R,height:"auto",overflow:"hidden"}:{height:"auto"}},N=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[Z,E]=s.useState(!1),[K,D]=s.useState([]),[j,$]=s.useState(0),[v,w]=s.useState(0),[P,Q]=s.useState(null),[z,T]=s.useState({title1:"",title2:"",title3:""}),O=(()=>{const se={},he=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return he&&(se["--cntrl-article-width"]=he),se})(),M=!n||i||o,ee=s.useMemo(()=>Cf(d),[d]),V=t??[],me=V.length%S||S,Ie=me<S&&V.length>0,ge=V.length-me,ae=Ie?Math.floor((S-me)/2)+1:1,ne=s.useMemo(()=>kf(V),[V]),oe=s.useMemo(()=>Nf(V),[V]),ie=(se,he,G)=>{if(n&&!o&&!i)return;const re=ne.findIndex(we=>we.gridIndex===se);if(re<0)return;const pe=ne[re];w(re),D(pe.items),$(he),T(pe.entry),Q(G??null),E(!0)},Ae=s.useCallback(()=>{E(!1),Q(null)},[]),be=s.useCallback(()=>{const se=ne[v];return!se||!k.current?P:Mf(k.current,se.gridIndex,x?"cover":"contain")??P},[ne,v,P,x]),Me=s.useCallback(se=>{if(ne.length>1){const he=ne.length,G=(v+se+he)%he,re=ne[G],pe=Math.min(j,re.items.length-1);w(G),D(re.items),$(pe),T(re.entry);return}$(he=>(he+se+K.length)%K.length)},[ne,v,j,K.length]),q=ne.length>1||K.length>1;return s.useEffect(()=>{if(!Z||typeof document>"u")return;const se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=se}},[Z]),s.useEffect(()=>{!n||o||i||E(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ee}}),a.jsx(Hf,{mediaList:oe}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${S}, ${U})`,rowGap:0,columnGap:F,width:W.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:V.map((se,he)=>{const G=ks(se.gallery),re=As(G),pe=re.filter(ue=>ue.lightboxMedia).map(ue=>ue.lightboxMedia),we=Math.floor(he/S)===Math.ceil(V.length/S)-1,Pe=Ie&&he>=ge?`${ae+(he-ge)}`:void 0,Ce=re[0],Y=Ce!=null&&Ce.lightboxMedia?pe.findIndex(ue=>ue.url===Ce.lightboxMedia.url):-1,xe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:L,children:re.length>0&&a.jsx(Vf,{media:Ce.displayMedia,gridIndex:he,className:`${d}-item-${ro(Ce.displayMedia)?"video":"image"}`.trim(),style:N,onMediaClick:M&&Y>=0?ue=>ie(he,Y,vd(ue.currentTarget,x?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:xe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},he)})}),Z&&typeof document<"u"&&(()=>{const se=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:O,"data-selection":"none",children:a.jsx(qf,{prefix:d,items:K,index:j,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:q,lightboxEntries:ne,entryIdx:v,layoutId:r,sourceRect:P,resolveCloseSourceRect:be,onClose:Ae,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),se)})()]})}const Uf=`import { CommonComponentProps } from '../props';
|
|
7505
|
+
`}const bl={url:"",name:"",objectFit:"cover"},Tn=500,lo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Tf=72,Lf=50,Rf=1e4,If=650,Pf=500;function Ef(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 vd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Mf(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?vd(i,n):null}function kf(e){return e.reduce((t,n,i)=>{const o=ks(n.gallery),l=As(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 yo(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 wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return yo(e,i,n)}const Af=.03;function xd(e){return e.width*Af}const ya={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function rr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ff(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Za(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 _f(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Za(e,t.width,t.height)}function Wf(e,t){if(ro(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 Nf(e){const t=new Set,n=[];for(const i of e){const o=ks(i.gallery),r=As(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 Hf({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=>ro(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 Xi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=xd(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 Ar(e,t,n){const i=Xi(e,t,n);return{...i,left:2*i.left-e.left}}function Of(e,t,n){const{left:i,width:o}=n,r=xd(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 bd(e,t,n,i){const o=Xi(e,"left",i),r=Xi(e,"right",i),l=Ar(e,"left",i),d=Ar(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 Df(e,t,n,i){const{start:o,end:r}=bd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Bf(e,t,n){const i=Xi(e,t,n),o=Ar(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function wd(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 ks(e){if(!e)return;if(wd(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??bl,i??o??bl]}]}function jf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function zf(e){const[t]=e.media;return t!=null&&t.url?t:null}function As(e){if(!Array.isArray(e)||e.length===0)return[];if(wd(e)){const t=[];for(const n of e){const i=jf(n);if(!i)continue;const o=zf(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 ro(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Vf({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ro(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 Gf({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 ar({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ro(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 qf({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),M=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(ya),[E,ee]=s.useState(0),[V,ue]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[me,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,pe]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ro(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?yo(u,p,-1):st(n,-1),Se=ht?yo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?yo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?yo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?wl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?wl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return _f(y.current,$e)},[S,E]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Sl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),tt=s.useCallback(()=>{We(),M.current=window.setTimeout(()=>{We(),qe(!1)},lo+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:ya.width,height:typeof window<"u"?window.innerHeight:ya.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=Df(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),pe(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),M.current=window.setTimeout(()=>{K.current!==null&&Tt()},lo+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),pe(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Pf:If;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Rf))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(Za(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Ff(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(Za(A,Et,Qe));return}}const ot=Sl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||Wf(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){ue("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),ue("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Tn);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),pe(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Lf&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,pe(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,pe(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>Tf){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),ue("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,pe(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),ue("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?me??x:x,it=De&&Q&&(V==="opening"||Nt)?Ef(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?rr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${lo}ms ${pn}`:X?`transform ${Tn}ms ${pn}, opacity ${Tn}ms ${pn}`:pt?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?bd(Ne,ot,Ae,T):{start:Re==="far"?Ar(Ne,$e,T):Xi(Ne,$e,T)},Qe=rr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?Bf(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${lo}ms ${pn}`:`transform ${lo}ms ${pn}, opacity ${Tn}ms ${pn}`:un?`transform ${Tn}ms ${pn}`:V==="opening"||Nt?`opacity ${Tn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?Of(Xi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?rr(Ht,T):null,St=Ot?rr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"none":`opacity ${Tn}ms ${pn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:xe?"none":`opacity ${Tn}ms ${pn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(ar,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(ar,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(ar,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(Gf,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}function Xf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,x=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",m=(b==null?void 0:b.reversed)??!1,[h,f]=g.split(":").map(Number),R=`${m?f:h} / ${m?h:f}`,H=c.entryWidth??.2,S=c.columnsCount,U=W.scalingValue(H,n),F=W.scalingValue(c.horizontalGap??0,n),_=U,B=U,L={width:_,...x?{aspectRatio:R,height:"auto",overflow:"hidden"}:{height:"auto"}},N=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[Z,M]=s.useState(!1),[K,D]=s.useState([]),[j,$]=s.useState(0),[v,w]=s.useState(0),[P,Q]=s.useState(null),[z,T]=s.useState({title1:"",title2:"",title3:""}),O=(()=>{const se={},he=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return he&&(se["--cntrl-article-width"]=he),se})(),E=!n||i||o,ee=s.useMemo(()=>Cf(d),[d]),V=t??[],ue=V.length%S||S,Ie=ue<S&&V.length>0,ge=V.length-ue,ae=Ie?Math.floor((S-ue)/2)+1:1,ne=s.useMemo(()=>kf(V),[V]),oe=s.useMemo(()=>Nf(V),[V]),ie=(se,he,G)=>{if(n&&!o&&!i)return;const re=ne.findIndex(we=>we.gridIndex===se);if(re<0)return;const me=ne[re];w(re),D(me.items),$(he),T(me.entry),Q(G??null),M(!0)},Ae=s.useCallback(()=>{M(!1),Q(null)},[]),be=s.useCallback(()=>{const se=ne[v];return!se||!k.current?P:Mf(k.current,se.gridIndex,x?"cover":"contain")??P},[ne,v,P,x]),Me=s.useCallback(se=>{if(ne.length>1){const he=ne.length,G=(v+se+he)%he,re=ne[G],me=Math.min(j,re.items.length-1);w(G),D(re.items),$(me),T(re.entry);return}$(he=>(he+se+K.length)%K.length)},[ne,v,j,K.length]),q=ne.length>1||K.length>1;return s.useEffect(()=>{if(!Z||typeof document>"u")return;const se=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=se}},[Z]),s.useEffect(()=>{!n||o||i||M(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ee}}),a.jsx(Hf,{mediaList:oe}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${S}, ${U})`,rowGap:0,columnGap:F,width:W.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:W.scalingValue(u??0,n)},children:V.map((se,he)=>{const G=ks(se.gallery),re=As(G),me=re.filter(pe=>pe.lightboxMedia).map(pe=>pe.lightboxMedia),we=Math.floor(he/S)===Math.ceil(V.length/S)-1,Pe=Ie&&he>=ge?`${ae+(he-ge)}`:void 0,Ce=re[0],Y=Ce!=null&&Ce.lightboxMedia?me.findIndex(pe=>pe.url===Ce.lightboxMedia.url):-1,xe=a.jsx("div",{className:`${d}-item-image-wrapper`,style:L,children:re.length>0&&a.jsx(Vf,{media:Ce.displayMedia,gridIndex:he,className:`${d}-item-${ro(Ce.displayMedia)?"video":"image"}`.trim(),style:N,onMediaClick:E&&Y>=0?pe=>ie(he,Y,vd(pe.currentTarget,x?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:U,...Pe?{gridColumn:Pe}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:B}})}),a.jsx("a",{className:`${d}-item-image-link`,children:xe}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:B}})})]})},he)})}),Z&&typeof document<"u"&&(()=>{const se=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:O,"data-selection":"none",children:a.jsx(qf,{prefix:d,items:K,index:j,entry:z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:q,lightboxEntries:ne,entryIdx:v,layoutId:r,sourceRect:P,resolveCloseSourceRect:be,onClose:Ae,onPrev:()=>Me(-1),onNext:()=>Me(1)})}),se)})()]})}const Uf=`import { CommonComponentProps } from '../props';
|
|
7506
7506
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7507
7507
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7508
7508
|
import { createPortal } from 'react-dom';
|
|
@@ -9845,7 +9845,7 @@ export function Hive({
|
|
|
9845
9845
|
</>
|
|
9846
9846
|
);
|
|
9847
9847
|
}
|
|
9848
|
-
`,Yf="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Kf(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ui=Jn.filter(e=>e!=="count"),Zf=Ui.reduce((e,t)=>({...e,...Kf(t)}),{}),Jf=Ui.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function va(e){return Ui.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Qf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ui.map(e=>[Es[e],Ms(e)]))},ey={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},ty=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...ey,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ny={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:ty},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Zf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Jf},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...va({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...va({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...va({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Qf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},iy={element:Xf,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Ui.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Ui.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:ny,sourceCode:Uf};function oy(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function ry({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function xa(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ay(e){return String(e??"").trim().length>0}function $l(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Cl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Tl(e,t,n,i,o,r,l){const d=W.scalingValue(r,l),c=W.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function sy(e,t,n){const i=W.scalingValue(t,n),o=W.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ll=10,Rl=10,co={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function ly(e,t,n){return Math.max(t,Math.min(n,e))}function ba(e,t,n){return e+(t-e)*n}function cy(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+Ll,y:n.clientY-d.top+Ll}}switch(e){case"left":return{x:Rl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Rl-i/2,y:l};default:return{x:o/2,y:l}}}function dy(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const g=n.current,m=i.current;g&&(g.style.transform=`translate3d(${m.x}px, ${m.y}px, 0) translate(-50%, -50%) rotate(${m.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const g=i.current;t?(g.x=ba(g.x,g.targetX,co.positionEase),g.y=ba(g.y,g.targetY,co.positionEase),g.rotation=ba(g.rotation,g.targetRotation,co.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const m=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,h=Math.abs(g.rotation-g.targetRotation)<.08;!m||!h?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((g,m)=>{const h=i.current;h.targetX=g,h.targetY=m,h.targetRotation=0,h.x=g,h.y=m,h.rotation=0,h.lastX=g,h.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((g,m)=>{if(!e)return;const h=i.current;if(t&&h.hasLastX){const f=g-h.lastX;h.targetRotation=ly(f*co.rotationFactor,-20,co.maxRotation)}else h.targetRotation=0;if(h.lastX=g,h.hasLastX=!0,h.targetX=g,h.targetY=m,t){c();return}h.x=g,h.y=m,h.rotation=h.targetRotation,r()},[e,r,t,c]),b=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),x=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||x(),l),[e,x,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:b,reset:x}}function uy(e){return`
|
|
9848
|
+
`,Yf="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>'),ci={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 Kf(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...ci.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...ci.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...ci.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...ci.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...ci.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...ci.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...ci.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ui=Qn.filter(e=>e!=="count"),Zf=Ui.reduce((e,t)=>({...e,...Kf(t)}),{}),Jf=Ui.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function va(e){return Ui.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const Qf={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ui.map(e=>[Es[e],Ms(e)]))},ey={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},ty=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...ey,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),ny={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},gallery:{type:"array",label:"Gallery",max:1,display:{type:"media-pair-list-input"},items:{type:"object",properties:{media:{type:"array",items:{type:"object",properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]},objectFit:{type:"string",enum:["cover","contain"]}}}}}}}},required:["gallery"]},default:ty},settings:{sizing:"auto auto",properties:{gridLayout:{type:"grid-layout",scope:"layout",display:{type:"grid-layout"},gridParams:{type:"object",properties:{columnsCount:{type:"number",title:"Columns",min:1,max:9999,display:{type:"numeric-input"}},wrapperWidth:{type:"number",title:"Width",min:0},entryWidth:{type:"number",title:"Entry",min:0},horizontalGap:{type:"number",title:"Gutter",min:0}}}},verticalGap:{type:"number",scope:"layout",title:"Vertical Gap",display:{type:"numeric-input"},min:0,max:1e3},align:{type:"string",scope:"layout",title:"Align",display:{type:"toggle-cycle",enum:["top","center","bottom"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}},...Zf},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Yf,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Jf},layoutDefaults:{m:{gridLayout:{entryWidth:.37837,horizontalGap:.081,wrapperWidth:1,columnsCount:2,lockedParam:"wrapperWidth"},verticalGap:.081,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.464864,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,contentMarginTop:.081,closeIconMaxWidth:.081,iconMarginRight:.05405,...va({title1FontSize:.04864,title1LineHeight:.056756,title2FontSize:.04864,title2LineHeight:.056756,title3FontSize:.04864,title3LineHeight:.056756})},t:{gridLayout:{entryWidth:.10416,horizontalGap:.013,wrapperWidth:1,columnsCount:8,lockedParam:"wrapperWidth"},verticalGap:.013,titleHeaderLayout:"desktop",title1Width:.3,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.026,closeIconMaxWidth:.039,iconMarginRight:.026,...va({title1FontSize:.02083,title1LineHeight:.02734,title2FontSize:.02083,title2LineHeight:.02734,title3FontSize:.02083,title3LineHeight:.02734})},d:{gridLayout:{entryWidth:.06944,horizontalGap:.006944,wrapperWidth:1,columnsCount:12,lockedParam:"wrapperWidth"},verticalGap:.00694,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,contentMarginTop:.01,closeIconMaxWidth:.0125,iconMarginRight:.01,...va({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098})}},displayRules:[{if:{name:"imageDisplay.display",value:"cover"},then:{name:"properties.align.display.enabled",value:!1}}],layout:["__componentName__","gridLayout","verticalGap","align","imageDisplay","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","contentMarginTop","closeIconMaxWidth","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:[{type:"group",title:"",items:["gridLayout"]}]},{type:"row",title:"",items:["verticalGap"]},{type:"row",title:"",items:["imageDisplay","align"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[Qf]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},iy={element:Xf,id:"hive",name:"Catalogue",category:"grids",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/hive.png"},version:1,defaultSize:{d:{width:720,height:540}},assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[...Ui.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Ui.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:ny,sourceCode:Uf};function oy(e){if(e.type==="video")return!0;if(e.type==="image")return!1;const t=e.name??"";return/\.(mp4|webm|ogg|mov)(\?|$)/i.test(t)?!0:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.url)}function ry({media:e,className:t,style:n}){const i=s.useRef(null);return s.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const r=o.play();r&&r.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?a.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:t,src:e.url,alt:"",style:n})}function xa(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ay(e){return String(e??"").trim().length>0}function $l(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY-i.top>i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Cl(e,t){const n=e.currentTarget,i=n.getBoundingClientRect(),o=e.clientY<i.top+i.height/2;n.classList.toggle(`${t}-reveal-from-bottom`,o)}function Tl(e,t,n,i,o,r,l){const d=W.scalingValue(r,l),c=W.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function sy(e,t,n){const i=W.scalingValue(t,n),o=W.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ll=10,Rl=10,co={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function ly(e,t,n){return Math.max(t,Math.min(n,e))}function ba(e,t,n){return e+(t-e)*n}function cy(e,t,n,i){if(!t)return{x:0,y:0};const o=t.offsetWidth,l=t.offsetHeight/2;if(e==="cursor"&&n){const d=t.getBoundingClientRect();return{x:n.clientX-d.left+Ll,y:n.clientY-d.top+Ll}}switch(e){case"left":return{x:Rl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Rl-i/2,y:l};default:return{x:o/2,y:l}}}function dy(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const g=n.current,m=i.current;g&&(g.style.transform=`translate3d(${m.x}px, ${m.y}px, 0) translate(-50%, -50%) rotate(${m.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const g=i.current;t?(g.x=ba(g.x,g.targetX,co.positionEase),g.y=ba(g.y,g.targetY,co.positionEase),g.rotation=ba(g.rotation,g.targetRotation,co.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const m=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,h=Math.abs(g.rotation-g.targetRotation)<.08;!m||!h?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((g,m)=>{const h=i.current;h.targetX=g,h.targetY=m,h.targetRotation=0,h.x=g,h.y=m,h.rotation=0,h.lastX=g,h.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((g,m)=>{if(!e)return;const h=i.current;if(t&&h.hasLastX){const f=g-h.lastX;h.targetRotation=ly(f*co.rotationFactor,-20,co.maxRotation)}else h.targetRotation=0;if(h.lastX=g,h.hasLastX=!0,h.targetX=g,h.targetY=m,t){c();return}h.x=g,h.y=m,h.rotation=h.targetRotation,r()},[e,r,t,c]),b=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),x=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||x(),l),[e,x,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:b,reset:x}}function uy(e){return`
|
|
9849
9849
|
.${e}-wrapper {
|
|
9850
9850
|
display: grid;
|
|
9851
9851
|
align-items: start;
|
|
@@ -10221,7 +10221,7 @@ a.${e}-list-item {
|
|
|
10221
10221
|
overflow-wrap: anywhere;
|
|
10222
10222
|
word-break: break-word;
|
|
10223
10223
|
}
|
|
10224
|
-
`}const Qn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",ko=[...Fs,Wn],Jr=["A","B","C","D","E"];function Sd(e){return`${e}ColumnVerticalAlign`}const Ja=["Top","Center","Bottom"];function _s(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Jr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function py(e){const t=_s(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function my(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Jr.includes(n)?n:null}function $d(e,t,n){const i=my(e);return i?i===t?!1:py(n[Sd(i)]):!0}function Ao(e){const t=_s(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Jr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function gy(e,t,n){if(Cd(e,t,n))return Ao(e);const i=Ao(e);return i.kind==="baseline"?{kind:"top"}:i}function hy(e){const t=Ao(e);return t.kind==="baseline"?{kind:"top"}:t}function Cd(e,t,n){return $d(e,n,t)?Ao(e).kind==="baseline":!1}function fy(e){const t={};let n=!1;for(const i of Jr){const o=Sd(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}$d(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function yy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function vy(e){const t=Ao(e).kind;return t==="baseline"?"center":t}function xy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Il(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function by(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 wa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=by(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 wy(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 Sy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const $y={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Cy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ty(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ly(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(ko.map(e=>[Cy[e],Ty(e)]))}}function Fr(e,t){const n=i=>{const o=Pt(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Pl(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 an(Ut(n,t))}function El(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Ml(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ki=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Zi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Ry={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Iy=["hover","focus","filled","success","error"],kl=.004,Fi=.004,Sa=Fi,Ws=50,Fo=1440,_o=Ws/Fo;function Td(e){const t=typeof e=="number"&&e>0?e:Fo;return Ws/t}function Py(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 Fo}const Ld={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function So(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ey(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function My(){return Object.fromEntries([...Yi.map(e=>[e,0]),...Ki.map(e=>[e,0])])}function ky(){return Object.fromEntries(Zi.map(e=>[e,0]))}function sr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function Rd(e,t,n){const i=e-_o,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 $r(e,t,n){const i=Ns(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 Ay(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Yi[o],l=Ki[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Rd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Ns(e,t,n){if(e<=0)return[];const i=vn.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)+_o;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]-_o;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function Fy(e,t,n){if(e<=1)return{};const i=Ns(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Al(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Qn]}function _y(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Wy(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=Yi[c],b=Ki[c],x=Zi[c],g=vn[l],m=Yi[l],h=Ki[l],f=Zi[l],C=n[u],y=n[p],R=n[b],H=n[x];typeof C=="number"&&(r[g]=C),typeof y=="number"&&(r[m]=y),typeof R=="number"&&(r[h]=R),typeof H=="number"&&(r[f]=H)}return r}function Id(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 Ny(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=So(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Ey(n,o),...My()};if(r)for(const d of Zi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,ky());return Id(e,l)?l:e}function Hy(e,t,n){const i=fy(e);i&&(e={...e,...i});const o=Td(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=So(e),c=So(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:Qn.length,b=R=>{if(u)return R;const H=sr({...t,...R}),S=So(R),U=$r(p,S,H),F=Ay(p,U,{...t,...R});return Object.keys(F).length===0?R:{...R,...F}};if(typeof r=="number"&&r!==l)return e;const x=Al(e),g=Al(t);if(!_y(x,g))return b({...e,...Wy(x,g,t,p)});if(d<c&&typeof p=="number"&&!u){const R=sr({...t,...e});return b({...e,...Fy(p,d,R)})}if(u){const R=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return R>H?{...e,textPaddingLR:H}:e}const m=sr({...t,...e}),h=$r(p,c,sr(t)),C=$r(p,d,m).some((R,H)=>R<(h[H]??R)),y=vn.some(R=>{const H=e[R],S=t[R];return typeof H=="number"&&typeof S=="number"&&H!==S});return C||y?b(e):e}function Oy(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(_o,i-o-r-_o)}function Dy(e,t){return Math.random()*(t-e)+e}function By(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function $a(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function jy(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Yi[d],u=Ki[d],p=Zi[d];return{key:l,textPrefix:$y[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function zy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=W.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:x,entriesCount:g,cellMinHeight:m,dividerWidth:h,showVisibility:f,cut:C,showCut:y,cutCellMinHeight:R,cutLabel:H,imageSize:S,imageOnHover:U,imagePosition:F="cursor",imageInterpolation:_="on",entryHoverEffect:B,entryHoverShowOption:L,rowPaddingTop:N,rowPaddingBottom:k,rowPaddingTopB:Z,columnsOrder:E,textPaddingLR:K,textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P}=e,[Q,z]=s.useState(void 0),[T,O]=s.useState(null),M=s.useRef(null),ee=U==="on"&&(!n||i),V=F==="cursor",me=V&&_==="on",{anchorRef:Ie,onShow:ge,onCursorMove:ae,exit:ne}=dy(!!(ee&&T!==null),me),oe=(C??0)>0,ie=b==="b",Ae=s.useRef(null),be=s.useRef(null),[Me,q]=s.useState(null),[se,he]=s.useState(Fo),G=Td(se),re=Math.max(0,((x??0)-G)/2),pe=Math.min(K??0,re),we=Math.max(pe,Fi),Pe=((x??0)+G)/2;s.useLayoutEffect(()=>{if(!n){he(Fo);return}const Le=()=>{he(Py(Ae.current))};Le();const De=Ae.current;if(!De)return;const it=new ResizeObserver(Le);it.observe(De);let gt=De;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&it.observe(gt),()=>it.disconnect()},[n,l]),s.useEffect(()=>{z(void 0)},[C,y,t,g]),s.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const Ce=W.buildColorVars(c,{textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P},Ry,Iy),Y=r&&r!=="default"?`${c}-state-${r}`:"",ue=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Y}`.trim(),X=B==="reveal"&&(!n||i),le=(f==null?void 0:f[0])??!1,Fe=(f==null?void 0:f[1])??!1,fe=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){fe.current=e,J.current=l;return}if(J.current!==l){fe.current=e,J.current=l;return}const Le=fe.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){fe.current=e;return}const it=Hy(e,Le,{designWidth:se});fe.current=e,Id(e,it)&&d(it)},[e,d,n,l,se]);const Xe=s.useMemo(()=>By(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>$a(e,Yi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),dt=s.useMemo(()=>$a(e,Ki),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),nt=s.useMemo(()=>$a(e,Zi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(E)&&E.length>0?E:[...Qn],[E]),st=s.useMemo(()=>jy(ht,p,Xe,Oe,dt,nt),[ht,p,Xe,Oe,dt,nt]),ze=So(e),Se=s.useMemo(()=>vn.slice(0,p).map(Le=>Xe[Le]),[p,Xe]),_e=s.useMemo(()=>Ns(p,ze,Xe),[p,ze,Xe]),Be=s.useMemo(()=>$r(p,ze,Xe),[p,ze,Xe]),Ye=s.useMemo(()=>st.map((Le,De)=>Rd(Be[De]??0,Le.paddingLeft,Le.paddingRight)),[st,Be]),de=s.useMemo(()=>{const Le=g===0?1/0:g;return(t??[]).slice(0,Le).map((it,gt)=>({id:gt,cells:Object.fromEntries(Qn.map(ft=>[ft,it[ft]??""])),image:it.image,link:it.link}))},[t,g]),ve=oe?Q??C:de.length,Ee=s.useMemo(()=>oe?de.slice(0,ve):de,[de,oe,ve]),Ge=oe&&ve<de.length,Ze=Ee.length>1||Ge,Ve=[le?`${c}-divider-top`:"",Fe||Ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),at=!n||i,Je=()=>{if(!at)return;const Le=Q??C;if(!y){z(de.length);return}z(Math.min(Le+y,de.length))},ke=Le=>W.scalingValue(Le,n??!1),qe=ie?Z??0:N??0,We=k??0,tt=m??0,rt=Math.max(We,Sa),lt=Tl(0,Ee.length,le,Fe,Ge,h??0,n??!1).borderTopWidth,Tt=ie?"rowPaddingTopB":"rowPaddingTop",Xt=st[0],Zt=st[st.length-1],xt=Ye[0],wt=Ye[Ye.length-1],Bt=Xt&&xt?Math.max(xt.paddingLeft,Fi):0,At=Zt&&wt?Math.max(wt.paddingRight,Fi):0,vt=ze,Ft=(Le,De)=>cy(F,Ae.current,V?Le:null,De),Wt=(Le,De)=>{if(!ee)return;const it=Le.image;if(!(it!=null&&it.url)){ne(()=>O(null));return}const gt=(S==null?void 0:S.min)??80,ft=(S==null?void 0:S.max)??320,It=(T==null?void 0:T.rowId)===Le.id,pt=It?T.widthPx:Dy(gt,ft),{x:jt,y:kt}=Ft(De,pt);if(It&&V){ae(jt,kt);return}O({rowId:Le.id,url:it.url,objectFit:"contain",isVideo:oy(it),widthPx:pt}),M.current={x:jt,y:kt}},Yt=Le=>{if(!ee||!T||!V)return;const{x:De,y:it}=Ft(Le,T.widthPx);ae(De,it)},Jt=()=>{T&&ne(()=>O(null))},Ct=Le=>{X&&$l(Le,c),!(!ee||!T)&&ne(()=>O(null))},Nt=Le=>{X&&Cl(Le,c)};s.useLayoutEffect(()=>{if(!T||!M.current)return;const{x:Le,y:De}=M.current;M.current=null,ge(Le,De)},[T==null?void 0:T.rowId,T==null?void 0:T.url,ge]),s.useLayoutEffect(()=>{if(!u||ie){q(null);return}const Le=be.current,De=Le==null?void 0:Le.parentElement;if(!Le||!De){q(null);return}const it=()=>{const ft=Le.querySelector("[data-list-row]");if(!ft){q(null);return}const It=De.getBoundingClientRect(),pt=ft.getBoundingClientRect();q(pt.top-It.top+pt.height/2)};it();const gt=new ResizeObserver(it);return gt.observe(Le),gt.observe(De),()=>gt.disconnect()},[u,ie,Ee,qe,We,tt,t,e,st,Be,se,h,le,Fe,Ge]);const rn=s.useMemo(()=>!ie&&Fs.some(Le=>{const De=Le.charAt(0),it=e[`${Le}VerticalAlign`];return Cd(it,e,De)}),[ie,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var jt;const Le=Ae.current;if(!Le)return;const De=()=>{Le.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(ie||!rn){De();return}const it=()=>{const kt=Array.from(Le.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Ot=Ht.querySelector(`.${Mt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));wy(Gt,Ht,Mt)}),Le.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Ot=Gt.getBoundingClientRect().top,_t=new Map,St=Ht.map(Re=>{const Ne=Re.querySelector(`.${c}-list-col-title`),ot={el:Re,titleEl:Ne,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return _t.set(ot.letter,ot),ot}),A=new Map,$e=(Re,Ne)=>{const ot=A.get(Re.letter);if(ot!==void 0)return ot;const Et=Re.anchor?_t.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Et||Ne.has(Re.letter)){const nn=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,nn),nn}Ne.add(Re.letter);const Qe=$e(Et,Ne);Ne.delete(Re.letter);const yt=wa(Re,Ot,Mt,Vt),Dt=Qe-yt;Sy(Re.titleEl,Dt);const Lt=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,Lt),Lt};St.forEach(Re=>$e(Re,new Set))})};let gt=null;const ft=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,it()}))};it();const It=new ResizeObserver(()=>ft());It.observe(Le);let pt=!1;return typeof document<"u"&&((jt=document.fonts)!=null&&jt.ready)&&document.fonts.ready.then(()=>{pt||ft()}),()=>{pt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),De()}},[rn,ie,e,t,se,Ee,Be]);const mt=s.useMemo(()=>uy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Ae,className:`${c}-wrapper ${ue}${Ve?` ${Ve}`:""}${ie?` ${c}-type-b`:""}`.trim(),style:{width:W.scalingValue(x??0,n)},onMouseMove:ee?Yt:void 0,onMouseLeave:ee?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ee.map((Le,De)=>{var It;const it=(((It=Le.link)==null?void 0:It.length)??0)>0,gt=it&&(!n||i)?"a":"div",ft=Tl(De,Ee.length,le,Fe,Ge,h??0,n??!1);return a.jsxs(gt,{ref:De===0?pt=>{be.current=pt}:void 0,className:`${c}-list-item${it||L==="always"?` ${c}-list-item-has-link`:""}${Ge&&De===Ee.length-1?` ${c}-list-item-before-cut`:""}`,...it?{href:Le.link,target:"_blank"}:{},style:ft,onMouseEnter:pt=>{X&&(it||L==="always")&&$l(pt,c),ee&&Wt(Le,pt)},onMouseLeave:pt=>{X&&(it||L==="always")&&Cl(pt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${ie?"":` ${c}-list-cols-row-h`}${u&&De===0&&ie?` ${c}-list-cols-row-controls`:""}`,...ie?{}:{"data-list-row":""},style:ie?void 0:{minHeight:ke(tt)},children:[st.map((pt,jt)=>{const kt=jt===st.length-1,Mt=Ye[jt],Vt=pt.paddingBottom,Gt=ay(Le.cells[pt.key]),Ht=ie&&Gt&&Vt>0,Ot=ie?{minHeight:ke(tt)}:{width:ke(Be[jt])},_t=ie?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{paddingLeft:ke(Mt.paddingLeft),paddingRight:ke(Mt.paddingRight)},St=pt.textPrefix.charAt(0),A=ie?hy(e[`${pt.textPrefix}VerticalAlign`]):gy(e[`${pt.textPrefix}VerticalAlign`],e,St),$e=ie&&Gt&&u&&De===0;return ie&&!Gt?null:a.jsxs("div",{className:ie?`${c}-list-col-wrap`:void 0,...ie?{}:{"data-list-col":"","data-col-letter":St,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Ot,...ie?{justifyContent:Il(A.kind)}:{}},"data-test":pt.width,children:a.jsx("span",{className:El(e,pt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Pl(Fr(e,pt.textPrefix),n),...Ml(e,pt.textPrefix,c,n),...ie?{}:yy(A.kind)},children:Le.cells[pt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Vt)}}),$e&&a.jsx("div",{"data-controls":pt.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:ke(Math.max(Vt,Sa))}})]},pt.key)}),u&&De===0&&ie&&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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:ke(we),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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:ke(Math.max(we,ze-we)),width:ke(we),height:"100%"}})]})]}),!ie&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(We)}}),u&&De===0&&!ie&&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:ke(rt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Tt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ie?"center":"left-y",className:`${c}-control-anchor`,style:{top:lt,left:0,width:"100%",height:ke(Math.max(qe,Sa))}})},"row-padding-handles"),u&&!ie&&Xt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((xt==null?void 0:xt.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:ke(Bt),height:"100%"}}),a.jsx("div",{"data-controls":Zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[st.length-1]-((wt==null?void 0:wt.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:ke(vt-At),width:ke(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=st[De+1],gt=_e.slice(0,De+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ye[De],It=Ye[De+1],pt=Math.max(ft.paddingRight,Fi),jt=Math.max(It.paddingLeft,Fi);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(Be[De]-ft.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:ke(gt-pt),width:ke(pt),height:"100%"}}),a.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[De+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:ke(gt),width:ke(jt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=Oy(De,_e,Se,ze),ft=_e.slice(0,De+1).reduce((It,pt)=>It+pt,0)-kl/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(Ws),"data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ke(ft),width:ke(kl),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),Ge&&(()=>{const Le=Fr(e,Wn),De=vy(e.cutLabelVerticalAlign),it=Le.textTextAlign==="justify"||ie;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ke(R??0),cursor:at?"pointer":"default",...sy(Fe,h??0,n??!1)},onClick:at?Je:void 0,onMouseEnter:X||ee?Ct:void 0,onMouseLeave:X?Nt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...ie?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{},justifyContent:xy(Le.textTextAlign),alignItems:Il(De)},children:a.jsx("span",{className:El(e,Wn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Pl(Le,n),...Ml(e,Wn,c,n),...it?{width:"100%"}:{}},children:H})})})})(),ee&&T&&(()=>{const Le=`${T.widthPx}px`,De={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:a.jsx(ry,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:De},`${T.rowId}-${T.url}`)})})()]})})]})}const Vy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10224
|
+
`}const ei=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Fs=["AColumn","BColumn","CColumn","DColumn","EColumn"],Wn="cutLabel",ko=[...Fs,Wn],Jr=["A","B","C","D","E"];function Sd(e){return`${e}ColumnVerticalAlign`}const Ja=["Top","Center","Bottom"];function _s(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return Jr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function py(e){const t=_s(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function my(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return Jr.includes(n)?n:null}function $d(e,t,n){const i=my(e);return i?i===t?!1:py(n[Sd(i)]):!0}function Ao(e){const t=_s(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return Jr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function gy(e,t,n){if(Cd(e,t,n))return Ao(e);const i=Ao(e);return i.kind==="baseline"?{kind:"top"}:i}function hy(e){const t=Ao(e);return t.kind==="baseline"?{kind:"top"}:t}function Cd(e,t,n){return $d(e,n,t)?Ao(e).kind==="baseline":!1}function fy(e){const t={};let n=!1;for(const i of Jr){const o=Sd(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}$d(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function yy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function vy(e){const t=Ao(e).kind;return t==="baseline"?"center":t}function xy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Il(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function by(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 wa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=by(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 wy(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 Sy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const $y={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Cy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Ty(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Ly(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(ko.map(e=>[Cy[e],Ty(e)]))}}function Fr(e,t){const n=i=>{const o=Pt(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===Wn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Pl(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 an(Ut(n,t))}function El(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function Ml(e,t,n,i){const o=Fr(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((r-l)/2,i)}}const vn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Yi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Ki=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Zi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],Ry={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},Iy=["hover","focus","filled","success","error"],kl=.004,_i=.004,Sa=_i,Ws=50,Fo=1440,_o=Ws/Fo;function Td(e){const t=typeof e=="number"&&e>0?e:Fo;return Ws/t}function Py(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 Fo}const Ld={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function So(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function Ey(e,t=1){const n=t/e;return Object.fromEntries(vn.map(i=>[i,n]))}function My(){return Object.fromEntries([...Yi.map(e=>[e,0]),...Ki.map(e=>[e,0])])}function ky(){return Object.fromEntries(Zi.map(e=>[e,0]))}function sr(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function Rd(e,t,n){const i=e-_o,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 $r(e,t,n){const i=Ns(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 Ay(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=Yi[o],l=Ki[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=Rd(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function Ns(e,t,n){if(e<=0)return[];const i=vn.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)+_o;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]-_o;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function Fy(e,t,n){if(e<=1)return{};const i=Ns(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=vn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function Al(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ei]}function _y(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function Wy(e,t,n,i){const o=Math.min(i,e.length,vn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=vn[c],p=Yi[c],b=Ki[c],x=Zi[c],g=vn[l],m=Yi[l],h=Ki[l],f=Zi[l],C=n[u],y=n[p],R=n[b],H=n[x];typeof C=="number"&&(r[g]=C),typeof y=="number"&&(r[m]=y),typeof R=="number"&&(r[h]=R),typeof H=="number"&&(r[f]=H)}return r}function Id(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 Ny(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=So(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...Ey(n,o),...My()};if(r)for(const d of Zi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,ky());return Id(e,l)?l:e}function Hy(e,t,n){const i=fy(e);i&&(e={...e,...i});const o=Td(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=So(e),c=So(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ei.length,b=R=>{if(u)return R;const H=sr({...t,...R}),S=So(R),U=$r(p,S,H),F=Ay(p,U,{...t,...R});return Object.keys(F).length===0?R:{...R,...F}};if(typeof r=="number"&&r!==l)return e;const x=Al(e),g=Al(t);if(!_y(x,g))return b({...e,...Wy(x,g,t,p)});if(d<c&&typeof p=="number"&&!u){const R=sr({...t,...e});return b({...e,...Fy(p,d,R)})}if(u){const R=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return R>H?{...e,textPaddingLR:H}:e}const m=sr({...t,...e}),h=$r(p,c,sr(t)),C=$r(p,d,m).some((R,H)=>R<(h[H]??R)),y=vn.some(R=>{const H=e[R],S=t[R];return typeof H=="number"&&typeof S=="number"&&H!==S});return C||y?b(e):e}function Oy(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(_o,i-o-r-_o)}function Dy(e,t){return Math.random()*(t-e)+e}function By(e){return Object.fromEntries(vn.map(t=>[t,typeof e[t]=="number"?e[t]:Ld[t]]))}function $a(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function jy(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=Yi[d],u=Ki[d],p=Zi[d];return{key:l,textPrefix:$y[l],widthKey:vn[d],width:n[vn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function zy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=W.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:x,entriesCount:g,cellMinHeight:m,dividerWidth:h,showVisibility:f,cut:C,showCut:y,cutCellMinHeight:R,cutLabel:H,imageSize:S,imageOnHover:U,imagePosition:F="cursor",imageInterpolation:_="on",entryHoverEffect:B,entryHoverShowOption:L,rowPaddingTop:N,rowPaddingBottom:k,rowPaddingTopB:Z,columnsOrder:M,textPaddingLR:K,textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P}=e,[Q,z]=s.useState(void 0),[T,O]=s.useState(null),E=s.useRef(null),ee=U==="on"&&(!n||i),V=F==="cursor",ue=V&&_==="on",{anchorRef:Ie,onShow:ge,onCursorMove:ae,exit:ne}=dy(!!(ee&&T!==null),ue),oe=(C??0)>0,ie=b==="b",Ae=s.useRef(null),be=s.useRef(null),[Me,q]=s.useState(null),[se,he]=s.useState(Fo),G=Td(se),re=Math.max(0,((x??0)-G)/2),me=Math.min(K??0,re),we=Math.max(me,_i),Pe=((x??0)+G)/2;s.useLayoutEffect(()=>{if(!n){he(Fo);return}const Le=()=>{he(Py(Ae.current))};Le();const De=Ae.current;if(!De)return;const it=new ResizeObserver(Le);it.observe(De);let gt=De;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&it.observe(gt),()=>it.disconnect()},[n,l]),s.useEffect(()=>{z(void 0)},[C,y,t,g]),s.useEffect(()=>{n&&!i&&z(void 0)},[n,i]);const Ce=W.buildColorVars(c,{textColor:D,backgroundColor:j,dividerColor:$,textHoverColor:v,backgroundHoverColor:w,dividerHoverColor:P},Ry,Iy),Y=r&&r!=="default"?`${c}-state-${r}`:"",pe=`${!n||i?B==="default"?`${c}-entry-hover-default`:B==="blinds"?`${c}-entry-hover-blinds`:B==="reveal"?`${c}-entry-hover-reveal`:"":""} ${Y}`.trim(),X=B==="reveal"&&(!n||i),le=(f==null?void 0:f[0])??!1,Fe=(f==null?void 0:f[1])??!1,fe=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){fe.current=e,J.current=l;return}if(J.current!==l){fe.current=e,J.current=l;return}const Le=fe.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){fe.current=e;return}const it=Hy(e,Le,{designWidth:se});fe.current=e,Id(e,it)&&d(it)},[e,d,n,l,se]);const Xe=s.useMemo(()=>By(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Oe=s.useMemo(()=>$a(e,Yi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),dt=s.useMemo(()=>$a(e,Ki),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),nt=s.useMemo(()=>$a(e,Zi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ht=s.useMemo(()=>Array.isArray(M)&&M.length>0?M:[...ei],[M]),st=s.useMemo(()=>jy(ht,p,Xe,Oe,dt,nt),[ht,p,Xe,Oe,dt,nt]),ze=So(e),Se=s.useMemo(()=>vn.slice(0,p).map(Le=>Xe[Le]),[p,Xe]),_e=s.useMemo(()=>Ns(p,ze,Xe),[p,ze,Xe]),Be=s.useMemo(()=>$r(p,ze,Xe),[p,ze,Xe]),Ye=s.useMemo(()=>st.map((Le,De)=>Rd(Be[De]??0,Le.paddingLeft,Le.paddingRight)),[st,Be]),de=s.useMemo(()=>{const Le=g===0?1/0:g;return(t??[]).slice(0,Le).map((it,gt)=>({id:gt,cells:Object.fromEntries(ei.map(ft=>[ft,it[ft]??""])),image:it.image,link:it.link}))},[t,g]),ve=oe?Q??C:de.length,Ee=s.useMemo(()=>oe?de.slice(0,ve):de,[de,oe,ve]),Ge=oe&&ve<de.length,Ze=Ee.length>1||Ge,Ve=[le?`${c}-divider-top`:"",Fe||Ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),at=!n||i,Je=()=>{if(!at)return;const Le=Q??C;if(!y){z(de.length);return}z(Math.min(Le+y,de.length))},ke=Le=>W.scalingValue(Le,n??!1),qe=ie?Z??0:N??0,We=k??0,tt=m??0,rt=Math.max(We,Sa),lt=Tl(0,Ee.length,le,Fe,Ge,h??0,n??!1).borderTopWidth,Tt=ie?"rowPaddingTopB":"rowPaddingTop",Xt=st[0],Zt=st[st.length-1],xt=Ye[0],wt=Ye[Ye.length-1],Bt=Xt&&xt?Math.max(xt.paddingLeft,_i):0,At=Zt&&wt?Math.max(wt.paddingRight,_i):0,vt=ze,Ft=(Le,De)=>cy(F,Ae.current,V?Le:null,De),Wt=(Le,De)=>{if(!ee)return;const it=Le.image;if(!(it!=null&&it.url)){ne(()=>O(null));return}const gt=(S==null?void 0:S.min)??80,ft=(S==null?void 0:S.max)??320,It=(T==null?void 0:T.rowId)===Le.id,pt=It?T.widthPx:Dy(gt,ft),{x:jt,y:kt}=Ft(De,pt);if(It&&V){ae(jt,kt);return}O({rowId:Le.id,url:it.url,objectFit:"contain",isVideo:oy(it),widthPx:pt}),E.current={x:jt,y:kt}},Yt=Le=>{if(!ee||!T||!V)return;const{x:De,y:it}=Ft(Le,T.widthPx);ae(De,it)},Jt=()=>{T&&ne(()=>O(null))},Ct=Le=>{X&&$l(Le,c),!(!ee||!T)&&ne(()=>O(null))},Nt=Le=>{X&&Cl(Le,c)};s.useLayoutEffect(()=>{if(!T||!E.current)return;const{x:Le,y:De}=E.current;E.current=null,ge(Le,De)},[T==null?void 0:T.rowId,T==null?void 0:T.url,ge]),s.useLayoutEffect(()=>{if(!u||ie){q(null);return}const Le=be.current,De=Le==null?void 0:Le.parentElement;if(!Le||!De){q(null);return}const it=()=>{const ft=Le.querySelector("[data-list-row]");if(!ft){q(null);return}const It=De.getBoundingClientRect(),pt=ft.getBoundingClientRect();q(pt.top-It.top+pt.height/2)};it();const gt=new ResizeObserver(it);return gt.observe(Le),gt.observe(De),()=>gt.disconnect()},[u,ie,Ee,qe,We,tt,t,e,st,Be,se,h,le,Fe,Ge]);const rn=s.useMemo(()=>!ie&&Fs.some(Le=>{const De=Le.charAt(0),it=e[`${Le}VerticalAlign`];return Cd(it,e,De)}),[ie,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var jt;const Le=Ae.current;if(!Le)return;const De=()=>{Le.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Mt=kt.querySelector(`.${c}-list-col`);Mt&&(Mt.style.minHeight="",Mt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(ie||!rn){De();return}const it=()=>{const kt=Array.from(Le.querySelectorAll("[data-list-row]")),Mt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Ot=Ht.querySelector(`.${Mt}`);Ot&&(Ot.style.minHeight="",Ot.style.height="");const _t=Ht.querySelector(`.${c}-list-col-title`);_t&&(_t.style.transform="")})}),kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));wy(Gt,Ht,Mt)}),Le.offsetHeight,kt.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Ot=Gt.getBoundingClientRect().top,_t=new Map,St=Ht.map(Re=>{const Ne=Re.querySelector(`.${c}-list-col-title`),ot={el:Re,titleEl:Ne,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return _t.set(ot.letter,ot),ot}),A=new Map,$e=(Re,Ne)=>{const ot=A.get(Re.letter);if(ot!==void 0)return ot;const Et=Re.anchor?_t.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Et||Ne.has(Re.letter)){const nn=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,nn),nn}Ne.add(Re.letter);const Qe=$e(Et,Ne);Ne.delete(Re.letter);const yt=wa(Re,Ot,Mt,Vt),Dt=Qe-yt;Sy(Re.titleEl,Dt);const Lt=wa(Re,Ot,Mt,Vt);return A.set(Re.letter,Lt),Lt};St.forEach(Re=>$e(Re,new Set))})};let gt=null;const ft=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,it()}))};it();const It=new ResizeObserver(()=>ft());It.observe(Le);let pt=!1;return typeof document<"u"&&((jt=document.fonts)!=null&&jt.ready)&&document.fonts.ready.then(()=>{pt||ft()}),()=>{pt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),De()}},[rn,ie,e,t,se,Ee,Be]);const mt=s.useMemo(()=>uy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),a.jsx("div",{style:Ce,children:a.jsxs("div",{ref:Ae,className:`${c}-wrapper ${pe}${Ve?` ${Ve}`:""}${ie?` ${c}-type-b`:""}`.trim(),style:{width:W.scalingValue(x??0,n)},onMouseMove:ee?Yt:void 0,onMouseLeave:ee?Jt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ee.map((Le,De)=>{var It;const it=(((It=Le.link)==null?void 0:It.length)??0)>0,gt=it&&(!n||i)?"a":"div",ft=Tl(De,Ee.length,le,Fe,Ge,h??0,n??!1);return a.jsxs(gt,{ref:De===0?pt=>{be.current=pt}:void 0,className:`${c}-list-item${it||L==="always"?` ${c}-list-item-has-link`:""}${Ge&&De===Ee.length-1?` ${c}-list-item-before-cut`:""}`,...it?{href:Le.link,target:"_blank"}:{},style:ft,onMouseEnter:pt=>{X&&(it||L==="always")&&$l(pt,c),ee&&Wt(Le,pt)},onMouseLeave:pt=>{X&&(it||L==="always")&&Cl(pt,c)},children:[qe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(qe)}}),a.jsxs("div",{className:`${c}-list-cols-row${ie?"":` ${c}-list-cols-row-h`}${u&&De===0&&ie?` ${c}-list-cols-row-controls`:""}`,...ie?{}:{"data-list-row":""},style:ie?void 0:{minHeight:ke(tt)},children:[st.map((pt,jt)=>{const kt=jt===st.length-1,Mt=Ye[jt],Vt=pt.paddingBottom,Gt=ay(Le.cells[pt.key]),Ht=ie&&Gt&&Vt>0,Ot=ie?{minHeight:ke(tt)}:{width:ke(Be[jt])},_t=ie?{paddingLeft:ke(me),paddingRight:ke(me)}:{paddingLeft:ke(Mt.paddingLeft),paddingRight:ke(Mt.paddingRight)},St=pt.textPrefix.charAt(0),A=ie?hy(e[`${pt.textPrefix}VerticalAlign`]):gy(e[`${pt.textPrefix}VerticalAlign`],e,St),$e=ie&&Gt&&u&&De===0;return ie&&!Gt?null:a.jsxs("div",{className:ie?`${c}-list-col-wrap`:void 0,...ie?{}:{"data-list-col":"","data-col-letter":St,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{..._t,...Ot,...ie?{justifyContent:Il(A.kind)}:{}},"data-test":pt.width,children:a.jsx("span",{className:El(e,pt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Pl(Fr(e,pt.textPrefix),n),...Ml(e,pt.textPrefix,c,n),...ie?{}:yy(A.kind)},children:Le.cells[pt.key]??null})}),Ht&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Vt)}}),$e&&a.jsx("div",{"data-controls":pt.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:ke(Math.max(Vt,Sa))}})]},pt.key)}),u&&De===0&&ie&&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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:ke(we),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(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:ke(Math.max(we,ze-we)),width:ke(we),height:"100%"}})]})]}),!ie&&We>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(We)}}),u&&De===0&&!ie&&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:ke(rt)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Tt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":ie?"center":"left-y",className:`${c}-control-anchor`,style:{top:lt,left:0,width:"100%",height:ke(Math.max(qe,Sa))}})},"row-padding-handles"),u&&!ie&&Xt&&Zt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Xt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((xt==null?void 0:xt.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:ke(Bt),height:"100%"}}),a.jsx("div",{"data-controls":Zt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[st.length-1]-((wt==null?void 0:wt.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:ke(vt-At),width:ke(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=st[De+1],gt=_e.slice(0,De+1).reduce((kt,Mt)=>kt+Mt,0),ft=Ye[De],It=Ye[De+1],pt=Math.max(ft.paddingRight,_i),jt=Math.max(It.paddingLeft,_i);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(Be[De]-ft.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:ke(gt-pt),width:ke(pt),height:"100%"}}),a.jsx("div",{"data-controls":it.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[De+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:ke(gt),width:ke(jt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!ie&&st.slice(0,-1).map((Le,De)=>{const it=Oy(De,_e,Se,ze),ft=_e.slice(0,De+1).reduce((It,pt)=>It+pt,0)-kl/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(Ws),"data-controls-max-fraction":String(it),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ke(ft),width:ke(kl),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),Ge&&(()=>{const Le=Fr(e,Wn),De=vy(e.cutLabelVerticalAlign),it=Le.textTextAlign==="justify"||ie;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ke(R??0),cursor:at?"pointer":"default",...sy(Fe,h??0,n??!1)},onClick:at?Je:void 0,onMouseEnter:X||ee?Ct:void 0,onMouseLeave:X?Nt:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...ie?{paddingLeft:ke(me),paddingRight:ke(me)}:{},justifyContent:xy(Le.textTextAlign),alignItems:Il(De)},children:a.jsx("span",{className:El(e,Wn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Pl(Le,n),...Ml(e,Wn,c,n),...it?{width:"100%"}:{}},children:H})})})})(),ee&&T&&(()=>{const Le=`${T.widthPx}px`,De={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:a.jsx(ry,{media:T,className:T.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:De},`${T.rowId}-${T.url}`)})})()]})})]})}const Vy=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10225
10225
|
import { CommonComponentProps } from '../props';
|
|
10226
10226
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10227
10227
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13309,7 +13309,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13309
13309
|
</>
|
|
13310
13310
|
);
|
|
13311
13311
|
}
|
|
13312
|
-
`,ao=["A","B","C","D","E"],Fl=[...Ja,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ci={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 Gy(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function qy(){return Object.fromEntries(ao.map((e,t)=>{const n=Qn[t],i=`${e} column`;return[n,Gy(i)]}))}function Xy(){const e={};for(const t of ao)e[`${t}ColumnWidth`]=lr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lr(`${t} column padding bottom`);return e}function _l(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Qn]};for(const r of ao)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 Uy(e){const t={};if(e===Wn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ja]},enum:[...Ja]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Fl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Fl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...ci.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...ci.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...ci.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...ci.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...ci.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...ci.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...ci.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Yy=ko.reduce((e,t)=>({...e,...Uy(t)}),{});function Ky(e){return{verticalAlign:e===Wn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Wn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Zy(e,t={}){var n;return{...Ky(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Wl=new Set(["textFontFamily","textFontSettings"]);function Jy(e,t,n){const i=r=>n===void 0?!0:n==="common"?Wl.has(r):!Wl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=_s(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function Cr(e={},t){return ko.reduce((n,i)=>({...n,...Jy(i,Zy(i,e),t)}),{})}const Qy=Cr(),ev=Ly();function Pd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function tv(){const e=[];return Fs.forEach((t,n)=>{const i=Qn[n],o=Pd(t);for(let r=1;r<Qn.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 nv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Pd(Wn);const iv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],di=[{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"}],ov=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:di[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:di[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:di[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:di[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:di[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:di[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:di[6],link:""}],rv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],av={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:{...qy(),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:ov},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"}},...Xy(),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"}},...Yy,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",...Qy,...Cr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:_l({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},...Cr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:_l({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},...Cr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...tv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...iv.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}},...ao.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",...rv]},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__",ev]}],paletteBookmark:{items:[...nv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},sv={element:zy,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ny(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:[...ko.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:av,sourceCode:Vy},Nl=300,jn=.004,lv={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"},cv=["hover","focus","filled","success","error"];function dv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ol(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:W.scalingValue((o-t)/2,i)}}function uv(e){return`
|
|
13312
|
+
`,ao=["A","B","C","D","E"],Fl=[...Ja,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],di={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 Gy(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function lr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function qy(){return Object.fromEntries(ao.map((e,t)=>{const n=ei[t],i=`${e} column`;return[n,Gy(i)]}))}function Xy(){const e={};for(const t of ao)e[`${t}ColumnWidth`]=lr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=lr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=lr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=lr(`${t} column padding bottom`);return e}function _l(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ei]};for(const r of ao)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 Uy(e){const t={};if(e===Wn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ja]},enum:[...Ja]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Fl],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...Fl]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...di.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...di.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...di.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...di.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...di.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...di.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...di.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Yy=ko.reduce((e,t)=>({...e,...Uy(t)}),{});function Ky(e){return{verticalAlign:e===Wn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Wn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Zy(e,t={}){var n;return{...Ky(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const Wl=new Set(["textFontFamily","textFontSettings"]);function Jy(e,t,n){const i=r=>n===void 0?!0:n==="common"?Wl.has(r):!Wl.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=_s(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function Cr(e={},t){return ko.reduce((n,i)=>({...n,...Jy(i,Zy(i,e),t)}),{})}const Qy=Cr(),ev=Ly();function Pd(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function tv(){const e=[];return Fs.forEach((t,n)=>{const i=ei[n],o=Pd(t);for(let r=1;r<ei.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 nv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Pd(Wn);const iv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ui=[{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"}],ov=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ui[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ui[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ui[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ui[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ui[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ui[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ui[6],link:""}],rv=[...ao.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],av={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:{...qy(),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:ov},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"}},...Xy(),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"}},...Yy,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",...Qy,...Cr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:_l({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},...Cr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:_l({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},...Cr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...tv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...iv.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}},...ao.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",...rv]},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__",ev]}],paletteBookmark:{items:[...nv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},sv={element:zy,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Ny(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:[...ko.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...ko.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:av,sourceCode:Vy},Nl=300,jn=.004,lv={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"},cv=["hover","focus","filled","success","error"];function dv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Hl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ol(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:W.scalingValue((o-t)/2,i)}}function uv(e){return`
|
|
13313
13313
|
.${e}-wrapper {
|
|
13314
13314
|
box-sizing: border-box;
|
|
13315
13315
|
display: flex;
|
|
@@ -13474,7 +13474,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13474
13474
|
pointer-events: none;
|
|
13475
13475
|
z-index: 2;
|
|
13476
13476
|
}
|
|
13477
|
-
`}function Dl(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 pv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=W.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:x="default",autoclose:g="off",icon:m,iconMaxWidth:h=.00833,iconPaddingRight:f=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:R="#000000",dividerColor:H="#0000001F",iconColor:S="#000000",questionHoverColor:U="#666666",iconHoverColor:F="#666666",iconActiveColor:_="#000000",dividerHoverColor:B="#000000",questionFontFamily:L,questionFontSettings:N,questionFontSize:k,questionLineHeight:Z,questionLetterSpacing:
|
|
13477
|
+
`}function Dl(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 pv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=W.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:x="default",autoclose:g="off",icon:m,iconMaxWidth:h=.00833,iconPaddingRight:f=0,iconAnimation:C="rotate 45",questionColor:y="#000000",answerColor:R="#000000",dividerColor:H="#0000001F",iconColor:S="#000000",questionHoverColor:U="#666666",iconHoverColor:F="#666666",iconActiveColor:_="#000000",dividerHoverColor:B="#000000",questionFontFamily:L,questionFontSettings:N,questionFontSize:k,questionLineHeight:Z,questionLetterSpacing:M,questionWordSpacing:K,questionTextAppearance:D,answerFontFamily:j,answerFontSettings:$,answerFontSize:v,answerLineHeight:w,answerLetterSpacing:P,answerWordSpacing:Q,answerTextAppearance:z,questionPaddingLeft:T=0,questionPaddingTop:O=0,questionPaddingBottom:E=0,answerPaddingLeft:ee=0,answerPaddingRight:V=0,answerPaddingTop:ue=0,answerPaddingBottom:Ie=0}=e,ge=t??[],[ae,ne]=s.useState(()=>new Set),oe=!n||i;s.useEffect(()=>{ne(new Set)},[g]),s.useEffect(()=>{n&&!o&&!i&&ne(new Set)},[n,o,i]);const ie=Ye=>W.scalingValue(Ye,n??!1),Ae=Math.max(T,jn),be=Math.max(O,jn),Me=Math.max(E,jn),q=Math.max(ee,jn),se=Math.max(V,jn),he=Math.max(ue,jn),G=Math.max(Ie,jn),re=Math.max(0,(c??1)-f-h),me=Math.max(0,(c??1)-V),we=Math.max(0,(c??1)-ee),Pe=Math.max(f,jn),Ce=Math.max(0,(c??1)-T-h),Y=s.useMemo(()=>ae.size===0?0:Math.min(...ae),[ae]),xe=s.useCallback(Ye=>ae.has(Ye),[ae]),pe=oe&&x==="default"?`${l}-entry-hover-default`:"",X=m??"",le=X!=="",Fe=C.replace(/^rotate /,""),fe=`${l}-icon-anim-${Fe}`,J=an(Ut(Dl(L,N,k,Z,M,K,D,y),n)),Xe=an(Ut(Dl(j,$,v,w,P,Q,z,R),n)),Oe=Hl(k,Z,`${l}-question`,`${l}-text-tight-leading`),dt=Hl(v,w,`${l}-answer-text`,`${l}-text-tight-leading`),nt=Ol(k,Z,l,n),ht=Ol(v,w,l,n),st=W.buildColorVars(l,{questionColor:y,answerColor:R,dividerColor:H,iconColor:S,questionHoverColor:U,iconHoverColor:F,iconActiveColor:_,dividerHoverColor:B},lv,cv),ze=r&&r!=="default"?`${l}-state-${r}`:"",Se=s.useCallback(Ye=>{oe&&ne(de=>{if(de.has(Ye)){const Ee=new Set(de);return Ee.delete(Ye),Ee}if(g==="on")return new Set([Ye]);const ve=new Set(de);return ve.add(Ye),ve})},[oe,g]),_e=s.useMemo(()=>uv(l),[l]),Be={[`--${l}-divider-width`]:W.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:W.scalingValue(h,n??!1),...u>0?{[`--${l}-question-min-height`]:W.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:_e}}),a.jsx("div",{style:st,children:a.jsx("div",{className:ut(`${l}-wrapper`,n&&!i&&`${l}-editor`,pe,ze),style:{width:W.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:ge.map((Ye,de)=>{var at;const ve=xe(de),Ee=((at=Ye.question)==null?void 0:at.trim())??"",Ge=Ye.answer,Ze=((Ge==null?void 0:Ge.length)??0)>0,Ve=d&&de===Y;return a.jsxs("div",{className:ut(`${l}-item`,ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[Ve&&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:ie(be)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ie(Ae),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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ie(Pe),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":ve,style:{...J,...nt,paddingLeft:ie(T),paddingRight:ie(f)},onClick:()=>Se(de),children:[O>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ie(O)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Oe,children:Ee}),Ze&&(le?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${fe}`,"aria-hidden":"true",children:a.jsx(sn,{url:X,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 ${fe}`,"aria-hidden":"true"}))]}),E>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:ie(E)},"aria-hidden":"true"})]}),Ve&&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:ie(Me)}})]}),Ze&&Ge&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[Ve&&ve&&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:ie(he)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(me),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:ie(q),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(we),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:ie(se),height:"100%"}})]}),ue>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ie(ue)}}),a.jsx("div",{className:`${l}-answer`,style:{...Xe,...ht,paddingLeft:ie(ee),paddingRight:ie(V)},children:a.jsx("div",{className:dt,children:a.jsx($i,{content:Ge})})}),Ie>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:ie(Ie)}}),Ve&&ve&&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:ie(G)}})]})})})]},de)})})})]})}const mv=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13478
13478
|
import cn from 'classnames';
|
|
13479
13479
|
import { CommonComponentProps } from '../props';
|
|
13480
13480
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14222,7 +14222,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14222
14222
|
</>
|
|
14223
14223
|
);
|
|
14224
14224
|
}
|
|
14225
|
-
`;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Bl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],hv={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:zn("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:{...Bl.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:{...Bl.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...gv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},fv={element:pv,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:hv,sourceCode:mv},Nn=e=>e.display==="cover",Qr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},jl=100,yv=.2,zl=8,Ed=({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"?jl:Math.max(jl,window.innerHeight*yv),[]),b=s.useCallback(L=>Math.max(0,1-L/(p*1.5)),[p]),x=s.useCallback(L=>Math.max(0,1-L/(p*.45)),[p]),g=s.useCallback(L=>{const N=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-L/N*.12);return`translateY(${L}px) scale(${k})`},[]),m=s.useCallback(()=>{c.current=null},[]),h=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),f=s.useCallback(()=>{const L=typeof window<"u"?window.innerHeight:800;d(!0),r(L),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),C=s.useCallback(L=>{!e||l||L.pointerType==="touch"&&(i!=null&&i(L.target)||(c.current={startX:L.clientX,startY:L.clientY,isLocked:null,pointerId:L.pointerId}))},[e,l,i]),y=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=L.clientX-N.startX,Z=L.clientY-N.startY;if(N.isLocked===null){if(Math.abs(k)<zl&&Math.abs(Z)<zl)return;if(Z>0&&Z>Math.abs(k))N.isLocked=!0,L.currentTarget.setPointerCapture(L.pointerId);else{N.isLocked=!1,m();return}}if(!N.isLocked)return;L.preventDefault();const E=Math.max(0,Z);u.current=E,r(E)},[e,m]),R=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=N.isLocked===!0;if(L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId),!k){m();return}L.clientY-N.startY>=p?f():h()},[p,f,e,m,h]),H=s.useCallback(L=>{R(L)},[R]),S=s.useCallback(L=>{R(L)},[R]),U=o>0,F=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:b(o),transition:_},mediaAreaStyle:{transform:g(o),transition:F,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:B?{opacity:x(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:H,onPointerCancel:S}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},vv="[data-lightbox-scrollable]",Md=()=>{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(vv)||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"})}},[])},xv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},bv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},wv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Sv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(m,h)=>{bv(t),e.scrollLeft=m,h&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=m=>{m.target!==t||m.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),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)`,b=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-wv(t),!1))}},$o=300,$v=900,Cv=1500,Tv="cubic-bezier(0.16, 1, 0.3, 1)",Lv=3e3,Rv=2,Iv=16,Pv=.05,Ev=1,cr=.3,Mv=50,kv=20,Ii=.004,Ji=["title1","title2","title3"],Av={title1:"1",title2:"2",title3:"3"},Fv={title1:"title1Color",title2:"title2Color",title3:"title3Color"},_v={title1:.02,title2:.02,title3:.02},dr=e=>`max(${e}, ${kv}px)`,Wv=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]}},Nv=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=Wv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Hv=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")],Ov=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ji.map(e=>[Av[e],Hv(e)]))}),Hs=(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},kd=(e,t)=>Hs(e,t),ur=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Hs(e.length,n),effective:kd(e.length,n)}},Dv=(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},Ca=(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[Fv[t]]}},Bv=(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),Ta=(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??_v[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},jv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:x,closeIconMaxWidth:g,closeIconColor:m,closeIconHoverColor:h,thumbnailTrigger:f,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:R,thumbnailActiveColor:H,title1Width:S,title2Width:U,title3Width:F,title1MarginLeft:_=0,title2MarginLeft:B=0,title3MarginLeft:L=0,titleRowMarginBottom:N=0,titleHeaderLayout:k="desktop",contentMarginTop:Z,iconMarginLeft:E}=n,K=I=>W.scalingValue(I,i??!1),D=c??n.thumnailSize??.03,j=K(D),$=K(u),v=K(p??.02),w=K(b??0),P=K(Z??0),Q=dr(P),z=K(E??0),[T,O]=s.useState(0),M=s.useRef(T);M.current=T;const ee=t[T],{title1:V,title2:me,title3:Ie}=Nv(ee),ge=Ta("title1",Ca(n,"title1"),i),ae=Ta("title2",Ca(n,"title2"),i),ne=Ta("title3",Ca(n,"title3"),i),oe=k==="mobile",ie=!o&&(!i||r),Ae=ie,be=ie,Me=ie,q=Nn(y),se=q?{"--image-aspect-ratio":Qr(y)}:void 0,he=!!(V||me||Ie),G=s.useMemo(()=>Dv(e,V,me,Ie,ge,ae,ne),[e,T,V,me,Ie,ge,ae,ne]),re=s.useMemo(()=>({title1Width:S,title2Width:U,title3Width:F}),[S,U,F]),pe=s.useMemo(()=>G.map(I=>re[I.widthKey]),[G,re]),we=s.useMemo(()=>Hs(G.length,pe),[G.length,pe]),Pe=s.useMemo(()=>kd(G.length,pe),[G.length,pe]),Ce=s.useMemo(()=>G.filter(I=>I.prefix==="title1"),[G]),Y=s.useMemo(()=>G.filter(I=>I.prefix==="title2"||I.prefix==="title3"),[G]),xe=s.useMemo(()=>Vl(Ce,re),[Ce,re]),ue=s.useMemo(()=>Vl(Y,re),[Y,re]),X=s.useCallback((I,te)=>{const ce=G.indexOf(I);if(!oe||te==="single-row")return{effectiveWidth:Pe[ce]??0,resolvedWidth:we[ce]??0,maxWidth:ur(ce,we)};if(te==="two-row-top"){const He=Ce.indexOf(I);return{effectiveWidth:xe.effective[He]??0,resolvedWidth:xe.resolved[He]??0,maxWidth:ur(He,xe.resolved)}}const Te=Y.indexOf(I);return{effectiveWidth:ue.effective[Te]??0,resolvedWidth:ue.resolved[Te]??0,maxWidth:ur(Te,ue.resolved)}},[Y,ue,Pe,we,G,Ce,xe,oe]),le=s.useCallback(I=>W.scalingValue(I,i??!1),[i]),Fe=le(N??0),fe=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:B,title3MarginLeft:L}),[_,B,L]),J=s.useCallback(I=>G.slice(0,I+1).reduce((te,ce,Te)=>te+(ce!=null&&ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(we[Te]??0),0)+(oe?0:_??0),[G,fe,we,oe,_]),Xe=s.useCallback(()=>oe?0:_??0,[oe,_]),Oe=s.useCallback(I=>Y.slice(0,I).reduce((te,ce,Te)=>te+(ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(ue.resolved[Te]??0),0),[Y,ue.resolved,fe]),dt=s.useCallback(I=>{const te=Y[I];return Oe(I)+(te.marginLeftKey?fe[te.marginLeftKey]??0:0)+(ue.resolved[I]??0)},[Y,ue.resolved,Oe,fe]),nt=(I,te)=>{const ce=I.marginLeftKey?fe[I.marginLeftKey]??0:0,{effectiveWidth:Te,resolvedWidth:He,maxWidth:Ke}=X(I,te),bt=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":I.prefix,style:{...te==="single-row"?{gridArea:I.prefix}:{},width:le(Te),...ce>0?{marginLeft:le(ce)}:{}},children:[a.jsx("p",{className:I.className,style:I.style,children:I.text}),bt&&I.marginLeftKey&&a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(-ce),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Ii/2),width:le(Ii),height:"100%",pointerEvents:"auto"}})]},I.className)},ht=()=>{const I=oe?-1:G.findIndex(Te=>Te.prefix==="title1"),te=!oe&&(o||(_??0)>0)?(()=>{const Te=_??0,He=I>=0?we[I]:S??0;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:`max(${le(Te)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=G.flatMap((Te,He)=>{if(!Te.marginLeftKey)return[];const Ke=fe[Te.marginLeftKey]??0,bt=Bv(G,we,fe,He)+Xe();return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[He]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(Ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)});return te?[te,...ce]:ce},st=()=>G.map((I,te)=>{const ce=ur(te,we),He=J(te)-Ii/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Ii),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),ze=()=>Y.flatMap((I,te)=>{if(!I.marginLeftKey)return[];const ce=fe[I.marginLeftKey]??0,Te=Oe(te),{resolvedWidth:He}=X(I,"two-row-bottom");return a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(Te),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},I.marginLeftKey)}),Se=()=>Y.map((I,te)=>{const{maxWidth:ce}=X(I,"two-row-bottom"),He=dt(te)-Ii/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Ii),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useRef(null),de=s.useRef(null),ve=s.useRef([]),Ee=s.useRef([]),Ge=s.useRef(0),Ze=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),at=s.useRef(null),Je=s.useRef(null),ke=s.useRef(0),qe=s.useRef("forward"),We=s.useRef(0),tt=s.useRef(null),rt=s.useRef(!1),lt=t.length>1&&(!o||!!r),Tt=lt?3:1,Xt=s.useMemo(()=>Array.from({length:Tt},()=>t).flat(),[t,Tt]),[Zt,xt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Wt=s.useRef(null),Yt=s.useRef(!1),Jt=s.useRef(!1),Ct=s.useRef(null),Nt=s.useRef(null),rn=Ae&&!At,mt=s.useCallback(()=>{Ae&&(vt(!0),Nt.current&&clearTimeout(Nt.current),Nt.current=setTimeout(()=>{Ve.current.isActive||vt(!1)},Lv))},[Ae]),Le=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Ct.current=setTimeout(()=>{l()},$o))},[o,l]),De=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(g??0,i),height:W.scalingValue(g??0,i),marginRight:z,"--close-icon-hover-color":h},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(sn,{url:x,fill:m,hoverFill:i&&!r?m:h,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:z,height:"100%",pointerEvents:"auto"}})]}),it=(I="two-row")=>a.jsx("div",{...I==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(_??0),flexShrink:0,...I==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...I==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const I=G.find(Te=>Te.prefix==="title1"),te=G.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),ce=te.length>0||o||(N??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?it():null,I&&nt(I,"two-row-top"),x&&De()]}),ce?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[te.map(Te=>nt(Te,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),Se()]})]}):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:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?it("single-row"):null,G.map(I=>nt(I,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),st()]}):null,x?De():null]}),It=s.useCallback(I=>!!(I.closest("[data-controls]")||I.closest(`.${e}-thumbnails`)||I.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pt,backdropStyle:jt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Ed({enabled:ie??!1,onClose:Le,animMs:$o,isBlockedTarget:It}),Ht=()=>{if(!lt||t.length===0)return Ge.current=0,0;const I=Ee.current[0],te=Ee.current[t.length];if(!I||!te)return Ge.current;const ce=te.offsetLeft-I.offsetLeft;return ce>0&&(Ge.current=ce),Ge.current},Ot=(I=!1)=>{if(!lt)return;const te=Be.current,ce=Ht();!te||ce<=0||ce<te.clientWidth*.25||(te.scrollLeft<=0?(te.scrollLeft+=ce,I&&(Ve.current.scrollLeft+=ce),rt.current&&(We.current+=ce)):te.scrollLeft>=ce*2&&(te.scrollLeft-=ce,I&&(Ve.current.scrollLeft-=ce),rt.current&&(We.current-=ce)))},_t=(I,te=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!lt)return I;let Te=t.length+I,He=1/0;for(let Ke=0;Ke<Tt;Ke++){const bt=Ke*t.length+I,Rt=Ee.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-te);tn<He&&(He=tn,Te=bt)}return Te},St=I=>{const te=Be.current;return!I||!te?!1:I.offsetWidth>te.clientWidth+1},A=I=>{const te=Be.current;if(!I||!te||!St(I))return!1;const ce=I.offsetLeft,Te=ce+I.offsetWidth;return te.scrollLeft>=ce-1&&te.scrollLeft+te.clientWidth<=Te+1},$e=(I=(te=>(te=Be.current)==null?void 0:te.scrollLeft)()??0)=>{for(let Te=0;Te<Ee.current.length;Te+=1){const He=Ee.current[Te];if(He&&A(He))return Te}let ce={flatIndex:0,distance:1/0};return Ee.current.forEach((Te,He)=>{if(!Te)return;const Ke=Math.abs(Te.offsetLeft-I);Ke<ce.distance&&(ce={flatIndex:He,distance:Ke})}),ce.flatIndex},Re=I=>{Be.current&&Ee.current.forEach(te=>{te&&(te.style.scrollSnapAlign=St(te)&&I==="backward"?"end":"start")})},Ne=(I,te,ce)=>{const Te=I-te,He=$e(te),Ke=Ee.current[He];if(A(Ke))return $e(I)%t.length;const bt=Ee.current[He+1],Rt=Ke?bt?bt.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0,tn=Rt>0?Te>Rt*cr?1:Te<-Rt*cr?-1:0:0;return tn===0?ce:lt?(ce+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+tn))},ot=s.useCallback((I=!1)=>{if(C!=="on"||o)return;const te=de.current,ce=M.current,Te=ve.current[ce];if(!te||!Te||te.scrollWidth<=te.clientWidth)return;const He=te.scrollLeft,Ke=He+te.clientWidth,bt=Te.offsetLeft,Rt=bt+Te.offsetWidth;if(bt>=He&&Rt<=Ke)return;const tn=te.scrollWidth-te.clientWidth;let Qt=He;if(!I&&Ft.current===null){const Ti=ve.current[ce-1],so=ve.current[ce+1],Qo=Ti?Te.offsetLeft-Ti.offsetLeft:so?so.offsetLeft-Te.offsetLeft:Te.offsetWidth;Rt>Ke?Qt+=Qo:bt<He&&(Qt-=Qo)}else Rt>Ke?Qt=Rt-te.clientWidth:Qt=bt;te.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((I=!1)=>{I&&(Yt.current=!0),Wt.current===null&&(Wt.current=requestAnimationFrame(()=>{Wt.current=null;const te=Yt.current;Yt.current=!1,ot(te)}))},[ot]),Qe=s.useCallback(I=>{if(I===M.current)return;const te=M.current;M.current=I;const ce=Math.abs(I-te)>1,Te=lt&&t.length>1&&(te===t.length-1&&I===0||te===0&&I===t.length-1);O(I),Et(ce||Te)},[t.length,lt,Et]),yt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const I=Be.current.scrollLeft,te=$e(I)%t.length;te!==M.current&&Qe(te)},Dt=()=>{Ft.current=null},Lt=I=>{const te=Be.current;te&&(te.style.scrollSnapType=I?"":"none")},nn=()=>{var I;(I=Je.current)==null||I.call(Je),Je.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),rt.current=!1},oi=()=>{const I=Be.current;if(!I){tt.current=null,rt.current=!1;return}const te=We.current-I.scrollLeft;if(Math.abs(te)<.5){I.scrollLeft=We.current,Ot(),yt(),tt.current=null,rt.current=!1;return}I.scrollLeft+=te*Pv,Ot(),yt(),mt(),tt.current=requestAnimationFrame(oi)},ri=()=>{const I=Ye.current;I&&(I.style.transition="",I.style.transform="",I.style.willChange="")},Yo=(I,te,ce,Te)=>{ri(),I.scrollLeft=te,ke.current=I.scrollLeft,Ot(),ce!==void 0?(M.current=ce,O(ce)):yt(),Lt(!0),Te==null||Te()},Ko=(I,{behavior:te="smooth",activeIndex:ce,onComplete:Te}={})=>{const He=Be.current,Ke=Ye.current;if(!He||!Ke)return;if(un(),nn(),Lt(!1),te==="auto"){Yo(He,I,ce,Te);return}const bt=Math.abs(I-He.scrollLeft),Rt=xv(bt,$v,Cv,He.clientWidth*.55);Je.current=Sv(He,Ke,I,{duration:Rt,easing:Tv,onComplete:()=>{Je.current=null,Yo(He,I,ce,Te)}})},ta=(I="smooth")=>{const te=Be.current;if(!te||t.length===0)return;const ce=$e()%t.length,Te=_t(ce,te.scrollLeft),He=Ee.current[Te];He&&Ko(He.offsetLeft,{behavior:I,activeIndex:ce})},na=(I,te="smooth",ce,Te)=>{const He=Be.current;if(!He||t.length===0)return;const Ke=(Te??He.scrollLeft)-I,bt=$e(I),Rt=Ee.current[bt];if(A(Rt)){Lt(!0),yt();return}const tn=Ee.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Ke>Qt*cr?1:Ke<-Qt*cr?-1:0:0)!==0){const ru=ce??bt%t.length,au=Ne(Te??He.scrollLeft,I,ru);Cn(au,te);return}const so=Te??He.scrollLeft,Qo=$e(so),Bs=Ee.current[Qo];if(Bs&&Math.abs(Bs.offsetLeft-so)<1){Lt(!0),yt();return}ta("auto")},Cn=(I,te="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Te=_t(I,ce.scrollLeft),He=Ee.current[Te];He&&(te==="smooth"?Ft.current=I:Ft.current=null,M.current=I,O(I),Et(!0),Ko(He.offsetLeft,{behavior:te,activeIndex:I,onComplete:te==="smooth"?Dt:void 0}))},Ci=()=>{at.current&&(window.removeEventListener("pointerup",at.current),window.removeEventListener("pointercancel",at.current),at.current=null)},Zo=(I,te,ce,Te,He)=>{const Ke=ce-I,bt=Te-te,Rt=Math.abs(Ke),tn=Math.abs(bt);if(Rt<Mv||Rt<=tn)return!1;const Qt=Ke<0?1:-1,Ti=lt?(He+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,He+Qt));return Ti===He?!1:(Cn(Ti),!0)},ai=I=>{if(!Ve.current.isActive)return;Ci();const te=Be.current;if(!te)return;const{scrollLeft:ce,startActiveIndex:Te,hasMoved:He}=Ve.current,Ke=te.scrollLeft;Ot(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),I!==void 0&&te.hasPointerCapture(I)&&te.releasePointerCapture(I),He?na(ce,"smooth",Te,Ke):(Lt(!0),yt()),mt()},Jo=(I,te)=>{const ce=Ze.current;Ze.current=null,ce&&(Zo(ce.startX,ce.startY,I,te,ce.startActiveIndex),mt())},ia=I=>{if(!be)return;if(I.pointerType==="touch"){if(un(),Lt(!0),It(I.target))return;Ze.current={startX:I.clientX,startY:I.clientY,startActiveIndex:M.current};return}if(I.pointerType!=="mouse"||I.button!==0||It(I.target))return;const te=Be.current;if(!te)return;un(),nn(),ri(),Ft.current=null,Ve.current={isActive:!0,startX:I.clientX,scrollLeft:te.scrollLeft,startActiveIndex:M.current,hasMoved:!1},Lt(!1),mt(),te.setPointerCapture(I.pointerId),Ci();const ce=Te=>{Te.pointerType==="mouse"&&ai(Te.pointerId)};at.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},oa=I=>{if(!be||I.pointerType!=="mouse")return;const te=Be.current;if(!te||!Ve.current.isActive)return;if(I.buttons===0){ai(I.pointerId);return}const ce=I.clientX-Ve.current.startX;Math.abs(ce)>Ev&&(Ve.current.hasMoved=!0,xt(!0)),Ve.current.hasMoved&&(I.preventDefault(),te.scrollLeft=Ve.current.scrollLeft-ce,Ot(!0),yt(),mt())},ye=I=>{if(be){if(I.pointerType==="touch"){I.type==="pointerup"?Jo(I.clientX,I.clientY):Ze.current=null;return}I.pointerType==="mouse"&&ai(I.pointerId)}},je=I=>{!be||I.pointerType!=="mouse"||ai(I.pointerId)};return Md(),s.useEffect(()=>{const I=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(I),nn(),Ci(),Wt.current!==null&&(cancelAnimationFrame(Wt.current),Wt.current=null),Ct.current&&clearTimeout(Ct.current),Nt.current&&clearTimeout(Nt.current)}},[]),s.useEffect(()=>{if(!Ae){vt(!0);return}mt();const I=_e.current;if(!I)return;const te=()=>mt();return I.addEventListener("pointermove",te),I.addEventListener("pointerdown",te),()=>{I.removeEventListener("pointermove",te),I.removeEventListener("pointerdown",te),Nt.current&&clearTimeout(Nt.current)}},[Ae,mt]),s.useEffect(()=>{const I=te=>{te.key==="Escape"&&Le()};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[Le]),s.useLayoutEffect(()=>{Ht()},[w,t.length,lt]),s.useLayoutEffect(()=>{o||Cn(M.current,"auto")},[w,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,lt]),s.useEffect(()=>{const I=Be.current;if(!I||o||!ie)return;const te=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Te=ce.deltaMode===1?Iv:ce.deltaMode===2?I.clientHeight:1,He=ce.deltaY*Te*Rv;if(He!==0){if(nn(),rt.current||(rt.current=!0,We.current=I.scrollLeft,Ft.current=null,Lt(!1)),We.current+=He,!lt){const Ke=I.scrollWidth-I.clientWidth;We.current=Math.max(0,Math.min(Ke,We.current))}mt(),tt.current===null&&(tt.current=requestAnimationFrame(oi))}};return I.addEventListener("wheel",te,{passive:!1}),()=>{I.removeEventListener("wheel",te),un()}},[o,ie,lt]),s.useEffect(()=>{const I=Be.current;if(!I)return;const te=()=>{Ot(Ve.current.isActive);const Te=I.scrollLeft,He=Te-ke.current;ke.current=Te;const Ke=Ge.current>0?Ge.current*.5:1/0;if(He!==0&&Math.abs(He)<Ke){const bt=He>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Re(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};I.addEventListener("scroll",te,{passive:!0});const ce=new ResizeObserver(()=>{Ht(),Ot(Ve.current.isActive),Re(qe.current),yt()});return ce.observe(I),()=>{nn(),I.removeEventListener("scroll",te),ce.disconnect()}},[t.length,lt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{pt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${$o}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...jt}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:I=>I.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":be&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ia,onPointerMove:oa,onPointerUp:ye,onPointerCancel:ye,onLostPointerCapture:je,children:a.jsx("div",{ref:Ye,className:`${e}-lightbox-strip-track`,style:{gap:w},children:Xt.map((I,te)=>{const ce=I.image.objectFit??"contain",Te=te%t.length,He=Math.floor(te/t.length),Ke=dr(w),bt=`calc(-0.5 * (${Ke} + ${w}))`;return a.jsxs("div",{ref:Rt=>Ee.current[te]=Rt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:I.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Te<t.length-1&&He===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He}-${I.image.url}-${Te}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:P,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:Q,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:(he||x)&&a.jsx("div",{className:`${e}-header ${oe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:oe?gt():he||x?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const I=dr(v),te=`calc(-0.5 * (${v} + ${I}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:v},children:a.jsx("div",{ref:de,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ce=>ce.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":R,style:{gap:$,"--thumbnail-active-color":H},children:[t.map((ce,Te)=>{const He=dr($),Ke=`calc(-0.5 * (${He} + ${$}))`;return a.jsxs("div",{ref:bt=>{ve.current[Te]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===Te?"true":"false",onClick:()=>ie&&f==="click"&&Cn(Te),onMouseEnter:()=>Me&&f==="hover"&&Cn(Te),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Te+1}`,"aria-current":T===Te?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${q?` ${e}-thumb-image-cover`:""}`,src:ce.image.url,alt:"",draggable:!1,style:{...se,maxWidth:j,maxHeight:j,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Te<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ke,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Te}`)}),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:te,height:I,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zv(e){return`
|
|
14225
|
+
`;function zn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Bl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],hv={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:zn("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:{...Bl.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:{...Bl.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:zn("Question Padding Left"),questionPaddingTop:zn("Question Padding Top"),questionPaddingBottom:zn("Question Padding Bottom"),answerPaddingLeft:zn("Answer Padding Left"),answerPaddingRight:zn("Answer Padding Right"),answerPaddingTop:zn("Answer Padding Top"),answerPaddingBottom:zn("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:[...gv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},fv={element:pv,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:hv,sourceCode:mv},Nn=e=>e.display==="cover",Qr=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},jl=100,yv=.2,zl=8,Ed=({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"?jl:Math.max(jl,window.innerHeight*yv),[]),b=s.useCallback(L=>Math.max(0,1-L/(p*1.5)),[p]),x=s.useCallback(L=>Math.max(0,1-L/(p*.45)),[p]),g=s.useCallback(L=>{const N=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-L/N*.12);return`translateY(${L}px) scale(${k})`},[]),m=s.useCallback(()=>{c.current=null},[]),h=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),m()},[n,m]),f=s.useCallback(()=>{const L=typeof window<"u"?window.innerHeight:800;d(!0),r(L),window.setTimeout(()=>{t(),m(),d(!1)},Math.min(n,200))},[n,t,m]),C=s.useCallback(L=>{!e||l||L.pointerType==="touch"&&(i!=null&&i(L.target)||(c.current={startX:L.clientX,startY:L.clientY,isLocked:null,pointerId:L.pointerId}))},[e,l,i]),y=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=L.clientX-N.startX,Z=L.clientY-N.startY;if(N.isLocked===null){if(Math.abs(k)<zl&&Math.abs(Z)<zl)return;if(Z>0&&Z>Math.abs(k))N.isLocked=!0,L.currentTarget.setPointerCapture(L.pointerId);else{N.isLocked=!1,m();return}}if(!N.isLocked)return;L.preventDefault();const M=Math.max(0,Z);u.current=M,r(M)},[e,m]),R=s.useCallback(L=>{const N=c.current;if(!e||!N||L.pointerType!=="touch"||N.pointerId!==L.pointerId)return;const k=N.isLocked===!0;if(L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId),!k){m();return}L.clientY-N.startY>=p?f():h()},[p,f,e,m,h]),H=s.useCallback(L=>{R(L)},[R]),S=s.useCallback(L=>{R(L)},[R]),U=o>0,F=l?`transform ${n}ms ease`:"none",_=l?`opacity ${n}ms ease`:"none",B=o>0||l;return{isSwipeDragging:U,backdropStyle:{opacity:b(o),transition:_},mediaAreaStyle:{transform:g(o),transition:F,touchAction:U?"none":void 0,willChange:U?"transform":void 0},overlayContentStyle:B?{opacity:x(o),transition:_}:void 0,swipeHandlers:e?{onPointerDown:C,onPointerMove:y,onPointerUp:H,onPointerCancel:S}:{},dismissAreaStyle:e?{touchAction:U?"none":"pan-x"}:void 0}},vv="[data-lightbox-scrollable]",Md=()=>{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(vv)||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"})}},[])},xv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},bv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},wv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Sv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(m,h)=>{bv(t),e.scrollLeft=m,h&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=m=>{m.target!==t||m.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),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)`,b=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-wv(t),!1))}},$o=300,$v=900,Cv=1500,Tv="cubic-bezier(0.16, 1, 0.3, 1)",Lv=3e3,Rv=2,Iv=16,Pv=.05,Ev=1,cr=.3,Mv=50,kv=20,Pi=.004,Ji=["title1","title2","title3"],Av={title1:"1",title2:"2",title3:"3"},Fv={title1:"title1Color",title2:"title2Color",title3:"title3Color"},_v={title1:.02,title2:.02,title3:.02},dr=e=>`max(${e}, ${kv}px)`,Wv=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]}},Nv=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=Wv(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},zt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Hv=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")],Ov=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(Ji.map(e=>[Av[e],Hv(e)]))}),Hs=(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},kd=(e,t)=>Hs(e,t),ur=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Vl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Hs(e.length,n),effective:kd(e.length,n)}},Dv=(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},Ca=(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[Fv[t]]}},Bv=(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),Ta=(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??_v[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Ut(i,n)},jv=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:x,closeIconMaxWidth:g,closeIconColor:m,closeIconHoverColor:h,thumbnailTrigger:f,thumbnailVisibility:C,thumbnailObjectFit:y,thumbnailActive:R,thumbnailActiveColor:H,title1Width:S,title2Width:U,title3Width:F,title1MarginLeft:_=0,title2MarginLeft:B=0,title3MarginLeft:L=0,titleRowMarginBottom:N=0,titleHeaderLayout:k="desktop",contentMarginTop:Z,iconMarginLeft:M}=n,K=I=>W.scalingValue(I,i??!1),D=c??n.thumnailSize??.03,j=K(D),$=K(u),v=K(p??.02),w=K(b??0),P=K(Z??0),Q=dr(P),z=K(M??0),[T,O]=s.useState(0),E=s.useRef(T);E.current=T;const ee=t[T],{title1:V,title2:ue,title3:Ie}=Nv(ee),ge=Ta("title1",Ca(n,"title1"),i),ae=Ta("title2",Ca(n,"title2"),i),ne=Ta("title3",Ca(n,"title3"),i),oe=k==="mobile",ie=!o&&(!i||r),Ae=ie,be=ie,Me=ie,q=Nn(y),se=q?{"--image-aspect-ratio":Qr(y)}:void 0,he=!!(V||ue||Ie),G=s.useMemo(()=>Dv(e,V,ue,Ie,ge,ae,ne),[e,T,V,ue,Ie,ge,ae,ne]),re=s.useMemo(()=>({title1Width:S,title2Width:U,title3Width:F}),[S,U,F]),me=s.useMemo(()=>G.map(I=>re[I.widthKey]),[G,re]),we=s.useMemo(()=>Hs(G.length,me),[G.length,me]),Pe=s.useMemo(()=>kd(G.length,me),[G.length,me]),Ce=s.useMemo(()=>G.filter(I=>I.prefix==="title1"),[G]),Y=s.useMemo(()=>G.filter(I=>I.prefix==="title2"||I.prefix==="title3"),[G]),xe=s.useMemo(()=>Vl(Ce,re),[Ce,re]),pe=s.useMemo(()=>Vl(Y,re),[Y,re]),X=s.useCallback((I,te)=>{const ce=G.indexOf(I);if(!oe||te==="single-row")return{effectiveWidth:Pe[ce]??0,resolvedWidth:we[ce]??0,maxWidth:ur(ce,we)};if(te==="two-row-top"){const He=Ce.indexOf(I);return{effectiveWidth:xe.effective[He]??0,resolvedWidth:xe.resolved[He]??0,maxWidth:ur(He,xe.resolved)}}const Te=Y.indexOf(I);return{effectiveWidth:pe.effective[Te]??0,resolvedWidth:pe.resolved[Te]??0,maxWidth:ur(Te,pe.resolved)}},[Y,pe,Pe,we,G,Ce,xe,oe]),le=s.useCallback(I=>W.scalingValue(I,i??!1),[i]),Fe=le(N??0),fe=s.useMemo(()=>({title1MarginLeft:_,title2MarginLeft:B,title3MarginLeft:L}),[_,B,L]),J=s.useCallback(I=>G.slice(0,I+1).reduce((te,ce,Te)=>te+(ce!=null&&ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(we[Te]??0),0)+(oe?0:_??0),[G,fe,we,oe,_]),Xe=s.useCallback(()=>oe?0:_??0,[oe,_]),Oe=s.useCallback(I=>Y.slice(0,I).reduce((te,ce,Te)=>te+(ce.marginLeftKey?fe[ce.marginLeftKey]??0:0)+(pe.resolved[Te]??0),0),[Y,pe.resolved,fe]),dt=s.useCallback(I=>{const te=Y[I];return Oe(I)+(te.marginLeftKey?fe[te.marginLeftKey]??0:0)+(pe.resolved[I]??0)},[Y,pe.resolved,Oe,fe]),nt=(I,te)=>{const ce=I.marginLeftKey?fe[I.marginLeftKey]??0:0,{effectiveWidth:Te,resolvedWidth:He,maxWidth:Ke}=X(I,te),bt=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":I.prefix,style:{...te==="single-row"?{gridArea:I.prefix}:{},width:le(Te),...ce>0?{marginLeft:le(ce)}:{}},children:[a.jsx("p",{className:I.className,style:I.style,children:I.text}),bt&&I.marginLeftKey&&a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(-ce),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}}),bt&&a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ke),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:le(-Pi/2),width:le(Pi),height:"100%",pointerEvents:"auto"}})]},I.className)},ht=()=>{const I=oe?-1:G.findIndex(Te=>Te.prefix==="title1"),te=!oe&&(o||(_??0)>0)?(()=>{const Te=_??0,He=I>=0?we[I]:S??0;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:`max(${le(Te)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,ce=G.flatMap((Te,He)=>{if(!Te.marginLeftKey)return[];const Ke=fe[Te.marginLeftKey]??0,bt=Bv(G,we,fe,He)+Xe();return a.jsx("div",{"data-controls":Te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[He]),style:{position:"absolute",top:0,left:le(bt),width:`max(${le(Ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},Te.marginLeftKey)});return te?[te,...ce]:ce},st=()=>G.map((I,te)=>{const ce=ur(te,we),He=J(te)-Pi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Pi),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),ze=()=>Y.flatMap((I,te)=>{if(!I.marginLeftKey)return[];const ce=fe[I.marginLeftKey]??0,Te=Oe(te),{resolvedWidth:He}=X(I,"two-row-bottom");return a.jsx("div",{"data-controls":I.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(He),style:{position:"absolute",top:0,left:le(Te),width:`max(${le(ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},I.marginLeftKey)}),Se=()=>Y.map((I,te)=>{const{maxWidth:ce}=X(I,"two-row-bottom"),He=dt(te)-Pi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":I.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ce),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:le(He),width:le(Pi),height:"100%",pointerEvents:"auto"}})},`${I.widthKey}-junction`)}),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useRef(null),de=s.useRef(null),ve=s.useRef([]),Ee=s.useRef([]),Ge=s.useRef(0),Ze=s.useRef(null),Ve=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),at=s.useRef(null),Je=s.useRef(null),ke=s.useRef(0),qe=s.useRef("forward"),We=s.useRef(0),tt=s.useRef(null),rt=s.useRef(!1),lt=t.length>1&&(!o||!!r),Tt=lt?3:1,Xt=s.useMemo(()=>Array.from({length:Tt},()=>t).flat(),[t,Tt]),[Zt,xt]=s.useState(!1),[wt,Bt]=s.useState(!1),[At,vt]=s.useState(!0),Ft=s.useRef(null),Wt=s.useRef(null),Yt=s.useRef(!1),Jt=s.useRef(!1),Ct=s.useRef(null),Nt=s.useRef(null),rn=Ae&&!At,mt=s.useCallback(()=>{Ae&&(vt(!0),Nt.current&&clearTimeout(Nt.current),Nt.current=setTimeout(()=>{Ve.current.isActive||vt(!1)},Lv))},[Ae]),Le=s.useCallback(()=>{o||Jt.current||(Jt.current=!0,Bt(!1),Ct.current=setTimeout(()=>{l()},$o))},[o,l]),De=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":rn?"true":"false",style:{width:W.scalingValue(g??0,i),height:W.scalingValue(g??0,i),marginRight:z,"--close-icon-hover-color":h},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(sn,{url:x,fill:m,hoverFill:i&&!r?m:h,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:z,height:"100%",pointerEvents:"auto"}})]}),it=(I="two-row")=>a.jsx("div",{...I==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:le(_??0),flexShrink:0,...I==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...I==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const I=G.find(Te=>Te.prefix==="title1"),te=G.filter(Te=>Te.prefix==="title2"||Te.prefix==="title3"),ce=te.length>0||o||(N??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(_??0)>0||o?it():null,I&&nt(I,"two-row-top"),x&&De()]}),ce?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[te.map(Te=>nt(Te,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[ze(),Se()]})]}):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:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>a.jsxs(a.Fragment,{children:[(_??0)>0||o?it("single-row"):null,G.map(I=>nt(I,"single-row")),o?a.jsxs(a.Fragment,{children:[ht(),st()]}):null,x?De():null]}),It=s.useCallback(I=>!!(I.closest("[data-controls]")||I.closest(`.${e}-thumbnails`)||I.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:pt,backdropStyle:jt,mediaAreaStyle:kt,overlayContentStyle:Mt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Ed({enabled:ie??!1,onClose:Le,animMs:$o,isBlockedTarget:It}),Ht=()=>{if(!lt||t.length===0)return Ge.current=0,0;const I=Ee.current[0],te=Ee.current[t.length];if(!I||!te)return Ge.current;const ce=te.offsetLeft-I.offsetLeft;return ce>0&&(Ge.current=ce),Ge.current},Ot=(I=!1)=>{if(!lt)return;const te=Be.current,ce=Ht();!te||ce<=0||ce<te.clientWidth*.25||(te.scrollLeft<=0?(te.scrollLeft+=ce,I&&(Ve.current.scrollLeft+=ce),rt.current&&(We.current+=ce)):te.scrollLeft>=ce*2&&(te.scrollLeft-=ce,I&&(Ve.current.scrollLeft-=ce),rt.current&&(We.current-=ce)))},_t=(I,te=(ce=>(ce=Be.current)==null?void 0:ce.scrollLeft)()??0)=>{if(!lt)return I;let Te=t.length+I,He=1/0;for(let Ke=0;Ke<Tt;Ke++){const bt=Ke*t.length+I,Rt=Ee.current[bt];if(!Rt)continue;const tn=Math.abs(Rt.offsetLeft-te);tn<He&&(He=tn,Te=bt)}return Te},St=I=>{const te=Be.current;return!I||!te?!1:I.offsetWidth>te.clientWidth+1},A=I=>{const te=Be.current;if(!I||!te||!St(I))return!1;const ce=I.offsetLeft,Te=ce+I.offsetWidth;return te.scrollLeft>=ce-1&&te.scrollLeft+te.clientWidth<=Te+1},$e=(I=(te=>(te=Be.current)==null?void 0:te.scrollLeft)()??0)=>{for(let Te=0;Te<Ee.current.length;Te+=1){const He=Ee.current[Te];if(He&&A(He))return Te}let ce={flatIndex:0,distance:1/0};return Ee.current.forEach((Te,He)=>{if(!Te)return;const Ke=Math.abs(Te.offsetLeft-I);Ke<ce.distance&&(ce={flatIndex:He,distance:Ke})}),ce.flatIndex},Re=I=>{Be.current&&Ee.current.forEach(te=>{te&&(te.style.scrollSnapAlign=St(te)&&I==="backward"?"end":"start")})},Ne=(I,te,ce)=>{const Te=I-te,He=$e(te),Ke=Ee.current[He];if(A(Ke))return $e(I)%t.length;const bt=Ee.current[He+1],Rt=Ke?bt?bt.offsetLeft-Ke.offsetLeft:Ke.offsetWidth:0,tn=Rt>0?Te>Rt*cr?1:Te<-Rt*cr?-1:0:0;return tn===0?ce:lt?(ce+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,ce+tn))},ot=s.useCallback((I=!1)=>{if(C!=="on"||o)return;const te=de.current,ce=E.current,Te=ve.current[ce];if(!te||!Te||te.scrollWidth<=te.clientWidth)return;const He=te.scrollLeft,Ke=He+te.clientWidth,bt=Te.offsetLeft,Rt=bt+Te.offsetWidth;if(bt>=He&&Rt<=Ke)return;const tn=te.scrollWidth-te.clientWidth;let Qt=He;if(!I&&Ft.current===null){const Li=ve.current[ce-1],so=ve.current[ce+1],Qo=Li?Te.offsetLeft-Li.offsetLeft:so?so.offsetLeft-Te.offsetLeft:Te.offsetWidth;Rt>Ke?Qt+=Qo:bt<He&&(Qt-=Qo)}else Rt>Ke?Qt=Rt-te.clientWidth:Qt=bt;te.scrollLeft=Math.max(0,Math.min(tn,Qt))},[o,C]),Et=s.useCallback((I=!1)=>{I&&(Yt.current=!0),Wt.current===null&&(Wt.current=requestAnimationFrame(()=>{Wt.current=null;const te=Yt.current;Yt.current=!1,ot(te)}))},[ot]),Qe=s.useCallback(I=>{if(I===E.current)return;const te=E.current;E.current=I;const ce=Math.abs(I-te)>1,Te=lt&&t.length>1&&(te===t.length-1&&I===0||te===0&&I===t.length-1);O(I),Et(ce||Te)},[t.length,lt,Et]),yt=()=>{if(!Be.current||t.length===0||Ft.current!==null||Ve.current.isActive&&Ve.current.hasMoved)return;const I=Be.current.scrollLeft,te=$e(I)%t.length;te!==E.current&&Qe(te)},Dt=()=>{Ft.current=null},Lt=I=>{const te=Be.current;te&&(te.style.scrollSnapType=I?"":"none")},nn=()=>{var I;(I=Je.current)==null||I.call(Je),Je.current=null},un=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),rt.current=!1},ri=()=>{const I=Be.current;if(!I){tt.current=null,rt.current=!1;return}const te=We.current-I.scrollLeft;if(Math.abs(te)<.5){I.scrollLeft=We.current,Ot(),yt(),tt.current=null,rt.current=!1;return}I.scrollLeft+=te*Pv,Ot(),yt(),mt(),tt.current=requestAnimationFrame(ri)},ai=()=>{const I=Ye.current;I&&(I.style.transition="",I.style.transform="",I.style.willChange="")},Yo=(I,te,ce,Te)=>{ai(),I.scrollLeft=te,ke.current=I.scrollLeft,Ot(),ce!==void 0?(E.current=ce,O(ce)):yt(),Lt(!0),Te==null||Te()},Ko=(I,{behavior:te="smooth",activeIndex:ce,onComplete:Te}={})=>{const He=Be.current,Ke=Ye.current;if(!He||!Ke)return;if(un(),nn(),Lt(!1),te==="auto"){Yo(He,I,ce,Te);return}const bt=Math.abs(I-He.scrollLeft),Rt=xv(bt,$v,Cv,He.clientWidth*.55);Je.current=Sv(He,Ke,I,{duration:Rt,easing:Tv,onComplete:()=>{Je.current=null,Yo(He,I,ce,Te)}})},ta=(I="smooth")=>{const te=Be.current;if(!te||t.length===0)return;const ce=$e()%t.length,Te=_t(ce,te.scrollLeft),He=Ee.current[Te];He&&Ko(He.offsetLeft,{behavior:I,activeIndex:ce})},na=(I,te="smooth",ce,Te)=>{const He=Be.current;if(!He||t.length===0)return;const Ke=(Te??He.scrollLeft)-I,bt=$e(I),Rt=Ee.current[bt];if(A(Rt)){Lt(!0),yt();return}const tn=Ee.current[bt+1],Qt=Rt?tn?tn.offsetLeft-Rt.offsetLeft:Rt.offsetWidth:0;if((Qt>0?Ke>Qt*cr?1:Ke<-Qt*cr?-1:0:0)!==0){const ru=ce??bt%t.length,au=Ne(Te??He.scrollLeft,I,ru);Cn(au,te);return}const so=Te??He.scrollLeft,Qo=$e(so),Bs=Ee.current[Qo];if(Bs&&Math.abs(Bs.offsetLeft-so)<1){Lt(!0),yt();return}ta("auto")},Cn=(I,te="smooth")=>{const ce=Be.current;if(!ce||t.length===0)return;const Te=_t(I,ce.scrollLeft),He=Ee.current[Te];He&&(te==="smooth"?Ft.current=I:Ft.current=null,E.current=I,O(I),Et(!0),Ko(He.offsetLeft,{behavior:te,activeIndex:I,onComplete:te==="smooth"?Dt:void 0}))},Ti=()=>{at.current&&(window.removeEventListener("pointerup",at.current),window.removeEventListener("pointercancel",at.current),at.current=null)},Zo=(I,te,ce,Te,He)=>{const Ke=ce-I,bt=Te-te,Rt=Math.abs(Ke),tn=Math.abs(bt);if(Rt<Mv||Rt<=tn)return!1;const Qt=Ke<0?1:-1,Li=lt?(He+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,He+Qt));return Li===He?!1:(Cn(Li),!0)},si=I=>{if(!Ve.current.isActive)return;Ti();const te=Be.current;if(!te)return;const{scrollLeft:ce,startActiveIndex:Te,hasMoved:He}=Ve.current,Ke=te.scrollLeft;Ot(!0),Ve.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),I!==void 0&&te.hasPointerCapture(I)&&te.releasePointerCapture(I),He?na(ce,"smooth",Te,Ke):(Lt(!0),yt()),mt()},Jo=(I,te)=>{const ce=Ze.current;Ze.current=null,ce&&(Zo(ce.startX,ce.startY,I,te,ce.startActiveIndex),mt())},ia=I=>{if(!be)return;if(I.pointerType==="touch"){if(un(),Lt(!0),It(I.target))return;Ze.current={startX:I.clientX,startY:I.clientY,startActiveIndex:E.current};return}if(I.pointerType!=="mouse"||I.button!==0||It(I.target))return;const te=Be.current;if(!te)return;un(),nn(),ai(),Ft.current=null,Ve.current={isActive:!0,startX:I.clientX,scrollLeft:te.scrollLeft,startActiveIndex:E.current,hasMoved:!1},Lt(!1),mt(),te.setPointerCapture(I.pointerId),Ti();const ce=Te=>{Te.pointerType==="mouse"&&si(Te.pointerId)};at.current=ce,window.addEventListener("pointerup",ce),window.addEventListener("pointercancel",ce)},oa=I=>{if(!be||I.pointerType!=="mouse")return;const te=Be.current;if(!te||!Ve.current.isActive)return;if(I.buttons===0){si(I.pointerId);return}const ce=I.clientX-Ve.current.startX;Math.abs(ce)>Ev&&(Ve.current.hasMoved=!0,xt(!0)),Ve.current.hasMoved&&(I.preventDefault(),te.scrollLeft=Ve.current.scrollLeft-ce,Ot(!0),yt(),mt())},ye=I=>{if(be){if(I.pointerType==="touch"){I.type==="pointerup"?Jo(I.clientX,I.clientY):Ze.current=null;return}I.pointerType==="mouse"&&si(I.pointerId)}},je=I=>{!be||I.pointerType!=="mouse"||si(I.pointerId)};return Md(),s.useEffect(()=>{const I=requestAnimationFrame(()=>Bt(!0));return()=>{cancelAnimationFrame(I),nn(),Ti(),Wt.current!==null&&(cancelAnimationFrame(Wt.current),Wt.current=null),Ct.current&&clearTimeout(Ct.current),Nt.current&&clearTimeout(Nt.current)}},[]),s.useEffect(()=>{if(!Ae){vt(!0);return}mt();const I=_e.current;if(!I)return;const te=()=>mt();return I.addEventListener("pointermove",te),I.addEventListener("pointerdown",te),()=>{I.removeEventListener("pointermove",te),I.removeEventListener("pointerdown",te),Nt.current&&clearTimeout(Nt.current)}},[Ae,mt]),s.useEffect(()=>{const I=te=>{te.key==="Escape"&&Le()};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[Le]),s.useLayoutEffect(()=>{Ht()},[w,t.length,lt]),s.useLayoutEffect(()=>{o||Cn(E.current,"auto")},[w,o]),s.useLayoutEffect(()=>{Cn(0,"auto")},[t.length,lt]),s.useEffect(()=>{const I=Be.current;if(!I||o||!ie)return;const te=ce=>{if(ce.preventDefault(),Math.abs(ce.deltaY)<=Math.abs(ce.deltaX))return;const Te=ce.deltaMode===1?Iv:ce.deltaMode===2?I.clientHeight:1,He=ce.deltaY*Te*Rv;if(He!==0){if(nn(),rt.current||(rt.current=!0,We.current=I.scrollLeft,Ft.current=null,Lt(!1)),We.current+=He,!lt){const Ke=I.scrollWidth-I.clientWidth;We.current=Math.max(0,Math.min(Ke,We.current))}mt(),tt.current===null&&(tt.current=requestAnimationFrame(ri))}};return I.addEventListener("wheel",te,{passive:!1}),()=>{I.removeEventListener("wheel",te),un()}},[o,ie,lt]),s.useEffect(()=>{const I=Be.current;if(!I)return;const te=()=>{Ot(Ve.current.isActive);const Te=I.scrollLeft,He=Te-ke.current;ke.current=Te;const Ke=Ge.current>0?Ge.current*.5:1/0;if(He!==0&&Math.abs(He)<Ke){const bt=He>0?"forward":"backward";bt!==qe.current&&(qe.current=bt,Re(bt))}Ve.current.isActive&&Ve.current.hasMoved||yt()};I.addEventListener("scroll",te,{passive:!0});const ce=new ResizeObserver(()=>{Ht(),Ot(Ve.current.isActive),Re(qe.current),yt()});return ce.observe(I),()=>{nn(),I.removeEventListener("scroll",te),ce.disconnect()}},[t.length,lt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{pt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:wt?1:0,transition:`opacity ${$o}ms ease`,pointerEvents:wt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...jt}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:I=>I.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":be&&t.length>0?"true":"false","data-mouse-dragging":Zt?"true":"false",onPointerDown:ia,onPointerMove:oa,onPointerUp:ye,onPointerCancel:ye,onLostPointerCapture:je,children:a.jsx("div",{ref:Ye,className:`${e}-lightbox-strip-track`,style:{gap:w},children:Xt.map((I,te)=>{const ce=I.image.objectFit??"contain",Te=te%t.length,He=Math.floor(te/t.length),Ke=dr(w),bt=`calc(-0.5 * (${Ke} + ${w}))`;return a.jsxs("div",{ref:Rt=>Ee.current[te]=Rt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:I.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:ce}}),o&&Te<t.length-1&&He===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:bt,width:Ke,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${He}-${I.image.url}-${Te}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":rn?"true":"false",style:Mt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:P,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:Q,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:(he||x)&&a.jsx("div",{className:`${e}-header ${oe?`${e}-header-two-row`:`${e}-header-single-row`}`,children:oe?gt():he||x?ft():null})})})]}),t.length>1&&C==="on"&&(()=>{const I=dr(v),te=`calc(-0.5 * (${v} + ${I}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:v},children:a.jsx("div",{ref:de,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:ce=>ce.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":R,style:{gap:$,"--thumbnail-active-color":H},children:[t.map((ce,Te)=>{const He=dr($),Ke=`calc(-0.5 * (${He} + ${$}))`;return a.jsxs("div",{ref:bt=>{ve.current[Te]=bt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":T===Te?"true":"false",onClick:()=>ie&&f==="click"&&Cn(Te),onMouseEnter:()=>Me&&f==="hover"&&Cn(Te),"aria-label":ce.image.name?`View ${ce.image.name}`:`View image ${Te+1}`,"aria-current":T===Te?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${q?` ${e}-thumb-image-cover`:""}`,src:ce.image.url,alt:"",draggable:!1,style:{...se,maxWidth:j,maxHeight:j,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Te<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ke,width:He,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${ce.image.url}-${Te}`)}),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:te,height:I,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function zv(e){return`
|
|
14226
14226
|
.${e}-wrapper {
|
|
14227
14227
|
position: relative;
|
|
14228
14228
|
width: 100%;
|
|
@@ -15153,7 +15153,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15153
15153
|
</>
|
|
15154
15154
|
);
|
|
15155
15155
|
};
|
|
15156
|
-
`,qv="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>'),ui={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 Xv(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")]={...ui.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSize")]={...ui.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[zt(e,"lineHeight")]={...ui.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[zt(e,"letterSpacing")]={...ui.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[zt(e,"wordSpacing")]={...ui.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[zt(e,"textAlign")]={...ui.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[zt(e,"textAppearance")]={...ui.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uv=Ji.reduce((e,t)=>({...e,...Xv(t)}),{}),Yv=Ji.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 La(e){return Ji.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 Kv=Ov(),Zv={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"}},...Uv,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:qv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Yv},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,...La({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,...La({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,...La({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:[Kv]}],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"}]}},Jv={element:Vv,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:Zv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ji.map(e=>({path:`${zt(e,"fontFamily")}`}))]},fontRelations:{...Ji.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${zt(t,"fontFamily")}`}),{})}},Qv=({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:b,coverFit:x,backgroundColor:g,imageGap:m,maxWidth:h,maxHeight:f,textTransition:C,title1Width:y,title2Width:R,title3Width:H,title1MarginLeft:S=0,title2MarginLeft:U=0,title3MarginLeft:F=0,titleRowMarginBottom:_=0,titleHeaderLayout:B="single-row",countCloseGap:L=0,closeIcon:N,closeIconMaxWidth:k,closeIconColor:Z,closeIconHoverColor:E,contentMarginTop:K=0,iconMarginRight:D=0}=n,j=s.useCallback(ye=>W.scalingValue(ye,i??!1),[i]),$=j(m??0),v=`${h}%`,w=`${f}%`,P=j(L),Q=j(K),z=j(D),T=fi("title1",hi(n,"title1"),i),O=fi("title2",hi(n,"title2"),i),M=fi("title3",hi(n,"title3"),i),ee=fi("count",hi(n,"count"),i),V=B==="mobile",me=!i||!!r,Ie=!o&&(!i||!!r),ge=s.useMemo(()=>Sr(t,b),[t,b]),[ae,ne]=s.useState(l),oe=ge[ae],ie=oe==null?void 0:oe.entry,[Ae,be]=s.useState(!1),[Me,q]=s.useState(null),[se,he]=s.useState(!1),[G,re]=s.useState(null),[pe,we]=s.useState(!1),[Pe,Ce]=s.useState(0),[Y,xe]=s.useState(),[ue,X]=s.useState(),[le,Fe]=s.useState(null),fe=s.useRef(null),J=s.useRef(0),Xe=s.useRef(0),Oe=s.useRef(0),dt=s.useRef(!1),nt=s.useRef(null),ht=s.useRef(null),st=s.useRef(null),ze=s.useRef(null),Se=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useCallback(()=>{const ye=ht.current;if(!ye)return;const je=ye.closest(`.${e}-lightbox-content-area`);if(!je)return ye.getBoundingClientRect().width;const I=Array.from(je.children).reduce((te,ce)=>!(ce instanceof HTMLElement)||ce.contains(ye)?te:te+ce.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-I},[e]),de=s.useCallback(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),ve=s.useCallback(ye=>{ye===J.current&&(re(null),we(!1))},[]),Ee=s.useCallback(()=>{o||dt.current||(dt.current=!0,u==null||u(),be(!1),nt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=s.useCallback(ye=>!!(ye.closest("[data-controls]")||ye.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ve,mediaAreaStyle:at,overlayContentStyle:Je,swipeHandlers:ke,dismissAreaStyle:qe}=Ed({enabled:Ie,onClose:Ee,animMs:300,isBlockedTarget:Ge}),We=s.useCallback(ye=>{d&&pd(ye+1,c,!0)},[d,c]),tt=s.useCallback(ye=>{if(ye)return ye.getBoundingClientRect().height},[]),rt=s.useCallback(ye=>{if(ge.length===0)return;const je=(ye%ge.length+ge.length)%ge.length;if(je===ae)return;const I=ge[ae],te=ge[je];J.current+=1;const ce=J.current,Te=C==="fade"&&xl(I==null?void 0:I.entry)!==xl(te==null?void 0:te.entry),He=tt(st.current),Ke=Te?(()=>{const Rt=Ye();Dn.flushSync(()=>{Fe(te.entry)}),st.current&&Rt&&(st.current.style.width=`${Rt}px`);const tn=tt(st.current);return st.current&&(st.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(He??0,(Ke==null?void 0:Ke.measuredIncomingTitlesHeight)??0)||void 0;Ce(ce),re(ae),we(!0),ne(je),We(je),Oe.current=je,Te?(de(),bt&&xe(bt),Ke!=null&&Ke.incomingTitlesMeasureWidth&&X(Ke.incomingTitlesMeasureWidth),q((I==null?void 0:I.entryIndex)??null),he(!0),Xe.current=te.entryIndex,fe.current=setTimeout(()=>{q(null),he(!1),xe(void 0),X(void 0),Fe(null),fe.current=null},400)):(de(),q(null),he(!1),xe(void 0),X(void 0),Fe(null),Xe.current=te.entryIndex)},[ae,de,Ye,tt,ge,We,C]),lt=s.useCallback(()=>{Be.current=null},[]),Tt=s.useCallback(ye=>{!me||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0||ye.target.closest("[data-controls]")||(Be.current={startX:ye.clientX,startY:ye.clientY,pointerId:ye.pointerId})},[me,ge.length]),Xt=s.useCallback(ye=>{var Rt;if(!me||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0)return;if(Ze){lt();return}const je=Be.current;if(!je||je.pointerId!==ye.pointerId||(lt(),ye.target.closest("[data-controls]")))return;const te=ye.clientX-je.startX,ce=ye.clientY-je.startY,Te=Math.abs(te),He=Math.abs(ce);if(Te>=uf&&Te>He){rt(te>0?ae-1:ae+1);return}if(Te>hl||He>hl)return;const Ke=(Rt=ze.current)==null?void 0:Rt.getBoundingClientRect(),bt=Ke?Ke.left+Ke.width/2:window.innerWidth/2;rt(ye.clientX<bt?ae-1:ae+1)},[ae,me,rt,Ze,lt,ge.length]),Zt=s.useCallback(ye=>{const je=Be.current;(je==null?void 0:je.pointerId)===ye.pointerId&<()},[lt]);Md(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ye=requestAnimationFrame(()=>{be(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(ye),nt.current&&clearTimeout(nt.current),fe.current&&clearTimeout(fe.current);const je=_e.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var ye;C!=="fade"&&(Xe.current=((ye=ge[ae])==null?void 0:ye.entryIndex)??0,de(),q(null),he(!1),xe(void 0),X(void 0))},[ae,de,ge,C]),s.useEffect(()=>{const ye=je=>{if(je.key==="Escape"){Ee();return}if(je.key==="ArrowLeft"&&ge.length>1){rt(ae-1);return}if(je.key==="ArrowRight"&&ge.length>1){rt(ae+1);return}if(je.key==="Tab"&&ze.current){const I=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),te=Array.from(I).filter(Ke=>!Ke.closest('[aria-hidden="true"]'));if(te.length===0)return;const ce=te[0],Te=te[te.length-1],He=document.activeElement;je.shiftKey?(He===ce||!ze.current.contains(He))&&(je.preventDefault(),Te.focus()):(He===Te||!ze.current.contains(He))&&(je.preventDefault(),ce.focus())}};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[rt,Ee,ae,ge.length]),s.useLayoutEffect(()=>{de(),J.current=0,Ce(0),re(null),we(!1),q(null),he(!1),xe(void 0),X(void 0),Fe(null),ne(ye=>{const je=Math.max(0,ge.length-1);return Math.min(ye,je)})},[de,t.length,b,ge.length]),s.useLayoutEffect(()=>{var I;const ye=Math.max(0,ge.length-1),je=Math.min(Math.max(0,l),ye);Oe.current=je,Xe.current=((I=ge[je])==null?void 0:I.entryIndex)??0,ne(je)},[l]);const xt=Me!==null?t[Me]:null,wt=G!==null?ge[G]:null,Bt=(ie==null?void 0:ie.title1)||(ie==null?void 0:ie.title2)||(ie==null?void 0:ie.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),At=xf(b,ge,t),vt=N!==null,Ft=Bt||At||vt,Wt=At&&vt?{gap:P}:void 0,Yt=`${e}-titles-stack${V?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${V?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Nt=(S??0)>0||o,rn=j(_),mt=s.useMemo(()=>({title1Width:y??Di.title1Width,title2Width:R??Di.title2Width,title3Width:H??Di.title3Width}),[y,R,H]),Le=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:F}),[U,F]),De=s.useMemo(()=>ie?Un(e,ie,T,O,M):[],[e,ie,T,O,M]),it=s.useMemo(()=>De.map(ye=>mt[ye.widthKey]),[De,mt]),gt=s.useMemo(()=>qi(De.length,it),[De.length,it]),ft=s.useMemo(()=>Mo(De.length,it),[De.length,it]),It=s.useMemo(()=>De.filter(ye=>ye.prefix==="title1"),[De]),pt=s.useMemo(()=>De.filter(ye=>ye.prefix==="title2"||ye.prefix==="title3"),[De]),jt=s.useMemo(()=>Yn(It,mt),[It,mt]),kt=s.useMemo(()=>Yn(pt,mt),[pt,mt]),Mt=s.useCallback((ye,je)=>{const I=De.findIndex(ce=>ce.prefix===ye.prefix);if(!V||je==="single-row")return{effectiveWidth:ft[I]??0,resolvedWidth:gt[I]??0,maxWidth:cn(I,gt)};if(je==="two-row-top"){const ce=It.findIndex(Te=>Te.prefix===ye.prefix);return{effectiveWidth:jt.effective[ce]??0,resolvedWidth:jt.resolved[ce]??0,maxWidth:cn(ce,jt.resolved)}}const te=pt.findIndex(ce=>ce.prefix===ye.prefix);return{effectiveWidth:kt.effective[te]??0,resolvedWidth:kt.resolved[te]??0,maxWidth:cn(te,kt.resolved)}},[De,pt,kt,ft,gt,It,jt,V]),Vt=s.useCallback(ye=>fd(De,gt,Le,ye)+(V?0:S??0),[De,gt,Le,V,S]),Gt=s.useCallback(()=>V?0:S??0,[V,S]),Ht=s.useCallback(ye=>pt.slice(0,ye).reduce((je,I,te)=>je+(I.marginLeftKey?Le[I.marginLeftKey]??0:0)+(kt.resolved[te]??0),0),[pt,kt.resolved,Le]),Ot=s.useCallback(ye=>{const je=pt[ye];return Ht(ye)+(je.marginLeftKey?Le[je.marginLeftKey]??0:0)+(kt.resolved[ye]??0)},[pt,kt.resolved,Ht,Le]),_t=s.useCallback((ye,je,I)=>{if(!V||I==="single-row"){const Ke=ye.findIndex(Qt=>Qt.prefix===je.prefix),bt=ye.map(Qt=>mt[Qt.widthKey]),Rt=qi(ye.length,bt);return{effectiveWidth:Mo(ye.length,bt)[Ke]??0,resolvedWidth:Rt[Ke]??0,maxWidth:cn(Ke,Rt)}}if(I==="two-row-top"){const Ke=ye.filter(Qt=>Qt.prefix==="title1"),bt=Ke.findIndex(Qt=>Qt.prefix===je.prefix),{resolved:Rt,effective:tn}=Yn(Ke,mt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const te=ye.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),ce=te.findIndex(Ke=>Ke.prefix===je.prefix),{resolved:Te,effective:He}=Yn(te,mt);return{effectiveWidth:He[ce]??0,resolvedWidth:Te[ce]??0,maxWidth:cn(ce,Te)}},[mt,V]),St=(ye,je,I)=>{const te=ye.marginLeftKey?Le[ye.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Te,maxWidth:He}=I??Mt(ye,je),Ke=Math.max(te,Xn),bt=o&&je==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":ye.prefix,style:{width:j(ce),...te>0?{marginLeft:j(te)}:{}},children:[a.jsx("p",{className:ye.className,style:ye.style,children:ye.text}),bt&&ye.marginLeftKey?a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(-te),width:j(Ke),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j(-fn/2),width:j(fn),height:"100%",pointerEvents:"auto"}}):null]},ye.className)},A=(ye="two-row")=>{const je=De.findIndex(ce=>ce.prefix==="title1"),I=je>=0?gt[je]:mt.title1Width,te=ye==="two-row"&&o;return a.jsx("div",{...te?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(I)}:{},style:{width:j(S??0),flexShrink:0,alignSelf:"stretch",...te?{pointerEvents:"auto"}:{}}})},$e=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Re=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ee,"aria-live":"polite","aria-atomic":"true",children:vf(ge,ae,b,t)}),Ne=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fa(P)} + ${P}))`,width:fa(P),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,ot=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Wt,children:[Ne(),vt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,Lt(ie),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Cn()]}),Qe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:se&&Y?{minHeight:Y}:void 0,children:[a.jsx("div",{ref:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ri(le||ie)}),a.jsxs("div",{ref:ht,className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%",...se&&ue?{width:ue,maxWidth:"100%"}:void 0},children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ri(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ri(ie)})]})]}),ot(),Cn()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(k??0,i),height:W.scalingValue(k??0,i),marginRight:z,"--close-icon-hover-color":E},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:N??"",fill:Z,hoverFill:i&&!r?Z:E,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:z,height:"100%",pointerEvents:"auto"}})]}),Dt=(ye,je)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?$e():null,Nt?A("two-row"):null,je!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:ye}):a.jsxs(a.Fragment,{children:[ye,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Lt=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,M);return a.jsx(a.Fragment,{children:je.map(I=>St(I,"single-row",_t(je,I,"single-row")))})},nn=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,M),I=je.find(te=>te.prefix==="title1");return I?St(I,"two-row-top",_t(je,I,"two-row-top")):null},un=(ye,je=!1)=>{const I=ye?Un(e,ye,T,O,M):[],te=I.filter(He=>He.prefix==="title2"||He.prefix==="title3"),ce=o&&je;return te.length>0||ce||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[te.map(He=>St(He,"two-row-bottom",_t(I,He,"two-row-bottom"))),je&&o?a.jsxs(a.Fragment,{children:[ta(),na()]}):null]}):null,(_??0)>0||ce?a.jsx("div",{"data-controls":ce?"titleRowMarginBottom":void 0,"data-controls-axis":ce?"y":void 0,"data-controls-reverse":ce?"":void 0,className:ce?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ce?"auto":"none"}}):null]}):null},oi=(ye,je=!1)=>a.jsxs(a.Fragment,{children:[Dt(nn(ye)),un(ye,je)]}),ri=ye=>V?a.jsx("div",{className:`${e}-titles-row-two-row`,children:oi(ye)}):ye?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Lt(ye)}):null,Yo=()=>{const ye=V?-1:De.findIndex(te=>te.prefix==="title1"),je=!V&&(o||(S??0)>0)?(()=>{const te=S??0,ce=ye>=0?gt[ye]:mt.title1Width,Te=Math.max(te,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ce),style:{position:"absolute",top:0,left:0,width:j(Te),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,I=De.flatMap((te,ce)=>{if(!te.marginLeftKey)return[];const Te=Le[te.marginLeftKey]??0,He=hd(De,gt,Le,ce)+Gt(),Ke=Math.max(Te,Xn);return a.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[ce]),style:{position:"absolute",top:0,left:j(He),width:j(Ke),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)});return je?[je,...I]:I},Ko=()=>De.map((ye,je)=>{const I=cn(je,gt),ce=Vt(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),ta=()=>pt.flatMap((ye,je)=>{if(!ye.marginLeftKey)return[];const I=Le[ye.marginLeftKey]??0,te=Ht(je),ce=Math.max(I,Xn),{resolvedWidth:Te}=Mt(ye,"two-row-bottom");return a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(te),width:j(ce),height:"100%",pointerEvents:"auto"}},ye.marginLeftKey)}),na=()=>pt.map((ye,je)=>{const{maxWidth:I}=Mt(ye,"two-row-bottom"),ce=Ot(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),Cn=()=>!o||V?null:a.jsxs(a.Fragment,{children:[Yo(),Ko()]}),Ci=ye=>{const je=!ye.objectFit&&Nn(x);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:v,maxHeight:w,...je?{"--image-aspect-ratio":Qr(x)}:{}}}},Zo=ye=>ye.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ye.objectFit}}:Nn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ai=ye=>{if(ye.length===0)return null;const je=ye.length>1,I=fa($),te=`calc(-0.5 * (${I} + ${$}))`;if(ye.length===1){const ce=ye[0];return a.jsx("div",{...Ci(ce),children:a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:$}:void 0,children:ye.map((ce,Te)=>a.jsxs("div",{...Ci(ce),children:[a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&je&&Te<ye.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:te,width:I,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Te}`))})},Jo=!!(ie!=null&&ie.title2||ie!=null&&ie.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(_??0)>0||o),ia=()=>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:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:oi(le||ie)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...se&&Y?{minHeight:Y}:void 0,...se&&ue?{width:ue,maxWidth:"100%"}:void 0},children:[Dt(a.jsxs("div",{className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%"},children:[xt&&se?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(ie)})]}),se&&Y?Y:void 0),Jo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${V?` ${e}-titles-layer-in-stacked`:""}`,children:un(ie,!0)})]}):null]})]}),oa=()=>{const ye=Jo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ye?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:ye?void 0:{flex:"0 0 auto",height:"auto"},children:oi(ie,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Ee()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Ae?1:0,transition:"opacity 300ms ease",pointerEvents:Ae?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...ke,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:ye=>ye.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":me&&ge.length>1?"true":"false",onPointerDown:me?Tt:void 0,onPointerUp:me?Xt:void 0,onPointerCancel:me?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&pe?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ye=>{ye.target===ye.currentTarget&&ve(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:ai(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:oe?ai(oe.images):null})},`slide-in-${Pe}-${ae}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Je,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Q,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...V?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${V?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${V?` ${e}-text-bar-cell-stacked`:""}`,style:V?void 0:{flex:1,minWidth:0,width:"100%"},children:V?C==="fade"?ia():oa():C==="fade"?Qe():Et()})})})]})]})]})};function ex(e){return`
|
|
15156
|
+
`,qv="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>'),pi={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 Xv(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")]={...pi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[zt(e,"fontSize")]={...pi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[zt(e,"lineHeight")]={...pi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[zt(e,"letterSpacing")]={...pi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[zt(e,"wordSpacing")]={...pi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[zt(e,"textAlign")]={...pi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[zt(e,"textAppearance")]={...pi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Uv=Ji.reduce((e,t)=>({...e,...Xv(t)}),{}),Yv=Ji.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 La(e){return Ji.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 Kv=Ov(),Zv={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"}},...Uv,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:qv,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...Yv},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,...La({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,...La({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,...La({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:[Kv]}],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"}]}},Jv={element:Vv,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:Zv,sourceCode:Gv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Ji.map(e=>({path:`${zt(e,"fontFamily")}`}))]},fontRelations:{...Ji.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${zt(t,"fontFamily")}`}),{})}},Qv=({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:b,coverFit:x,backgroundColor:g,imageGap:m,maxWidth:h,maxHeight:f,textTransition:C,title1Width:y,title2Width:R,title3Width:H,title1MarginLeft:S=0,title2MarginLeft:U=0,title3MarginLeft:F=0,titleRowMarginBottom:_=0,titleHeaderLayout:B="single-row",countCloseGap:L=0,closeIcon:N,closeIconMaxWidth:k,closeIconColor:Z,closeIconHoverColor:M,contentMarginTop:K=0,iconMarginRight:D=0}=n,j=s.useCallback(ye=>W.scalingValue(ye,i??!1),[i]),$=j(m??0),v=`${h}%`,w=`${f}%`,P=j(L),Q=j(K),z=j(D),T=yi("title1",fi(n,"title1"),i),O=yi("title2",fi(n,"title2"),i),E=yi("title3",fi(n,"title3"),i),ee=yi("count",fi(n,"count"),i),V=B==="mobile",ue=!i||!!r,Ie=!o&&(!i||!!r),ge=s.useMemo(()=>Sr(t,b),[t,b]),[ae,ne]=s.useState(l),oe=ge[ae],ie=oe==null?void 0:oe.entry,[Ae,be]=s.useState(!1),[Me,q]=s.useState(null),[se,he]=s.useState(!1),[G,re]=s.useState(null),[me,we]=s.useState(!1),[Pe,Ce]=s.useState(0),[Y,xe]=s.useState(),[pe,X]=s.useState(),[le,Fe]=s.useState(null),fe=s.useRef(null),J=s.useRef(0),Xe=s.useRef(0),Oe=s.useRef(0),dt=s.useRef(!1),nt=s.useRef(null),ht=s.useRef(null),st=s.useRef(null),ze=s.useRef(null),Se=s.useRef(null),_e=s.useRef(null),Be=s.useRef(null),Ye=s.useCallback(()=>{const ye=ht.current;if(!ye)return;const je=ye.closest(`.${e}-lightbox-content-area`);if(!je)return ye.getBoundingClientRect().width;const I=Array.from(je.children).reduce((te,ce)=>!(ce instanceof HTMLElement)||ce.contains(ye)?te:te+ce.getBoundingClientRect().width,0);return je.getBoundingClientRect().width-I},[e]),de=s.useCallback(()=>{fe.current&&(clearTimeout(fe.current),fe.current=null)},[]),ve=s.useCallback(ye=>{ye===J.current&&(re(null),we(!1))},[]),Ee=s.useCallback(()=>{o||dt.current||(dt.current=!0,u==null||u(),be(!1),nt.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=s.useCallback(ye=>!!(ye.closest("[data-controls]")||ye.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ve,mediaAreaStyle:at,overlayContentStyle:Je,swipeHandlers:ke,dismissAreaStyle:qe}=Ed({enabled:Ie,onClose:Ee,animMs:300,isBlockedTarget:Ge}),We=s.useCallback(ye=>{d&&pd(ye+1,c,!0)},[d,c]),tt=s.useCallback(ye=>{if(ye)return ye.getBoundingClientRect().height},[]),rt=s.useCallback(ye=>{if(ge.length===0)return;const je=(ye%ge.length+ge.length)%ge.length;if(je===ae)return;const I=ge[ae],te=ge[je];J.current+=1;const ce=J.current,Te=C==="fade"&&xl(I==null?void 0:I.entry)!==xl(te==null?void 0:te.entry),He=tt(st.current),Ke=Te?(()=>{const Rt=Ye();Dn.flushSync(()=>{Fe(te.entry)}),st.current&&Rt&&(st.current.style.width=`${Rt}px`);const tn=tt(st.current);return st.current&&(st.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Rt}})():void 0,bt=Math.max(He??0,(Ke==null?void 0:Ke.measuredIncomingTitlesHeight)??0)||void 0;Ce(ce),re(ae),we(!0),ne(je),We(je),Oe.current=je,Te?(de(),bt&&xe(bt),Ke!=null&&Ke.incomingTitlesMeasureWidth&&X(Ke.incomingTitlesMeasureWidth),q((I==null?void 0:I.entryIndex)??null),he(!0),Xe.current=te.entryIndex,fe.current=setTimeout(()=>{q(null),he(!1),xe(void 0),X(void 0),Fe(null),fe.current=null},400)):(de(),q(null),he(!1),xe(void 0),X(void 0),Fe(null),Xe.current=te.entryIndex)},[ae,de,Ye,tt,ge,We,C]),lt=s.useCallback(()=>{Be.current=null},[]),Tt=s.useCallback(ye=>{!ue||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0||ye.target.closest("[data-controls]")||(Be.current={startX:ye.clientX,startY:ye.clientY,pointerId:ye.pointerId})},[ue,ge.length]),Xt=s.useCallback(ye=>{var Rt;if(!ue||ge.length<=1||ye.pointerType==="mouse"&&ye.button!==0)return;if(Ze){lt();return}const je=Be.current;if(!je||je.pointerId!==ye.pointerId||(lt(),ye.target.closest("[data-controls]")))return;const te=ye.clientX-je.startX,ce=ye.clientY-je.startY,Te=Math.abs(te),He=Math.abs(ce);if(Te>=uf&&Te>He){rt(te>0?ae-1:ae+1);return}if(Te>hl||He>hl)return;const Ke=(Rt=ze.current)==null?void 0:Rt.getBoundingClientRect(),bt=Ke?Ke.left+Ke.width/2:window.innerWidth/2;rt(ye.clientX<bt?ae-1:ae+1)},[ae,ue,rt,Ze,lt,ge.length]),Zt=s.useCallback(ye=>{const je=Be.current;(je==null?void 0:je.pointerId)===ye.pointerId&<()},[lt]);Md(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ye=requestAnimationFrame(()=>{be(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():ze.current&&ze.current.focus()})});return()=>{cancelAnimationFrame(ye),nt.current&&clearTimeout(nt.current),fe.current&&clearTimeout(fe.current);const je=_e.current;je&&document.contains(je)&&je.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var ye;C!=="fade"&&(Xe.current=((ye=ge[ae])==null?void 0:ye.entryIndex)??0,de(),q(null),he(!1),xe(void 0),X(void 0))},[ae,de,ge,C]),s.useEffect(()=>{const ye=je=>{if(je.key==="Escape"){Ee();return}if(je.key==="ArrowLeft"&&ge.length>1){rt(ae-1);return}if(je.key==="ArrowRight"&&ge.length>1){rt(ae+1);return}if(je.key==="Tab"&&ze.current){const I=ze.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),te=Array.from(I).filter(Ke=>!Ke.closest('[aria-hidden="true"]'));if(te.length===0)return;const ce=te[0],Te=te[te.length-1],He=document.activeElement;je.shiftKey?(He===ce||!ze.current.contains(He))&&(je.preventDefault(),Te.focus()):(He===Te||!ze.current.contains(He))&&(je.preventDefault(),ce.focus())}};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[rt,Ee,ae,ge.length]),s.useLayoutEffect(()=>{de(),J.current=0,Ce(0),re(null),we(!1),q(null),he(!1),xe(void 0),X(void 0),Fe(null),ne(ye=>{const je=Math.max(0,ge.length-1);return Math.min(ye,je)})},[de,t.length,b,ge.length]),s.useLayoutEffect(()=>{var I;const ye=Math.max(0,ge.length-1),je=Math.min(Math.max(0,l),ye);Oe.current=je,Xe.current=((I=ge[je])==null?void 0:I.entryIndex)??0,ne(je)},[l]);const xt=Me!==null?t[Me]:null,wt=G!==null?ge[G]:null,Bt=(ie==null?void 0:ie.title1)||(ie==null?void 0:ie.title2)||(ie==null?void 0:ie.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),At=xf(b,ge,t),vt=N!==null,Ft=Bt||At||vt,Wt=At&&vt?{gap:P}:void 0,Yt=`${e}-titles-stack${V?` ${e}-titles-stack-stacked`:""}`,Jt=`${e}-titles-layer-out${V?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Nt=(S??0)>0||o,rn=j(_),mt=s.useMemo(()=>({title1Width:y??Di.title1Width,title2Width:R??Di.title2Width,title3Width:H??Di.title3Width}),[y,R,H]),Le=s.useMemo(()=>({title2MarginLeft:U,title3MarginLeft:F}),[U,F]),De=s.useMemo(()=>ie?Un(e,ie,T,O,E):[],[e,ie,T,O,E]),it=s.useMemo(()=>De.map(ye=>mt[ye.widthKey]),[De,mt]),gt=s.useMemo(()=>qi(De.length,it),[De.length,it]),ft=s.useMemo(()=>Mo(De.length,it),[De.length,it]),It=s.useMemo(()=>De.filter(ye=>ye.prefix==="title1"),[De]),pt=s.useMemo(()=>De.filter(ye=>ye.prefix==="title2"||ye.prefix==="title3"),[De]),jt=s.useMemo(()=>Yn(It,mt),[It,mt]),kt=s.useMemo(()=>Yn(pt,mt),[pt,mt]),Mt=s.useCallback((ye,je)=>{const I=De.findIndex(ce=>ce.prefix===ye.prefix);if(!V||je==="single-row")return{effectiveWidth:ft[I]??0,resolvedWidth:gt[I]??0,maxWidth:cn(I,gt)};if(je==="two-row-top"){const ce=It.findIndex(Te=>Te.prefix===ye.prefix);return{effectiveWidth:jt.effective[ce]??0,resolvedWidth:jt.resolved[ce]??0,maxWidth:cn(ce,jt.resolved)}}const te=pt.findIndex(ce=>ce.prefix===ye.prefix);return{effectiveWidth:kt.effective[te]??0,resolvedWidth:kt.resolved[te]??0,maxWidth:cn(te,kt.resolved)}},[De,pt,kt,ft,gt,It,jt,V]),Vt=s.useCallback(ye=>fd(De,gt,Le,ye)+(V?0:S??0),[De,gt,Le,V,S]),Gt=s.useCallback(()=>V?0:S??0,[V,S]),Ht=s.useCallback(ye=>pt.slice(0,ye).reduce((je,I,te)=>je+(I.marginLeftKey?Le[I.marginLeftKey]??0:0)+(kt.resolved[te]??0),0),[pt,kt.resolved,Le]),Ot=s.useCallback(ye=>{const je=pt[ye];return Ht(ye)+(je.marginLeftKey?Le[je.marginLeftKey]??0:0)+(kt.resolved[ye]??0)},[pt,kt.resolved,Ht,Le]),_t=s.useCallback((ye,je,I)=>{if(!V||I==="single-row"){const Ke=ye.findIndex(Qt=>Qt.prefix===je.prefix),bt=ye.map(Qt=>mt[Qt.widthKey]),Rt=qi(ye.length,bt);return{effectiveWidth:Mo(ye.length,bt)[Ke]??0,resolvedWidth:Rt[Ke]??0,maxWidth:cn(Ke,Rt)}}if(I==="two-row-top"){const Ke=ye.filter(Qt=>Qt.prefix==="title1"),bt=Ke.findIndex(Qt=>Qt.prefix===je.prefix),{resolved:Rt,effective:tn}=Yn(Ke,mt);return{effectiveWidth:tn[bt]??0,resolvedWidth:Rt[bt]??0,maxWidth:cn(bt,Rt)}}const te=ye.filter(Ke=>Ke.prefix==="title2"||Ke.prefix==="title3"),ce=te.findIndex(Ke=>Ke.prefix===je.prefix),{resolved:Te,effective:He}=Yn(te,mt);return{effectiveWidth:He[ce]??0,resolvedWidth:Te[ce]??0,maxWidth:cn(ce,Te)}},[mt,V]),St=(ye,je,I)=>{const te=ye.marginLeftKey?Le[ye.marginLeftKey]??0:0,{effectiveWidth:ce,resolvedWidth:Te,maxWidth:He}=I??Mt(ye,je),Ke=Math.max(te,Xn),bt=o&&je==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":ye.prefix,style:{width:j(ce),...te>0?{marginLeft:j(te)}:{}},children:[a.jsx("p",{className:ye.className,style:ye.style,children:ye.text}),bt&&ye.marginLeftKey?a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(-te),width:j(Ke),height:"100%",pointerEvents:"auto"}}):null,bt?a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(He),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j(-fn/2),width:j(fn),height:"100%",pointerEvents:"auto"}}):null]},ye.className)},A=(ye="two-row")=>{const je=De.findIndex(ce=>ce.prefix==="title1"),I=je>=0?gt[je]:mt.title1Width,te=ye==="two-row"&&o;return a.jsx("div",{...te?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(I)}:{},style:{width:j(S??0),flexShrink:0,alignSelf:"stretch",...te?{pointerEvents:"auto"}:{}}})},$e=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:T,"aria-hidden":"true",children:" "}),Re=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ee,"aria-live":"polite","aria-atomic":"true",children:vf(ge,ae,b,t)}),Ne=()=>At?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${fa(P)} + ${P}))`,width:fa(P),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,ot=()=>!At&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Wt,children:[Ne(),vt?yt():null]}),Et=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,Lt(ie),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),ot(),Cn()]}),Qe=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Bt?$e():null,Nt?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:se&&Y?{minHeight:Y}:void 0,children:[a.jsx("div",{ref:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ai(le||ie)}),a.jsxs("div",{ref:ht,className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%",...se&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-fade-out`,children:ai(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ai(ie)})]})]}),ot(),Cn()]}),yt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:W.scalingValue(k??0,i),height:W.scalingValue(k??0,i),marginRight:z,"--close-icon-hover-color":M},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(sn,{url:N??"",fill:Z,hoverFill:i&&!r?Z:M,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:z,height:"100%",pointerEvents:"auto"}})]}),Dt=(ye,je)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Bt?$e():null,Nt?A("two-row"):null,je!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:je},children:ye}):a.jsxs(a.Fragment,{children:[ye,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),ot()]}),Lt=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,E);return a.jsx(a.Fragment,{children:je.map(I=>St(I,"single-row",_t(je,I,"single-row")))})},nn=ye=>{if(!ye)return null;const je=Un(e,ye,T,O,E),I=je.find(te=>te.prefix==="title1");return I?St(I,"two-row-top",_t(je,I,"two-row-top")):null},un=(ye,je=!1)=>{const I=ye?Un(e,ye,T,O,E):[],te=I.filter(He=>He.prefix==="title2"||He.prefix==="title3"),ce=o&&je;return te.length>0||ce||(_??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[te.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[te.map(He=>St(He,"two-row-bottom",_t(I,He,"two-row-bottom"))),je&&o?a.jsxs(a.Fragment,{children:[ta(),na()]}):null]}):null,(_??0)>0||ce?a.jsx("div",{"data-controls":ce?"titleRowMarginBottom":void 0,"data-controls-axis":ce?"y":void 0,"data-controls-reverse":ce?"":void 0,className:ce?`${e}-control`:void 0,style:{height:rn,width:"100%",flexShrink:0,pointerEvents:ce?"auto":"none"}}):null]}):null},ri=(ye,je=!1)=>a.jsxs(a.Fragment,{children:[Dt(nn(ye)),un(ye,je)]}),ai=ye=>V?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ri(ye)}):ye?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Lt(ye)}):null,Yo=()=>{const ye=V?-1:De.findIndex(te=>te.prefix==="title1"),je=!V&&(o||(S??0)>0)?(()=>{const te=S??0,ce=ye>=0?gt[ye]:mt.title1Width,Te=Math.max(te,Xn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ce),style:{position:"absolute",top:0,left:0,width:j(Te),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,I=De.flatMap((te,ce)=>{if(!te.marginLeftKey)return[];const Te=Le[te.marginLeftKey]??0,He=hd(De,gt,Le,ce)+Gt(),Ke=Math.max(Te,Xn);return a.jsx("div",{"data-controls":te.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[ce]),style:{position:"absolute",top:0,left:j(He),width:j(Ke),height:"100%",pointerEvents:"auto"}},te.marginLeftKey)});return je?[je,...I]:I},Ko=()=>De.map((ye,je)=>{const I=cn(je,gt),ce=Vt(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),ta=()=>pt.flatMap((ye,je)=>{if(!ye.marginLeftKey)return[];const I=Le[ye.marginLeftKey]??0,te=Ht(je),ce=Math.max(I,Xn),{resolvedWidth:Te}=Mt(ye,"two-row-bottom");return a.jsx("div",{"data-controls":ye.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Te),style:{position:"absolute",top:0,left:j(te),width:j(ce),height:"100%",pointerEvents:"auto"}},ye.marginLeftKey)}),na=()=>pt.map((ye,je)=>{const{maxWidth:I}=Mt(ye,"two-row-bottom"),ce=Ot(je)-fn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":ye.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(I),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j(ce),width:j(fn),height:"100%",pointerEvents:"auto"}})},`${ye.widthKey}-junction`)}),Cn=()=>!o||V?null:a.jsxs(a.Fragment,{children:[Yo(),Ko()]}),Ti=ye=>{const je=!ye.objectFit&&Nn(x);return{className:`${e}-slide-image-cell${je?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:v,maxHeight:w,...je?{"--image-aspect-ratio":Qr(x)}:{}}}},Zo=ye=>ye.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ye.objectFit}}:Nn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},si=ye=>{if(ye.length===0)return null;const je=ye.length>1,I=fa($),te=`calc(-0.5 * (${I} + ${$}))`;if(ye.length===1){const ce=ye[0];return a.jsx("div",{...Ti(ce),children:a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:je?{gap:$}:void 0,children:ye.map((ce,Te)=>a.jsxs("div",{...Ti(ce),children:[a.jsx("img",{...Zo(ce),src:ce.url,alt:ce.name??"",draggable:!1}),o&&je&&Te<ye.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:te,width:I,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${ce.url}-${Te}`))})},Jo=!!(ie!=null&&ie.title2||ie!=null&&ie.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(_??0)>0||o),ia=()=>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:st,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ri(le||ie)}),a.jsxs("div",{ref:ht,className:`${e}-titles-row-two-row`,style:{...se&&Y?{minHeight:Y}:void 0,...se&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[Dt(a.jsxs("div",{className:Yt,style:{position:se?"absolute":"relative",inset:se?0:void 0,width:"100%"},children:[xt&&se?a.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(ie)})]}),se&&Y?Y:void 0),Jo?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&se?a.jsx("div",{className:`${Jt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:un(xt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${se?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${V?` ${e}-titles-layer-in-stacked`:""}`,children:un(ie,!0)})]}):null]})]}),oa=()=>{const ye=Jo;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ye?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:ye?void 0:{flex:"0 0 auto",height:"auto"},children:ri(ie,!0)}),Cn()]})};return a.jsxs("div",{ref:ze,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Ee()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Ae?1:0,transition:"opacity 300ms ease",pointerEvents:Ae?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ve}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:qe,...ke,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:at,onClick:ye=>ye.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ue&&ge.length>1?"true":"false",onPointerDown:ue?Tt:void 0,onPointerUp:ue?Xt:void 0,onPointerCancel:ue?Zt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&me?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ye=>{ye.target===ye.currentTarget&&ve(Pe)},children:a.jsx("div",{className:`${e}-slide-area`,children:si(wt.images)})},`slide-out-${Pe}`):null,a.jsx("div",{className:`${e}-slide-layer-in${me?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:oe?si(oe.images):null})},`slide-in-${Pe}-${ae}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Je,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:Q,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...V?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${V?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&a.jsx("div",{className:`${e}-text-bar-cell${V?` ${e}-text-bar-cell-stacked`:""}`,style:V?void 0:{flex:1,minWidth:0,width:"100%"},children:V?C==="fade"?ia():oa():C==="fade"?Qe():Et()})})})]})]})]})};function ex(e){return`
|
|
15157
15157
|
.${e}-wrapper {
|
|
15158
15158
|
position: relative;
|
|
15159
15159
|
width: 100%;
|
|
@@ -16431,7 +16431,7 @@ export type LightboxJournalSettings = {
|
|
|
16431
16431
|
closeIconColor: string;
|
|
16432
16432
|
closeIconHoverColor: string;
|
|
16433
16433
|
};
|
|
16434
|
-
`,ix="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>'),pi={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 ox(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...pi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...pi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...pi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...pi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...pi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...pi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...pi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const rx=Jn.reduce((e,t)=>({...e,...ox(t)}),{}),ax=Jn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ra(e){return Jn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const sx=bf(),lx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...rx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ix,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ax,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ra({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ra({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ra({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[sx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},cx={element:tx,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:lx,sourceCode:nx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Jn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Jn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},dx={sizeType:"custom",value:700,min:400,max:700};function _r(e,t){return{widthPx:e,heightPx:e*t}}function Qa(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function Gl(e,t,n,i){const{heightPx:o}=_r(n,i);return Qa(e/2,t/2,e,t,n,o)}function Ad(e,t,n){for(const i of n){const{heightPx:o}=_r(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function ux(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Ad(e,t,n)||r==="area"?l??"none":d??"none"}function ql(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function px(e){return`
|
|
16434
|
+
`,ix="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>'),mi={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 ox(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const rx=Qn.reduce((e,t)=>({...e,...ox(t)}),{}),ax=Qn.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Goudy Bookletter 1911",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ra(e){return Qn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const sx=bf(),lx={type:"object",version:1,settings:{sizing:"auto manual",properties:{cover:{type:"string",scope:"common",title:"",display:{type:"settings-image-input"}},coverFit:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["A","B"]},maxHeight:{type:"number",scope:"layout",title:"Max Height (%)",min:0,max:100,display:{type:"percentage-input"}},maxWidth:{type:"number",scope:"layout",title:"Max Width (%)",min:0,max:100,display:{type:"percentage-input"}},imageGap:{type:"number",scope:"layout",title:"Image Gap",min:0,display:{type:"range-control",visible:!1}},backgroundColor:{type:"string",scope:"common",title:"BG Default",display:{type:"settings-color-picker"}},closeIcon:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},closeIconMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"full-width-input"},min:0,max:1},closeIconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"settings-color-picker"}},closeIconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"settings-color-picker"}},textTransition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["none","fade"]}},title1Width:{type:"number",scope:"layout",title:"Title 1 width",min:0,display:{type:"range-control"}},title2Width:{type:"number",scope:"layout",title:"Title 2 width",min:0,display:{type:"range-control"}},title3Width:{type:"number",scope:"layout",title:"Title 3 width",min:0,display:{type:"range-control"}},title2MarginLeft:{type:"number",scope:"layout",title:"Title 2 margin left",min:0,display:{type:"range-control"}},title3MarginLeft:{type:"number",scope:"layout",title:"Title 3 margin left",min:0,display:{type:"range-control"}},titleHeaderLayout:{type:"string",scope:"layout",title:"Title header layout",display:{type:"toggle-cycle",enum:["desktop","mobile"]}},title1MarginLeft:{type:"number",scope:"layout",title:"Title 1 margin left",min:0,display:{type:"range-control"}},titleRowMarginBottom:{type:"number",scope:"layout",title:"Title row margin bottom",min:0,display:{type:"range-control"}},countCloseGap:{type:"number",scope:"layout",title:"Count / Close Gap",min:0,display:{type:"range-control"}},title1Color:{type:"string",scope:"common",title:"Title Default",display:{type:"palette-color-picker"}},title2Color:{type:"string",scope:"common",title:"Subtitle Default",display:{type:"palette-color-picker"}},title3Color:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-color-picker"}},countColor:{type:"string",scope:"common",title:"Count Default",display:{type:"palette-color-picker"}},...rx,contentMarginTop:{type:"number",scope:"layout",title:"Content margin top",min:0,display:{type:"range-control"}},iconMarginRight:{type:"number",scope:"layout",title:"Icon margin right",min:0,display:{type:"range-control"}}},defaults:{cover:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",coverFit:{display:"fit",ratioValue:"1:1",reversed:!1},closeIcon:ix,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...ax,countFontFamily:"Arial"},layoutDefaults:{m:{type:"B",imageGap:.01,maxHeight:80,maxWidth:80,closeIconMaxWidth:.08,contentMarginTop:.04,titleHeaderLayout:"mobile",title1Width:.4,title2Width:.55,title3Width:.3,title1MarginLeft:.04,title2MarginLeft:.04,title3MarginLeft:.08,titleRowMarginBottom:.08,iconMarginRight:.01,countCloseGap:.04,...Ra({title1FontSize:.04,title1LineHeight:.04,title2FontSize:.04,title2LineHeight:.04,title3FontSize:.04,title3LineHeight:.04,countFontSize:.04,countLineHeight:.04})},t:{type:"A",imageGap:.05,maxHeight:80,maxWidth:40,closeIconMaxWidth:.03,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.16,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.03,...Ra({title1FontSize:.0208,title1LineHeight:.0208,title2FontSize:.0208,title2LineHeight:.0208,title3FontSize:.0208,title3LineHeight:.0208,countFontSize:.0208,countLineHeight:.0208})},d:{type:"A",maxHeight:80,maxWidth:40,imageGap:.05,closeIconMaxWidth:.0125,contentMarginTop:.01,titleHeaderLayout:"desktop",title1Width:.35,title2Width:.248,title3Width:.1,title1MarginLeft:.01,title2MarginLeft:.1,title3MarginLeft:.1,titleRowMarginBottom:0,iconMarginRight:.01,countCloseGap:.02,...Ra({title1FontSize:.0098,title1LineHeight:.0098,title2FontSize:.0098,title2LineHeight:.0098,title3FontSize:.0098,title3LineHeight:.0098,countFontSize:.008,countLineHeight:.0098})}},layout:["__componentName__","maxWidth","maxHeight","imageGap","title1Width","title2Width","title3Width","title2MarginLeft","title3MarginLeft","titleHeaderLayout","titleRowMarginBottom","title1MarginLeft","countCloseGap","contentMarginTop","iconMarginRight"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["type"]},{type:"row",title:"Image",items:["maxWidth","maxHeight"]},{type:"row",title:"Text",items:["textTransition"]},{type:"row",title:"Close icon",items:["closeIcon","closeIconMaxWidth"]},{type:"row",title:"Cover Image",items:["cover","coverFit"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[sx]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","countColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0},items:{type:"object",properties:{title1:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},title2:{type:"string",label:"Subtitle",placeholder:"Add Subtitle...",display:{type:"text-input"}},title3:{type:"string",label:"Caption",placeholder:"Add Caption...",display:{type:"text-input"}},image:{type:"object",label:"Image",max:2,display:{type:"media-list-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]}}},default:[{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"",objectFit:"contain"},{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"",objectFit:"contain"}]},{title1:"NASA",title2:"Apollo 9 Mission, 1969",title3:"Archival Footage",image:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"contain"}]}]}},cx={element:tx,id:"lightbox-journal",name:"Journal",category:"galleries",version:1,defaultSize:{d:{width:350},t:{width:300},m:{width:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Journal.png"},schema:lx,sourceCode:nx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Qn.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{...Qn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})}},dx={sizeType:"custom",value:700,min:400,max:700};function _r(e,t){return{widthPx:e,heightPx:e*t}}function Qa(e,t,n,i,o,r){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,r/2),i-r/2)}}function Gl(e,t,n,i){const{heightPx:o}=_r(n,i);return Qa(e/2,t/2,e,t,n,o)}function Ad(e,t,n){for(const i of n){const{heightPx:o}=_r(i.widthPx,i.aspectRatio),r=i.widthPx/2,l=o/2;if(e>=i.x-r&&e<=i.x+r&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function ux(e,t,n,i,o,r,l,d){if(o==="system")return"none";const c=i.getBoundingClientRect(),u=document.elementFromPoint(c.left+e,c.top+t);return u&&u.closest("a")?"none":Ad(e,t,n)||r==="area"?l??"none":d??"none"}function ql(e,t,n){var d;const{sizeType:i,value:o,min:r,max:l}=t;return i==="custom"?o:i==="as is"?((d=n.get(e))==null?void 0:d.naturalWidth)??o:Math.round(Math.random()*(l-r)+r)}function px(e){return`
|
|
16435
16435
|
.${e}-root {
|
|
16436
16436
|
position: absolute;
|
|
16437
16437
|
top: 0;
|
|
@@ -16466,7 +16466,7 @@ export type LightboxJournalSettings = {
|
|
|
16466
16466
|
width: 32px;
|
|
16467
16467
|
height: 32px;
|
|
16468
16468
|
}
|
|
16469
|
-
`}function mx(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 gx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await mx(i)]));return new Map(n)}function hx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=W.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,x]=s.useState({x:0,y:0}),[g,m]=s.useState("none"),h=s.useRef({x:0,y:0}),[f,C]=s.useState(!1),[y,R]=s.useState(!1),H=s.useRef(new Map),{imageSize:S=dx,cursor:U="system",target:F="area",position:_="random",visible:B="all",defaultCursor:L=null,hoverCursor:N=null}=e,k=t.filter(v=>{var w;return!!((w=v==null?void 0:v.image)!=null&&w.url)}),Z=s.useMemo(()=>px(i),[i]),
|
|
16469
|
+
`}function mx(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 gx(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await mx(i)]));return new Map(n)}function hx({settings:e,content:t=[],isEditor:n}){const{prefix:i}=W.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,x]=s.useState({x:0,y:0}),[g,m]=s.useState("none"),h=s.useRef({x:0,y:0}),[f,C]=s.useState(!1),[y,R]=s.useState(!1),H=s.useRef(new Map),{imageSize:S=dx,cursor:U="system",target:F="area",position:_="random",visible:B="all",defaultCursor:L=null,hoverCursor:N=null}=e,k=t.filter(v=>{var w;return!!((w=v==null?void 0:v.image)!=null&&w.url)}),Z=s.useMemo(()=>px(i),[i]),M=s.useCallback((v,w,P=l)=>{if(!o)return;const Q=o.getBoundingClientRect(),z=v-Q.left,T=w-Q.top;x({x:z,y:T}),m(ux(z,T,P,o,U,F,N,L))},[o,l,U,F,N,L]);s.useEffect(()=>{const v=[...k.map(P=>P.image.url),L,N].filter(P=>!!P);if(v.length===0){H.current=new Map,R(!0);return}let w=!1;return R(!1),gx(v).then(P=>{w||(H.current=P,R(!0))}),()=>{w=!0}},[t,L,N]),s.useEffect(()=>{if(!o)return;const v=P=>{P.stopPropagation(),h.current={x:P.clientX,y:P.clientY},M(P.clientX,P.clientY)},w=()=>{f&&M(h.current.x,h.current.y)};return o.addEventListener("mousemove",v),window.addEventListener("scroll",w,!0),()=>{o.removeEventListener("mousemove",v),window.removeEventListener("scroll",w,!0)}},[o,f,M]),s.useEffect(()=>{!o||!f||M(h.current.x,h.current.y)},[l,o,f,M]),s.useEffect(()=>{f||m("none")},[f]);const K=(v,w,P,Q={})=>{var V,ue;if(!((V=v==null?void 0:v.image)!=null&&V.url))return null;const z=((ue=H.current.get(v.image.url))==null?void 0:ue.aspectRatio)??1,T=ql(v.image.url,S,H.current),{heightPx:O}=_r(T,z);let E=0,ee=0;return _==="same"?{x:E,y:ee}=Gl(w,P,T,z):(E=Q.x??Math.random()*w,ee=Q.y??Math.random()*P,{x:E,y:ee}=Qa(E,ee,w,P,T,O)),{id:p.current++,url:v.image.url,link:v.link,name:v.image.name,x:E,y:ee,xRatio:E/w,yRatio:ee/P,aspectRatio:z,widthPx:T}},D=()=>{if(!o)return;const v=o.getBoundingClientRect(),w=v.width,P=v.height;w===0||P===0||d(Q=>Q.length===0?Q:Q.map(z=>{const T=S.sizeType==="random"?z.widthPx:ql(z.url,S,H.current),{heightPx:O}=_r(T,z.aspectRatio);if(_==="same"){const{x:V,y:ue}=Gl(w,P,T,z.aspectRatio);return{...z,x:V,y:ue,widthPx:T}}const{x:E,y:ee}=Qa(z.xRatio*w,z.yRatio*P,w,P,T,O);return{...z,x:E,y:ee,widthPx:T}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const v=o.getBoundingClientRect(),w=v.width,P=v.height,Q=K(k[0],w,P);Q&&(d([Q]),u(k.length>1?1:0))},[S,_,o,t,y]),s.useEffect(()=>{if(!o)return;D();const v=new ResizeObserver(D);return v.observe(o),window.addEventListener("resize",D),()=>{v.disconnect(),window.removeEventListener("resize",D)}},[o,_,S,l.length]),s.useEffect(()=>{B==="last One"&&d(v=>v.length>0?[v[v.length-1]]:[])},[B]);const j=v=>{if(!o||k.length===0||!y)return;const w=o.getBoundingClientRect(),P=v.clientX-w.left,Q=v.clientY-w.top;if(F==="image"&&!Ad(P,Q,l))return;let z=0,T=0;_==="on Click"?(z=P,T=Q):_==="same"?(z=w.width/2,T=w.height/2):(z=Math.random()*w.width,T=Math.random()*w.height);const O=k[c%k.length],E=K(O,w.width,w.height,{x:z,y:T});if(!E)return;const ee=B==="all"?[...l,E]:[E];d(ee),u(V=>(V+1)%k.length),M(v.clientX,v.clientY,ee)},$=U==="custom"&&g!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),a.jsxs("div",{ref:r,onClick:j,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:`${i}-root`,style:{cursor:$?"none":"default"},children:[l.map(v=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${v.y}px`,left:`${v.x}px`,width:`${v.widthPx}px`,cursor:$?"none":"default"},children:F==="area"&&v.link?a.jsx("a",{href:v.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:v.url,alt:v.name,className:`${i}-image`})}):a.jsx("img",{src:v.url,alt:v.name,className:`${i}-image`})},v.id)),f&&$&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const fx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16470
16470
|
import { CommonComponentProps } from '../props';
|
|
16471
16471
|
import { useScopedStyles } from '../utils/index';
|
|
16472
16472
|
|
|
@@ -17106,7 +17106,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17106
17106
|
display: block;
|
|
17107
17107
|
pointer-events: none;
|
|
17108
17108
|
}
|
|
17109
|
-
`}function Sx(e){return e==="blur"?bx:e==="greyscale"?xx:0}function uo(e,t=1,n=1){const i=Sx(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 Xl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function $x(e,t){return t<=1?0:(e-1+t)%t}function Cx(e,t=1){return!e||e.height===0?t:e.width/e.height}function Tx(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 Ul(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 Fd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Yl(e,t,n){return{...Fd(e),[`--${n}-stage-scale`]:t}}function Lx(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 Rx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var he,G,re,
|
|
17109
|
+
`}function Sx(e){return e==="blur"?bx:e==="greyscale"?xx:0}function uo(e,t=1,n=1){const i=Sx(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 Xl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function $x(e,t){return t<=1?0:(e-1+t)%t}function Cx(e,t=1){return!e||e.height===0?t:e.width/e.height}function Tx(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 Ul(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 Fd(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function Yl(e,t,n){return{...Fd(e),[`--${n}-stage-scale`]:t}}function Lx(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 Rx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var he,G,re,me,we,Pe,Ce;const{prefix:o}=W.useScopedStyles(),r=s.useMemo(()=>wx(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],x=Xl(b.length),[g,m]=s.useState(x.activeIndex),[h,f]=s.useState(x.backgroundIndex),[C,y]=s.useState(!1),[R,H]=s.useState(!1),[S,U]=s.useState(null),[F,_]=s.useState(null),[B,L]=s.useState(0),[N,k]=s.useState(1),[Z,M]=s.useState("none"),[K,D]=s.useState("next"),[j,$]=s.useState({}),[v,w]=s.useState({width:0,height:0}),P=s.useRef(null),Q=s.useRef(null),z=!n||!!i,T=l??60,O=Math.max(10,Math.min(100,d??T)),E=Math.max(10,Math.min(100,c??T)),ee=Math.max(100,u),V=uo(p),ue=s.useCallback(Y=>{const xe=Cx(Y?j[Y]:void 0);return Tx(v.width,v.height,xe,O,E)},[v.height,v.width,j,E,O]);s.useEffect(()=>{const Y=Q.current;if(!Y)return;const xe=new ResizeObserver(([pe])=>{const{width:X,height:le}=pe.contentRect;w({width:X,height:le})});return xe.observe(Y),()=>xe.disconnect()},[]),s.useEffect(()=>{const Y=(t??[]).map(xe=>{var pe;return(pe=xe.image)==null?void 0:pe.url}).filter(xe=>!!xe);Lx(Y,(xe,pe)=>{$(X=>{var le,Fe;return((le=X[xe])==null?void 0:le.width)===pe.width&&((Fe=X[xe])==null?void 0:Fe.height)===pe.height?X:{...X,[xe]:pe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:Y,activeIndex:xe}=Xl(b.length);m(xe),f(Y),y(!1),H(!1),U(null),_(null),L(0),k(1),M("none"),D("next")},[b.length,t]),s.useEffect(()=>()=>{P.current&&clearTimeout(P.current)},[]);const Ie=s.useCallback(Y=>{var fe,J,Xe,Oe;if(!z||C||b.length<=1)return;const xe=Y==="next"?(g+1)%b.length:(g-1+b.length)%b.length,pe=ue((J=(fe=b[g])==null?void 0:fe.image)==null?void 0:J.url),X=ue((Oe=(Xe=b[xe])==null?void 0:Xe.image)==null?void 0:Oe.url),le=Ul(v.width,v.height,pe),Fe=Ul(v.width,v.height,X);P.current&&clearTimeout(P.current),D(Y),H(!0),y(!0),Y==="next"?(U(g),_(xe),L(0),k(1),M(uo(p,0,1))):(f($x(xe,b.length)),U(xe),_(g),L(1),k(Fe),M(uo(p,1,Fe))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{Y==="next"?(L(1),k(le),M(uo(p,1,le))):(L(0),k(1),M(uo(p,0,1)))})}),P.current=setTimeout(()=>{Y==="next"&&f(g),m(xe),U(null),_(null),y(!1)},ee)},[g,p,v.height,v.width,ue,C,z,b,ee]),ge=b[g],ae=h!==null?b[h]:null,ne=S!==null?b[S]:null,oe=F!==null?b[F]:null,ie=b.length<=1?0:(g-1+b.length)%b.length,Ae=b.length<=1?0:(g+1)%b.length,be=ue((he=ge==null?void 0:ge.image)==null?void 0:he.url),Me=ue((G=ne==null?void 0:ne.image)==null?void 0:G.url),q=ue((re=oe==null?void 0:oe.image)==null?void 0:re.url),se={[`--${o}-transition-ms`]:`${ee}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:Q,className:ut(`${o}-wrapper`,R&&`${o}-snap`,n&&!i&&`${o}-editor`),style:se,"aria-label":"Zoom gallery",children:[((me=ae==null?void 0:ae.image)==null?void 0:me.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ae.image.url,alt:"",style:{filter:V}})}),C&&((we=ne==null?void 0:ne.image)==null?void 0:we.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${K}`),style:Yl(Me,N,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ne.image.url,alt:"",style:{filter:Z}})}),C&&((Pe=oe==null?void 0:oe.image)==null?void 0:Pe.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${K}`),style:Yl(q,B,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:oe.image.url,alt:""})}),!C&&((Ce=ge==null?void 0:ge.image)==null?void 0:Ce.url)&&a.jsx("div",{className:ut(`${o}-stage`,`${o}-foreground`),style:Fd(be),children:a.jsx("img",{className:`${o}-image`,src:ge.image.url,alt:ge.image.name??""})}),z&&b.length>1&&!C&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ie("prev"),"aria-label":`Show previous image (${ie+1} of ${b.length})`}),a.jsx("button",{type:"button",className:ut(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ie("next"),"aria-label":`Show next image (${Ae+1} of ${b.length})`})]})]})]})}const Ix=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17110
17110
|
import cn from 'classnames';
|
|
17111
17111
|
import { CommonComponentProps } from '../props';
|
|
17112
17112
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17865,7 +17865,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17865
17865
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17866
17866
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17867
17867
|
}
|
|
17868
|
-
`}function Pa(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 Kl(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{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=W.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 Wx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=W.useScopedStyles(),l=s.useMemo(()=>_x(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:x="text-icon",gap:g=0,iconSize:m=0,iconWidthC:h=0,dimensions:f=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:R={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:S={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:F=0,backgroundColor:_="#000000",textColor:B="#ffffff",borderColor:L="#ffffff",iconColor:N="#ffffff",hoverEffect:k="none",fontFamily:Z,fontSettings:
|
|
17868
|
+
`}function Pa(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 Kl(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(sn,{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=W.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 Wx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=W.useScopedStyles(),l=s.useMemo(()=>_x(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:x="text-icon",gap:g=0,iconSize:m=0,iconWidthC:h=0,dimensions:f=!1,padding:C={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:R={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:S={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:U="rgba(0, 0, 0, 0)",stroke:F=0,backgroundColor:_="#000000",textColor:B="#ffffff",borderColor:L="#ffffff",iconColor:N="#ffffff",hoverEffect:k="none",fontFamily:Z,fontSettings:M,fontSize:K,lineHeight:D,letterSpacing:j=0,wordSpacing:$=0,textAppearance:v,stateOverrides:w,minWidth:P=0,minHeight:Q=0,width:z=0,height:T=0}=e,O=W.buildColorVars(r,{backgroundColor:_,textColor:B,borderColor:L,iconColor:N,boxShadowColor:H,innerBoxShadowColor:U},Mx,kx,w),E=i&&i!=="default"?`${r}-state-${i}`:"",ee=t&&!n?`${r}-editing`:"",V=k!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${k}`:"",ue=k==="reveal"||k==="swipe",Ie=k==="content-roll",ge=k==="reveal"&&(!t||n),ae=f===!0,oe=d==="a"?b??p:p,ie=d==="c",Ae=d!=="b",be={fontSettings:{fontFamily:Z,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:K??.01,lineHeight:D,letterSpacing:j,wordSpacing:$,textAppearance:v,color:B},q={...Ae?an(Ut(be,t)):{},[`--${r}-box-shadow-x`]:W.scalingValue(R.left,t),[`--${r}-box-shadow-y`]:W.scalingValue(R.top,t),[`--${r}-box-shadow-blur`]:W.scalingValue(R.right,t),[`--${r}-box-shadow-spread`]:W.scalingValue(R.bottom,t),[`--${r}-inner-box-shadow-x`]:W.scalingValue(S.left,t),[`--${r}-inner-box-shadow-y`]:W.scalingValue(S.top,t),[`--${r}-inner-box-shadow-blur`]:W.scalingValue(S.right,t),[`--${r}-inner-box-shadow-spread`]:W.scalingValue(S.bottom,t),paddingTop:W.scalingValue(C.top,t),paddingRight:W.scalingValue(C.right,t),paddingBottom:W.scalingValue(C.bottom,t),paddingLeft:W.scalingValue(C.left,t),borderRadius:W.scalingValue(y,t),borderWidth:W.scalingValue(F,t),...ie?{}:{justifyContent:Ia[oe],textAlign:oe},...ie&&!Ie?{gap:W.scalingValue(g,t)}:{},...ae?{width:W.scalingValue(z,t),height:W.scalingValue(T,t)}:{minWidth:W.scalingValue(P,t),minHeight:W.scalingValue(Q,t),...ie?{width:"100%"}:{}}};let se;const he={display:"inline-flex",alignItems:"center",justifyContent:ie?Ia[oe]:Ia[d==="a"?oe:"center"],gap:ie?W.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const me=()=>Kl(r,u,m>0?"fixed":"fill",100,m,t);se=Ie?Pa(r,me,`${r}-icon-roll`,void 0,he):me()}else if(d==="c"){const me=()=>{const we=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),Pe=Kl(r,u,h>0?"fixed":"fill",100,h,t);return x==="icon-text"?a.jsxs(a.Fragment,{children:[Pe,we]}):a.jsxs(a.Fragment,{children:[we,Pe]})};se=Ie?Pa(r,me,`${r}-icon-text-roll`,void 0,he):me()}else se=Ie?Pa(r,()=>c,`${r}-label-roll`,void 0,he):ue?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const G=ge?me=>Ax(me,r):void 0,re=ge?me=>Fx(me,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:O,children:a.jsx("div",{className:`${r}-wrapper ${E} ${ee}`.trim(),children:a.jsx("div",{className:`${r}-button ${V}`.trim(),style:q,onMouseEnter:G,onMouseLeave:re,role:"button",tabIndex:o||t&&!n?void 0:0,children:se})})})]})}const Nx=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17869
17869
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17870
17870
|
import { CommonComponentProps } from '../props';
|
|
17871
17871
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18690,7 +18690,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18690
18690
|
pointer-events: auto;
|
|
18691
18691
|
flex-shrink: 0;
|
|
18692
18692
|
}
|
|
18693
|
-
`}const Ln=500,po=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",zx=72,Vx=50,Gx=1e4,qx=650,Xx=500;function Ux(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 _d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Yx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Kx(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 vo(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 Zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return vo(e,i,n)}const Zx=.03;function Wd(e){return e.width*Zx}const Ea={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function es(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 Qx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:es(e,t.width,t.height)}function e0(e,t){if(ea(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 t0(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 n0({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=>ea(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 Qi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(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 Wr(e,t,n){const i=Qi(e,t,n);return{...i,left:2*i.left-e.left}}function i0(e,t,n){const{left:i,width:o}=n,r=Wd(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 Nd(e,t,n,i){const o=Qi(e,"left",i),r=Qi(e,"right",i),l=Wr(e,"left",i),d=Wr(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 o0(e,t,n,i){const{start:o,end:r}=Nd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function r0(e,t,n){const i=Qi(e,t,n),o=Wr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ea(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function a0({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ea(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 s0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),E=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(Ea),[M,ee]=s.useState(0),[V,me]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[pe,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,ue]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ea(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?vo(u,p,-1):st(n,-1),Se=ht?vo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?vo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?vo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?Zl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?Zl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return Qx(y.current,$e)},[S,M]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Jl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),tt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{We(),qe(!1)},po+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ea.width,height:typeof window<"u"?window.innerHeight:Ea.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=o0(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),E.current=window.setTimeout(()=>{K.current!==null&&Tt()},po+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),ue(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Xx:qx;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Gx))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(es(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Jx(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(es(A,Et,Qe));return}}const ot=Jl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||e0(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){me("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),me("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Ln);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),ue(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Vx&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,ue(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,ue(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>zx){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),me("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,ue(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),me("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?pe??x:x,it=De&&Q&&(V==="opening"||Nt)?Ux(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?pr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${po}ms ${mn}`:X?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:pt?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?Nd(Ne,ot,Ae,T):{start:Re==="far"?Wr(Ne,$e,T):Qi(Ne,$e,T)},Qe=pr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?r0(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${po}ms ${mn}`:`transform ${po}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?i0(Qi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?pr(Ht,T):null,St=Ot?pr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"none":`opacity ${Ln}ms ${mn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:xe?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(mr,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(mr,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(a0,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}const l0=20,c0=.18;function d0(e){return`
|
|
18693
|
+
`}const Ln=500,po=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",zx=72,Vx=50,Gx=1e4,qx=650,Xx=500;function Ux(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 _d(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=kr(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 Yx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?_d(i,n):null}function Kx(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 vo(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 Zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return vo(e,i,n)}const Zx=.03;function Wd(e){return e.width*Zx}const Ea={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function pr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Jl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Jx(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function es(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 Qx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:es(e,t.width,t.height)}function e0(e,t){if(ea(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 t0(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 n0({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=>ea(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 Qi(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Wd(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 Wr(e,t,n){const i=Qi(e,t,n);return{...i,left:2*i.left-e.left}}function i0(e,t,n){const{left:i,width:o}=n,r=Wd(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 Nd(e,t,n,i){const o=Qi(e,"left",i),r=Qi(e,"right",i),l=Wr(e,"left",i),d=Wr(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 o0(e,t,n,i){const{start:o,end:r}=Nd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function r0(e,t,n){const i=Qi(e,t,n),o=Wr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ea(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function a0({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 mr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ea(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 s0({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:x,resolveCloseSourceRect:g,onClose:m,onPrev:h,onNext:f}){const C=s.useRef(null),y=s.useRef(null),R=s.useRef(null),H=s.useRef(new Map),[S,U]=s.useState(0),F=s.useRef(null),_=s.useRef(0),B=s.useRef(0),L=s.useRef("none"),N=s.useRef(!1),k=s.useRef(!1),Z=s.useRef(!1),M=s.useRef(null),K=s.useRef(null),D=s.useRef(null),j=s.useRef(()=>{}),$=s.useRef(null),v=s.useRef(null),w=s.useRef(null),P=s.useRef(!1),[Q,z]=s.useState(null),[T,O]=s.useState(Ea),[E,ee]=s.useState(0),[V,ue]=s.useState("opening"),[Ie,ge]=s.useState(0),[ae,ne]=s.useState(0),[oe,ie]=s.useState(!1),[Ae,be]=s.useState(null),[Me,q]=s.useState(null),[se,he]=s.useState(null),[G,re]=s.useState(!1),[me,we]=s.useState(null),[Pe,Ce]=s.useState(!1),Y=s.useRef(!1),[xe,pe]=s.useState(!1),[X,le]=s.useState(!1),Fe=s.useRef(n),fe=s.useRef(void 0),J=t[n],Xe=J?ea(J):!1,Oe=ae!==0||oe,dt=!l&&(!r||!!d),nt=c&&!l,ht=u.length>1,st=s.useCallback((A,$e)=>t.length<=1?null:t[(A+$e+t.length)%t.length]??null,[t]),ze=ht?vo(u,p,-1):st(n,-1),Se=ht?vo(u,p,1):st(n,1),_e=Ae===-1&&Oe?ht&&Me!==null?vo(u,Me,-1):se!==null?st(se,-1):null:null,Be=Ae===1&&Oe?ht&&Me!==null?vo(u,Me,1):se!==null?st(se,1):null:null,Ye=_e&&_e.url!==(ze==null?void 0:ze.url)?_e:null,de=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,ve=ze&&nt?(()=>{const A=ht?Zl(u,p,-1):t.length>2?st((n-1+t.length)%t.length,-1):null;return A&&A.url!==ze.url?A:null})():null,Ee=Se&&nt?(()=>{const A=ht?Zl(u,p,1):t.length>2?st((n+1)%t.length,1):null;return A&&A.url!==Se.url?A:null})():null,Ge=Ye??ve,Ze=de??Ee,Ve=s.useCallback((A,$e,Re)=>{if(!A||!$e||!Re)return;const Ne=H.current,ot=Ne.get(A);(ot==null?void 0:ot.width)===$e&&(ot==null?void 0:ot.height)===Re||(Ne.set(A,{width:$e,height:Re}),U(Et=>Et+1))},[]),at=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const $e=H.current.get(A.url);return Qx(y.current,$e)},[S,E]),Je=s.useCallback(()=>{if(!J)return;const A=at(J);if(A){z(A);return}const $e=y.current;$e&&z(Jl($e))},[J,at]),ke=s.useCallback(A=>{if(ht){const $e=u.length;q((p+A+$e)%$e),he(null);return}t.length>1&&(he((n+A+t.length)%t.length),q(null))},[ht,u.length,p,t.length,n]),qe=s.useCallback(A=>{Z.current=A,ie(A)},[]),We=s.useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null)},[]),tt=s.useCallback(()=>{We(),M.current=window.setTimeout(()=>{We(),qe(!1)},po+32)},[We,qe]),rt=s.useCallback(()=>{const A=C.current;if(!A){O({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ea.width,height:typeof window<"u"?window.innerHeight:Ea.height});return}const $e=A.getBoundingClientRect();O({left:$e.left,top:$e.top,width:$e.width,height:$e.height})},[]),lt=s.useCallback((A,$e)=>{if(Oe){if(xe&&!oe)return`translate(${ae}px, 0px)`;if(oe&&Ae!==null){const Re=at(A);if(!Re)return;const{x:Ne,y:ot}=o0(Re,$e,Ae,T);return`translate(${Ne}px, ${ot}px)`}if(oe)return"translate(0px, 0px)"}},[Oe,xe,oe,ae,Ae,T,at]),Tt=s.useCallback(()=>{const A=K.current;K.current=null,We(),qe(!1),be(null),q(null),he(null),ne(0),pe(!1),N.current=!1,B.current=0,L.current="none",A===-1?h():A===1&&f()},[We,qe,h,f]),Xt=s.useCallback(()=>{We(),M.current=window.setTimeout(()=>{K.current!==null&&Tt()},po+32)},[We,Tt]),Zt=s.useCallback(()=>{We(),K.current=null,qe(!1),be(null),q(null),he(null),ne(0),pe(!1),N.current=!1,B.current=0,L.current="none"},[We,qe]),xt=s.useCallback(A=>{if(!(!nt||!Q)){if(Z.current){if(K.current===A){D.current=A,Tt();return}Zt()}We(),ke(A),K.current=A,be(A),qe(!0),Xt()}},[nt,Q,Tt,Zt,We,ke,qe,Xt]);j.current=xt;const wt=s.useCallback(()=>{$.current=null,P.current=!1,v.current!==null&&(window.clearInterval(v.current),v.current=null),w.current!==null&&(window.clearTimeout(w.current),w.current=null)},[]),Bt=s.useCallback(A=>{v.current!==null&&window.clearInterval(v.current);const $e=P.current?Xx:qx;v.current=window.setInterval(()=>{j.current(A)},$e)},[]),At=s.useCallback(A=>{$.current!==A&&(wt(),$.current=A,P.current=!1,j.current(A),Bt(A),w.current=window.setTimeout(()=>{w.current=null,$.current===A&&(P.current=!0,Bt(A))},Gx))},[wt,Bt]),vt=s.useCallback(()=>{const A=y.current;if(!A)return;const $e=J==null?void 0:J.url,Re=$e?H.current.get($e):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){z(es(A,Re.width,Re.height));return}const Ne=R.current;if(Ne&&$e&&(Ne.src===$e||Ne.currentSrc===$e)){const{width:Et,height:Qe}=Jx(Ne);if(Et&&Qe){Ve($e,Et,Qe),z(es(A,Et,Qe));return}}const ot=Jl(A);!ot.width||!ot.height||z(ot)},[J==null?void 0:J.url,Ve]),Ft=s.useCallback(A=>{if(R.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&vt();return}A.complete&&A.naturalWidth>0&&vt()}},[vt]),Wt=s.useCallback(()=>{rt(),vt(),ee(A=>A+1)},[rt,vt]);s.useEffect(()=>{Wt();const A=y.current,$e=C.current,Re=new ResizeObserver(()=>Wt());return A&&Re.observe(A),$e&&Re.observe($e),window.addEventListener("resize",Wt),()=>{Re.disconnect(),window.removeEventListener("resize",Wt)}},[Wt,n,b]),s.useLayoutEffect(()=>{if(!J)return;const A=R.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){vt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Je()},[Je,S]),s.useEffect(()=>{const A=new Set,$e=[],Re=Ne=>{!(Ne!=null&&Ne.url)||A.has(Ne.url)||(A.add(Ne.url),$e.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),$e.forEach(Ne=>{H.current.has(Ne.url)||e0(Ne,Ve)})},[t,u,Ve]),s.useEffect(()=>{if(V!=="opening"||!Q)return;if(!x){ue("open");return}re(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),ue("open")})});return()=>cancelAnimationFrame(A)},[V,Q,x]),s.useEffect(()=>{if(V!=="closing")return;const A=setTimeout(()=>m(),Ln);return()=>clearTimeout(A)},[V,m]),s.useEffect(()=>()=>{We()},[We]),s.useLayoutEffect(()=>{Fe.current===n&&fe.current===(J==null?void 0:J.url)||(We(),K.current=null,be(null),q(null),he(null),ge(0),ne(0),qe(!1),le(!1),pe(!1),_.current=0,B.current=0,L.current="none",N.current=!1,F.current=null,k.current=!1,R.current=null,Je(),Fe.current=n,fe.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,qe,We,Je]),s.useLayoutEffect(()=>{const A=D.current;A!==null&&(D.current=null,requestAnimationFrame(()=>{j.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(V==="opening"){Y.current=!1,Ce(!1);return}if(V!=="open"||Y.current)return;if(!ze&&!Se){Y.current=!0;return}Ce(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),Y.current=!0})});return()=>cancelAnimationFrame(A)},[V,ze==null?void 0:ze.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(V!=="open")return;const A=()=>{const Qe=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Qe,!0)};document.addEventListener("click",Qe,!0)},$e=Qe=>{const yt=Qe<0?1:-1;We(),ke(yt),K.current=yt,be(yt),qe(!0),Xt()},Re=Qe=>{if(Math.abs(Qe)>Vx&&nt){$e(Qe);return}K.current=null,be(null),q(null),he(null),qe(!0),ne(0),tt()},Ne=Qe=>{if(Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0];k.current=!0,F.current={x:yt.clientX,y:yt.clientY},L.current="none",B.current=0,N.current=!1},ot=Qe=>{if(!F.current||Qe.touches.length!==1||Z.current)return;const yt=Qe.touches[0],Dt=yt.clientX-F.current.x,Lt=yt.clientY-F.current.y;if(L.current==="none"){if(Math.abs(Dt)<10&&Math.abs(Lt)<10)return;if(Math.abs(Dt)>Math.abs(Lt)){if(!nt)return;L.current="horizontal"}else if(Lt>0){if(!dt)return;L.current="vertical"}else return}if(L.current==="horizontal"){N.current=!0,pe(!0),B.current=Dt,ne(Dt),Qe.preventDefault();return}L.current==="vertical"&&(N.current=!0,pe(!0),_.current=Lt,ge(Lt),Qe.preventDefault())},Et=()=>{if(!F.current)return;const Qe=L.current,yt=N.current;if(yt&&Qe==="horizontal")Re(B.current),A();else if(yt&&Qe==="vertical"){const Dt=_.current;if(dt&&Dt>zx){const Lt=window.innerHeight;_.current=Lt,le(!0),ge(Lt),ue("closing")}else _.current=0,ge(0);A()}else Qe==="horizontal"&&Math.abs(B.current)>0&&(Re(B.current),A());F.current=null,L.current="none",B.current=0,N.current=!1,pe(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",ot,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",ot),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[V,nt,qe,tt,We,dt,Xt,ke]);const Yt=s.useCallback(()=>{const A=(g==null?void 0:g())??x??null;A&&Q&&(we(A),re(!0)),ue("closing")},[g,x,Q]);s.useEffect(()=>{const A=Ne=>{if(Ne.key==="Escape"){if(r&&d||V==="closing")return;wt(),Yt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||V!=="open"||!nt)return;Ne.preventDefault();const ot=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&$.current===ot||At(ot)},$e=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const ot=Ne.key==="ArrowLeft"?-1:1;$.current===ot&&wt()},Re=()=>{wt()};return window.addEventListener("keydown",A),window.addEventListener("keyup",$e),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",$e),window.removeEventListener("blur",Re),wt()}},[V,r,d,Yt,nt,At,wt]),s.useEffect(()=>{V!=="open"&&wt()},[V,wt]);const Jt=()=>{V==="closing"||l||Yt()},Ct=V==="open",Nt=V==="closing",rn=Ie>0?Math.max(0,1-Ie/500):1,mt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!Z.current)){if(K.current!==null){Tt();return}We(),qe(!1)}},[We,qe,Tt]),De=V==="closing"?me??x:x,it=De&&Q&&(V==="opening"||Nt)?Ux(De,Q):void 0,gt=Oe&&J?lt(J,"center"):Ie>0?`translateY(${Ie}px)`:it,ft=Q?pr(Q,T):null,It=!!(De&&Q),pt=It&&(V==="closing"||V==="open"&&G),jt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ie>0?mt:It?1:V==="opening"||Nt?0:1,transition:xe&&!oe?"none":oe?`transform ${po}ms ${mn}`:X?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:pt?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Xe&&Ct&&!Oe?"auto":"none",touchAction:Xe&&Ct?"none":void 0,zIndex:1,overflow:Xe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Oe?"auto":"none"},Mt=(A,$e,Re="adjacent")=>{const Ne=at(A);if(!Ne)return{display:"none"};const ot=Re==="far"?$e==="left"?"far-left":"far-right":$e==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ae!==null?Nd(Ne,ot,Ae,T):{start:Re==="far"?Wr(Ne,$e,T):Qi(Ne,$e,T)},Qe=pr(Et,T),yt=lt(A,ot),Dt=!Oe&&Re==="adjacent"&&Ct&&!Pe?r0(Ne,$e,T):null,Lt=Re==="far"&&Oe&&Ae===($e==="left"?-1:1),nn=xe&&!oe?!1:oe,un=Re==="adjacent"&&Ct&&Pe&&!Oe;return{position:"absolute",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,objectFit:"contain",transform:yt??(Dt?`translate(${Dt.x}px, ${Dt.y}px)`:void 0),opacity:Re==="far"?Ct&&Lt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${po}ms ${mn}`:`transform ${po}ms ${mn}, opacity ${Ln}ms ${mn}`:un?`transform ${Ln}ms ${mn}`:V==="opening"||Nt?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,$e)=>{const Re=at(A);return Re?i0(Qi(Re,$e,T),$e,T):null},Gt=A=>$e=>{if(!l){if(k.current){k.current=!1;return}$e.stopPropagation(),xt(A)}},Ht=ze?Vt(ze,"left"):null,Ot=Se?Vt(Se,"right"):null,_t=Ht?pr(Ht,T):null,St=Ot?pr(Ot,T):null;return a.jsxs("div",{ref:C,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Jt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?rn:0,transition:xe?"none":`opacity ${Ln}ms ${mn}`,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:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:xe?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(yd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Jt})})]}),Ct&&Ge&&a.jsx(mr,{media:Ge,style:Mt(Ge,"left","far"),onMeasure:Ve,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&ze&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:ze,style:Mt(ze,"left"),onMeasure:Ve,onTransitionEnd:Le},`prev-${ze.url}`),_t&&a.jsx("div",{style:{position:"absolute",top:_t.top,left:_t.left,width:_t.width,height:_t.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Se,style:Mt(Se,"right"),onMeasure:Ve,onTransitionEnd:Le},`next-${Se.url}`),St&&a.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||xe?"default":"pointer",pointerEvents:l||xe?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&a.jsx(mr,{media:Ze,style:Mt(Ze,"right","far"),onMeasure:Ve,onTransitionEnd:Le},`far-next-${Ze.url}`),Q&&J&&(Xe?a.jsx(a0,{src:J.url,phase:V,onMediaElement:Ft,wrapperStyle:jt,videoStyle:kt,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Ft,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:jt},`${n}-${J.url}`))]})}const l0=20,c0=.18;function d0(e){return`
|
|
18694
18694
|
.${e}-wrapper {
|
|
18695
18695
|
box-sizing: border-box;
|
|
18696
18696
|
max-width: 100%;
|
|
@@ -18778,7 +18778,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18778
18778
|
pointer-events: auto;
|
|
18779
18779
|
}
|
|
18780
18780
|
${jx(e)}
|
|
18781
|
-
`}function u0(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 p0(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 m0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:W.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:W.scalingValue(i*c0,n??!1),[`--${t}-image-aspect`]:u0(e)}}function g0(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 Ut(n,t)}function h0(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 f0(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?_d(d,o):void 0)}}function y0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>d0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=W.scalingValue(x,n??!1),m=`max(${g}, ${l0}px)`,{objectFitMode:h,imageStyle:f}=h0(e),C=g0(e,n),y=s.useRef(null),[R,H]=s.useState(!1),[S,U]=s.useState([]),[F,_]=s.useState(0),[B,L]=s.useState(0),[N,k]=s.useState(null),[Z,
|
|
18781
|
+
`}function u0(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 p0(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 m0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:W.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:W.scalingValue(i*c0,n??!1),[`--${t}-image-aspect`]:u0(e)}}function g0(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 Ut(n,t)}function h0(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 f0(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?_d(d,o):void 0)}}function y0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>d0(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=W.scalingValue(x,n??!1),m=`max(${g}, ${l0}px)`,{objectFitMode:h,imageStyle:f}=h0(e),C=g0(e,n),y=s.useRef(null),[R,H]=s.useState(!1),[S,U]=s.useState([]),[F,_]=s.useState(0),[B,L]=s.useState(0),[N,k]=s.useState(null),[Z,M]=s.useState({title1:"",title2:"",title3:""}),K=(!n||i)&&!R,D=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},j=D.sizeType??"none",$=K&&j!=="none"?`${d}-item-image-hover-${j}`:void 0,v=(D.value??120)/100,w=s.useCallback(ae=>{!ae||j!=="scale"||(ae.style.transformOrigin=ug(ae))},[j]),P=s.useCallback(ae=>{if(ae){if(h==="contain"){const ne=p0(ae);if(ne){const oe=ae.closest(`.${d}-item-image`);oe instanceof HTMLElement&&oe.style.setProperty(`--${d}-item-media-aspect`,String(ne))}}w(ae)}},[d,w,h]),Q={width:W.scalingValue(b,n??!1),...C,...m0(e,d,n),[`--${d}-image-hover-scale`]:String(v)},z=(()=>{const ae={},ne=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ne&&(ae["--cntrl-article-width"]=ne),ae})(),T=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),O=s.useMemo(()=>Kx(u),[u]),E=s.useMemo(()=>t0(u),[u]),ee=(ae,ne)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const oe=O.findIndex(Ae=>Ae.gridIndex===ae);if(oe<0)return;const ie=O[oe];L(oe),U(ie.items),_(0),M(ie.entry),k(ne??null),H(!0)},V=s.useCallback(()=>{H(!1),k(null)},[]),ue=s.useCallback(()=>{const ae=O[B];return!ae||!y.current?N:Yx(y.current,ae.gridIndex,h)??N},[O,B,N,h]),Ie=s.useCallback(ae=>{if(O.length>1){const ne=O.length,oe=(B+ae+ne)%ne,ie=O[oe];L(oe),U(ie.items),_(0),M(ie.entry);return}_(ne=>(ne+ae+S.length)%S.length)},[O,B,S.length]),ge=O.length>1||S.length>1;return s.useEffect(()=>{if(!R||typeof document>"u")return;const ae=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ae}},[R]),s.useEffect(()=>{!n||o||i||H(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&H(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(n0,{mediaList:E}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:Q,children:u.map((ae,ne)=>{var Ae,be;const oe=!!((Ae=ae.image)!=null&&Ae.url),ie=f0(!!T,oe,ne,d,h,ee);return a.jsxs("div",{className:`${d}-item`,children:[ae.title?a.jsx("span",{className:`${d}-item-title`,onClick:ie,style:ie?{cursor:"pointer"}:void 0,children:ae.title}):null,(be=ae.image)!=null&&be.url?a.jsx("span",{className:[`${d}-item-image`,h==="contain"?`${d}-item-image-fit`:void 0,$].filter(Boolean).join(" "),children:ae.image.type==="video"?a.jsx("video",{ref:P,src:ae.image.url,"data-waterfall-index":ne,style:f,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:ie,onLoadedData:Me=>P(Me.currentTarget)}):a.jsx("img",{ref:P,src:ae.image.url,alt:ae.image.name??"","data-waterfall-index":ne,style:f,onClick:ie,onLoad:Me=>P(Me.currentTarget)})}):null,ne<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!R&&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:m,height:"100%"}})})]},ne)})}),R&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ae=(l?document.getElementById(l):null)??document.body;return Dn.createPortal(a.jsx("div",{style:z,"data-selection":"none",children:a.jsx(s0,{prefix:d,items:S,index:F,entry:Z,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ge,lightboxEntries:O,entryIdx:B,layoutId:r,sourceRect:N,resolveCloseSourceRect:ue,onClose:V,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ae)})()]})}const v0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18782
18782
|
import type React from 'react';
|
|
18783
18783
|
import { createPortal } from 'react-dom';
|
|
18784
18784
|
import { CommonComponentProps } from '../props';
|
|
@@ -19292,7 +19292,7 @@ export function Waterfall({
|
|
|
19292
19292
|
</>
|
|
19293
19293
|
);
|
|
19294
19294
|
}
|
|
19295
|
-
`,x0="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>'),Gn={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 b0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...Gn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...Gn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...Gn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...Gn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...Gn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...Gn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...Gn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const eo=Jn.filter(e=>e!=="count"),w0=eo.reduce((e,t)=>({...e,...b0(t)}),{}),S0=eo.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ma(e){return eo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const $0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(eo.map(e=>[Es[e],Ms(e)]))},gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},C0=[{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"}}],T0={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:C0},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:{...Gn.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"]}}},...w0},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:x0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...S0},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,...Ma({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,...Ma({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,...Ma({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:[$0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},L0={element:y0,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"},...eo.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...eo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:T0,sourceCode:v0},Bi=500,Hd="cubic-bezier(0.25, 1, 0.5, 1)",R0=300,I0=5,P0=.15,E0=.4,M0=100,Pi=100,Ql={color:"#000000",hover:"#cccccc"},mo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},k0={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}},ka={offset:{x:0,y:0},linkColor:"#cccccc"},ec={sizeType:"drag",value:3},A0="left";function F0(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:A0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Ei(e,t,n){return`${e}: ${W.scalingValue(t/1440,n)};`}function xo(e,t){return t<=0?0:(e%t+t)%t}function _0(e,t,n,i){if(!i)return{position:xo(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 W0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function N0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const x=n.getBoundingClientRect();return{x:x.left,y:x.top}},o=i(0,0),r=i(Pi,0),l=i(0,Pi);e.removeChild(n);const d={x:(r.x-o.x)/Pi,y:(r.y-o.y)/Pi},c={x:(l.x-o.x)/Pi,y:(l.y-o.y)/Pi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function H0(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 O0(e,t){return`
|
|
19295
|
+
`,x0="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>'),Gn={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 b0(e){const t={};return t[et(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSettings")]={...Gn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[et(e,"fontSize")]={...Gn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[et(e,"lineHeight")]={...Gn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[et(e,"letterSpacing")]={...Gn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[et(e,"wordSpacing")]={...Gn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[et(e,"textAlign")]={...Gn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[et(e,"textAppearance")]={...Gn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const eo=Qn.filter(e=>e!=="count"),w0=eo.reduce((e,t)=>({...e,...b0(t)}),{}),S0=eo.reduce((e,t)=>({...e,[et(t,"fontFamily")]:"Arial",[et(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[et(t,"letterSpacing")]:0,[et(t,"wordSpacing")]:0,[et(t,"textAlign")]:"left",[et(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ma(e){return eo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[et(n,"fontSize")]=i),o!==void 0&&(t[et(n,"lineHeight")]=o),t},{})}const $0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(eo.map(e=>[Es[e],Ms(e)]))},gr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},C0=[{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"}}],T0={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:C0},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:{...Gn.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"]}}},...w0},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:x0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...S0},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,...Ma({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,...Ma({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,...Ma({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:[$0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},L0={element:y0,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"},...eo.map(e=>({path:`${et(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...eo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${et(t,"fontFamily")}`}),{})},schema:T0,sourceCode:v0},Bi=500,Hd="cubic-bezier(0.25, 1, 0.5, 1)",R0=300,I0=5,P0=.15,E0=.4,M0=100,Ei=100,Ql={color:"#000000",hover:"#cccccc"},mo={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},k0={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}},ka={offset:{x:0,y:0},linkColor:"#cccccc"},ec={sizeType:"drag",value:3},A0="left";function F0(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:A0,color:(e==null?void 0:e.titleColor)??"#000000"};return Ut(n,t)}function Mi(e,t,n){return`${e}: ${W.scalingValue(t/1440,n)};`}function xo(e,t){return t<=0?0:(e%t+t)%t}function _0(e,t,n,i){if(!i)return{position:xo(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 W0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function N0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const x=n.getBoundingClientRect();return{x:x.left,y:x.top}},o=i(0,0),r=i(Ei,0),l=i(0,Ei);e.removeChild(n);const d={x:(r.x-o.x)/Ei,y:(r.y-o.y)/Ei},c={x:(l.x-o.x)/Ei,y:(l.y-o.y)/Ei},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function H0(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 O0(e,t){return`
|
|
19296
19296
|
.${e}-wrapper {
|
|
19297
19297
|
position: relative;
|
|
19298
19298
|
width: 100%;
|
|
@@ -19391,29 +19391,29 @@ export function Waterfall({
|
|
|
19391
19391
|
top: 50%;
|
|
19392
19392
|
z-index: 1;
|
|
19393
19393
|
padding: 0;
|
|
19394
|
-
${
|
|
19395
|
-
${
|
|
19394
|
+
${Mi("width",30,t)}
|
|
19395
|
+
${Mi("height",30,t)}
|
|
19396
19396
|
transition: opacity 0.15s ease-in-out;
|
|
19397
19397
|
}
|
|
19398
19398
|
.${e}-arrow-prev {
|
|
19399
|
-
${
|
|
19399
|
+
${Mi("left",-20,t)}
|
|
19400
19400
|
transform: translate3d(-50%, -50%, 0);
|
|
19401
19401
|
}
|
|
19402
19402
|
.${e}-arrow-next {
|
|
19403
19403
|
left: unset;
|
|
19404
|
-
${
|
|
19404
|
+
${Mi("right",-20,t)}
|
|
19405
19405
|
transform: translate3d(50%, -50%, 0);
|
|
19406
19406
|
}
|
|
19407
19407
|
.${e}-arrow-prev-vertical {
|
|
19408
19408
|
left: 50%;
|
|
19409
|
-
${
|
|
19409
|
+
${Mi("top",-20,t)}
|
|
19410
19410
|
transform: translate3d(-50%, -50%, 0);
|
|
19411
19411
|
}
|
|
19412
19412
|
.${e}-arrow-next-vertical {
|
|
19413
19413
|
left: 50%;
|
|
19414
19414
|
right: unset;
|
|
19415
19415
|
top: unset;
|
|
19416
|
-
${
|
|
19416
|
+
${Mi("bottom",-20,t)}
|
|
19417
19417
|
transform: translate3d(-50%, 50%, 0);
|
|
19418
19418
|
}
|
|
19419
19419
|
.${e}-arrow-hidden {
|
|
@@ -19562,7 +19562,7 @@ export function Waterfall({
|
|
|
19562
19562
|
from { clip-path: inset(100% 0 0 0); }
|
|
19563
19563
|
to { clip-path: inset(0 0 0 0); }
|
|
19564
19564
|
}
|
|
19565
|
-
`}function D0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=F0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??ec,p=u.sizeType??"drag",b=u.value??ec.value,x=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",m=(e==null?void 0:e.nav)??"classic",h=(e==null?void 0:e.navSize)??"m",f=k0[h],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>W.scalingValue(Se*C,n),R=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,S=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,F=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??Ql.color,B=(e==null?void 0:e.controlsHoverColor)??Ql.hover,L=(e==null?void 0:e.navColor)??mo.colors.inactive,N=(e==null?void 0:e.navPaginationColor)??mo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??mo.colors.background,Z=(e==null?void 0:e.linkColor)??ka.linkColor,E=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,K=x==="horizontal",D=p==="click",j=p==="drag",$=p==="auto"&&(!n||!!i),v=!n,w=g==="slide",P=m==="classic",Q=R!=="never",z=R==="on hover",T=W.scalingValue(S,n),O={width:T,height:T,maxWidth:T},M=w&&c>1,[ee,V]=s.useState(0),[me,Ie]=s.useState(M?1:0),[ge,ae]=s.useState(!1),[ne,oe]=s.useState(!1),[ie,Ae]=s.useState(!1),[be,Me]=s.useState(0),[q,se]=s.useState(!1),[he,G]=s.useState(!1),re=s.useRef(!1),pe=s.useRef(me);pe.current=me;const we=s.useRef(null),Pe=s.useRef(0),Ce=s.useRef(null),Y=s.useRef(null),xe=s.useRef(null),ue=s.useRef(null),X=s.useCallback(Se=>{re.current=Se,ae(Se)},[]),le=s.useCallback(Se=>{if(c<2||Se===0)return;const _e=Se>0?1:-1,Be=Math.abs(Se);if(se(!0),X(!0),!w){V(Ze=>xo(Ze+Se,c));return}let Ye=pe.current;const de=M&&(Ye===0||Ye===c+1),ve=de?ee+1:null;de&&(Ye=ee+1);let Ee=Be;for(;Ee>0;){const Ze=_0(Ye,_e,c,M);if(Ye=Ze.position,Ee-=1,Ze.hitBoundary){Pe.current=Ee*_e;break}}const Ge=Be-Ee;if(Ge>0&&V(Ze=>xo(Ze+Ge*_e,c)),pe.current=Ye,ve!==null){if(pe.current=ve,Ye===ve){oe(!0),Ie(Ye);return}we.current=Ye,oe(!0),Ie(ve);return}oe(!1),Ie(Ye)},[ee,c,M,w,X]),Fe=s.useCallback(Se=>{le(Se)},[le]),fe=s.useCallback(Se=>{if(c<2)return;const _e=xo(Se,c);if(!(_e===ee&&!re.current)&&(se(!0),X(!0),V(_e),w)){const Be=_e+(M?1:0);we.current=null,Pe.current=0,pe.current=Be,oe(!1),Ie(Be)}},[ee,c,M,w,X]);s.useEffect(()=>{if(!ge)return;const Se=window.setTimeout(()=>{if(M&&(me===0||me===c+1)){we.current=null,oe(!0),Ie(ee+1);return}X(!1)},Bi);return()=>window.clearTimeout(Se)},[ee,c,M,ge,X,me]),s.useEffect(()=>{if(!ne)return;let Se=0;const _e=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=we.current;we.current=null;const Ye=Pe.current;if(Pe.current=0,oe(!1),Be!==null){pe.current=Be,Ie(Be);return}if(Ye!==0){le(Ye);return}X(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(Se)}},[le,X,ne]);const J=`${M}:${c}`,Xe=s.useRef(J);s.useEffect(()=>{if(Xe.current===J)return;Xe.current=J;const Se=c>0?Math.min(ee,c-1):0;xe.current=null,ue.current=null,Ae(!1),Me(0),V(Se),oe(!0),Ie(Se+(M?1:0))},[ee,c,M,J]),s.useEffect(()=>{if(!q)return;const Se=window.setTimeout(()=>se(!1),R0);return()=>window.clearTimeout(Se)},[q,ee]),s.useEffect(()=>{if(!$||c<2)return;const Se=Math.max(b,.1)*1e3,_e=window.setInterval(()=>{v&&he||Fe(1)},Se);return()=>window.clearInterval(_e)},[b,c,Fe,$,he,v]);const Oe=s.useCallback(Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;xe.current=null,ue.current=null;const Be=Ce.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!_e.isActive){w&&Me(0);return}const de=!(Se.timeStamp-_e.lastTime>M0)&&Math.abs(_e.velocity)>E0,ve=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*P0;if(Ae(!1),!de&&!ve){Me(0);return}const Ee=ve?_e.offset-_e.baseOffset:_e.velocity;let Ge=1;ve&&_e.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Ee)/_e.size))),Me(0),le(Ee<0?Ge:-Ge)},[le,w]);s.useEffect(()=>{const Se=_e=>{ue.current===null||_e.pointerId!==ue.current||Oe(_e)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[Oe]);const dt=Se=>{const _e=Ce.current;if(!j||c<2||!_e||Se.pointerType==="mouse"&&Se.button!==0)return;we.current=null,Pe.current=0,re.current&&X(!1);let Be=0;const Ye=Y.current;if(w&&Ye){const de=K?Ye.offsetWidth:Ye.offsetHeight;if(de>0){const ve=W0(Ye,K);let Ee=pe.current;M&&(Ee===0||Ee===c+1)?(Ee=ee+1,pe.current=Ee,oe(!0),Ie(Ee),Be=0):Be=ve+Ee*de,Me(Be)}}_e.setPointerCapture(Se.pointerId),ue.current=Se.pointerId,xe.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:N0(_e,`${r}-axis-probe`),size:K?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},nt=Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){Oe(Se);return}const Be=Se.clientX-_e.startClientX,Ye=Se.clientY-_e.startClientY,de=_e.axes?H0(_e.axes,Be,Ye):{x:Be,y:Ye},ve=K?de.x:de.y,Ee=K?de.y:de.x,Ge=_e.baseOffset+ve;if(!_e.isActive){if(Math.max(Math.abs(ve),Math.abs(Ee))<I0)return;if(Math.abs(Ee)>Math.abs(ve)){const Ve=Ce.current;Ve!=null&&Ve.hasPointerCapture(_e.pointerId)&&Ve.releasePointerCapture(_e.pointerId),xe.current=null,ue.current=null,w&&Me(0);return}_e.isActive=!0,Ae(!0)}const Ze=Se.timeStamp-_e.lastTime;Ze>0&&(_e.velocity=(Ge-_e.offset)/Ze,_e.lastTime=Se.timeStamp),_e.offset=Ge,w&&Me(Ge)},ht=Se=>{Oe(Se)},st=K?`translate3d(calc(${-me*100}% + ${be}px), 0, 0)`:`translate3d(0, calc(${-me*100}% + ${be}px), 0)`,ze=M?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O0(r,n)}}),a.jsxs("div",{className:ut(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!K}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:ut(`${r}-track`,{[`${r}-track-draggable`]:j,[`${r}-track-draggable-vertical`]:j&&!K}),onPointerDown:dt,onPointerMove:nt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:Se=>{ue.current===Se.pointerId&&Oe(Se)},children:a.jsx("div",{ref:Y,className:ut(`${r}-list`,{[`${r}-list-slide`]:w,[`${r}-list-slide-vertical`]:w&&!K,[`${r}-list-fade`]:!w}),style:w?{transform:st,transition:ie||ne?"none":`transform ${Bi}ms ${Hd}`}:void 0,children:ze.map((Se,_e)=>{const Be=M?xo(_e-1,c):_e,de=M&&(_e===0||_e===c+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:ut(`${r}-slide`,{[`${r}-is-active`]:!w&&Be===ee}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:ut(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},de)})})}),Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-prev`]:K,[`${r}-arrow-prev-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),Fe(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(U,n)}, ${W.scalingValue(F*(K?1:-1),n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:ut(`${r}-arrow-img`,`${r}-mirror`),style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-next`]:K,[`${r}-arrow-next-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),Fe(1)},style:{transform:`translate(${W.scalingValue(U*(K?-1:1),n)}, ${W.scalingValue(F,n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:`${r}-arrow-img`,style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),D&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Fe(1)}),P&&a.jsx("div",{className:ut(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:K,[`${r}-pagination-inside-left`]:!K}),style:K?{bottom:y(f.inset)}:{left:y(f.inset)},children:a.jsx("div",{className:ut(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!K,[`${r}-animate-dots`]:q}),style:{backgroundColor:k,gap:y(f.gapInactive-f.activeDot+f.dot),...K?{height:y(f.activeDot+f.paddingY*2),paddingTop:y(f.paddingY),paddingBottom:y(f.paddingY),paddingLeft:y(f.paddingActive),paddingRight:y(f.paddingActive)}:{width:y(f.activeDot+f.paddingY*2),paddingLeft:y(f.paddingY),paddingRight:y(f.paddingY),paddingTop:y(f.paddingActive),paddingBottom:y(f.paddingActive)},borderRadius:y(f.borderRadius),transform:`translate(${W.scalingValue(mo.offset.x,n)}, ${W.scalingValue(mo.offset.y,n)})`},children:d.map((Se,_e)=>{const Be=_e===ee,Ye=Be?f.activeDot:f.dot;return a.jsx("button",{onClick:()=>fe(_e),className:`${r}-pagination-item`,style:{width:y(f.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?N:L,width:y(Ye)}})},_e)})},`${h}-${x}`)})]}),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:W.scalingValue(E,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,_e)=>a.jsx("div",{className:ut(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===ee&&n,[`${r}-active`]:_e===ee}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Bi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:W.scalingValue(ka.offset.y,n),left:W.scalingValue(ka.offset.x,n)},children:a.jsx(Si,{content:Se.imageCaption})})},_e))})]})]})]})}function tc({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 B0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19565
|
+
`}function D0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=W.useScopedStyles(),l=F0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??ec,p=u.sizeType??"drag",b=u.value??ec.value,x=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",m=(e==null?void 0:e.nav)??"classic",h=(e==null?void 0:e.navSize)??"m",f=k0[h],C=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>W.scalingValue(Se*C,n),R=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,S=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,U=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,F=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,_=(e==null?void 0:e.controlsColor)??Ql.color,B=(e==null?void 0:e.controlsHoverColor)??Ql.hover,L=(e==null?void 0:e.navColor)??mo.colors.inactive,N=(e==null?void 0:e.navPaginationColor)??mo.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??mo.colors.background,Z=(e==null?void 0:e.linkColor)??ka.linkColor,M=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,K=x==="horizontal",D=p==="click",j=p==="drag",$=p==="auto"&&(!n||!!i),v=!n,w=g==="slide",P=m==="classic",Q=R!=="never",z=R==="on hover",T=W.scalingValue(S,n),O={width:T,height:T,maxWidth:T},E=w&&c>1,[ee,V]=s.useState(0),[ue,Ie]=s.useState(E?1:0),[ge,ae]=s.useState(!1),[ne,oe]=s.useState(!1),[ie,Ae]=s.useState(!1),[be,Me]=s.useState(0),[q,se]=s.useState(!1),[he,G]=s.useState(!1),re=s.useRef(!1),me=s.useRef(ue);me.current=ue;const we=s.useRef(null),Pe=s.useRef(0),Ce=s.useRef(null),Y=s.useRef(null),xe=s.useRef(null),pe=s.useRef(null),X=s.useCallback(Se=>{re.current=Se,ae(Se)},[]),le=s.useCallback(Se=>{if(c<2||Se===0)return;const _e=Se>0?1:-1,Be=Math.abs(Se);if(se(!0),X(!0),!w){V(Ze=>xo(Ze+Se,c));return}let Ye=me.current;const de=E&&(Ye===0||Ye===c+1),ve=de?ee+1:null;de&&(Ye=ee+1);let Ee=Be;for(;Ee>0;){const Ze=_0(Ye,_e,c,E);if(Ye=Ze.position,Ee-=1,Ze.hitBoundary){Pe.current=Ee*_e;break}}const Ge=Be-Ee;if(Ge>0&&V(Ze=>xo(Ze+Ge*_e,c)),me.current=Ye,ve!==null){if(me.current=ve,Ye===ve){oe(!0),Ie(Ye);return}we.current=Ye,oe(!0),Ie(ve);return}oe(!1),Ie(Ye)},[ee,c,E,w,X]),Fe=s.useCallback(Se=>{le(Se)},[le]),fe=s.useCallback(Se=>{if(c<2)return;const _e=xo(Se,c);if(!(_e===ee&&!re.current)&&(se(!0),X(!0),V(_e),w)){const Be=_e+(E?1:0);we.current=null,Pe.current=0,me.current=Be,oe(!1),Ie(Be)}},[ee,c,E,w,X]);s.useEffect(()=>{if(!ge)return;const Se=window.setTimeout(()=>{if(E&&(ue===0||ue===c+1)){we.current=null,oe(!0),Ie(ee+1);return}X(!1)},Bi);return()=>window.clearTimeout(Se)},[ee,c,E,ge,X,ue]),s.useEffect(()=>{if(!ne)return;let Se=0;const _e=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=we.current;we.current=null;const Ye=Pe.current;if(Pe.current=0,oe(!1),Be!==null){me.current=Be,Ie(Be);return}if(Ye!==0){le(Ye);return}X(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(Se)}},[le,X,ne]);const J=`${E}:${c}`,Xe=s.useRef(J);s.useEffect(()=>{if(Xe.current===J)return;Xe.current=J;const Se=c>0?Math.min(ee,c-1):0;xe.current=null,pe.current=null,Ae(!1),Me(0),V(Se),oe(!0),Ie(Se+(E?1:0))},[ee,c,E,J]),s.useEffect(()=>{if(!q)return;const Se=window.setTimeout(()=>se(!1),R0);return()=>window.clearTimeout(Se)},[q,ee]),s.useEffect(()=>{if(!$||c<2)return;const Se=Math.max(b,.1)*1e3,_e=window.setInterval(()=>{v&&he||Fe(1)},Se);return()=>window.clearInterval(_e)},[b,c,Fe,$,he,v]);const Oe=s.useCallback(Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;xe.current=null,pe.current=null;const Be=Ce.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!_e.isActive){w&&Me(0);return}const de=!(Se.timeStamp-_e.lastTime>M0)&&Math.abs(_e.velocity)>E0,ve=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*P0;if(Ae(!1),!de&&!ve){Me(0);return}const Ee=ve?_e.offset-_e.baseOffset:_e.velocity;let Ge=1;ve&&_e.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Ee)/_e.size))),Me(0),le(Ee<0?Ge:-Ge)},[le,w]);s.useEffect(()=>{const Se=_e=>{pe.current===null||_e.pointerId!==pe.current||Oe(_e)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[Oe]);const dt=Se=>{const _e=Ce.current;if(!j||c<2||!_e||Se.pointerType==="mouse"&&Se.button!==0)return;we.current=null,Pe.current=0,re.current&&X(!1);let Be=0;const Ye=Y.current;if(w&&Ye){const de=K?Ye.offsetWidth:Ye.offsetHeight;if(de>0){const ve=W0(Ye,K);let Ee=me.current;E&&(Ee===0||Ee===c+1)?(Ee=ee+1,me.current=Ee,oe(!0),Ie(Ee),Be=0):Be=ve+Ee*de,Me(Be)}}_e.setPointerCapture(Se.pointerId),pe.current=Se.pointerId,xe.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:N0(_e,`${r}-axis-probe`),size:K?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},nt=Se=>{const _e=xe.current;if(!_e||_e.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){Oe(Se);return}const Be=Se.clientX-_e.startClientX,Ye=Se.clientY-_e.startClientY,de=_e.axes?H0(_e.axes,Be,Ye):{x:Be,y:Ye},ve=K?de.x:de.y,Ee=K?de.y:de.x,Ge=_e.baseOffset+ve;if(!_e.isActive){if(Math.max(Math.abs(ve),Math.abs(Ee))<I0)return;if(Math.abs(Ee)>Math.abs(ve)){const Ve=Ce.current;Ve!=null&&Ve.hasPointerCapture(_e.pointerId)&&Ve.releasePointerCapture(_e.pointerId),xe.current=null,pe.current=null,w&&Me(0);return}_e.isActive=!0,Ae(!0)}const Ze=Se.timeStamp-_e.lastTime;Ze>0&&(_e.velocity=(Ge-_e.offset)/Ze,_e.lastTime=Se.timeStamp),_e.offset=Ge,w&&Me(Ge)},ht=Se=>{Oe(Se)},st=K?`translate3d(calc(${-ue*100}% + ${be}px), 0, 0)`:`translate3d(0, calc(${-ue*100}% + ${be}px), 0)`,ze=E?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O0(r,n)}}),a.jsxs("div",{className:ut(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!K}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:Ce,className:ut(`${r}-track`,{[`${r}-track-draggable`]:j,[`${r}-track-draggable-vertical`]:j&&!K}),onPointerDown:dt,onPointerMove:nt,onPointerUp:ht,onPointerCancel:ht,onLostPointerCapture:Se=>{pe.current===Se.pointerId&&Oe(Se)},children:a.jsx("div",{ref:Y,className:ut(`${r}-list`,{[`${r}-list-slide`]:w,[`${r}-list-slide-vertical`]:w&&!K,[`${r}-list-fade`]:!w}),style:w?{transform:st,transition:ie||ne?"none":`transform ${Bi}ms ${Hd}`}:void 0,children:ze.map((Se,_e)=>{const Be=E?xo(_e-1,c):_e,de=E&&(_e===0||_e===c+1)?`clone-${_e===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:ut(`${r}-slide`,{[`${r}-is-active`]:!w&&Be===ee}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:ut(`${r}-slider-image`,{[`${r}-contain`]:Se.image.objectFit==="contain",[`${r}-cover`]:Se.image.objectFit==="cover"}),src:Se.image.url,alt:Se.image.name??"",draggable:!1})})})},de)})})}),Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-prev`]:K,[`${r}-arrow-prev-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),Fe(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${W.scalingValue(U,n)}, ${W.scalingValue(F*(K?1:-1),n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:ut(`${r}-arrow-img`,`${r}-mirror`),style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:ut(`${r}-arrow`,{[`${r}-arrow-next`]:K,[`${r}-arrow-next-vertical`]:!K,[`${r}-hover-arrow`]:z}),style:{color:_,"--arrow-hover-color":B,...O},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),Fe(1)},style:{transform:`translate(${W.scalingValue(U*(K?-1:1),n)}, ${W.scalingValue(F,n)}) rotate(${K?"0deg":"90deg"})`},children:[H&&a.jsx(sn,{url:H,fill:_,hoverFill:B,className:`${r}-arrow-img`,style:O}),!H&&a.jsx(tc,{color:_,className:ut(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),D&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Fe(1)}),P&&a.jsx("div",{className:ut(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:K,[`${r}-pagination-inside-left`]:!K}),style:K?{bottom:y(f.inset)}:{left:y(f.inset)},children:a.jsx("div",{className:ut(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!K,[`${r}-animate-dots`]:q}),style:{backgroundColor:k,gap:y(f.gapInactive-f.activeDot+f.dot),...K?{height:y(f.activeDot+f.paddingY*2),paddingTop:y(f.paddingY),paddingBottom:y(f.paddingY),paddingLeft:y(f.paddingActive),paddingRight:y(f.paddingActive)}:{width:y(f.activeDot+f.paddingY*2),paddingLeft:y(f.paddingY),paddingRight:y(f.paddingY),paddingTop:y(f.paddingActive),paddingBottom:y(f.paddingActive)},borderRadius:y(f.borderRadius),transform:`translate(${W.scalingValue(mo.offset.x,n)}, ${W.scalingValue(mo.offset.y,n)})`},children:d.map((Se,_e)=>{const Be=_e===ee,Ye=Be?f.activeDot:f.dot;return a.jsx("button",{onClick:()=>fe(_e),className:`${r}-pagination-item`,style:{width:y(f.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?N:L,width:y(Ye)}})},_e)})},`${h}-${x}`)})]}),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:W.scalingValue(M,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,_e)=>a.jsx("div",{className:ut(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===ee&&n,[`${r}-active`]:_e===ee}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Bi/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":Z,"--link-hover-color":Z,position:"relative",top:W.scalingValue(ka.offset.y,n),left:W.scalingValue(ka.offset.x,n)},children:a.jsx($i,{content:Se.imageCaption})})},_e))})]})]})]})}function tc({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 B0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19566
19566
|
import cn from 'classnames';
|
|
19567
19567
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19568
19568
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20743,7 +20743,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20743
20743
|
</svg>
|
|
20744
20744
|
);
|
|
20745
20745
|
}
|
|
20746
|
-
`,j0={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},z0={element:D0,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:j0,sourceCode:B0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},
|
|
20746
|
+
`,j0={type:"object",version:1,settings:{sizing:"manual",properties:{trigger:{type:"object",scope:"common",title:"Trigger",display:{type:"toggle-cycle-numeric-input",enum:["click","drag","auto"],inputs:{click:"none",drag:"none",auto:"single"},defaultValue:3,showDash:!1},min:1,max:5,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},direction:{type:"string",scope:"common",title:"Direction",display:{type:"toggle-cycle",enum:["horizontal","vertical"]}},transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["slide","fade in","reveal"]}},nav:{type:"string",scope:"common",title:"Nav",display:{type:"toggle-cycle",enum:["classic","no"]}},navSize:{type:"string",scope:"layout",title:"Nav Size",display:{type:"toggle-cycle",enum:["s","m","l"]}},navUnit:{type:"number",scope:"layout",title:"",display:{type:"numeric-input",visible:!1},min:0,max:1},controls:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},controlsMaxWidth:{type:"number",scope:"layout",title:"Max Width",display:{type:"numeric-input"},min:0,max:9999},show:{type:"string",scope:"common",title:"Show",display:{type:"toggle-cycle",enum:["always","on hover","never"]}},paddingX:{type:"number",scope:"layout",title:"Padding X",display:{type:"numeric-input"},min:-9999,max:9999},paddingY:{type:"number",scope:"layout",title:"Padding Y",display:{type:"numeric-input"},min:-9999,max:9999},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"palette-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"palette-color-picker"}},navColor:{type:"string",scope:"common",title:"Dot Nav",display:{type:"palette-color-picker"}},navPaginationColor:{type:"string",scope:"common",title:"Active Nav",display:{type:"palette-color-picker"}},navBackgroundColor:{type:"string",scope:"common",title:"BG Nav",display:{type:"palette-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"palette-color-picker"}},titleColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{type:"object",scope:"common",title:"",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},titleFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},titleTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:100,display:{type:"range-control"}}},defaults:{trigger:{sizeType:"drag",value:3,min:1,max:5},direction:"horizontal",transition:"slide",nav:"classic",controls:null,show:"always",controlsColor:"#000000",controlsHoverColor:"#3F3F3F",navColor:"#A4A4A4",navPaginationColor:"#FFFFFF",navBackgroundColor:"#000000",linkColor:"#2E12F0",titleColor:"#000000",titleFontFamily:"Arial",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{controlsMaxWidth:30/1440,paddingX:0,paddingY:0,captionMarginTop:10/1440,titleFontSize:16/1440,titleLineHeight:16/1440,navSize:"m",navUnit:1/1440},t:{controlsMaxWidth:30/768,paddingX:-10/768,paddingY:0,captionMarginTop:10/768,titleFontSize:16/768,titleLineHeight:16/768,navSize:"m",navUnit:1/768},m:{controlsMaxWidth:30/375,paddingX:-14/375,paddingY:0,captionMarginTop:10/375,titleFontSize:16/375,titleLineHeight:16/375,navSize:"m",navUnit:1/375}},displayRules:[{if:{name:"show",value:"never"},then:{name:"properties.controlsColor.display.visible",value:!1}},{if:{name:"show",value:"never"},then:{name:"properties.controlsHoverColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navPaginationColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navBackgroundColor.display.visible",value:!1}},{if:{name:"nav",value:"no"},then:{name:"properties.navSize.display.visible",value:!1}}],layout:["__componentName__","trigger","direction","transition","nav","navSize","controls","controlsMaxWidth","show","paddingX","paddingY","captionMarginTop","titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["trigger","direction"]},{type:"row",title:"",items:["transition","nav"]},{type:"row",title:"",items:["navSize"]},{type:"group",title:"Controls",items:[{type:"row",title:"",items:["controls","controlsMaxWidth"]},{type:"row",title:"",items:["paddingX","paddingY"]},{type:"row",title:"",items:["show"]}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleTextAppearance"]}]}],paletteBookmark:{items:["controlsColor","controlsHoverColor","navPaginationColor","navColor","navBackgroundColor","titleColor","linkColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},objectFit:{type:"string",enum:["cover","contain"]}},required:["url","name"]},imageCaption:{placeholder:"Add Caption...",label:"Description",display:{type:"rich-text"}}},required:["image"]},default:[{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Earth-orbital mission"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Salton Sea from Above"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module Pilot"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Lunar Module 3 porch"}]}]},{image:{objectFit:"cover",url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg"},imageCaption:[{type:"paragraph",children:[{text:"Command Module"}]}]}]}},z0={element:D0,id:"slider-2-0",name:"Slider 2.0",category:"galleries",version:1,defaultSize:{d:{width:400,height:400},t:{width:400,height:400},m:{width:300,height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Slider.mp4"},schema:j0,sourceCode:B0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Wi=300/1440,V0=8/1440,hi=.004;function G0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ic(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:W.scalingValue((o-t)/2,i)}}function q0(e){return`
|
|
20747
20747
|
.${e}-wrapper {
|
|
20748
20748
|
box-sizing: border-box;
|
|
20749
20749
|
display: flex;
|
|
@@ -20960,7 +20960,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20960
20960
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20961
20961
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20962
20962
|
}
|
|
20963
|
-
`}const X0="rgba(28,31,34,0.9)",Mn=500,mi="cubic-bezier(0.22, 1, 0.36, 1)",U0=72,Y0=50,K0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Z0=[];function J0(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 Q0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function tb(e){if(!Array.isArray(e)||e.length===0)return[];if(J0(e)){const t=[];for(const n of e){const i=Q0(n);if(!i)continue;const o=eb(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 ts(e){return e.type==="video"}function nb(e){e.pause(),e.removeAttribute("src"),e.load()}function hr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ib(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const ob=1140/1440;function rb(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 ab(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 sb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function lb({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()=>{nb(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 cb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(!1),S=s.useRef(null),[U,F]=s.useState(null),[_,B]=s.useState("opening"),[L,N]=s.useState(0),[k,Z]=s.useState(0),[E,K]=s.useState(!1),[D,j]=s.useState(!1),[$,v]=s.useState(!1),w=s.useRef(n),P=t[n],Q=P?ts(P):!1,z=k!==0||E,T=s.useCallback(q=>{H.current=q,K(q)},[]),O=s.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),M=s.useCallback(()=>{O(),S.current=window.setTimeout(()=>{O(),T(!1)},Mn+32)},[O,T]),ee=s.useCallback(()=>{const q=x.current,se=g.current;if(!q)return;const he=q.getBoundingClientRect(),G=he.width,re=he.height;if(!G||!re)return;if(i==="cover"){F({width:G,height:re,left:he.left,top:he.top});return}if(!se){F(hr(q));return}const{width:pe,height:we}=ib(se);if(!pe||!we){F(hr(q));return}const Pe=pe/we,Ce=G/re;if(Pe>Ce){const Y=G/Pe;F({width:G,height:Y,left:he.left,top:he.top+(re-Y)/2})}else{const Y=re*Pe;F({width:Y,height:re,left:he.left+(G-Y)/2,top:he.top})}},[i]);s.useEffect(()=>{ee();const q=x.current;if(!q)return;const se=new ResizeObserver(()=>ee());return se.observe(q),()=>se.disconnect()},[ee,n]),s.useEffect(()=>{_==="opening"&&U&&B("open")},[_,U]),s.useEffect(()=>{if(_!=="closing")return;const q=setTimeout(()=>r(),Mn);return()=>clearTimeout(q)},[_,r]),s.useEffect(()=>()=>{O()},[O]),s.useLayoutEffect(()=>{if(w.current===n)return;O(),N(0),Z(0),T(!1),v(!1),j(!1),h.current=0,f.current=0,C.current="none",y.current=!1,m.current=null,R.current=!1;const q=x.current;q&&F(hr(q)),w.current=n},[n,T,O]),s.useEffect(()=>{if(_!=="open")return;let q=null;const se=()=>{q&&(document.removeEventListener("click",q,!0),q=null)},he=()=>{se(),q=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),se()},document.addEventListener("click",q,!0)},G=Ce=>{O(),H.current=!1,K(!1),Z(0),j(!1),y.current=!1,f.current=0,C.current="none";const Y=x.current;Y&&F(hr(Y)),Ce<0?d():l()},re=Ce=>{if(Math.abs(Ce)>Y0&&t.length>1){G(Ce);return}T(!0),Z(0),M()},pe=Ce=>{if(Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0];R.current=!0,m.current={x:Y.clientX,y:Y.clientY},C.current="none",f.current=0,y.current=!1},we=Ce=>{if(!m.current||Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0],xe=Y.clientX-m.current.x,ue=Y.clientY-m.current.y;if(C.current==="none"){if(Math.abs(xe)<10&&Math.abs(ue)<10)return;if(Math.abs(xe)>Math.abs(ue)){if(t.length<=1)return;C.current="horizontal"}else if(ue>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,j(!0),f.current=xe,Z(xe),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,j(!0),h.current=ue,N(ue),Ce.preventDefault())},Pe=()=>{if(!m.current)return;const Ce=C.current,Y=y.current;if(Y&&Ce==="horizontal")re(f.current),he();else if(Y&&Ce==="vertical")if(h.current>U0){const ue=window.innerHeight;h.current=ue,v(!0),N(ue),B("closing")}else h.current=0,N(0),he();else Ce==="horizontal"&&Math.abs(f.current)>0&&(re(f.current),he());m.current=null,C.current="none",f.current=0,y.current=!1,j(!1)};return document.addEventListener("touchstart",pe,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",pe),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),se()}},[_,t.length,d,l,T,M,O]),s.useEffect(()=>{const q=se=>{se.key==="Escape"&&(se.preventDefault(),se.stopPropagation(),_!=="closing"&&B("closing"))};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[_]);const V=()=>{_!=="closing"&&B("closing")},me=_==="open",Ie=_==="closing",ge=L>0?Math.max(0,1-L/500):1,ae=L>0?Math.max(.35,1-L/500):1,ne=q=>{if(q.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientY-se.top,G=Math.min(52,se.height*.2);if(!(he>se.height-G)){if(q.clientX-se.left<se.width/2){l();return}d()}},oe=q=>{if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientX-se.left,G=q.clientY-se.top,re=Math.min(52,se.height*.2);if(G>se.height-re){q.currentTarget.style.cursor="default";return}q.currentTarget.style.cursor=he<se.width/2?"w-resize":"e-resize"},ie=s.useCallback(q=>{q.propertyName!=="transform"||!H.current||(O(),T(!1))},[O,T]),Ae=z?`translateX(${k}px)`:L>0?`translateY(${L}px)`:void 0,be={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Ae,opacity:L>0?ae:_==="opening"||Ie?0:1,transition:D&&!E?"none":E?`transform ${Mn}ms ${mi}`:$?`transform ${Mn}ms ${mi}, opacity ${Mn}ms ${mi}`:_==="opening"||Ie?`opacity ${Mn}ms ${mi}`:"none",pointerEvents:Q&&me&&!z?"auto":"none",touchAction:Q&&me?"none":void 0,zIndex:9998},Me=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:V,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:me?ge:0,transition:D?"none":`opacity ${Mn}ms ${mi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,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:me?1:0,transition:`opacity ${Mn}ms ${mi}`,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:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:me?1:0,transition:`opacity ${Mn}ms ${mi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&P&&(Q?a.jsx(lb,{src:P.url,phase:_,mediaRef:g,mediaStyle:be,onLoadedMetadata:ee,onClick:ne,onMouseMove:oe,onTransitionEnd:ie},`${n}-${P.url}`):a.jsx("img",{ref:g,src:P.url,alt:P.name,onLoad:ee,onTransitionEnd:ie,style:be},`${n}-${P.url}`)),me&&Me&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:U.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),d()}})]})]})}function oc({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 b=`${e}-gallery-${ts(t)?"video":"image"}`,x=r.display==="cover",g=ab(r),m=_=>W.scalingValue(_,l??!1),h=n??_i,f=o?{width:"100%",maxWidth:"100%"}:{width:m(h),maxWidth:"100%"},C=i?{borderRadius:m(i)}:{},y={...f,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...C},R={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":m(h)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:C},S={className:b,style:R,onClick:p?_=>{_.stopPropagation(),p()}:void 0},U=Math.max(d,gi),F=ts(t)?a.jsx("video",{...S,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...S,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:y,children:F}):F,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:m(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:m(U)}})]})}function db({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,x=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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 ub(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function rc({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 ac({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 Aa({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),[b,x]=s.useState(0),g=t??"",m=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!m)return;const h=p.current;if(!h||typeof ResizeObserver>"u")return;const f=()=>x(h.offsetHeight);f();const C=new ResizeObserver(f);return C.observe(h),()=>C.disconnect()},[g,m]),a.jsx("div",{ref:h=>{p.current=h,i(h)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...m?{[`--${e}-title-height`]:`${b}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:g})})]})})}const sc=45;function lc(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 pb(e){const t=lc(e,"--cntrl-viewport-height",window.innerHeight),n=lc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function mb(e,t,n){const{top:i,centerY:o}=pb(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 gb(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=mb(u,n,c);return Math.exp(-(p*p)/(2*sc*sc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function hb(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(gb(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 fb(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 yb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),d=s.useMemo(()=>q0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??_i,x=(e==null?void 0:e.titleWidth)??ob,g=rb(e==null?void 0:e.imageDisplay),m=(e==null?void 0:e.cornerRadius)??V0,h=(e==null?void 0:e.position)??"center",f=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,R=ub(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",S=p==="b",U=R==="fade"||R==="retype",{setTitleRef:F,dominantIndex:_}=hb(c.length,U,h),B=((tt=c[_])==null?void 0:tt.title)??"",L=fb(B,R==="retype"),N=R==="fade"||R==="retype",k=R==="retype"?L:B,Z=S?void 0:{width:W.scalingValue(b,n??!1)},E=H==="on"&&(!n||i||o),K=o??!1,D=(e==null?void 0:e.galleryPaddingRight)??0,j=(e==null?void 0:e.galleryPaddingLeft)??0,$=(e==null?void 0:e.galleryPaddingBetween)??0,v=rt=>W.scalingValue(rt,n??!1),P={width:v(x)},Q=p==="a"?D:j,z=S?{width:"100%"}:{width:`calc(100% - ${v(b)} - ${v(Q)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(D,gi),O=Math.max(j,gi),M=Math.max($,gi),ee=Math.max(f,gi),V=Math.max(C,gi),me=Math.max(y,gi),Ie=Math.max(0,(u??1)-(b??_i)),ge=p==="a"?Math.max(0,(u??1)-(b??_i)-D):p==="c"?Math.max(0,(u??1)-(b??_i)-j):p==="b"?u??1:1,ae=K&&(p==="a"||p==="b"||p==="c")&&h==="top",ne=K&&((p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")),oe=K&&((p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"),ie=c.length>1,Ae=S?void 0:v((p==="c"?j:D)+(b??_i)),be=p==="c"&&Ae?{left:Ae}:void 0,Me=p==="a"&&Ae?{right:Ae}:void 0,q=S?{left:0,width:"100%"}:p==="a"?{right:v(D),width:v(b)}:{left:v(j),width:v(b)},{titleColor:se,titleFontFamily:he,titleFontSettings:G,titleFontSize:re,titleLineHeight:pe,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:Y,lightboxCounterColor:xe,lightboxCounterFontFamily:ue,lightboxCounterFontSettings:X,lightboxCounterFontSize:le,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Xe}=e??{},Oe={fontSettings:{fontFamily:he,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:re??.01,lineHeight:pe,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:Y,color:se??"#000000"},nt=an(Ut(Oe,n)),ht=P,st=ic(re,pe,l,n),ze=nc(re,pe,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:ue,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Fe,letterSpacing:fe??0,wordSpacing:J??0,textAppearance:Xe,color:xe??"#DEDDDD"},Be={...an(Ut(Se,n)),...ic(le,Fe,l,n)},Ye=nc(le,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),de=W.buildColorVars(l,{titleColor:se??"#000000",lightboxCounterColor:xe??"#DEDDDD"},K0,Z0),ve=s.useRef(null),[Ee,Ge]=s.useState(!1),[Ze,Ve]=s.useState([]),[at,Je]=s.useState(0),ke=s.useCallback((rt,lt)=>{E&&(Ve(rt),Je(lt),Ge(!0))},[E]),qe=s.useCallback(()=>{Ge(!1)},[]),We=s.useMemo(()=>{const rt={...de},lt=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return lt&&(rt["--cntrl-article-width"]=lt),rt},[de,Ee]);return s.useEffect(()=>{if(!Ee||H!=="on"||typeof document>"u")return;const rt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=rt}},[Ee,H]),s.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Ge(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:de,children:a.jsxs("div",{ref:ve,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&h==="top"?v(f):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")?v(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"?v(y):void 0},children:[N&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Aa,{P:l,title:k,position:h,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...st,...z},titleTextBoxStyle:ht,titleStyle:nt,showTextBoxOutline:K,topPaddingControl:ae?rc({P:l,scaled:v,height:ee,paired:!1}):void 0})}),c.map((rt,lt)=>{const Tt=tb(rt.gallery),Xt=lt<c.length-1,Zt=Tt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),xt={P:l,position:h,titleRef:F(lt),titleClassName:ze,titleContainerStyle:st,titleTextBoxStyle:N?{maxWidth:"100%"}:ht,titleStyle:nt,showTextBoxOutline:K&&!N,topPaddingControl:ae&&!N?rc({P:l,scaled:v,height:ee,paired:ie}):void 0};return a.jsxs("div",{"data-item-index":lt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?v($):void 0},children:[ne&&ac({P:l,controlKey:"titleLeftPadding",scaled:v,width:V,maxFraction:ge,side:"left",paired:ie,anchorStyle:be}),oe&&ac({P:l,controlKey:"titleRightPadding",scaled:v,width:me,maxFraction:ge,side:"right",paired:ie,anchorStyle:Me}),K&&Xt&&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:v(M),...q}}),S?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,imgWidth:b||void 0,cornerRadius:m||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:E&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Aa,{...xt,title:N?"":rt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Aa,{...xt,title:N?"":rt.title}),Tt.length>0&&a.jsx(db,{P:l,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:D,galleryPaddingLeft:j,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:O,galleryPaddingMaxFraction:Ie,showControls:K,scaled:v,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,cornerRadius:m||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:E&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})})]})]},lt)})]})}),Ee&&H==="on"&&typeof document<"u"&&e&&(()=>{const rt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(cb,{prefix:l,items:Ze,index:at,imageDisplay:sb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(lt=>(lt-1+Ze.length)%Ze.length),onNext:()=>Je(lt=>(lt+1)%Ze.length),counterClassName:Ye,counterStyle:Be,backgroundColor:e.backgroundColor??X0})}),rt)})()]})}const vb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20963
|
+
`}const X0="rgba(28,31,34,0.9)",Mn=500,gi="cubic-bezier(0.22, 1, 0.36, 1)",U0=72,Y0=50,K0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Z0=[];function J0(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 Q0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function tb(e){if(!Array.isArray(e)||e.length===0)return[];if(J0(e)){const t=[];for(const n of e){const i=Q0(n);if(!i)continue;const o=eb(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 ts(e){return e.type==="video"}function nb(e){e.pause(),e.removeAttribute("src"),e.load()}function hr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function ib(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const ob=1140/1440;function rb(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 ab(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 sb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function lb({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()=>{nb(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 cb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",x=s.useRef(null),g=s.useRef(null),m=s.useRef(null),h=s.useRef(0),f=s.useRef(0),C=s.useRef("none"),y=s.useRef(!1),R=s.useRef(!1),H=s.useRef(!1),S=s.useRef(null),[U,F]=s.useState(null),[_,B]=s.useState("opening"),[L,N]=s.useState(0),[k,Z]=s.useState(0),[M,K]=s.useState(!1),[D,j]=s.useState(!1),[$,v]=s.useState(!1),w=s.useRef(n),P=t[n],Q=P?ts(P):!1,z=k!==0||M,T=s.useCallback(q=>{H.current=q,K(q)},[]),O=s.useCallback(()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},[]),E=s.useCallback(()=>{O(),S.current=window.setTimeout(()=>{O(),T(!1)},Mn+32)},[O,T]),ee=s.useCallback(()=>{const q=x.current,se=g.current;if(!q)return;const he=q.getBoundingClientRect(),G=he.width,re=he.height;if(!G||!re)return;if(i==="cover"){F({width:G,height:re,left:he.left,top:he.top});return}if(!se){F(hr(q));return}const{width:me,height:we}=ib(se);if(!me||!we){F(hr(q));return}const Pe=me/we,Ce=G/re;if(Pe>Ce){const Y=G/Pe;F({width:G,height:Y,left:he.left,top:he.top+(re-Y)/2})}else{const Y=re*Pe;F({width:Y,height:re,left:he.left+(G-Y)/2,top:he.top})}},[i]);s.useEffect(()=>{ee();const q=x.current;if(!q)return;const se=new ResizeObserver(()=>ee());return se.observe(q),()=>se.disconnect()},[ee,n]),s.useEffect(()=>{_==="opening"&&U&&B("open")},[_,U]),s.useEffect(()=>{if(_!=="closing")return;const q=setTimeout(()=>r(),Mn);return()=>clearTimeout(q)},[_,r]),s.useEffect(()=>()=>{O()},[O]),s.useLayoutEffect(()=>{if(w.current===n)return;O(),N(0),Z(0),T(!1),v(!1),j(!1),h.current=0,f.current=0,C.current="none",y.current=!1,m.current=null,R.current=!1;const q=x.current;q&&F(hr(q)),w.current=n},[n,T,O]),s.useEffect(()=>{if(_!=="open")return;let q=null;const se=()=>{q&&(document.removeEventListener("click",q,!0),q=null)},he=()=>{se(),q=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),se()},document.addEventListener("click",q,!0)},G=Ce=>{O(),H.current=!1,K(!1),Z(0),j(!1),y.current=!1,f.current=0,C.current="none";const Y=x.current;Y&&F(hr(Y)),Ce<0?d():l()},re=Ce=>{if(Math.abs(Ce)>Y0&&t.length>1){G(Ce);return}T(!0),Z(0),E()},me=Ce=>{if(Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0];R.current=!0,m.current={x:Y.clientX,y:Y.clientY},C.current="none",f.current=0,y.current=!1},we=Ce=>{if(!m.current||Ce.touches.length!==1||H.current)return;const Y=Ce.touches[0],xe=Y.clientX-m.current.x,pe=Y.clientY-m.current.y;if(C.current==="none"){if(Math.abs(xe)<10&&Math.abs(pe)<10)return;if(Math.abs(xe)>Math.abs(pe)){if(t.length<=1)return;C.current="horizontal"}else if(pe>0)C.current="vertical";else return}if(C.current==="horizontal"){y.current=!0,j(!0),f.current=xe,Z(xe),Ce.preventDefault();return}C.current==="vertical"&&(y.current=!0,j(!0),h.current=pe,N(pe),Ce.preventDefault())},Pe=()=>{if(!m.current)return;const Ce=C.current,Y=y.current;if(Y&&Ce==="horizontal")re(f.current),he();else if(Y&&Ce==="vertical")if(h.current>U0){const pe=window.innerHeight;h.current=pe,v(!0),N(pe),B("closing")}else h.current=0,N(0),he();else Ce==="horizontal"&&Math.abs(f.current)>0&&(re(f.current),he());m.current=null,C.current="none",f.current=0,y.current=!1,j(!1)};return document.addEventListener("touchstart",me,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",me),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),se()}},[_,t.length,d,l,T,E,O]),s.useEffect(()=>{const q=se=>{se.key==="Escape"&&(se.preventDefault(),se.stopPropagation(),_!=="closing"&&B("closing"))};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[_]);const V=()=>{_!=="closing"&&B("closing")},ue=_==="open",Ie=_==="closing",ge=L>0?Math.max(0,1-L/500):1,ae=L>0?Math.max(.35,1-L/500):1,ne=q=>{if(q.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientY-se.top,G=Math.min(52,se.height*.2);if(!(he>se.height-G)){if(q.clientX-se.left<se.width/2){l();return}d()}},oe=q=>{if(t.length<=1)return;const se=q.currentTarget.getBoundingClientRect(),he=q.clientX-se.left,G=q.clientY-se.top,re=Math.min(52,se.height*.2);if(G>se.height-re){q.currentTarget.style.cursor="default";return}q.currentTarget.style.cursor=he<se.width/2?"w-resize":"e-resize"},ie=s.useCallback(q=>{q.propertyName!=="transform"||!H.current||(O(),T(!1))},[O,T]),Ae=z?`translateX(${k}px)`:L>0?`translateY(${L}px)`:void 0,be={position:"fixed",top:U==null?void 0:U.top,left:U==null?void 0:U.left,width:U==null?void 0:U.width,height:U==null?void 0:U.height,objectFit:i==="cover"?"cover":"contain",transform:Ae,opacity:L>0?ae:_==="opening"||Ie?0:1,transition:D&&!M?"none":M?`transform ${Mn}ms ${gi}`:$?`transform ${Mn}ms ${gi}, opacity ${Mn}ms ${gi}`:_==="opening"||Ie?`opacity ${Mn}ms ${gi}`:"none",pointerEvents:Q&&ue&&!z?"auto":"none",touchAction:Q&&ue?"none":void 0,zIndex:9998},Me=U?{position:"fixed",top:U.top,height:U.height,width:U.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:V,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ue?ge:0,transition:D?"none":`opacity ${Mn}ms ${gi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,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:ue?1:0,transition:`opacity ${Mn}ms ${gi}`,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:x,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ue?1:0,transition:`opacity ${Mn}ms ${gi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),U&&P&&(Q?a.jsx(lb,{src:P.url,phase:_,mediaRef:g,mediaStyle:be,onLoadedMetadata:ee,onClick:ne,onMouseMove:oe,onTransitionEnd:ie},`${n}-${P.url}`):a.jsx("img",{ref:g,src:P.url,alt:P.name,onLoad:ee,onTransitionEnd:ie,style:be},`${n}-${P.url}`)),ue&&Me&&t.length>1&&!Q&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Me,left:U.left,cursor:"w-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),l()}}),a.jsx("div",{style:{...Me,left:U.left+U.width/2,cursor:"e-resize",pointerEvents:z?"none":"auto"},onClick:q=>{if(R.current){R.current=!1;return}q.stopPropagation(),d()}})]})]})}function oc({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 b=`${e}-gallery-${ts(t)?"video":"image"}`,x=r.display==="cover",g=ab(r),m=_=>W.scalingValue(_,l??!1),h=n??Wi,f=o?{width:"100%",maxWidth:"100%"}:{width:m(h),maxWidth:"100%"},C=i?{borderRadius:m(i)}:{},y={...f,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...C},R={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":m(h)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:C},S={className:b,style:R,onClick:p?_=>{_.stopPropagation(),p()}:void 0},U=Math.max(d,hi),F=ts(t)?a.jsx("video",{...S,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...S,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[x?a.jsx("div",{style:y,children:F}):F,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:m(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:m(U)}})]})}function db({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,x=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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"&&x&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"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 ub(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function rc({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 ac({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 Aa({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),[b,x]=s.useState(0),g=t??"",m=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!m)return;const h=p.current;if(!h||typeof ResizeObserver>"u")return;const f=()=>x(h.offsetHeight);f();const C=new ResizeObserver(f);return C.observe(h),()=>C.disconnect()},[g,m]),a.jsx("div",{ref:h=>{p.current=h,i(h)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...m?{[`--${e}-title-height`]:`${b}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:g})})]})})}const sc=45;function lc(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 pb(e){const t=lc(e,"--cntrl-viewport-height",window.innerHeight),n=lc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function mb(e,t,n){const{top:i,centerY:o}=pb(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 gb(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=mb(u,n,c);return Math.exp(-(p*p)/(2*sc*sc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function hb(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(gb(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 fb(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 yb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=W.useScopedStyles(),d=s.useMemo(()=>q0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Wi,x=(e==null?void 0:e.titleWidth)??ob,g=rb(e==null?void 0:e.imageDisplay),m=(e==null?void 0:e.cornerRadius)??V0,h=(e==null?void 0:e.position)??"center",f=(e==null?void 0:e.titleTopPadding)??0,C=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,R=ub(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",S=p==="b",U=R==="fade"||R==="retype",{setTitleRef:F,dominantIndex:_}=hb(c.length,U,h),B=((tt=c[_])==null?void 0:tt.title)??"",L=fb(B,R==="retype"),N=R==="fade"||R==="retype",k=R==="retype"?L:B,Z=S?void 0:{width:W.scalingValue(b,n??!1)},M=H==="on"&&(!n||i||o),K=o??!1,D=(e==null?void 0:e.galleryPaddingRight)??0,j=(e==null?void 0:e.galleryPaddingLeft)??0,$=(e==null?void 0:e.galleryPaddingBetween)??0,v=rt=>W.scalingValue(rt,n??!1),P={width:v(x)},Q=p==="a"?D:j,z=S?{width:"100%"}:{width:`calc(100% - ${v(b)} - ${v(Q)})`,...p==="c"?{marginLeft:"auto"}:{}},T=Math.max(D,hi),O=Math.max(j,hi),E=Math.max($,hi),ee=Math.max(f,hi),V=Math.max(C,hi),ue=Math.max(y,hi),Ie=Math.max(0,(u??1)-(b??Wi)),ge=p==="a"?Math.max(0,(u??1)-(b??Wi)-D):p==="c"?Math.max(0,(u??1)-(b??Wi)-j):p==="b"?u??1:1,ae=K&&(p==="a"||p==="b"||p==="c")&&h==="top",ne=K&&((p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")),oe=K&&((p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"),ie=c.length>1,Ae=S?void 0:v((p==="c"?j:D)+(b??Wi)),be=p==="c"&&Ae?{left:Ae}:void 0,Me=p==="a"&&Ae?{right:Ae}:void 0,q=S?{left:0,width:"100%"}:p==="a"?{right:v(D),width:v(b)}:{left:v(j),width:v(b)},{titleColor:se,titleFontFamily:he,titleFontSettings:G,titleFontSize:re,titleLineHeight:me,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:Y,lightboxCounterColor:xe,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:X,lightboxCounterFontSize:le,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:fe,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Xe}=e??{},Oe={fontSettings:{fontFamily:he,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:re??.01,lineHeight:me,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:Y,color:se??"#000000"},nt=an(Ut(Oe,n)),ht=P,st=ic(re,me,l,n),ze=nc(re,me,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:pe,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:le??.01,lineHeight:Fe,letterSpacing:fe??0,wordSpacing:J??0,textAppearance:Xe,color:xe??"#DEDDDD"},Be={...an(Ut(Se,n)),...ic(le,Fe,l,n)},Ye=nc(le,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),de=W.buildColorVars(l,{titleColor:se??"#000000",lightboxCounterColor:xe??"#DEDDDD"},K0,Z0),ve=s.useRef(null),[Ee,Ge]=s.useState(!1),[Ze,Ve]=s.useState([]),[at,Je]=s.useState(0),ke=s.useCallback((rt,lt)=>{M&&(Ve(rt),Je(lt),Ge(!0))},[M]),qe=s.useCallback(()=>{Ge(!1)},[]),We=s.useMemo(()=>{const rt={...de},lt=ve.current?getComputedStyle(ve.current).getPropertyValue("--cntrl-article-width").trim():"";return lt&&(rt["--cntrl-article-width"]=lt),rt},[de,Ee]);return s.useEffect(()=>{if(!Ee||H!=="on"||typeof document>"u")return;const rt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=rt}},[Ee,H]),s.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Ge(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:de,children:a.jsxs("div",{ref:ve,className:`${l}-wrapper`,style:{width:W.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&h==="top"?v(f):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(h==="left"||h==="top")||p==="c"&&(h==="left"||h==="top")?v(C):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&h==="right"||p==="a"&&h==="right"?v(y):void 0},children:[N&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Aa,{P:l,title:k,position:h,titleRef:()=>{},titleClassName:`${ze} ${l}-single-title`,titleContainerStyle:{...st,...z},titleTextBoxStyle:ht,titleStyle:nt,showTextBoxOutline:K,topPaddingControl:ae?rc({P:l,scaled:v,height:ee,paired:!1}):void 0})}),c.map((rt,lt)=>{const Tt=tb(rt.gallery),Xt=lt<c.length-1,Zt=Tt.filter(wt=>wt.lightboxMedia).map(wt=>wt.lightboxMedia),xt={P:l,position:h,titleRef:F(lt),titleClassName:ze,titleContainerStyle:st,titleTextBoxStyle:N?{maxWidth:"100%"}:ht,titleStyle:nt,showTextBoxOutline:K&&!N,topPaddingControl:ae&&!N?rc({P:l,scaled:v,height:ee,paired:ie}):void 0};return a.jsxs("div",{"data-item-index":lt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Xt?v($):void 0},children:[ne&&ac({P:l,controlKey:"titleLeftPadding",scaled:v,width:V,maxFraction:ge,side:"left",paired:ie,anchorStyle:be}),oe&&ac({P:l,controlKey:"titleRightPadding",scaled:v,width:ue,maxFraction:ge,side:"right",paired:ie,anchorStyle:Me}),K&&Xt&&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:v(E),...q}}),S?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,imgWidth:b||void 0,cornerRadius:m||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:M&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Aa,{...xt,title:N?"":rt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Aa,{...xt,title:N?"":rt.title}),Tt.length>0&&a.jsx(db,{P:l,layoutType:p,galleryWidthStyle:Z,galleryPaddingRight:D,galleryPaddingLeft:j,galleryPaddingRightWidth:T,galleryPaddingLeftWidth:O,galleryPaddingMaxFraction:Ie,showControls:K,scaled:v,children:Tt.map(({displayMedia:wt,lightboxMedia:Bt},At)=>{const vt=Bt?Zt.findIndex(Ft=>Ft.url===Bt.url):-1;return a.jsx(oc,{P:l,media:wt,cornerRadius:m||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:$,showPaddingAfter:At<Tt.length-1,showControls:K,onMediaClick:M&&vt>=0?()=>ke(Zt,vt):void 0},`${wt.url}-${At}`)})})]})]},lt)})]})}),Ee&&H==="on"&&typeof document<"u"&&e&&(()=>{const rt=(r?document.getElementById(r):null)??document.body;return Dn.createPortal(a.jsx("div",{style:We,"data-selection":"none",children:a.jsx(cb,{prefix:l,items:Ze,index:at,imageDisplay:sb(e.lightboxImageDisplay),isEditor:n,onClose:qe,onPrev:()=>Je(lt=>(lt-1+Ze.length)%Ze.length),onNext:()=>Je(lt=>(lt+1)%Ze.length),counterClassName:Ye,counterStyle:Be,backgroundColor:e.backgroundColor??X0})}),rt)})()]})}const vb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20964
20964
|
import { createPortal } from 'react-dom';
|
|
20965
20965
|
import type React from 'react';
|
|
20966
20966
|
import { CommonComponentProps } from '../props';
|
|
@@ -23010,7 +23010,7 @@ export function Mercury({
|
|
|
23010
23010
|
</>
|
|
23011
23011
|
);
|
|
23012
23012
|
}
|
|
23013
|
-
`;function Mi(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Fa={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},xb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{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"}}},galleryPaddingRight:Mi("Gallery Padding Right"),galleryPaddingLeft:Mi("Gallery Padding Left"),galleryPaddingBetween:Mi("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:Mi("Title Top Padding"),titleLeftPadding:Mi("Title Left Padding"),titleRightPadding:Mi("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Fa.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"}},titleAlign:{...Fa.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Fa.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},bb={element:yb,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:xb,sourceCode:vb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},cc=48,wb=10,Sb=400,$b=1,Cb=1120/1440,Tb=140/1440,Lb=550/1440,Rb=13,Ib=4,Pb=38/100,Eb=28/100,Od=2.8,Mb=.9,Dd=.22,kb=.5,Ab=1,Fb=1.5,_b=0,Wb=.85;function Nb(e,t){return`
|
|
23013
|
+
`;function ki(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Fa={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},xb={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"}},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"]}}}}}}}},required:["gallery"]},default:[{title:"AX-2 Space Suit",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-3.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-4.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-5.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Earth-orbital mission",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-3.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"}]},{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-6.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]},{title:"Salton Sea from Above",gallery:[{media:[{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-7.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-8.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-9.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-10.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-11.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]},{media:[{url:"https://cdn.cntrl.site/component-assets/Mercury-default-12.jpg",name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]}]},settings:{sizing:"auto auto",properties:{wrapperWidth:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},imgWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},titleWidth:{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"}}},galleryPaddingRight:ki("Gallery Padding Right"),galleryPaddingLeft:ki("Gallery Padding Left"),galleryPaddingBetween:ki("Gallery Padding Between"),cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},position:{type:"string",scope:"layout",title:"Position",display:{type:"toggle-cycle",enum:["left","center","right","top"]}},titleTopPadding:ki("Title Top Padding"),titleLeftPadding:ki("Title Left Padding"),titleRightPadding:ki("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...Fa.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"}},titleAlign:{...Fa.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...Fa.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:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{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"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},bb={element:yb,id:"mercury",name:"Mercury",category:"lists",layoutMode:"structured",version:1,defaultSize:{d:{width:720,height:540}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Mercury.mp4"},schema:xb,sourceCode:vb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},cc=48,wb=10,Sb=400,$b=1,Cb=1120/1440,Tb=140/1440,Lb=550/1440,Rb=13,Ib=4,Pb=38/100,Eb=28/100,Od=2.8,Mb=.9,Dd=.22,kb=.5,Ab=1,Fb=1.5,_b=0,Wb=.85;function Nb(e,t){return`
|
|
23014
23014
|
.${e}-wrapper {
|
|
23015
23015
|
position: relative;
|
|
23016
23016
|
box-sizing: border-box;
|
|
@@ -23058,7 +23058,7 @@ ${t}
|
|
|
23058
23058
|
`}function Xo(e){return Number(e.toFixed(4))}function dc(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 _a(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 Hb(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 Ob(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function Db(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 Bd(e,t){return(1-e)/(1-e*Math.cos(t))}function Bb(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)*Bd(e,i)))}return t||1}function jb(e,t){return e?1:1+Dd*(.35+t)}function zb(e,t,n,i){const o=t*jb(n,i);return Math.max(0,(e-o)/2)}function jd(e,t,n){const i=Bd(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function zd(e,t,n){return e/2+t*n}function Vb(e,t,n){return e(t-n/2)}function Gb(e,t){return e*t}function Vd(e){return Math.round(e*1e3)}function Gd(e,t,n){const i=Math.cos(e),o=Math.cos(Wb*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Xo(t+(n-t)*r)}function qd(e){return Gd(e,kb,Ab)}function qb(e){return Gd(e,Fb,_b)}function Xd(e,t){if(!t)return"none";const n=qb(e);return n<=0?"none":`blur(${n}px)`}function Xb(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=jd(i,o,r*Math.PI*2),p=r*Math.PI*2,b=zd(t,n,c),x=Xo(u),g=`calc(${e(b)} - var(--helix-base-w) * ${x} / 2)`,m=`calc(var(--helix-base-w) * ${x})`,h=l?`height: calc(var(--helix-base-h) * ${x});`:"";return`left: ${g}; width: ${m}; ${h} z-index: ${Vd(u)}; transform: translateY(-50%); opacity: ${qd(p)}; filter: ${Xd(p,d)};`}function Ub(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=cc;u+=1){const p=u/cc;c.push(` ${Xo(p*100)}% { ${Xb(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23059
23059
|
${c.join(`
|
|
23060
23060
|
`)}
|
|
23061
|
-
}`}function Ud(e,t){return(e%t+t)%t}function Yb(e,t){return Os(e,t)/t}function Os(e,t){return Ud(e,t)}function Kb(e,t){return Math.floor(e/t)}function Zb(e,t,n,i){return Kb(e,t)*n+Os(e,t)*i}function Jb(e,t,n){const i=n==="left"?1-e:e;return`${Xo(-i*t)}s`}function uc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Yd(e){const t=e%1;return t<0?t+1:t}function Qb(e,t,n){const i=t/Od,o=n==="left"?-e*i:e*i;return Yd(o)}function ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=W.useScopedStyles(),r=s.useRef(null),l=_a((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Cb),d=_a(e==null?void 0:e.imageWidth,Tb),c=_a(e==null?void 0:e.turnHeight,Lb),u=dc(e==null?void 0:e.itemsPerTurn,Rb,3,40),p=dc(e==null?void 0:e.turns,Ib,1,30),b=Math.min(Mb,Math.max(0,Pb)),x=Math.min(1,Math.max(0,Eb)),g=Math.max(0,(e==null?void 0:e.speed)??Od),m=(e==null?void 0:e.direction)==="left"?"left":"right",h=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",f=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>Hb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),R=y.display==="cover",H=z=>W.scalingValue(z,n??!1),S=s.useMemo(()=>Bb(b),[b]),U=s.useMemo(()=>zb(l,d,R,x),[l,d,R,x]),F=s.useMemo(()=>Nb(o,Ub(o,H,l,U,b,S,R,C)),[o,l,U,b,S,R,C,n]),_=s.useMemo(()=>(t??[]).filter(z=>{var T;return!!((T=z.image)!=null&&T.url)}),[t]),B=c/u,L=d*Ob(y),N=Math.min(Sb,p*u),k=$b*u,Z=N+k*2,K=Math.max(0,p-1)*c+(u-1)*B,D=g>0,j=h==="scroll"&&D,$=h==="autoplay"&&D&&(n?!!i:!0),[v,w]=s.useState(0);s.useEffect(()=>{if(!j)return;const z=r.current;if(!z)return;const T=()=>{const
|
|
23061
|
+
}`}function Ud(e,t){return(e%t+t)%t}function Yb(e,t){return Os(e,t)/t}function Os(e,t){return Ud(e,t)}function Kb(e,t){return Math.floor(e/t)}function Zb(e,t,n,i){return Kb(e,t)*n+Os(e,t)*i}function Jb(e,t,n){const i=n==="left"?1-e:e;return`${Xo(-i*t)}s`}function uc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Yd(e){const t=e%1;return t<0?t+1:t}function Qb(e,t,n){const i=t/Od,o=n==="left"?-e*i:e*i;return Yd(o)}function ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=W.useScopedStyles(),r=s.useRef(null),l=_a((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Cb),d=_a(e==null?void 0:e.imageWidth,Tb),c=_a(e==null?void 0:e.turnHeight,Lb),u=dc(e==null?void 0:e.itemsPerTurn,Rb,3,40),p=dc(e==null?void 0:e.turns,Ib,1,30),b=Math.min(Mb,Math.max(0,Pb)),x=Math.min(1,Math.max(0,Eb)),g=Math.max(0,(e==null?void 0:e.speed)??Od),m=(e==null?void 0:e.direction)==="left"?"left":"right",h=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",f=(e==null?void 0:e.cornerRadius)??0,C=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>Hb(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),R=y.display==="cover",H=z=>W.scalingValue(z,n??!1),S=s.useMemo(()=>Bb(b),[b]),U=s.useMemo(()=>zb(l,d,R,x),[l,d,R,x]),F=s.useMemo(()=>Nb(o,Ub(o,H,l,U,b,S,R,C)),[o,l,U,b,S,R,C,n]),_=s.useMemo(()=>(t??[]).filter(z=>{var T;return!!((T=z.image)!=null&&T.url)}),[t]),B=c/u,L=d*Ob(y),N=Math.min(Sb,p*u),k=$b*u,Z=N+k*2,K=Math.max(0,p-1)*c+(u-1)*B,D=g>0,j=h==="scroll"&&D,$=h==="autoplay"&&D&&(n?!!i:!0),[v,w]=s.useState(0);s.useEffect(()=>{if(!j)return;const z=r.current;if(!z)return;const T=()=>{const E=z.getBoundingClientRect(),ee=window.innerHeight||document.documentElement.clientHeight,V=ee+E.height;V<=0||w(Math.min(1,Math.max(0,(ee-E.top)/V)))};T(),window.addEventListener("scroll",T,{passive:!0}),window.addEventListener("resize",T);const O=new ResizeObserver(T);return O.observe(z),()=>{window.removeEventListener("scroll",T),window.removeEventListener("resize",T),O.disconnect()}},[j]);const P=j?Qb(v,g,m):0,Q=D&&h==="autoplay"?360/(g*wb):0;return _.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:F}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(K),marginInline:"auto"},children:Array.from({length:Z},(z,T)=>{const O=T-k,ee=_[Ud(O,_.length)].image,V=Os(O,u),ue=Yb(O,u),Ie=j?Yd(ue+P):ue,ge=Zb(O,u,c,B),ae=x===0?0:(uc(V+7.3)-.5)*x*B,ne=R?1:1+(uc(V+3.1)-.5)*2*Dd*(.35+x),oe=Ie*Math.PI*2,{offset:ie,scale:Ae}=jd(b,S,oe),be=d*ne,Me=Gb(be,Ae),q=zd(l,U,ie),se={"--helix-base-w":H(be),...R?{"--helix-base-h":H(L)}:{}},he={top:H(ge+ae),transform:"translateY(-50%)",...se,...$?{animationDuration:`${Xo(Q)}s`,animationDelay:Jb(ue,Q,m),animationDirection:m==="left"?"reverse":"normal"}:{left:Vb(H,q,Me),width:H(Me),...R?{height:H(L*Ae)}:{},zIndex:Vd(Ae),opacity:qd(oe),filter:Xd(oe,C)}},G=f>0?{borderRadius:H(f)}:{},re=R?{...G,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:G,me=Db(ee)?a.jsx("video",{className:`${o}-media`,style:re,src:ee.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:re,src:ee.url,alt:ee.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:$?`${o}-item`:`${o}-item ${o}-item-static`,style:he,children:R?a.jsx("div",{className:`${o}-cover`,style:G,children:me}):me},`${p}-${u}-${O}`)})})]})}const tw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23062
23062
|
import { CommonComponentProps } from '../props';
|
|
23063
23063
|
import { scalingValue } from '../utils/scalingValue';
|
|
23064
23064
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23596,7 +23596,7 @@ export function Helix({
|
|
|
23596
23596
|
</>
|
|
23597
23597
|
);
|
|
23598
23598
|
}
|
|
23599
|
-
`,nw=["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"],iw={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:nw.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"]}]}]},ow={element:ew,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:iw,sourceCode:tw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wa=typeof window>"u"?s.useEffect:s.useLayoutEffect,Wo=120,pc=3,rw=.12,Na=.25,aw=10,sw=4e3,lw=.12,mc=.92,cw=3,Kd=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function ns(e){return e<0?0:e>1?1:e}function dw(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 uw(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,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}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 go(e){return e.map(([t,n])=>({x:t,y:n}))}function Ha(e,t=Wo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Tr(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 Zd(e,t){switch(e){case"ellipse":return[Ha(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Ha(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[go([[.5,0],[1,1],[0,1]])];case"triangle-down":return[go([[0,0],[1,0],[.5,1]])];case"diamond":return[go([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[go([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Tr([Ha(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Wo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Wo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[go([[0,0],[1,0],[1,1],[0,1]])]}}const Jd={x:0,y:0,width:100,height:100};function pw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Jd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Lr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const is=16,mw=12,gw=16,Nr="0 0 100 100",Hr=100,Oa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,hw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function fw(e){const t=e.match(hw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function os(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function yw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function ei(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(yw)}))}function xi(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 gc(e,t,n,i=n){return xi(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function vw(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:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),x=(e.x-l.x)/2,g=(e.y-l.y)/2,m=p*x+b*g,h=-b*x+p*g,f=m*m/(d*d)+h*h/(c*c);if(f>1){const $=Math.sqrt(f);d*=$,c*=$}const C=o===r?-1:1,y=d*d*h*h+c*c*m*m,R=Math.max(0,d*d*c*c-y),H=y===0?0:C*Math.sqrt(R/y),S=H*d*h/c,U=-H*c*m/d,F=p*S-b*U+(e.x+l.x)/2,_=b*S+p*U+(e.y+l.y)/2,B=Math.atan2((h-U)/c,(m-S)/d);let N=Math.atan2((-h-U)/c,(-m-S)/d)-B;!r&&N>0&&(N-=Math.PI*2),r&&N<0&&(N+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2))),Z=N/k,E=4/3*Math.tan(Z/4),K=($,v)=>({x:F+p*d*$-b*c*v,y:_+b*d*$+p*c*v}),D=[];let j=B;for(let $=0;$<k;$+=1){const v=j+Z,w=Math.cos(j),P=Math.sin(j),Q=Math.cos(v),z=Math.sin(v);D.push({c1:K(w-E*P,P+E*w),c2:K(Q+E*z,z-E*Q),p:$===k-1?on(l):K(Q,z)}),j=v}return D}function No(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 g=i[0],m=i[i.length-1];Math.abs(g.p.x-m.p.x)<1e-6&&Math.abs(g.p.y-m.p.y)<1e-6&&(g.in=m.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,m)=>{i.push({p:g,in:m??null,out:null}),r=g},b=g=>{i.length&&(i[i.length-1].out=g)};Oa.lastIndex=0;let x=Oa.exec(t);for(;x!==null;){const g=x[1],m=g.toUpperCase(),h=g!==m,f=fw(x[2]),C=y=>h?{x:r.x+f[y],y:r.y+f[y+1]}:{x:f[y],y:f[y+1]};if(m==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(m==="M"){for(let y=0;y+1<f.length;y+=2){const R=C(y);y===0&&(u(),l=on(R)),p(R)}d=null,c=null}else if(m==="L"){for(let y=0;y+1<f.length;y+=2)p(C(y));d=null,c=null}else if(m==="H"){for(const y of f)p({x:h?r.x+y:y,y:r.y});d=null,c=null}else if(m==="V"){for(const y of f)p({x:r.x,y:h?r.y+y:y});d=null,c=null}else if(m==="C"){for(let y=0;y+5<f.length;y+=6){const R=C(y),H=C(y+2),S=C(y+4);b(R),p(S,H),d=H}c=null}else if(m==="S"){for(let y=0;y+3<f.length;y+=4){const R=d?os(d,r):on(r),H=C(y),S=C(y+2);b(R),p(S,H),d=H}c=null}else if(m==="Q")for(let y=0;y+3<f.length;y+=4){const R=C(y),H=C(y+2);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="T")for(let y=0;y+1<f.length;y+=2){const R=c?os(c,r):on(r),H=C(y);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="A")for(let y=0;y+6<f.length;y+=7){const R=h?{x:r.x+f[y+5],y:r.y+f[y+6]}:{x:f[y+5],y:f[y+6]};for(const H of vw(r,f[y],f[y+1],f[y+2],f[y+3]!==0,f[y+4]!==0,R))b(H.c1),p(H.p,H.c2);d=null,c=null}x=Oa.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function Uo(e,t){return!e.out&&!t.in}function hc(e,t){if(Uo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Ho(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(hc(r,l)),r=l;if(n.closed){const l=hc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Qd(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 rs(e,t,n){if(Uo(e,t))return gn(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 Ds(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Qd(n)){if(Uo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<is;r+=1)i.push(rs(o.from,o.to,r/is))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function Ni(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Ds(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 eu(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 tu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/gw)),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:on(r),...eu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xw(e){const t={x:0,y:0,width:Hr,height:Hr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Nr||!e.customPath)return t;const n=No(e.customPath);if(!n.length)return t;const i=Ni(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function nu(e,t,n=1){if(!e.length)return!1;const i=Ni(e);return!isFinite(i.minX)||!isFinite(i.maxX)?!1:i.minX<t.x-n||i.minY<t.y-n||i.maxX>t.x+t.width+n||i.maxY>t.y+t.height+n}function bw(e,t=1,n){const i=xw(n),o=Zd(e==="custom"?"rectangle":e,t),r=xi(tu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y}));return{shape:e,customPath:Ho(r),pathFit:"viewbox",pathViewBox:Nr}}function fc(e,t){return t>0?Math.round(e/t)*t:e}function yc(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=ei(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 ww(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=ei(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=os(o,c.p)}return d}function Sw(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=ei(e);return r[t].nodes[n][i]=null,r}function $w(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=ei(e),c=d[t].nodes,u=n+1;if(Uo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,x=gn(r.p,p,i),g=gn(p,b,i),m=gn(b,l.p,i),h=gn(x,g,i),f=gn(g,m,i),C=gn(h,f,i),y=(n+1)%o.nodes.length;return c[n].out=x,c[y].in=m,c.splice(u,0,{p:C,in:h,out:f}),{contours:d,nodeIndex:u}}function vc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=ei(e);return o[t].nodes.splice(n,1),o}function Cw(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=ei(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=eu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Tw(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)}}function Lw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Qd(i)){const l=Uo(r.from,r.to)?1:is;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Tw(t,rs(r.from,r.to,c),rs(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})}}}),n}function Rw(e,t="stretch",n=Jd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=No(i),d=Ds(l);if(d.length)return t==="viewbox"?Lr(d,n):Tr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",b),u.appendChild(x);let g=0;try{g=x.getTotalLength()}catch{g=0}if(!g)continue;const m=[];for(let h=0;h<Wo;h+=1){const f=x.getPointAtLength(h/Wo*g);m.push({x:f.x,y:f.y})}p.push(m)}return p.length?t==="viewbox"?Lr(p,n):Tr(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"?Lr([r],n):Tr([r])}function Iw(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=ns(n[o]),l=ns(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Pw(i)}function Pw(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 Ew(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 Mw(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 kw(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 Aw(e,t,n,i){let o=null;for(let r=0;r<pc;r+=1){const l=ns(t+(n-t)*r/Math.max(1,pc-1)),d=Iw(e,l),c=i==="avoid"?Mw(d):d;if(o=o===null?c:Ew(o,c),o.length===0)return[]}return o??[]}function iu(e){return!!e&&typeof e=="object"&&e.type==="link"}function Fw(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(iu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function xc(e){return{...e.fontFamily&&{fontFamily:oo(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 _w(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(iu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function bc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,x=e.lineHeight*l,g=e.spaceWidth*l,m=[];if(!t.length||d<=0||x<=0)return{segments:m,placed:0,height:0,capLeft:0,capTop:0};const h=Math.max(1,g*.5),f=x*rw;let C=0,y=0,R=0,H=t[0].para,S=0,U=0,F=null;for(;C<t.length&&R<sw;){const _=y+x>c;if(_&&!u)break;const B=t[C].para;if(B>H+1){y+=x*(B-H-1),H=B-1,R+=1;continue}let L=_?[{x0:0,x1:d}]:Aw(i,(y+f)/c,(y+x-f)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!_&&L.length&&(F===null&&(F=R,S=L[0].x0,U=y),R-F<b&&(L=kw(L,{x0:S,x1:S+p})));const N=L.reduce((k,Z)=>Math.max(k,Z.x1-Z.x0),0);for(const k of L){const Z=k.x1-k.x0;if(Z<h)continue;if(C>=t.length||t[C].para!==B)break;const E=C;let K=0;for(;C<t.length&&t[C].para===B;){const D=n[C]*l,j=C===E?D:g+D;if(K+j>Z&&!(C===E&&Z>=N-.5&&D>d-.5))break;K+=j,C+=1}if(C>E){const D=C>=t.length||t[C].para!==B;m.push({top:y,left:k.x0,width:Z,from:E,to:C,justify:r==="justify"&&!D})}if(C>=t.length||t[C].para!==B)break}H=B,y+=x,R+=1}return{segments:m,placed:C,height:m.length?y:0,capLeft:S,capTop:U}}function Ww(e){return`
|
|
23599
|
+
`,nw=["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"],iw={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:nw.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"]}]}]},ow={element:ew,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:iw,sourceCode:tw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Wa=typeof window>"u"?s.useEffect:s.useLayoutEffect,Wo=120,pc=3,rw=.12,Na=.25,aw=10,sw=4e3,lw=.12,mc=.92,cw=3,Kd=["rectangle","ellipse","circle","triangle-up","triangle-down","diamond","hourglass","teardrop","leaf","wave","custom"];function ns(e){return e<0?0:e>1?1:e}function dw(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 uw(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,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}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 go(e){return e.map(([t,n])=>({x:t,y:n}))}function Ha(e,t=Wo){const n=[];for(let i=0;i<t;i+=1)n.push(e(i/t));return n}function Tr(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 Zd(e,t){switch(e){case"ellipse":return[Ha(n=>{const i=n*Math.PI*2;return{x:.5+Math.cos(i)*.5,y:.5+Math.sin(i)*.5}})];case"circle":{const n=t>=1?.5/t:.5,i=t>=1?.5:.5*t;return[Ha(o=>{const r=o*Math.PI*2;return{x:.5+Math.cos(r)*n,y:.5+Math.sin(r)*i}})]}case"triangle-up":return[go([[.5,0],[1,1],[0,1]])];case"triangle-down":return[go([[0,0],[1,0],[.5,1]])];case"diamond":return[go([[.5,0],[1,.5],[.5,1],[0,.5]])];case"hourglass":return[go([[0,0],[1,0],[.56,.5],[1,1],[0,1],[.44,.5]])];case"teardrop":return Tr([Ha(n=>{const i=n*Math.PI*2,o=Math.cos(i);return{x:.5+Math.sin(i)*Math.pow(Math.sin(i/2),2)*.5,y:.5-o*.5}})]);case"leaf":{const n=Math.round(Wo/2),i=[];for(let o=0;o<=n;o+=1){const r=o/n;i.push({x:.5+Math.sin(Math.PI*r)*.5,y:r})}for(let o=n;o>=0;o-=1){const r=o/n;i.push({x:.5-Math.sin(Math.PI*r)*.5,y:r})}return[i]}case"wave":{const o=Wo,r=[];for(let l=0;l<=o;l+=1){const d=l/o;r.push({x:.09+Math.sin(Math.PI*2*2*d)*.09,y:d})}for(let l=o;l>=0;l-=1){const d=l/o;r.push({x:1-.09+Math.sin(Math.PI*2*2*d+Math.PI/3)*.09,y:d})}return[r]}case"rectangle":case"custom":default:return[go([[0,0],[1,0],[1,1],[0,1]])]}}const Jd={x:0,y:0,width:100,height:100};function pw(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?Jd:{x:t[0],y:t[1],width:t[2],height:t[3]}}function Lr(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}const is=16,mw=12,gw=16,Nr="0 0 100 100",Hr=100,Oa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,hw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function fw(e){const t=e.match(hw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function gn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function os(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function yw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function ti(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(yw)}))}function Kn(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 gc(e,t,n,i=n){return Kn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function vw(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:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),x=(e.x-l.x)/2,g=(e.y-l.y)/2,m=p*x+b*g,h=-b*x+p*g,f=m*m/(d*d)+h*h/(c*c);if(f>1){const $=Math.sqrt(f);d*=$,c*=$}const C=o===r?-1:1,y=d*d*h*h+c*c*m*m,R=Math.max(0,d*d*c*c-y),H=y===0?0:C*Math.sqrt(R/y),S=H*d*h/c,U=-H*c*m/d,F=p*S-b*U+(e.x+l.x)/2,_=b*S+p*U+(e.y+l.y)/2,B=Math.atan2((h-U)/c,(m-S)/d);let N=Math.atan2((-h-U)/c,(-m-S)/d)-B;!r&&N>0&&(N-=Math.PI*2),r&&N<0&&(N+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2))),Z=N/k,M=4/3*Math.tan(Z/4),K=($,v)=>({x:F+p*d*$-b*c*v,y:_+b*d*$+p*c*v}),D=[];let j=B;for(let $=0;$<k;$+=1){const v=j+Z,w=Math.cos(j),P=Math.sin(j),Q=Math.cos(v),z=Math.sin(v);D.push({c1:K(w-M*P,P+M*w),c2:K(Q+M*z,z-M*Q),p:$===k-1?on(l):K(Q,z)}),j=v}return D}function No(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 g=i[0],m=i[i.length-1];Math.abs(g.p.x-m.p.x)<1e-6&&Math.abs(g.p.y-m.p.y)<1e-6&&(g.in=m.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,m)=>{i.push({p:g,in:m??null,out:null}),r=g},b=g=>{i.length&&(i[i.length-1].out=g)};Oa.lastIndex=0;let x=Oa.exec(t);for(;x!==null;){const g=x[1],m=g.toUpperCase(),h=g!==m,f=fw(x[2]),C=y=>h?{x:r.x+f[y],y:r.y+f[y+1]}:{x:f[y],y:f[y+1]};if(m==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(m==="M"){for(let y=0;y+1<f.length;y+=2){const R=C(y);y===0&&(u(),l=on(R)),p(R)}d=null,c=null}else if(m==="L"){for(let y=0;y+1<f.length;y+=2)p(C(y));d=null,c=null}else if(m==="H"){for(const y of f)p({x:h?r.x+y:y,y:r.y});d=null,c=null}else if(m==="V"){for(const y of f)p({x:r.x,y:h?r.y+y:y});d=null,c=null}else if(m==="C"){for(let y=0;y+5<f.length;y+=6){const R=C(y),H=C(y+2),S=C(y+4);b(R),p(S,H),d=H}c=null}else if(m==="S"){for(let y=0;y+3<f.length;y+=4){const R=d?os(d,r):on(r),H=C(y),S=C(y+2);b(R),p(S,H),d=H}c=null}else if(m==="Q")for(let y=0;y+3<f.length;y+=4){const R=C(y),H=C(y+2);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="T")for(let y=0;y+1<f.length;y+=2){const R=c?os(c,r):on(r),H=C(y);b(gn(r,R,2/3)),p(H,gn(H,R,2/3)),c=R,d=null}else if(m==="A")for(let y=0;y+6<f.length;y+=7){const R=h?{x:r.x+f[y+5],y:r.y+f[y+6]}:{x:f[y+5],y:f[y+6]};for(const H of vw(r,f[y],f[y+1],f[y+2],f[y+3]!==0,f[y+4]!==0,R))b(H.c1),p(H.p,H.c2);d=null,c=null}x=Oa.exec(t)}return u(),n}function Rn(e){return`${Number(e.toFixed(2))}`}function Uo(e,t){return!e.out&&!t.in}function hc(e,t){if(Uo(e,t))return`L${Rn(t.p.x)},${Rn(t.p.y)}`;const n=e.out??e.p,i=t.in??t.p;return`C${Rn(n.x)},${Rn(n.y)} ${Rn(i.x)},${Rn(i.y)} ${Rn(t.p.x)},${Rn(t.p.y)}`}function Ho(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Rn(i.p.x)},${Rn(i.p.y)}`);let r=i;for(const l of o)t.push(hc(r,l)),r=l;if(n.closed){const l=hc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Qd(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 rs(e,t,n){if(Uo(e,t))return gn(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 Ds(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Qd(n)){if(Uo(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<is;r+=1)i.push(rs(o.from,o.to,r/is))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function vi(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Ds(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 eu(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 tu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=mw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/gw)),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:on(r),...eu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function xw(e){const t={x:0,y:0,width:Hr,height:Hr};if(!e||e.pathFit!=="viewbox"||e.pathViewBox!==Nr||!e.customPath)return t;const n=No(e.customPath);if(!n.length)return t;const i=vi(n),o=i.maxX-i.minX,r=i.maxY-i.minY;return!isFinite(i.minX)||!isFinite(i.minY)||!(o>0)||!(r>0)?t:{x:i.minX,y:i.minY,width:o,height:r}}function nu(e,t,n=1){if(!e.length)return!1;const i=vi(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=Math.max(n,t.width*.5),r=Math.max(n,t.height*.5);return i.minX<t.x-o||i.minY<t.y-r||i.maxX>t.x+t.width+o||i.maxY>t.y+t.height+r}function bw(e,t){if(!e.length)return e;const n=vi(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 Kn(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function ww(e,t=1,n){const i=xw(n),o=Zd(e==="custom"?"rectangle":e,t),r=bw(Kn(tu(o),l=>({x:l.x*i.width+i.x,y:l.y*i.height+i.y})),i);return{shape:e,customPath:Ho(r),pathFit:"viewbox",pathViewBox:Nr}}function fc(e,t){return t>0?Math.round(e/t)*t:e}function yc(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=ti(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 Sw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=ti(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=os(o,c.p)}return d}function $w(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=ti(e);return r[t].nodes[n][i]=null,r}function Cw(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=ti(e),c=d[t].nodes,u=n+1;if(Uo(r,l))return c.splice(u,0,{p:gn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,x=gn(r.p,p,i),g=gn(p,b,i),m=gn(b,l.p,i),h=gn(x,g,i),f=gn(g,m,i),C=gn(h,f,i),y=(n+1)%o.nodes.length;return c[n].out=x,c[y].in=m,c.splice(u,0,{p:C,in:h,out:f}),{contours:d,nodeIndex:u}}function vc(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=ti(e);return o[t].nodes.splice(n,1),o}function Tw(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=ti(e),l=r[t].nodes[n];if(l.in||l.out)return l.in=null,l.out=null,r;const d=i.nodes.length,c=i.nodes[(n-1+d)%d].p,u=i.nodes[(n+1)%d].p,p=eu(c,l.p,u);return l.in=p.in,l.out=p.out,r}function Lw(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)}}function Rw(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Qd(i)){const l=Uo(r.from,r.to)?1:is;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=Lw(t,rs(r.from,r.to,c),rs(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})}}}),n}function Iw(e,t="stretch",n=Jd){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=No(i),d=Ds(l);if(d.length)return t==="viewbox"?Lr(d,n):Tr(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const x=document.createElementNS("http://www.w3.org/2000/svg","path");x.setAttribute("d",b),u.appendChild(x);let g=0;try{g=x.getTotalLength()}catch{g=0}if(!g)continue;const m=[];for(let h=0;h<Wo;h+=1){const f=x.getPointAtLength(h/Wo*g);m.push({x:f.x,y:f.y})}p.push(m)}return p.length?t==="viewbox"?Lr(p,n):Tr(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"?Lr([r],n):Tr([r])}function Pw(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=ns(n[o]),l=ns(n[o+1]);l>r&&i.push({x0:r,x1:l})}return Ew(i)}function Ew(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 Mw(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 kw(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 Aw(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 Fw(e,t,n,i){let o=null;for(let r=0;r<pc;r+=1){const l=ns(t+(n-t)*r/Math.max(1,pc-1)),d=Pw(e,l),c=i==="avoid"?kw(d):d;if(o=o===null?c:Mw(o,c),o.length===0)return[]}return o??[]}function iu(e){return!!e&&typeof e=="object"&&e.type==="link"}function _w(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(iu(c)){o(c.children??[],c.value,c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function xc(e){return{...e.fontFamily&&{fontFamily:oo(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 Ww(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(iu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function bc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,x=e.lineHeight*l,g=e.spaceWidth*l,m=[];if(!t.length||d<=0||x<=0)return{segments:m,placed:0,height:0,capLeft:0,capTop:0};const h=Math.max(1,g*.5),f=x*rw;let C=0,y=0,R=0,H=t[0].para,S=0,U=0,F=null;for(;C<t.length&&R<sw;){const _=y+x>c;if(_&&!u)break;const B=t[C].para;if(B>H+1){y+=x*(B-H-1),H=B-1,R+=1;continue}let L=_?[{x0:0,x1:d}]:Fw(i,(y+f)/c,(y+x-f)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!_&&L.length&&(F===null&&(F=R,S=L[0].x0,U=y),R-F<b&&(L=Aw(L,{x0:S,x1:S+p})));const N=L.reduce((k,Z)=>Math.max(k,Z.x1-Z.x0),0);for(const k of L){const Z=k.x1-k.x0;if(Z<h)continue;if(C>=t.length||t[C].para!==B)break;const M=C;let K=0;for(;C<t.length&&t[C].para===B;){const D=n[C]*l,j=C===M?D:g+D;if(K+j>Z&&!(C===M&&Z>=N-.5&&D>d-.5))break;K+=j,C+=1}if(C>M){const D=C>=t.length||t[C].para!==B;m.push({top:y,left:k.x0,width:Z,from:M,to:C,justify:r==="justify"&&!D})}if(C>=t.length||t[C].para!==B)break}H=B,y+=x,R+=1}return{segments:m,placed:C,height:m.length?y:0,capLeft:S,capTop:U}}function Nw(e){return`
|
|
23600
23600
|
.${e}-wrapper {
|
|
23601
23601
|
box-sizing: border-box;
|
|
23602
23602
|
display: flex;
|
|
@@ -23788,7 +23788,7 @@ export function Helix({
|
|
|
23788
23788
|
clip-path: inset(50%);
|
|
23789
23789
|
white-space: nowrap;
|
|
23790
23790
|
}
|
|
23791
|
-
`}const ho=7,Nw=3.5,fo=9,fr=8,yr=14,wc=10,Hw=24,Ow=1,Dw=.05,Sc=1.08;function ou(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}}}function Bw(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function $c(e,t){const n=ou(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*wc,y:n.y+o*wc}}function jw({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,onChange:l,onCommit:d}){const c=s.useRef(null),u=s.useRef(i);u.current=i;const p=s.useRef(null),b=s.useRef(null),x=s.useRef(null),[g,m]=s.useState(null),h=n.width>0?t.width/n.width:1,f=n.height>0?t.height/n.height:1,C=s.useCallback($=>r?{x:($.x-n.x)*h,y:($.y-n.y)*f}:{x:$.x-n.x,y:$.y-n.y},[r,n,h,f]),y=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:r?{x:n.x+($-w.left)/w.width*n.width,y:n.y+(v-w.top)/w.height*n.height}:{x:n.x+($-w.left),y:n.y+(v-w.top)}},[r,n]),R=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:{x:($-w.left)/w.width*t.width,y:(v-w.top)/w.height*t.height}},[t.width,t.height]),H=s.useCallback($=>{d($)},[d]),S=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){if($.stopPropagation(),$.preventDefault(),v.startDistance<=0)return;const T=y($.clientX,$.clientY),O=Math.hypot(T.x-v.origin.x,T.y-v.origin.y),M=Math.max(Dw,O/v.startDistance);if(!v.moved&&Math.abs(M-1)<1e-4)return;v.moved=!0,l(gc(v.startContours,v.origin,M));return}const w=b.current;if(w&&$.pointerId===w.pointerId){$.stopPropagation(),$.preventDefault();const T=y($.clientX,$.clientY),{bbox:O}=w,M=O.maxX-O.minX,ee=O.maxY-O.minY,V=T.x-w.origin.x,me=T.y-w.origin.y;let Ie=V,ge=me;if(isFinite(M)&&isFinite(ee))if(r){const ae=Math.min(n.x,n.x+n.width-M),ne=Math.max(n.x,n.x+n.width-M),oe=Math.min(n.y,n.y+n.height-ee),ie=Math.max(n.y,n.y+n.height-ee),Ae=Math.min(ne,Math.max(ae,O.minX+V)),be=Math.min(ie,Math.max(oe,O.minY+me));Ie=Ae-O.minX,ge=be-O.minY}else{const ae=O.minX-n.x,ne=O.minY-n.y,oe=Math.min(0,t.width-M),ie=Math.max(0,t.width-M),Ae=Math.min(0,t.height-ee),be=Math.max(0,t.height-ee),Me=Math.min(ie,Math.max(oe,ae+V)),q=Math.min(be,Math.max(Ae,ne+me));Ie=Me-ae,ge=q-ne}if(!w.moved&&Ie===0&&ge===0)return;w.moved=!0,l(xi(w.startContours,ae=>({x:ae.x+Ie,y:ae.y+ge})));return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;$.stopPropagation(),$.preventDefault();const Q=y($.clientX,$.clientY),z={x:fc(Q.x,o),y:fc(Q.y,o)};if(P.kind==="anchor"){let T=z.x-P.origin.x,O=z.y-P.origin.y;if($.shiftKey&&(Math.abs(T)>Math.abs(O)?O=0:T=0),!P.moved&&T===0&&O===0)return;P.moved=!0,l(yc(u.current,P.contour,P.node,{x:P.anchor.x+T,y:P.anchor.y+O}));return}P.moved=!0,l(ww(u.current,P.contour,P.node,P.kind,z,P.mirror&&!$.altKey))},U=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){x.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(v.pointerId)&&z.releasePointerCapture(v.pointerId),v.moved&&H(u.current);return}const w=b.current;if(w&&$.pointerId===w.pointerId){b.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(w.pointerId)&&z.releasePointerCapture(w.pointerId),w.moved?H(u.current):m(null);return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;p.current=null,$.stopPropagation();const Q=c.current;Q!=null&&Q.hasPointerCapture(P.pointerId)&&Q.releasePointerCapture(P.pointerId),P.moved&&H(u.current)},F=$=>{$.stopPropagation()},_=$=>{var v,w;$.stopPropagation(),$.preventDefault(),(v=c.current)==null||v.focus({preventScroll:!0}),b.current={pointerId:$.pointerId,origin:y($.clientX,$.clientY),startContours:ei(i),bbox:Ni(i),moved:!1},(w=c.current)==null||w.setPointerCapture($.pointerId)},B=($,v)=>{var T,O;$.stopPropagation(),$.preventDefault(),(T=c.current)==null||T.focus({preventScroll:!0}),m(null);const w=Ni(i),P=ou(w,Bw(v)),Q=$c(w,v),z=Math.hypot(Q.x-P.x,Q.y-P.y);!isFinite(z)||z<=0||(x.current={pointerId:$.pointerId,corner:v,origin:P,startDistance:z,startContours:ei(i),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId))},L=($,v,w,P)=>{var z,T,O;$.stopPropagation(),$.preventDefault(),(z=c.current)==null||z.focus({preventScroll:!0});const Q=(T=i[w])==null?void 0:T.nodes[P];if(Q){if($.altKey){const M=v==="anchor"?vc(i,w,P):Sw(i,w,P,v);if(M===i)return;m(v==="anchor"?null:{contour:w,node:P}),l(M),H(M);return}m({contour:w,node:P}),p.current={kind:v,contour:w,node:P,pointerId:$.pointerId,origin:y($.clientX,$.clientY),anchor:Q.p,mirror:v!=="anchor"&&!!(Q.in&&Q.out),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId)}},N=$=>{$.stopPropagation(),$.preventDefault();const v=xi(i,C),w=Lw(v,R($.clientX,$.clientY));if(!w||w.distance>Hw)return;const{contours:P,nodeIndex:Q}=$w(i,w.contour,w.segment,w.t);Q<0||(m({contour:w.contour,node:Q}),l(P),H(P))},k=$=>{var M,ee;if($.key==="="||$.key==="+"||$.key==="-"||$.key==="_"){$.preventDefault(),$.stopPropagation();const V=Ni(i);if(!isFinite(V.minX)||!isFinite(V.maxX))return;const me={x:(V.minX+V.maxX)/2,y:(V.minY+V.maxY)/2},ge=$.key==="="||$.key==="+"?Sc:1/Sc,ae=gc(i,me,ge);l(ae),H(ae);return}if(!g)return;const{contour:v,node:w}=g;if($.key==="Escape"){$.stopPropagation(),m(null);return}if($.key==="Backspace"||$.key==="Delete"){$.preventDefault(),$.stopPropagation();const V=vc(i,v,w);if(V===i)return;m(null),l(V),H(V);return}const P=o>0?o:Ow,Q=$.shiftKey?P*10:P,z={ArrowLeft:[-Q,0],ArrowRight:[Q,0],ArrowUp:[0,-Q],ArrowDown:[0,Q]}[$.key];if(!z)return;$.preventDefault(),$.stopPropagation();const T=(ee=(M=i[v])==null?void 0:M.nodes[w])==null?void 0:ee.p;if(!T)return;const O=yc(i,v,w,{x:T.x+z[0],y:T.y+z[1]});l(O),H(O)},Z=s.useMemo(()=>Ho(xi(i,C)),[i,C]),E=s.useMemo(()=>Ni(i),[i]),K=C({x:E.minX,y:E.minY}),D={width:C({x:E.maxX,y:E.minY}).x-K.x,height:C({x:E.minX,y:E.maxY}).y-K.y},j=!g&&isFinite(E.minX)&&isFinite(E.maxX)&&E.maxX>E.minX&&E.maxY>E.minY;return a.jsxs("svg",{ref:c,className:`${e}-editor${g?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:k,onPointerDown:()=>{var $;return($=c.current)==null?void 0:$.focus({preventScroll:!0})},onPointerMove:S,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>m(null),onClick:N}),a.jsx("path",{className:`${e}-editor-hit`,d:Z,onClick:N}),a.jsx("path",{className:`${e}-editor-outline`,d:Z}),a.jsx("path",{className:`${e}-editor-body`,d:Z,fillRule:"evenodd",onPointerDown:_,onClick:N}),i.map(($,v)=>$.nodes.map((w,P)=>{const Q=(g==null?void 0:g.contour)===v&&(g==null?void 0:g.node)===P,z=C(w.p);return a.jsxs("g",{children:[Q&&["in","out"].map(T=>{const O=w[T];if(!O)return null;const M=C(O);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:M.x,y2:M.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:M.x,cy:M.y,r:Nw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:M.x,cy:M.y,r:fo,onPointerDown:ee=>L(ee,T,v,P),onClick:F})]},T)}),a.jsx("rect",{className:`${e}-editor-anchor${Q?` ${e}-editor-anchor-selected`:""}`,x:z.x-ho/2,y:z.y-ho/2,width:ho,height:ho,rx:w.in||w.out?ho/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-fo,y:z.y-fo,width:fo*2,height:fo*2,onPointerDown:T=>L(T,"anchor",v,P),onClick:F,onDoubleClick:T=>{T.stopPropagation(),T.preventDefault();const O=Cw(i,v,P);l(O),H(O)}})]},`${v}-${P}`)})),j&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:K.x,y:K.y,width:D.width,height:D.height}),["nw","ne","se","sw"].map($=>{const v=C($c(E,$)),w=$==="ne"||$==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:v.x-fr/2,y:v.y-fr/2,width:fr,height:fr}),a.jsx("rect",{className:`${e}-editor-scale-grab${w?` ${e}-editor-scale-grab-nesw`:""}`,x:v.x-yr/2,y:v.y-yr/2,width:yr,height:yr,onPointerDown:P=>B(P,$),onClick:F})]},$)})]})]})}function zw(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function Vw(e,t){return 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}function Gw(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=zw(e);(!r||!Vw(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function qw(){return typeof document>"u"?null:document.body}function Xw({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:x,showGuides:g,typography:m,imageUrl:h,pathEditor:f}){var be,Me;const C=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[y,R]=s.useState(null),H=s.useRef(null),[S,U]=s.useState({width:0,height:0}),[F,_]=s.useState(null),[B,L]=s.useState(0),N=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),k=s.useMemo(()=>Fw(N),[N]),Z=s.useMemo(()=>_w(N),[N]),E=x>0?((Me=(be=k[0])==null?void 0:be.text)==null?void 0:Me.charAt(0))??"":"",K=S.height>0?S.width/S.height:1,D=(f==null?void 0:f.contours)??null,j=s.useMemo(()=>{if(D){const he=Ds(D);if(he.length)return Lr(he,r)}const q=i.trim(),se=q?Rw(q,o,r):null;return se&&se.length?se:Zd(n==="custom"?"rectangle":n,K)},[D,n,i,o,r,Math.round(K*100)/100]),$=f==null?void 0:f.onConvert,v=(f==null?void 0:f.needsConversion)??!1,w=s.useMemo(()=>{const q=D??(i.trim()?No(i):null);return!!(q&&nu(q,r))},[D,i,r]),[P,Q]=s.useState(null);Wa(()=>{if(!w){P&&Q(null);return}!P&&S.width>0&&S.height>0&&Q({width:S.width,height:S.height})},[w,S.width,S.height,P]);const z=s.useMemo(()=>{if(!w||S.width<=0||S.height<=0)return j;const q=P??S,se=r.width/q.width,he=r.height/q.height;return j.map(G=>G.map(re=>({x:re.x*se,y:re.y*he})))},[j,w,P,r.width,r.height,S.width,S.height]),T=s.useRef(null);s.useEffect(()=>{if(!(!$||S.width<=0||S.height<=0)){if(w){if(T.current===i)return;const q=D??(i.trim()?No(i):null);if(!(q!=null&&q.length))return;const se=xi(q,he=>({x:r.x+(he.x-r.x)/S.width*r.width,y:r.y+(he.y-r.y)/S.height*r.height}));T.current=Ho(se),$(se);return}!v||!j.length||$(xi(tu(j),q=>({x:q.x*Hr,y:q.y*Hr})))}},[v,w,$,j,D,i,r,S.width,S.height]),Wa(()=>{const q=y;if(!q||typeof ResizeObserver>"u")return;const se=()=>{const G=q.getBoundingClientRect();U(re=>Math.abs(re.width-G.width)<.5&&Math.abs(re.height-G.height)<.5?re:{width:G.width,height:G.height})};se();const he=new ResizeObserver(se);return he.observe(q),()=>he.disconnect()},[y]),s.useEffect(()=>{const q=typeof document<"u"?document.fonts:void 0;q!=null&&q.ready&&q.ready.then(()=>{L(se=>se+1)})},[]),Wa(()=>{const q=H.current;if(!q)return;if(!k.length){_(null);return}const se=[],he=document.createDocumentFragment();for(const X of k){const le=document.createElement("span");Object.assign(le.style,xc(X.leaf)),le.textContent=X.text,he.appendChild(le),se.push(le)}const G=document.createElement("span");G.textContent=" ",he.appendChild(G);const re=document.createElement("span");re.textContent=E||"H",re.style.lineHeight="1",he.appendChild(re),q.replaceChildren(he);const pe=window.getComputedStyle(q),we=parseFloat(pe.fontSize)||16,Pe=parseFloat(pe.lineHeight),Ce=Number.isNaN(Pe)?we*1.2:Pe;re.style.fontSize=`${Ce*Math.max(1,x)*mc}px`;const Y=se.map(X=>X.getBoundingClientRect().width),xe=G.getBoundingClientRect().width,ue=E?re.getBoundingClientRect().width:0;q.replaceChildren(),_({widths:Y,spaceWidth:xe,lineHeight:Ce,capWidth:ue})},[k,m,E,x,B,S.width]);const O=F&&E?F.capWidth+F.lineHeight*lw:0,M=s.useMemo(()=>{if(!F||!k.length||S.width<=0||S.height<=0||!u)return 1;const q=G=>bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:G,allowOverflow:!1,capInset:O*G,capLines:E?x:0});if(q(1).placed>=k.length)return 1;if(q(Na).placed<k.length)return Na;let se=Na,he=1;for(let G=0;G<aw;G+=1){const re=(se+he)/2;q(re).placed>=k.length?se=re:he=re}return se},[F,k,S.width,S.height,z,l,d,u,O,E,x]);s.useEffect(()=>{b(M)},[M,b]);const ee=u?Math.min(p,M):1,V=s.useMemo(()=>!F||!k.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:ee,allowOverflow:c,capInset:O*ee,capLines:E?x:0}),[F,k,S.width,S.height,z,l,d,ee,c,O,E,x]),me=F?F.lineHeight*ee:0,Ie=d==="justify"?"left":d,ge=!!(f&&D&&S.width>0&&S.height>0),ae=Gw(y,ge),ne=ge&&ae?qw():null,oe=s.useMemo(()=>h&&S.width>0&&S.height>0?dw(z,S):"",[h,z,S.width,S.height]),ie=s.useMemo(()=>h&&S.width>0&&S.height>0?uw(z,S):null,[h,z,S.width,S.height]),Ae=`${C}-pattern`;return a.jsxs("div",{className:`${e}-column`,ref:R,children:[h&&oe&&ie?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("pattern",{id:Ae,patternUnits:"userSpaceOnUse",x:ie.x,y:ie.y,width:ie.width,height:ie.height,children:a.jsx("image",{href:h,x:0,y:0,width:ie.width,height:ie.height,preserveAspectRatio:"xMidYMid slice"})})}),a.jsx("path",{d:oe,fill:`url(#${Ae})`,fillRule:"evenodd"})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...m,["--"+e+"-fit"]:ee},children:[a.jsx("div",{className:`${e}-measure`,ref:H,style:m,"aria-hidden":!0}),E&&F&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${V.capTop}px`,left:`${V.capLeft}px`,fontSize:`${me*Math.max(1,x)*mc}px`,lineHeight:`${me*Math.max(1,x)}px`},children:E}),V.segments.map((q,se)=>{const he=k.slice(q.from,q.to),G=se===0;return a.jsx("div",{className:`${e}-line${q.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${q.top}px`,left:`${q.left}px`,width:`${q.width}px`,textAlign:q.justify?void 0:Ie},children:he.map((re,pe)=>{const Pe=E&&G&&q.from===0&&pe===0?re.text.slice(1):re.text,Ce=xc(re.leaf),Y=re.href?a.jsx("a",{className:`${e}-link`,href:re.href,target:re.target,style:Ce,children:Pe}):a.jsx("span",{style:Ce,children:Pe});return a.jsxs("span",{children:[!q.justify&&pe>0?" ":null,Y]},pe)})},`${q.from}-${q.to}-${se}`)}),g&&!D&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:z.map((q,se)=>a.jsx("polygon",{points:q.map(he=>`${he.x},${he.y}`).join(" ")},se))})]}),ne&&ae&&D&&f&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:cw,pointerEvents:"none"},children:a.jsx(jw,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:D,snap:f.snap,stretchToBox:!w,onChange:f.onChange,onCommit:f.onCommit})}),ne),a.jsx("div",{className:`${e}-a11y`,children:Z.map((q,se)=>a.jsx("p",{children:q},se))})]})}function Uw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>Ww(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),x=(e==null?void 0:e.shape)??"rectangle",g=(e==null?void 0:e.customPath)??"",m=(e==null?void 0:e.pathFit)??"stretch",h=s.useMemo(()=>pw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),f=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",R=((e==null?void 0:e.fitText)??"off")==="on",H=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,S=u&&p&&!i,[U,F]=s.useState(!1);s.useEffect(()=>{if(!u||!p){F(!1);return}const O=()=>F(!0),M=()=>F(!1),ee=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],V=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const me of ee)window.addEventListener(me,O);for(const me of V)window.addEventListener(me,M);return()=>{for(const me of ee)window.removeEventListener(me,O);for(const me of V)window.removeEventListener(me,M)}},[u,p]);const _=u&&p&&!i&&typeof l=="function",B=!U,L=Math.max(0,(e==null?void 0:e.pathSnap)??0),[N,k]=s.useState(null),Z=s.useMemo(()=>{if(!_)return null;if(N&&(N.base===g||N.serialized===g))return N.contours;const O=No(g);return O.length?O:null},[_,N,g]),E=m==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Nr&&!!(Z&&!nu(Z,h)),K=s.useCallback((O,M)=>{const ee=Ho(O);k(V=>({base:V&&(V.base===g||V.serialized===g)?V.base:g,serialized:ee,contours:O})),M&&(l==null||l({...e,shape:"custom",customPath:ee}))},[g,l,e]),D=s.useMemo(()=>_?{contours:E?Z:null,snap:L,needsConversion:!E,onConvert:O=>{const M=Ho(O);k({base:M,serialized:M,contours:O}),l==null||l({...e,pathFit:"viewbox",pathViewBox:Nr,customPath:M})},onChange:O=>K(O,!1),onCommit:O=>K(O,!0)}:null,[_,E,Z,L,l,e,K]),[j,$]=s.useState(void 0),v=s.useRef(void 0),w=s.useCallback(O=>{const M=v.current;M!==void 0&&Math.abs(M-O)<.005||(v.current=O,$(O))},[]),P=s.useMemo(()=>R&&typeof j=="number"?j:1,[j,R]),Q=O=>`calc(${O} * var(--${d}-fit, 1))`,z=s.useMemo(()=>{var O,M,ee,V,me;return{fontFamily:oo(e==null?void 0:e.textFontFamily),fontWeight:(O=e==null?void 0:e.textFontSettings)==null?void 0:O.fontWeight,fontStyle:(M=e==null?void 0:e.textFontSettings)==null?void 0:M.fontStyle,fontSize:Q(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:Q(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:Q(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Q(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(ee=e==null?void 0:e.textTextAppearance)==null?void 0:ee.textTransform,textDecoration:(V=e==null?void 0:e.textTextAppearance)==null?void 0:V.textDecoration,fontVariant:(me=e==null?void 0:e.textTextAppearance)==null?void 0:me.fontVariant}},[e,u,d]),T={[`--${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:{...T},children:a.jsx(Xw,{P:d,item:b,shape:x,customPath:g,pathFit:m,viewBox:h,mode:f,align:C,allowOverflow:y,fitEnabled:R,scale:P,onFitScale:w,dropCapLines:H,showGuides:(S||_)&&B,typography:z,imageUrl:f==="avoid"?e==null?void 0:e.image:null,pathEditor:B?D:null})})]})}const Yw=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23791
|
+
`}const ho=7,Hw=3.5,fo=9,fr=8,yr=14,wc=10,Ow=24,Dw=1,Bw=.05,Sc=1.08;function ou(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}}}function jw(e){switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}}function $c(e,t){const n=ou(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*wc,y:n.y+o*wc}}function zw({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,onChange:l,onCommit:d}){const c=s.useRef(null),u=s.useRef(i);u.current=i;const p=s.useRef(null),b=s.useRef(null),x=s.useRef(null),[g,m]=s.useState(null),h=n.width>0?t.width/n.width:1,f=n.height>0?t.height/n.height:1,C=s.useCallback($=>r?{x:($.x-n.x)*h,y:($.y-n.y)*f}:{x:$.x-n.x,y:$.y-n.y},[r,n,h,f]),y=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:r?{x:n.x+($-w.left)/w.width*n.width,y:n.y+(v-w.top)/w.height*n.height}:{x:n.x+($-w.left),y:n.y+(v-w.top)}},[r,n]),R=s.useCallback(($,v)=>{var P;const w=(P=c.current)==null?void 0:P.getBoundingClientRect();return!w||w.width<=0||w.height<=0?{x:0,y:0}:{x:($-w.left)/w.width*t.width,y:(v-w.top)/w.height*t.height}},[t.width,t.height]),H=s.useCallback(($,v)=>{d($,v)},[d]),S=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){if($.stopPropagation(),$.preventDefault(),v.startDistance<=0)return;const T=y($.clientX,$.clientY),O=Math.hypot(T.x-v.origin.x,T.y-v.origin.y),E=Math.max(Bw,O/v.startDistance);if(!v.moved&&Math.abs(E-1)<1e-4)return;v.moved=!0,l(gc(v.startContours,v.origin,E));return}const w=b.current;if(w&&$.pointerId===w.pointerId){$.stopPropagation(),$.preventDefault();const T=y($.clientX,$.clientY),{bbox:O}=w,E=O.maxX-O.minX,ee=O.maxY-O.minY,V=T.x-w.origin.x,ue=T.y-w.origin.y;let Ie=V,ge=ue;if(isFinite(E)&&isFinite(ee))if(r){const ae=Math.min(n.x,n.x+n.width-E),ne=Math.max(n.x,n.x+n.width-E),oe=Math.min(n.y,n.y+n.height-ee),ie=Math.max(n.y,n.y+n.height-ee),Ae=Math.min(ne,Math.max(ae,O.minX+V)),be=Math.min(ie,Math.max(oe,O.minY+ue));Ie=Ae-O.minX,ge=be-O.minY}else{const ae=O.minX-n.x,ne=O.minY-n.y,oe=Math.min(0,t.width-E),ie=Math.max(0,t.width-E),Ae=Math.min(0,t.height-ee),be=Math.max(0,t.height-ee),Me=Math.min(ie,Math.max(oe,ae+V)),q=Math.min(be,Math.max(Ae,ne+ue));Ie=Me-ae,ge=q-ne}if(!w.moved&&Ie===0&&ge===0)return;w.moved=!0,l(Kn(w.startContours,ae=>({x:ae.x+Ie,y:ae.y+ge})));return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;$.stopPropagation(),$.preventDefault();const Q=y($.clientX,$.clientY),z={x:fc(Q.x,o),y:fc(Q.y,o)};if(P.kind==="anchor"){let T=z.x-P.origin.x,O=z.y-P.origin.y;if($.shiftKey&&(Math.abs(T)>Math.abs(O)?O=0:T=0),!P.moved&&T===0&&O===0)return;P.moved=!0,l(yc(u.current,P.contour,P.node,{x:P.anchor.x+T,y:P.anchor.y+O}));return}P.moved=!0,l(Sw(u.current,P.contour,P.node,P.kind,z,P.mirror&&!$.altKey))},U=$=>{const v=x.current;if(v&&$.pointerId===v.pointerId){x.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(v.pointerId)&&z.releasePointerCapture(v.pointerId),v.moved&&H(u.current,{preserveShape:!0});return}const w=b.current;if(w&&$.pointerId===w.pointerId){b.current=null,$.stopPropagation();const z=c.current;z!=null&&z.hasPointerCapture(w.pointerId)&&z.releasePointerCapture(w.pointerId),w.moved?H(u.current,{preserveShape:!0}):m(null);return}const P=p.current;if(!P||$.pointerId!==P.pointerId)return;p.current=null,$.stopPropagation();const Q=c.current;Q!=null&&Q.hasPointerCapture(P.pointerId)&&Q.releasePointerCapture(P.pointerId),P.moved&&H(u.current)},F=$=>{$.stopPropagation()},_=$=>{var v,w;$.stopPropagation(),$.preventDefault(),(v=c.current)==null||v.focus({preventScroll:!0}),b.current={pointerId:$.pointerId,origin:y($.clientX,$.clientY),startContours:ti(i),bbox:vi(i),moved:!1},(w=c.current)==null||w.setPointerCapture($.pointerId)},B=($,v)=>{var T,O;$.stopPropagation(),$.preventDefault(),(T=c.current)==null||T.focus({preventScroll:!0}),m(null);const w=vi(i),P=ou(w,jw(v)),Q=$c(w,v),z=Math.hypot(Q.x-P.x,Q.y-P.y);!isFinite(z)||z<=0||(x.current={pointerId:$.pointerId,corner:v,origin:P,startDistance:z,startContours:ti(i),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId))},L=($,v,w,P)=>{var z,T,O;$.stopPropagation(),$.preventDefault(),(z=c.current)==null||z.focus({preventScroll:!0});const Q=(T=i[w])==null?void 0:T.nodes[P];if(Q){if($.altKey){const E=v==="anchor"?vc(i,w,P):$w(i,w,P,v);if(E===i)return;m(v==="anchor"?null:{contour:w,node:P}),l(E),H(E);return}m({contour:w,node:P}),p.current={kind:v,contour:w,node:P,pointerId:$.pointerId,origin:y($.clientX,$.clientY),anchor:Q.p,mirror:v!=="anchor"&&!!(Q.in&&Q.out),moved:!1},(O=c.current)==null||O.setPointerCapture($.pointerId)}},N=$=>{$.stopPropagation(),$.preventDefault();const v=Kn(i,C),w=Rw(v,R($.clientX,$.clientY));if(!w||w.distance>Ow)return;const{contours:P,nodeIndex:Q}=Cw(i,w.contour,w.segment,w.t);Q<0||(m({contour:w.contour,node:Q}),l(P),H(P))},k=$=>{var E,ee;if($.key==="="||$.key==="+"||$.key==="-"||$.key==="_"){$.preventDefault(),$.stopPropagation();const V=vi(i);if(!isFinite(V.minX)||!isFinite(V.maxX))return;const ue={x:(V.minX+V.maxX)/2,y:(V.minY+V.maxY)/2},ge=$.key==="="||$.key==="+"?Sc:1/Sc,ae=gc(i,ue,ge);l(ae),H(ae,{preserveShape:!0});return}if(!g)return;const{contour:v,node:w}=g;if($.key==="Escape"){$.stopPropagation(),m(null);return}if($.key==="Backspace"||$.key==="Delete"){$.preventDefault(),$.stopPropagation();const V=vc(i,v,w);if(V===i)return;m(null),l(V),H(V);return}const P=o>0?o:Dw,Q=$.shiftKey?P*10:P,z={ArrowLeft:[-Q,0],ArrowRight:[Q,0],ArrowUp:[0,-Q],ArrowDown:[0,Q]}[$.key];if(!z)return;$.preventDefault(),$.stopPropagation();const T=(ee=(E=i[v])==null?void 0:E.nodes[w])==null?void 0:ee.p;if(!T)return;const O=yc(i,v,w,{x:T.x+z[0],y:T.y+z[1]});l(O),H(O)},Z=s.useMemo(()=>Ho(Kn(i,C)),[i,C]),M=s.useMemo(()=>vi(i),[i]),K=C({x:M.minX,y:M.minY}),D={width:C({x:M.maxX,y:M.minY}).x-K.x,height:C({x:M.minX,y:M.maxY}).y-K.y},j=!g&&isFinite(M.minX)&&isFinite(M.maxX)&&M.maxX>M.minX&&M.maxY>M.minY;return a.jsxs("svg",{ref:c,className:`${e}-editor${g?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:k,onPointerDown:()=>{var $;return($=c.current)==null?void 0:$.focus({preventScroll:!0})},onPointerMove:S,onPointerUp:U,onPointerCancel:U,onLostPointerCapture:U,"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>m(null),onClick:N}),a.jsx("path",{className:`${e}-editor-hit`,d:Z,onClick:N}),a.jsx("path",{className:`${e}-editor-outline`,d:Z}),a.jsx("path",{className:`${e}-editor-body`,d:Z,fillRule:"evenodd",onPointerDown:_,onClick:N}),i.map(($,v)=>$.nodes.map((w,P)=>{const Q=(g==null?void 0:g.contour)===v&&(g==null?void 0:g.node)===P,z=C(w.p);return a.jsxs("g",{children:[Q&&["in","out"].map(T=>{const O=w[T];if(!O)return null;const E=C(O);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:z.x,y1:z.y,x2:E.x,y2:E.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:E.x,cy:E.y,r:Hw}),a.jsx("circle",{className:`${e}-editor-grab`,cx:E.x,cy:E.y,r:fo,onPointerDown:ee=>L(ee,T,v,P),onClick:F})]},T)}),a.jsx("rect",{className:`${e}-editor-anchor${Q?` ${e}-editor-anchor-selected`:""}`,x:z.x-ho/2,y:z.y-ho/2,width:ho,height:ho,rx:w.in||w.out?ho/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:z.x-fo,y:z.y-fo,width:fo*2,height:fo*2,onPointerDown:T=>L(T,"anchor",v,P),onClick:F,onDoubleClick:T=>{T.stopPropagation(),T.preventDefault();const O=Tw(i,v,P);l(O),H(O)}})]},`${v}-${P}`)})),j&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:K.x,y:K.y,width:D.width,height:D.height}),["nw","ne","se","sw"].map($=>{const v=C($c(M,$)),w=$==="ne"||$==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:v.x-fr/2,y:v.y-fr/2,width:fr,height:fr}),a.jsx("rect",{className:`${e}-editor-scale-grab${w?` ${e}-editor-scale-grab-nesw`:""}`,x:v.x-yr/2,y:v.y-yr/2,width:yr,height:yr,onPointerDown:P=>B(P,$),onClick:F})]},$)})]})]})}function Vw(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}function Gw(e,t){return 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}function qw(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=Vw(e);(!r||!Gw(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n}function Xw(){return typeof document>"u"?null:document.body}function Uw({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:x,showGuides:g,typography:m,imageUrl:h,pathEditor:f}){var be,Me;const C=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[y,R]=s.useState(null),H=s.useRef(null),[S,U]=s.useState({width:0,height:0}),[F,_]=s.useState(null),[B,L]=s.useState(0),N=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),k=s.useMemo(()=>_w(N),[N]),Z=s.useMemo(()=>Ww(N),[N]),M=x>0?((Me=(be=k[0])==null?void 0:be.text)==null?void 0:Me.charAt(0))??"":"",K=S.height>0?S.width/S.height:1,D=(f==null?void 0:f.contours)??null,j=s.useMemo(()=>{if(D){const he=Ds(D);if(he.length)return Lr(he,r)}const q=i.trim(),se=q?Iw(q,o,r):null;return se&&se.length?se:Zd(n==="custom"?"rectangle":n,K)},[D,n,i,o,r,Math.round(K*100)/100]),$=f==null?void 0:f.onConvert,v=(f==null?void 0:f.needsConversion)??!1,w=s.useMemo(()=>{const q=D??(i.trim()?No(i):null);return!!(q&&nu(q,r))},[D,i,r]),[P,Q]=s.useState(null);Wa(()=>{if(!w){P&&Q(null);return}!P&&S.width>0&&S.height>0&&Q({width:S.width,height:S.height})},[w,S.width,S.height,P]);const z=s.useMemo(()=>{if(!w||S.width<=0||S.height<=0)return j;const q=P??S,se=r.width/q.width,he=r.height/q.height;return j.map(G=>G.map(re=>({x:re.x*se,y:re.y*he})))},[j,w,P,r.width,r.height,S.width,S.height]),T=s.useRef(null);s.useEffect(()=>{if(!(!$||S.width<=0||S.height<=0)){if(w){if(T.current===i)return;const q=D??(i.trim()?No(i):null);if(!(q!=null&&q.length))return;const se=Kn(q,he=>({x:r.x+(he.x-r.x)/S.width*r.width,y:r.y+(he.y-r.y)/S.height*r.height}));T.current=Ho(se),$(se);return}!v||!j.length||$(Kn(tu(j),q=>({x:q.x*Hr,y:q.y*Hr})))}},[v,w,$,j,D,i,r,S.width,S.height]),Wa(()=>{const q=y;if(!q||typeof ResizeObserver>"u")return;const se=()=>{const G=q.getBoundingClientRect();U(re=>Math.abs(re.width-G.width)<.5&&Math.abs(re.height-G.height)<.5?re:{width:G.width,height:G.height})};se();const he=new ResizeObserver(se);return he.observe(q),()=>he.disconnect()},[y]),s.useEffect(()=>{const q=typeof document<"u"?document.fonts:void 0;q!=null&&q.ready&&q.ready.then(()=>{L(se=>se+1)})},[]),Wa(()=>{const q=H.current;if(!q)return;if(!k.length){_(null);return}const se=[],he=document.createDocumentFragment();for(const X of k){const le=document.createElement("span");Object.assign(le.style,xc(X.leaf)),le.textContent=X.text,he.appendChild(le),se.push(le)}const G=document.createElement("span");G.textContent=" ",he.appendChild(G);const re=document.createElement("span");re.textContent=M||"H",re.style.lineHeight="1",he.appendChild(re),q.replaceChildren(he);const me=window.getComputedStyle(q),we=parseFloat(me.fontSize)||16,Pe=parseFloat(me.lineHeight),Ce=Number.isNaN(Pe)?we*1.2:Pe;re.style.fontSize=`${Ce*Math.max(1,x)*mc}px`;const Y=se.map(X=>X.getBoundingClientRect().width),xe=G.getBoundingClientRect().width,pe=M?re.getBoundingClientRect().width:0;q.replaceChildren(),_({widths:Y,spaceWidth:xe,lineHeight:Ce,capWidth:pe})},[k,m,M,x,B,S.width]);const O=F&&M?F.capWidth+F.lineHeight*lw:0,E=s.useMemo(()=>{if(!F||!k.length||S.width<=0||S.height<=0||!u)return 1;const q=G=>bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:G,allowOverflow:!1,capInset:O*G,capLines:M?x:0});if(q(1).placed>=k.length)return 1;if(q(Na).placed<k.length)return Na;let se=Na,he=1;for(let G=0;G<aw;G+=1){const re=(se+he)/2;q(re).placed>=k.length?se=re:he=re}return se},[F,k,S.width,S.height,z,l,d,u,O,M,x]);s.useEffect(()=>{b(E)},[E,b]);const ee=u?Math.min(p,E):1,V=s.useMemo(()=>!F||!k.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:bc({tokens:k,widths:F.widths,spaceWidth:F.spaceWidth,lineHeight:F.lineHeight,width:S.width,height:S.height,rings:z,mode:l,align:d,scale:ee,allowOverflow:c,capInset:O*ee,capLines:M?x:0}),[F,k,S.width,S.height,z,l,d,ee,c,O,M,x]),ue=F?F.lineHeight*ee:0,Ie=d==="justify"?"left":d,ge=!!(f&&D&&S.width>0&&S.height>0),ae=qw(y,ge),ne=ge&&ae?Xw():null,oe=s.useMemo(()=>h&&S.width>0&&S.height>0?dw(z,S):"",[h,z,S.width,S.height]),ie=s.useMemo(()=>h&&S.width>0&&S.height>0?uw(z,S):null,[h,z,S.width,S.height]),Ae=`${C}-pattern`;return a.jsxs("div",{className:`${e}-column`,ref:R,children:[h&&oe&&ie?a.jsxs("svg",{className:`${e}-shape-image`,viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("defs",{children:a.jsx("pattern",{id:Ae,patternUnits:"userSpaceOnUse",x:ie.x,y:ie.y,width:ie.width,height:ie.height,children:a.jsx("image",{href:h,x:0,y:0,width:ie.width,height:ie.height,preserveAspectRatio:"xMidYMid slice"})})}),a.jsx("path",{d:oe,fill:`url(#${Ae})`,fillRule:"evenodd"})]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...m,["--"+e+"-fit"]:ee},children:[a.jsx("div",{className:`${e}-measure`,ref:H,style:m,"aria-hidden":!0}),M&&F&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{top:`${V.capTop}px`,left:`${V.capLeft}px`,fontSize:`${ue*Math.max(1,x)*mc}px`,lineHeight:`${ue*Math.max(1,x)}px`},children:M}),V.segments.map((q,se)=>{const he=k.slice(q.from,q.to),G=se===0;return a.jsx("div",{className:`${e}-line${q.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${q.top}px`,left:`${q.left}px`,width:`${q.width}px`,textAlign:q.justify?void 0:Ie},children:he.map((re,me)=>{const Pe=M&&G&&q.from===0&&me===0?re.text.slice(1):re.text,Ce=xc(re.leaf),Y=re.href?a.jsx("a",{className:`${e}-link`,href:re.href,target:re.target,style:Ce,children:Pe}):a.jsx("span",{style:Ce,children:Pe});return a.jsxs("span",{children:[!q.justify&&me>0?" ":null,Y]},me)})},`${q.from}-${q.to}-${se}`)}),g&&!D&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:z.map((q,se)=>a.jsx("polygon",{points:q.map(he=>`${he.x},${he.y}`).join(" ")},se))})]}),ne&&ae&&D&&f&&Dn.createPortal(a.jsx("div",{"data-selection":"none",style:{position:"fixed",top:ae.top,left:ae.left,width:ae.width,height:ae.height,zIndex:cw,pointerEvents:"none"},children:a.jsx(zw,{P:e,box:{width:ae.width,height:ae.height},viewBox:r,contours:D,snap:f.snap,stretchToBox:!w,onChange:f.onChange,onCommit:f.onCommit})}),ne),a.jsx("div",{className:`${e}-a11y`,children:Z.map((q,se)=>a.jsx("p",{children:q},se))})]})}function Yw({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=W.useScopedStyles(),c=s.useMemo(()=>Nw(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),x=(e==null?void 0:e.shape)??"rectangle",g=(e==null?void 0:e.customPath)??"",m=(e==null?void 0:e.pathFit)??"stretch",h=s.useMemo(()=>pw(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),f=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",C=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",R=((e==null?void 0:e.fitText)??"off")==="on",H=((e==null?void 0:e.dropCap)??"off")==="on"?Math.max(2,Math.round((e==null?void 0:e.dropCapLines)??3)):0,S=u&&p&&!i,[U,F]=s.useState(!1);s.useEffect(()=>{if(!u||!p){F(!1);return}const O=()=>F(!0),E=()=>F(!1),ee=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],V=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const ue of ee)window.addEventListener(ue,O);for(const ue of V)window.addEventListener(ue,E);return()=>{for(const ue of ee)window.removeEventListener(ue,O);for(const ue of V)window.removeEventListener(ue,E)}},[u,p]);const _=u&&p&&!i&&typeof l=="function",B=!U,L=Math.max(0,(e==null?void 0:e.pathSnap)??0),[N,k]=s.useState(null),Z=s.useMemo(()=>{if(!_)return null;if(N&&(N.base===g||N.serialized===g))return N.contours;const O=No(g);return O.length?O:null},[_,N,g]),M=m==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===Nr&&!!(Z&&!nu(Z,h)),K=s.useCallback((O,E,ee)=>{const V=Ho(O);if(k(ue=>({base:ue&&(ue.base===g||ue.serialized===g)?ue.base:g,serialized:V,contours:O})),E){const ue=ee!=null&&ee.preserveShape?e==null?void 0:e.shape:"custom";l==null||l({...e,shape:ue,customPath:V})}},[g,l,e]),D=s.useMemo(()=>_?{contours:M?Z:null,snap:L,needsConversion:!M,onConvert:O=>{const E=Ho(O);k({base:E,serialized:E,contours:O}),l==null||l({...e,pathFit:"viewbox",pathViewBox:Nr,customPath:E})},onChange:O=>K(O,!1),onCommit:(O,E)=>K(O,!0,E)}:null,[_,M,Z,L,l,e,K]),[j,$]=s.useState(void 0),v=s.useRef(void 0),w=s.useCallback(O=>{const E=v.current;E!==void 0&&Math.abs(E-O)<.005||(v.current=O,$(O))},[]),P=s.useMemo(()=>R&&typeof j=="number"?j:1,[j,R]),Q=O=>`calc(${O} * var(--${d}-fit, 1))`,z=s.useMemo(()=>{var O,E,ee,V,ue;return{fontFamily:oo(e==null?void 0:e.textFontFamily),fontWeight:(O=e==null?void 0:e.textFontSettings)==null?void 0:O.fontWeight,fontStyle:(E=e==null?void 0:e.textFontSettings)==null?void 0:E.fontStyle,fontSize:Q(W.scalingValue((e==null?void 0:e.textFontSize)??.012,u)),lineHeight:Q(W.scalingValue((e==null?void 0:e.textLineHeight)??(e==null?void 0:e.textFontSize)??.012,u)),letterSpacing:Q(W.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:Q(W.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(ee=e==null?void 0:e.textTextAppearance)==null?void 0:ee.textTransform,textDecoration:(V=e==null?void 0:e.textTextAppearance)==null?void 0:V.textDecoration,fontVariant:(ue=e==null?void 0:e.textTextAppearance)==null?void 0:ue.fontVariant}},[e,u,d]),T={[`--${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:{...T},children:a.jsx(Uw,{P:d,item:b,shape:x,customPath:g,pathFit:m,viewBox:h,mode:f,align:C,allowOverflow:y,fitEnabled:R,scale:P,onFitScale:w,dropCapLines:H,showGuides:(S||_)&&B,typography:z,imageUrl:f==="avoid"?e==null?void 0:e.image:null,pathEditor:B?D:null})})]})}const Kw=`import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
23792
23792
|
import type React from 'react';
|
|
23793
23793
|
import { createPortal } from 'react-dom';
|
|
23794
23794
|
import { CommonComponentProps } from '../props';
|
|
@@ -24519,15 +24519,47 @@ function editablePathTargetRect(previous?: {
|
|
|
24519
24519
|
return { x: bbox.minX, y: bbox.minY, width, height };
|
|
24520
24520
|
}
|
|
24521
24521
|
|
|
24522
|
-
/**
|
|
24522
|
+
/**
|
|
24523
|
+
* True when path coords look like legacy rematerialized pixels (hundreds of
|
|
24524
|
+
* units), not a 0–100 edit path whose bezier handles only poke slightly out.
|
|
24525
|
+
*/
|
|
24523
24526
|
function pathExceedsEditViewBox(contours: VecContour[], viewBox: ViewBox, pad = 1): boolean {
|
|
24524
24527
|
if (!contours.length) return false;
|
|
24525
24528
|
const bbox = contoursBBox(contours);
|
|
24526
24529
|
if (!isFinite(bbox.minX) || !isFinite(bbox.maxX)) return false;
|
|
24527
|
-
|
|
24528
|
-
|
|
24529
|
-
|
|
24530
|
-
|
|
24530
|
+
// Curved presets (esp. wave) overshoot the edit viewBox by a few units via
|
|
24531
|
+
// smooth handles. Require ~half a viewBox of overflow so those aren't treated
|
|
24532
|
+
// as pixel-space paths and wrongly shrunk by boxWidth/viewBox.
|
|
24533
|
+
const padX = Math.max(pad, viewBox.width * 0.5);
|
|
24534
|
+
const padY = Math.max(pad, viewBox.height * 0.5);
|
|
24535
|
+
return bbox.minX < viewBox.x - padX
|
|
24536
|
+
|| bbox.minY < viewBox.y - padY
|
|
24537
|
+
|| bbox.maxX > viewBox.x + viewBox.width + padX
|
|
24538
|
+
|| bbox.maxY > viewBox.y + viewBox.height + padY;
|
|
24539
|
+
}
|
|
24540
|
+
|
|
24541
|
+
/** Scale contours so their drawn outline fits inside \`rect\` (uniform, centered). */
|
|
24542
|
+
function fitContoursInRect(
|
|
24543
|
+
contours: VecContour[],
|
|
24544
|
+
rect: { x: number; y: number; width: number; height: number },
|
|
24545
|
+
): VecContour[] {
|
|
24546
|
+
if (!contours.length) return contours;
|
|
24547
|
+
const bbox = contoursBBox(contours);
|
|
24548
|
+
const width = bbox.maxX - bbox.minX;
|
|
24549
|
+
const height = bbox.maxY - bbox.minY;
|
|
24550
|
+
if (!(width > 0) || !(height > 0)) return contours;
|
|
24551
|
+
const inside = bbox.minX >= rect.x - 1e-6
|
|
24552
|
+
&& bbox.minY >= rect.y - 1e-6
|
|
24553
|
+
&& bbox.maxX <= rect.x + rect.width + 1e-6
|
|
24554
|
+
&& bbox.maxY <= rect.y + rect.height + 1e-6;
|
|
24555
|
+
if (inside) return contours;
|
|
24556
|
+
const scale = Math.min(rect.width / width, rect.height / height);
|
|
24557
|
+
const originX = rect.x + (rect.width - width * scale) / 2;
|
|
24558
|
+
const originY = rect.y + (rect.height - height * scale) / 2;
|
|
24559
|
+
return mapContours(contours, point => ({
|
|
24560
|
+
x: originX + (point.x - bbox.minX) * scale,
|
|
24561
|
+
y: originY + (point.y - bbox.minY) * scale,
|
|
24562
|
+
}));
|
|
24531
24563
|
}
|
|
24532
24564
|
|
|
24533
24565
|
/** Turns a preset into the editable viewBox path the editor persists after a shape pick. */
|
|
@@ -24543,13 +24575,18 @@ export function settingsForEditablePreset(
|
|
|
24543
24575
|
} {
|
|
24544
24576
|
const target = editablePathTargetRect(previous);
|
|
24545
24577
|
const rings = getPresetRings(shape === 'custom' ? 'rectangle' : shape, aspect);
|
|
24546
|
-
|
|
24547
|
-
|
|
24548
|
-
|
|
24578
|
+
// Fit after mapping so curved-preset handle overshoot stays inside the target
|
|
24579
|
+
// (and the edit viewBox), avoiding false legacy-pixel migration.
|
|
24580
|
+
const contours = fitContoursInRect(
|
|
24581
|
+
mapContours(
|
|
24582
|
+
ringsToContours(rings),
|
|
24583
|
+
point => ({ x: point.x * target.width + target.x, y: point.y * target.height + target.y }),
|
|
24584
|
+
),
|
|
24585
|
+
target,
|
|
24549
24586
|
);
|
|
24550
24587
|
return {
|
|
24551
|
-
// Keep the preset id so the settings dropdown reflects the pick;
|
|
24552
|
-
// edits later flip to \`custom\` via writePath.
|
|
24588
|
+
// Keep the preset id so the settings dropdown reflects the pick; point
|
|
24589
|
+
// edits later flip to \`custom\` via writePath (move/scale keep the id).
|
|
24553
24590
|
shape,
|
|
24554
24591
|
customPath: serializeContours(contours),
|
|
24555
24592
|
pathFit: 'viewbox',
|
|
@@ -25344,6 +25381,11 @@ function scaleHandlePoint(
|
|
|
25344
25381
|
};
|
|
25345
25382
|
}
|
|
25346
25383
|
|
|
25384
|
+
type PathCommitOptions = {
|
|
25385
|
+
/** Whole-shape move/scale keeps the preset id; point edits diverge to \`custom\`. */
|
|
25386
|
+
preserveShape?: boolean;
|
|
25387
|
+
};
|
|
25388
|
+
|
|
25347
25389
|
type PathEditorProps = {
|
|
25348
25390
|
P: string;
|
|
25349
25391
|
box: { width: number; height: number };
|
|
@@ -25353,7 +25395,7 @@ type PathEditorProps = {
|
|
|
25353
25395
|
/** When true, map the edit viewBox across the full component box (presets). */
|
|
25354
25396
|
stretchToBox: boolean;
|
|
25355
25397
|
onChange: (contours: VecContour[]) => void;
|
|
25356
|
-
onCommit: (contours: VecContour[]) => void;
|
|
25398
|
+
onCommit: (contours: VecContour[], options?: PathCommitOptions) => void;
|
|
25357
25399
|
};
|
|
25358
25400
|
|
|
25359
25401
|
function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onChange, onCommit }: PathEditorProps) {
|
|
@@ -25411,8 +25453,8 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onCh
|
|
|
25411
25453
|
|
|
25412
25454
|
// Keep path coords in viewBox space (0–100) so top/left stay proportional
|
|
25413
25455
|
// when the component box scales with the article — never rematerialize to px.
|
|
25414
|
-
const commitContours = useCallback((next: VecContour[]) => {
|
|
25415
|
-
onCommit(next);
|
|
25456
|
+
const commitContours = useCallback((next: VecContour[], options?: PathCommitOptions) => {
|
|
25457
|
+
onCommit(next, options);
|
|
25416
25458
|
}, [onCommit]);
|
|
25417
25459
|
|
|
25418
25460
|
// The pointer is captured by the overlay for the whole drag, so the move and
|
|
@@ -25511,7 +25553,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onCh
|
|
|
25511
25553
|
event.stopPropagation();
|
|
25512
25554
|
const svg = svgRef.current;
|
|
25513
25555
|
if (svg?.hasPointerCapture(shapeScale.pointerId)) svg.releasePointerCapture(shapeScale.pointerId);
|
|
25514
|
-
if (shapeScale.moved) commitContours(contoursRef.current);
|
|
25556
|
+
if (shapeScale.moved) commitContours(contoursRef.current, { preserveShape: true });
|
|
25515
25557
|
return;
|
|
25516
25558
|
}
|
|
25517
25559
|
const shapeDrag = shapeDragRef.current;
|
|
@@ -25521,7 +25563,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onCh
|
|
|
25521
25563
|
const svg = svgRef.current;
|
|
25522
25564
|
if (svg?.hasPointerCapture(shapeDrag.pointerId)) svg.releasePointerCapture(shapeDrag.pointerId);
|
|
25523
25565
|
if (shapeDrag.moved) {
|
|
25524
|
-
commitContours(contoursRef.current);
|
|
25566
|
+
commitContours(contoursRef.current, { preserveShape: true });
|
|
25525
25567
|
} else {
|
|
25526
25568
|
// A click that never travels deselects, same as the background surface.
|
|
25527
25569
|
setSelection(null);
|
|
@@ -25647,7 +25689,7 @@ function PretextPathEditor({ P, box, viewBox, contours, snap, stretchToBox, onCh
|
|
|
25647
25689
|
const factor = grow ? KEYBOARD_SCALE_STEP : 1 / KEYBOARD_SCALE_STEP;
|
|
25648
25690
|
const next = scaleContours(contours, origin, factor);
|
|
25649
25691
|
onChange(next);
|
|
25650
|
-
commitContours(next);
|
|
25692
|
+
commitContours(next, { preserveShape: true });
|
|
25651
25693
|
return;
|
|
25652
25694
|
}
|
|
25653
25695
|
if (!selection) return;
|
|
@@ -25921,7 +25963,7 @@ type PathEditorBinding = {
|
|
|
25921
25963
|
needsConversion: boolean;
|
|
25922
25964
|
onConvert: (contours: VecContour[]) => void;
|
|
25923
25965
|
onChange: (contours: VecContour[]) => void;
|
|
25924
|
-
onCommit: (contours: VecContour[]) => void;
|
|
25966
|
+
onCommit: (contours: VecContour[], options?: PathCommitOptions) => void;
|
|
25925
25967
|
};
|
|
25926
25968
|
|
|
25927
25969
|
function PretextColumn({
|
|
@@ -26382,7 +26424,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26382
26424
|
&& (settings?.pathViewBox ?? '') === EDIT_VIEW_BOX
|
|
26383
26425
|
&& Boolean(editContours && !pathExceedsEditViewBox(editContours, viewBox));
|
|
26384
26426
|
|
|
26385
|
-
const writePath = useCallback((next: VecContour[], commit: boolean) => {
|
|
26427
|
+
const writePath = useCallback((next: VecContour[], commit: boolean, options?: PathCommitOptions) => {
|
|
26386
26428
|
const serialized = serializeContours(next);
|
|
26387
26429
|
setDraft(previous => ({
|
|
26388
26430
|
base: previous && (previous.base === customPath || previous.serialized === customPath)
|
|
@@ -26392,8 +26434,10 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26392
26434
|
contours: next,
|
|
26393
26435
|
}));
|
|
26394
26436
|
if (commit) {
|
|
26395
|
-
//
|
|
26396
|
-
|
|
26437
|
+
// Point/topology edits diverge from the named preset; whole-shape
|
|
26438
|
+
// move/scale only updates the path and keeps the dropdown selection.
|
|
26439
|
+
const nextShape = options?.preserveShape ? settings?.shape : 'custom';
|
|
26440
|
+
onUpdateSettings?.({ ...settings, shape: nextShape, customPath: serialized });
|
|
26397
26441
|
}
|
|
26398
26442
|
}, [customPath, onUpdateSettings, settings]);
|
|
26399
26443
|
|
|
@@ -26414,7 +26458,7 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26414
26458
|
});
|
|
26415
26459
|
},
|
|
26416
26460
|
onChange: (next: VecContour[]) => writePath(next, false),
|
|
26417
|
-
onCommit: (next: VecContour[]) => writePath(next, true),
|
|
26461
|
+
onCommit: (next: VecContour[], options?: PathCommitOptions) => writePath(next, true, options),
|
|
26418
26462
|
};
|
|
26419
26463
|
}, [pathEditing, isEditablePath, editContours, pathSnap, onUpdateSettings, settings, writePath]);
|
|
26420
26464
|
|
|
@@ -26485,4 +26529,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
26485
26529
|
</>
|
|
26486
26530
|
);
|
|
26487
26531
|
}
|
|
26488
|
-
`,Cc=[...Kd],
|
|
26532
|
+
`,Cc=[...Kd],Zw={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Jw={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",title:"Shape",display:{type:"drop-down",label:"Shape",enum:Cc},enum:Cc},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},dropCap:{type:"string",scope:"common",title:"Drop cap",display:{type:"toggle-cycle",enum:["off","on"]}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:2,max:8,step:1,display:{type:"numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"Background",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Zw.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link",display:{type:"style-panel-color-picker"}}},defaults:{shape:"diamond",customPath:"",pathSnap:0,pathFit:"stretch",shapeMode:"A",fitText:"off",dropCap:"off",dropCapLines:3,image:null,backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.011,textLineHeight:.0155,textLetterSpacing:0,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","dropCap","dropCapLines","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",items:["shape"]},{type:"row",items:["image","dropCap"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Style is viewed by many as a shallow obsession with disembodied surfaces. However our activities as designers are based on style’s function as a cultural communicator. A vocabulary or set of formal characteristics constitutes a particular style, recognized most frequently in retrospect. Style itself is the visual language of a culture: in fashion, in consumer goods, in art, in literature, in all media. Style is ephemeral; it is timely. To be in style is to embody the influences and values of your time."}]}]}]}},Qw={element:Yw,id:"pretext",name:"Pretext",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Kd.indexOf(n)===-1?e:{...e,...ww(n,1,t)}},defaultSize:{d:{width:380,height:382},t:{width:380,height:382},m:{width:334,height:336}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:Jw,sourceCode:Kw,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},eS=[fm,$m,vx,hg,Cg,Fg,Qg,Ch,Mh,Hh,df,iy,sv,fv,Jv,cx,Ex,L0,Bx,z0,bb,ow,Qw];exports.components=eS;exports.isSchemaV1=su;
|