@cntrl-site/components 1.0.82-alpha.0 → 1.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Pretext/imageUtils.d.ts +0 -10
- package/dist/index.js +41 -41
- package/dist/index.mjs +3876 -3887
- 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"),St=require("classnames"),j=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Gn=require("react-dom");function zu(e){return e.type==="object"&&e.version===1}const Bu="ControlSlider-module__wrapper___sHEkd",Vu="ControlSlider-module__hoverArrow___A-dOH",Gu="ControlSlider-module__sliderItem___QQSkR",qu="ControlSlider-module__sliderImage___9hRl-",Xu="ControlSlider-module__arrow___05ghY",Uu="ControlSlider-module__arrowVertical___tBfVN",Yu="ControlSlider-module__nextArrow___-30Yc",Ku="ControlSlider-module__arrowInner___aEra3",Zu="ControlSlider-module__arrowIcon___S4ztF",Ju="ControlSlider-module__arrowImg___2dwJW",Qu="ControlSlider-module__mirror___brd6U",ep="ControlSlider-module__pagination___bicLF",tp="ControlSlider-module__paginationInner___bT-P-",np="ControlSlider-module__paginationVertical___zYqKw",ip="ControlSlider-module__paginationItem___nTRbk",op="ControlSlider-module__dot___p1Qun",rp="ControlSlider-module__activeDot___LHFaj",ap="ControlSlider-module__paginationInsideBottom___R3FWn",sp="ControlSlider-module__paginationInsideTop___V-qb-",lp="ControlSlider-module__paginationOutsideBottom___14w8D",cp="ControlSlider-module__paginationOutsideTop___SCLqB",dp="ControlSlider-module__paginationInsideLeft___yOBRZ",up="ControlSlider-module__paginationInsideRight___Rtt3o",pp="ControlSlider-module__paginationOutsideLeft___lahaw",mp="ControlSlider-module__paginationOutsideRight___EtuQa",gp="ControlSlider-module__imgWrapper___UjEgB",hp="ControlSlider-module__captionBlock___dJ6-j",fp="ControlSlider-module__captionTextWrapper___HFlpf",yp="ControlSlider-module__captionText___uGBVc",vp="ControlSlider-module__active___WZK4G",xp="ControlSlider-module__withPointerEvents___t-18M",bp="ControlSlider-module__topLeftAlignment___zjnGM",wp="ControlSlider-module__topCenterAlignment___gD1xW",Sp="ControlSlider-module__topRightAlignment___NMapS",$p="ControlSlider-module__middleLeftAlignment___OnUrY",Cp="ControlSlider-module__middleCenterAlignment___Tdkl0",Tp="ControlSlider-module__middleRightAlignment___wEbfX",Lp="ControlSlider-module__bottomLeftAlignment___cTP2-",Rp="ControlSlider-module__bottomCenterAlignment___c54fB",Ip="ControlSlider-module__bottomRightAlignment___kEwrz",Ep="ControlSlider-module__clickOverlay___DZA28",Mp="ControlSlider-module__contain___pLyq7",Pp="ControlSlider-module__cover___KdDat",wt={wrapper:Bu,hoverArrow:Vu,sliderItem:Gu,sliderImage:qu,arrow:Xu,arrowVertical:Uu,nextArrow:Yu,arrowInner:Ku,arrowIcon:Zu,arrowImg:Ju,mirror:Qu,pagination:ep,paginationInner:tp,paginationVertical:np,paginationItem:ip,dot:op,activeDot:rp,paginationInsideBottom:ap,paginationInsideTop:sp,paginationOutsideBottom:lp,paginationOutsideTop:cp,paginationInsideLeft:dp,paginationInsideRight:up,paginationOutsideLeft:pp,paginationOutsideRight:mp,imgWrapper:gp,captionBlock:hp,captionTextWrapper:fp,captionText:yp,active:vp,withPointerEvents:xp,topLeftAlignment:bp,topCenterAlignment:wp,topRightAlignment:Sp,middleLeftAlignment:$p,middleCenterAlignment:Cp,middleRightAlignment:Tp,bottomLeftAlignment:Lp,bottomCenterAlignment:Rp,bottomRightAlignment:Ip,clickOverlay:Ep,contain:Mp,cover:Pp};function kp(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 Ap(e,t,n){return t&&kp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var dl="(prefers-reduced-motion: reduce)",Bi=1,Fp=2,Ji=3,mo=4,Xo=5,Er=6,_r=7,Wp={CREATED:Bi,MOUNTED:Fp,IDLE:Ji,MOVING:mo,SCROLLING:Xo,DRAGGING:Er,DESTROYED:_r};function Bn(e){e.length=0}function li(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ut(e){return e.bind.apply(e,[null].concat(li(arguments,1)))}var id=setTimeout,es=function(){};function ul(e){return requestAnimationFrame(e)}function Kr(e,t){return typeof t===e}function Fo(e){return!Is(e)&&Kr("object",e)}var Rs=Array.isArray,od=Ut(Kr,"function"),ii=Ut(Kr,"string"),Uo=Ut(Kr,"undefined");function Is(e){return e===null}function rd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Yo(e){return Rs(e)?e:[e]}function bn(e,t){Yo(e).forEach(t)}function Es(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Yo(t)),e}function Hn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function kn(e,t){Hn(e,ii(t)?t.split(" "):t,!0)}function Ko(e,t){bn(t,e.appendChild.bind(e))}function Ms(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Wo(e,t){return rd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ad(e,t){var n=e?li(e.children):[];return t?n.filter(function(i){return Wo(i,t)}):n}function Zo(e,t){return t?ad(e,t)[0]:e.firstElementChild}var _o=Object.keys;function Ci(e,t,n){return e&&(n?_o(e).reverse():_o(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function No(e){return li(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function Zn(e){return li(arguments,1).forEach(function(t){Ci(t,function(n,i){Rs(n)?e[i]=n.slice():Fo(n)?e[i]=Zn({},Fo(e[i])?e[i]:{},n):e[i]=n})}),e}function pl(e,t){bn(t||_o(e),function(n){delete e[n]})}function An(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Et(e,t,n){Fo(t)?Ci(t,function(i,o){Et(e,o,i)}):bn(e,function(i){Is(n)||n===""?An(i,t):i.setAttribute(t,String(n))})}function Xi(e,t,n){var i=document.createElement(e);return t&&(ii(t)?kn(i,t):Et(i,t)),n&&Ko(n,i),i}function Sn(e,t,n){if(Uo(n))return getComputedStyle(e)[t];Is(n)||(e.style[t]=""+n)}function Ho(e,t){Sn(e,"display",t)}function sd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function ml(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Li(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ld(e){return Zo(new DOMParser().parseFromString(e,"text/html").body)}function Nn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function cd(e,t){return e&&e.querySelector(t)}function Ps(e,t){return t?li(e.querySelectorAll(t)):[]}function On(e,t){Hn(e,t,!1)}function ts(e){return e.timeStamp}function gi(e){return ii(e)?e:e?e+"px":""}var Jo="splide",ks="data-"+Jo;function Mo(e,t){if(!e)throw new Error("["+Jo+"] "+(t||""))}var oi=Math.min,Nr=Math.max,Hr=Math.floor,Oo=Math.ceil,un=Math.abs;function dd(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=oi(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Oi(e,t,n){var i=oi(t,n),o=Nr(t,n);return oi(Nr(i,e),o)}function ns(e){return+(e>0)-+(e<0)}function is(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function As(e){return e<10?"0"+e:""+e}var gl={};function _p(e){return""+e+As(gl[e]=(gl[e]||0)+1)}function ud(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,b){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,b,c,g])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===x&&(!c||b[3]===c)?(b[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){bn(l,function(u){u&&bn(d,function(p){p.split(" ").forEach(function(x){var b=x.split(".");c(u,b[0],b[1])})})})}function r(){e.forEach(function(l){l[4]()}),Bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var ci="mounted",os="ready",Vn="move",go="moved",Fs="click",pd="active",md="inactive",gd="visible",hd="hidden",en="refresh",cn="updated",Qi="resize",Zr="resized",fd="drag",yd="dragging",vd="dragged",Jr="scroll",Ei="scrolled",Np="overflow",Ws="destroy",xd="arrows:mounted",bd="arrows:updated",wd="pagination:mounted",Sd="pagination:updated",_s="navigation:mounted",Ns="autoplay:play",$d="autoplay:playing",Hs="autoplay:pause",Os="lazyload:loaded",Cd="sk",Td="sh",Or="ei";function Jt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ud();function i(r,l){n.bind(t,Yo(r).join(" "),function(d){l.apply(l,Rs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,li(arguments,1))}return e&&e.event.on(Ws,n.destroy),No(n,{bus:t,on:i,off:Ut(n.unbind,t),emit:o})}function Qr(e,t,n,i){var o=Date.now,r,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?oi((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return b();d=ul(p)}}function x(I){I||g(),r=o()-(I?l*e:0),c=!1,d=ul(p)}function b(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(I){e=I}function v(){return c}return{start:x,rewind:m,pause:b,cancel:g,set:f,isPaused:v}}function Hp(e){var t=e;function n(o){t=o}function i(o){return Es(Yo(o),t)}return{set:n,is:i}}function Op(e,t){var n=Qr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Dp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ud(),d=[];function c(){var g=n.mediaQuery==="min";_o(o).sort(function(f,v){return g?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(g?"min":"max")+"-width:"+f+"px)")}),p(r,dl),x()}function u(g){g&&l.destroy()}function p(g,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([g,v])}function x(){var g=i.is(_r),f=n.direction,v=d.reduce(function(I,y){return Zn(I,y[1].matches?y[0]:{})},{});pl(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function b(g){matchMedia(dl).matches&&(g?Zn(n,r):pl(n,_o(r)))}function m(g,f,v){Zn(n,g),f&&Zn(Object.getPrototypeOf(n),g),(v||!i.is(Bi))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:b,set:m}}var ea="Arrow",ta=ea+"Left",na=ea+"Right",Ld=ea+"Up",Rd=ea+"Down",hl="rtl",ia="ttb",fa={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ld,na],ArrowRight:[Rd,ta]};function jp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===hl&&!l?1:d===ia?0:-1;return fa[r]&&fa[r][c]||r.replace(/width|left|right/i,function(u,p){var x=fa[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===hl?1:-1)}return{resolve:i,orient:o}}var Dn="role",Ui="tabindex",zp="disabled",Cn="aria-",Qo=Cn+"controls",Id=Cn+"current",fl=Cn+"selected",vn=Cn+"label",Ds=Cn+"labelledby",Ed=Cn+"hidden",js=Cn+"orientation",Do=Cn+"roledescription",yl=Cn+"live",vl=Cn+"busy",xl=Cn+"atomic",zs=[Dn,Ui,zp,Qo,Id,vn,Ds,Ed,js,Do],Wn=Jo+"__",di="is-",ya=Jo,bl=Wn+"track",Bp=Wn+"list",oa=Wn+"slide",Md=oa+"--clone",Vp=oa+"__container",Bs=Wn+"arrows",ra=Wn+"arrow",Pd=ra+"--prev",kd=ra+"--next",aa=Wn+"pagination",Ad=aa+"__page",Gp=Wn+"progress",qp=Gp+"__bar",Xp=Wn+"toggle",Up=Wn+"spinner",Yp=Wn+"sr",Kp=di+"initialized",Ri=di+"active",Fd=di+"prev",Wd=di+"next",rs=di+"visible",as=di+"loading",_d=di+"focus-in",Nd=di+"overflow",Zp=[Ri,rs,Fd,Wd,as,_d,Nd],Jp={slide:oa,clone:Md,arrows:Bs,arrow:ra,prev:Pd,next:kd,pagination:aa,page:Ad,spinner:Up};function Qp(e,t){if(od(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Wo(n,t);)n=n.parentElement;return n}var em=5,wl=200,Hd="touchstart mousedown",va="touchmove mousemove",xa="touchend touchcancel mouseup click";function tm(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],b,m,g;function f(){w(),V(),y()}function v(){o(en,I),o(en,f),o(cn,y),r(document,Hd+" keydown",function(M){g=M.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Hn(l,_d,!!g)})}function I(M){var F=zs.concat("style");Bn(u),On(l,p),On(b,x),An([b,m],F),An(l,M?F:["style",Do])}function y(){On(l,p),On(b,x),p=Y(ya),x=Y(bl),kn(l,p),kn(b,x),Et(l,vn,n.label),Et(l,Ds,n.labelledby)}function w(){b=z("."+bl),m=Zo(b,"."+Bp),Mo(b&&m,"A track/list element is missing."),Mr(u,ad(m,"."+oa+":not(."+Md+")")),Ci({arrows:Bs,pagination:aa,prev:Pd,next:kd,bar:qp,toggle:Xp},function(M,F){c[F]=z("."+M)}),No(c,{root:l,track:b,list:m,slides:u})}function V(){var M=l.id||_p(Jo),F=n.role;l.id=M,b.id=b.id||M+"-track",m.id=m.id||M+"-list",!$n(l,Dn)&&l.tagName!=="SECTION"&&F&&Et(l,Dn,F),Et(l,Do,d.carousel),Et(m,Dn,"presentation")}function z(M){var F=cd(l,M);return F&&Qp(F,"."+ya)===l?F:void 0}function Y(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===ya&&Ri]}return No(c,{setup:f,mount:v,destroy:I})}var eo="slide",ho="loop",er="fade";function nm(e,t,n,i){var o=Jt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,b=p.updateOnMove,m=p.i18n,g=p.pagination,f=p.slideFocus,v=c.Direction.resolve,I=$n(i,"style"),y=$n(i,vn),w=n>-1,V=Zo(i,"."+Vp),z;function Y(){w||(i.id=u.id+"-slide"+As(t+1),Et(i,Dn,g?"tabpanel":"group"),Et(i,Do,m.slide),Et(i,vn,y||is(m.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",Ut(l,Fs,Z)),d(i,"keydown",Ut(l,Cd,Z)),r([go,Td,Ei],L),r(_s,K),b&&r(Vn,T)}function F(){z=!0,o.destroy(),On(i,Zp),An(i,zs),Et(i,"style",I),Et(i,vn,y||"")}function K(){var $=e.splides.map(function(H){var B=H.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");Et(i,vn,is(m.slideX,(w?n:t)+1)),Et(i,Qo,$),Et(i,Dn,f?"button":""),f&&An(i,Do)}function T(){z||L()}function L(){if(!z){var $=e.index;W(),O(),Hn(i,Fd,t===$-1),Hn(i,Wd,t===$+1)}}function W(){var $=E();$!==ml(i,Ri)&&(Hn(i,Ri,$),Et(i,Id,x&&$||""),l($?pd:md,Z))}function O(){var $=_(),H=!$&&(!E()||w);if(e.state.is([mo,Xo])||Et(i,Ed,H||""),Et(Ps(i,p.focusableNodes||""),Ui,H?-1:""),f&&Et(i,Ui,H?-1:0),$!==ml(i,rs)&&(Hn(i,rs,$),l($?gd:hd,Z)),!$&&document.activeElement===i){var B=c.Slides.getAt(e.index);B&&sd(B.slide)}}function C($,H,B){Sn(B&&V||i,$,H)}function E(){var $=e.index;return $===t||p.cloneStatus&&$===n}function _(){if(e.is(er))return E();var $=fn(c.Elements.track),H=fn(i),B=v("left",!0),ce=v("right",!0);return Hr($[B])<=Oo(H[B])&&Hr(H[ce])<=Oo($[ce])}function S($,H){var B=un($-t);return!w&&(p.rewind||e.is(ho))&&(B=oi(B,e.length-B)),B<=H}var Z={index:t,slideIndex:n,slide:i,container:V,isClone:w,mount:Y,destroy:F,update:L,style:C,isWithin:S};return Z}function im(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){b(),o(en,m),o(en,b)}function b(){c.forEach(function(L,W){f(L,W,-1)})}function m(){z(function(L){L.destroy()}),Bn(p)}function g(){z(function(L){L.update()})}function f(L,W,O){var C=nm(e,W,O,L);C.mount(),p.push(C),p.sort(function(E,_){return E.index-_.index})}function v(L){return L?Y(function(W){return!W.isClone}):p}function I(L){var W=t.Controller,O=W.toIndex(L),C=W.hasFocus()?1:n.perPage;return Y(function(E){return Pr(E.index,O,O+C-1)})}function y(L){return Y(L)[0]}function w(L,W){bn(L,function(O){if(ii(O)&&(O=ld(O)),rd(O)){var C=c[W];C?Ms(O,C):Ko(u,O),kn(O,n.classes.slide),F(O,Ut(r,Qi))}}),r(en)}function V(L){Li(Y(L).map(function(W){return W.slide})),r(en)}function z(L,W){v(W).forEach(L)}function Y(L){return p.filter(od(L)?L:function(W){return ii(L)?Wo(W.slide,L):Es(Yo(L),W.index)})}function M(L,W,O){z(function(C){C.style(L,W,O)})}function F(L,W){var O=Ps(L,"img"),C=O.length;C?O.forEach(function(E){l(E,"load error",function(){--C||W()})}):W()}function K(L){return L?c.length:p.length}function T(){return p.length>n.perPage}return{mount:x,destroy:m,update:g,register:f,get:v,getIn:I,getAt:y,add:w,remove:V,forEach:z,filter:Y,style:M,getLength:K,isEnough:T}}function om(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,b=u.list,m=d.getAt,g=d.style,f,v,I;function y(){w(),r(window,"resize load",Op(Ut(l,Qi))),o([cn,en],w),o(Qi,V)}function w(){f=n.direction===ia,Sn(p,"maxWidth",gi(n.width)),Sn(x,c("paddingLeft"),z(!1)),Sn(x,c("paddingRight"),z(!0)),V(!0)}function V(Z){var $=fn(p);(Z||v.width!==$.width||v.height!==$.height)&&(Sn(x,"height",Y()),g(c("marginRight"),gi(n.gap)),g("width",F()),g("height",K(),!0),v=$,l(Zr),I!==(I=S())&&(Hn(p,Nd,I),l(Np,I)))}function z(Z){var $=n.padding,H=c(Z?"right":"left");return $&&gi($[H]||(Fo($)?0:$))||"0px"}function Y(){var Z="";return f&&(Z=M(),Mo(Z,"height or heightRatio is missing."),Z="calc("+Z+" - "+z(!1)+" - "+z(!0)+")"),Z}function M(){return gi(n.height||fn(b).width*n.heightRatio)}function F(){return n.autoWidth?null:gi(n.fixedWidth)||(f?"":T())}function K(){return gi(n.fixedHeight)||(f?n.autoHeight?null:T():M())}function T(){var Z=gi(n.gap);return"calc((100%"+(Z&&" + "+Z)+")/"+(n.perPage||1)+(Z&&" - "+Z)+")"}function L(){return fn(b)[c("width")]}function W(Z,$){var H=m(Z||0);return H?fn(H.slide)[c("width")]+($?0:E()):0}function O(Z,$){var H=m(Z);if(H){var B=fn(H.slide)[c("right")],ce=fn(b)[c("left")];return un(B-ce)+($?0:E())}return 0}function C(Z){return O(e.length-1)-O(0)+W(0,Z)}function E(){var Z=m(0);return Z&&parseFloat(Sn(Z.slide,c("marginRight")))||0}function _(Z){return parseFloat(Sn(x,c("padding"+(Z?"Right":"Left"))))||0}function S(){return e.is(er)||C(!0)>L()}return{mount:y,resize:V,listSize:L,slideSize:W,sliderSize:C,totalSize:O,getPadding:_,isOverflow:S}}var rm=2;function am(e,t,n){var i=Jt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([cn,Qi],m),(u=v())&&(g(u),t.Layout.resize(!0))}function x(){b(),p()}function b(){Li(c),Bn(c),i.destroy()}function m(){var I=v();u!==I&&(u<I||!I)&&i.emit(en)}function g(I){var y=l.get().slice(),w=y.length;if(w){for(;y.length<I;)Mr(y,y);Mr(y.slice(-I),y.slice(0,I)).forEach(function(V,z){var Y=z<I,M=f(V.slide,z);Y?Ms(M,y[0].slide):Ko(r.list,M),Mr(c,M),l.register(M,z-I+(Y?0:w),V.index)})}}function f(I,y){var w=I.cloneNode(!0);return kn(w,n.classes.clone),w.id=e.root.id+"-clone"+As(y+1),w}function v(){var I=n.clones;if(!e.is(ho))I=0;else if(Uo(I)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&Oo(fn(r.track)[d("width")]/y);I=w||n[d("autoWidth")]&&e.length||n.perPage*rm}return I}return{mount:p,destroy:b}}function sm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,b=d.sliderSize,m=t.Direction,g=m.resolve,f=m.orient,v=t.Elements,I=v.list,y=v.track,w;function V(){w=t.Transition,o([ci,Zr,cn,en],z)}function z(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function Y(H,B,ce,ie){H!==B&&Z(H>ce)&&(L(),F(T(C(),H>ce),!0)),l(mo),r(Vn,B,ce,H),w.start(B,function(){l(Ji),r(go,B,ce,H),ie&&ie()})}function M(H){F(O(H,!0))}function F(H,B){if(!e.is(er)){var ce=B?H:K(H);Sn(I,"transform","translate"+g("X")+"("+ce+"px)"),H!==ce&&r(Td)}}function K(H){if(e.is(ho)){var B=W(H),ce=B>t.Controller.getEnd(),ie=B<0;(ie||ce)&&(H=T(H,ce))}return H}function T(H,B){var ce=H-S(B),ie=b();return H-=f(ie*(Oo(un(ce)/ie)||1))*(B?1:-1),H}function L(){F(C(),!0),w.cancel()}function W(H){for(var B=t.Slides.get(),ce=0,ie=1/0,A=0;A<B.length;A++){var de=B[A].index,G=un(O(de,!0)-H);if(G<=ie)ie=G,ce=de;else break}return ce}function O(H,B){var ce=f(p(H-1)-_(H));return B?E(ce):ce}function C(){var H=g("left");return fn(I)[H]-fn(y)[H]+f(u(!1))}function E(H){return n.trimSpace&&e.is(eo)&&(H=Oi(H,0,f(b(!0)-x()))),H}function _(H){var B=n.focus;return B==="center"?(x()-c(H,!0))/2:+B*c(H)||0}function S(H){return O(H?t.Controller.getEnd():0,!!n.trimSpace)}function Z(H){var B=f(T(C(),H));return H?B>=0:B<=I[g("scrollWidth")]-fn(y)[g("width")]}function $(H,B){B=Uo(B)?C():B;var ce=H!==!0&&f(B)<f(S(!1)),ie=H!==!1&&f(B)>f(S(!0));return ce||ie}return{mount:V,move:Y,jump:M,translate:F,shift:T,cancel:L,toIndex:W,toPosition:O,getPosition:C,getLimit:S,exceededLimit:$,reposition:z}}function lm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,b=p.getLength,m=n.omitEnd,g=e.is(ho),f=e.is(eo),v=Ut(C,!1),I=Ut(C,!0),y=n.start||0,w,V=y,z,Y,M;function F(){K(),o([cn,en,Or],K),o(Zr,T)}function K(){z=b(!0),Y=n.perMove,M=n.perPage,w=Z();var G=Oi(y,0,m?w:z-1);G!==y&&(y=G,l.reposition())}function T(){w!==Z()&&r(Or)}function L(G,se,oe){if(!de()){var he=O(G),Ie=S(he);Ie>-1&&(se||Ie!==y)&&(ce(Ie),l.move(he,Ie,V,oe))}}function W(G,se,oe,he){t.Scroll.scroll(G,se,oe,function(){var Ie=S(l.toIndex(d()));ce(m?oi(Ie,w):Ie),he&&he()})}function O(G){var se=y;if(ii(G)){var oe=G.match(/([+\-<>])(\d+)?/)||[],he=oe[1],Ie=oe[2];he==="+"||he==="-"?se=E(y+ +(""+he+(+Ie||1)),y):he===">"?se=Ie?$(+Ie):v(!0):he==="<"&&(se=I(!0))}else se=g?G:Oi(G,0,w);return se}function C(G,se){var oe=Y||(A()?1:M),he=E(y+oe*(G?-1:1),y,!(Y||A()));return he===-1&&f&&!dd(d(),c(!G),1)?G?0:w:se?he:S(he)}function E(G,se,oe){if(x()||A()){var he=_(G);he!==G&&(se=G,G=he,oe=!1),G<0||G>w?!Y&&(Pr(0,G,se,!0)||Pr(w,se,G,!0))?G=$(H(G)):g?G=oe?G<0?-(z%M||M):z:G:n.rewind?G=G<0?w:0:G=-1:oe&&G!==se&&(G=$(H(se)+(G<se?-1:1)))}else G=-1;return G}function _(G){if(f&&n.trimSpace==="move"&&G!==y)for(var se=d();se===u(G,!0)&&Pr(G,0,e.length-1,!n.rewind);)G<y?--G:++G;return G}function S(G){return g?(G+z)%z||0:G}function Z(){for(var G=z-(A()||g&&Y?1:M);m&&G-- >0;)if(u(z-1,!0)!==u(G,!0)){G++;break}return Oi(G,0,z-1)}function $(G){return Oi(A()?G:M*G,0,w)}function H(G){return A()?oi(G,w):Hr((G>=w?z-1:G)/M)}function B(G){var se=l.toIndex(G);return f?Oi(se,0,w):se}function ce(G){G!==y&&(V=y,y=G)}function ie(G){return G?V:y}function A(){return!Uo(n.focus)||n.isNavigation}function de(){return e.state.is([mo,Xo])&&!!n.waitForTransition}return{mount:F,go:L,scroll:W,getNext:v,getPrev:I,getAdjacent:C,getEnd:Z,setIndex:ce,getIndex:ie,toIndex:$,toPage:H,toDest:B,hasFocus:A,isBusy:de}}var cm="http://www.w3.org/2000/svg",dm="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",sr=40;function um(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,b=u.track,m=x,g=u.prev,f=u.next,v,I,y={};function w(){z(),o(cn,V)}function V(){Y(),w()}function z(){var W=n.arrows;W&&!(g&&f)&&K(),g&&f&&(No(y,{prev:g,next:f}),Ho(m,W?"":"none"),kn(m,I=Bs+"--"+n.direction),W&&(M(),L(),Et([g,f],Qo,b.id),l(xd,g,f)))}function Y(){i.destroy(),On(m,I),v?(Li(x?[g,f]:m),g=f=null):An([g,f],zs)}function M(){o([ci,go,en,Ei,Or],L),r(f,"click",Ut(F,">")),r(g,"click",Ut(F,"<"))}function F(W){p.go(W,!0)}function K(){m=x||Xi("div",d.arrows),g=T(!0),f=T(!1),v=!0,Ko(m,[g,f]),!x&&Ms(m,b)}function T(W){var O='<button class="'+d.arrow+" "+(W?d.prev:d.next)+'" type="button"><svg xmlns="'+cm+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||dm)+'" />';return ld(O)}function L(){if(g&&f){var W=e.index,O=p.getPrev(),C=p.getNext(),E=O>-1&&W<O?c.last:c.prev,_=C>-1&&W>C?c.first:c.next;g.disabled=O<0,f.disabled=C<0,Et(g,vn,E),Et(f,vn,_),l(bd,g,f,O,C)}}return{arrows:y,mount:w,destroy:Y,update:L}}var pm=ks+"-interval";function mm(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=Qr(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,b=p.toggle,m=n.autoplay,g,f,v=m==="pause";function I(){m&&(y(),b&&Et(b,Qo,u.track.id),v||w(),Y())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(K){g=K.type==="mouseenter",z()}),n.pauseOnFocus&&r(x,"focusin focusout",function(K){f=K.type==="focusin",z()}),b&&r(b,"click",function(){v?w():V(!0)}),o([Vn,Jr,en],d.rewind),o(Vn,F)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=g=v=!1,Y(),l(Ns))}function V(K){K===void 0&&(K=!0),v=!!K,Y(),c()||(d.pause(),l(Hs))}function z(){v||(g||f?V(!1):w())}function Y(){b&&(Hn(b,Ri,!v),Et(b,vn,n.i18n[v?"play":"pause"]))}function M(K){var T=u.bar;T&&Sn(T,"width",K*100+"%"),l($d,K)}function F(K){var T=t.Slides.getAt(K);d.set(T&&+$n(T.slide,pm)||n.interval)}return{mount:I,destroy:d.cancel,play:w,pause:V,isPaused:c}}function gm(e,t,n){var i=Jt(e),o=i.on;function r(){n.cover&&(o(Os,Ut(d,!0)),o([ci,cn,en],Ut(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),Ho(u,c?"none":"")}return{mount:r,destroy:Ut(l,!1)}}var hm=10,fm=600,ym=.6,vm=1.5,xm=800;function bm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,b=e.is(eo),m,g,f=1;function v(){o(Vn,V),o([cn,en],z)}function I(M,F,K,T,L){var W=c();if(V(),K&&(!b||!p())){var O=t.Layout.sliderSize(),C=ns(M)*O*Hr(un(M)/O)||0;M=d.toPosition(t.Controller.toDest(M%O))+C}var E=dd(W,M,1);f=1,F=E?0:F||Nr(un(M-W)/vm,xm),g=T,m=Qr(F,y,Ut(w,W,M,L),1),l(Xo),r(Jr),m.start()}function y(){l(Ji),g&&g(),r(Ei)}function w(M,F,K,T){var L=c(),W=M+(F-M)*Y(T),O=(W-L)*f;x(L+O),b&&!K&&p()&&(f*=ym,un(O)<hm&&I(u(p(!0)),fm,!1,g,!0))}function V(){m&&m.cancel()}function z(){m&&!m.isPaused()&&(V(),y())}function Y(M){var F=n.easingFunc;return F?F(M):1-Math.pow(1-M,4)}return{mount:v,destroy:V,scroll:I,cancel:z}}var Di={passive:!1,capture:!0};function wm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,b=t.Elements.track,m=t.Media.reduce,g=t.Direction,f=g.resolve,v=g.orient,I=u.getPosition,y=u.exceededLimit,w,V,z,Y,M,F=!1,K,T,L;function W(){l(b,va,es,Di),l(b,xa,es,Di),l(b,Hd,C,Di),l(b,"click",S,{capture:!0}),l(b,"dragstart",Nn),o([ci,cn],O)}function O(){var U=n.drag;ue(!U),Y=U==="free"}function C(U){if(K=!1,!T){var le=Ie(U);he(U.target)&&(le||!U.button)&&(x.isBusy()?Nn(U,!0):(L=le?b:window,M=c.is([mo,Xo]),z=null,l(L,va,E,Di),l(L,xa,_,Di),u.cancel(),p.cancel(),Z(U)))}}function E(U){if(c.is(Er)||(c.set(Er),r(fd)),U.cancelable)if(M){u.translate(w+oe(A(U)));var le=de(U)>wl,re=F!==(F=y());(le||re)&&Z(U),K=!0,r(yd),Nn(U)}else B(U)&&(M=H(U),Nn(U))}function _(U){c.is(Er)&&(c.set(Ji),r(vd)),M&&($(U),Nn(U)),d(L,va,E),d(L,xa,_),M=!1}function S(U){!T&&K&&Nn(U,!0)}function Z(U){z=V,V=U,w=I()}function $(U){var le=ce(U),re=ie(le),Re=n.rewind&&n.rewindByDrag;m(!1),Y?x.scroll(re,0,n.snap):e.is(er)?x.go(v(ns(le))<0?Re?"<":"-":Re?">":"+"):e.is(eo)&&F&&Re?x.go(y(!0)?">":"<"):x.go(x.toDest(re),!0),m(!0)}function H(U){var le=n.dragMinThreshold,re=Fo(le),Re=re&&le.mouse||0,we=(re?le.touch:+le)||10;return un(A(U))>(Ie(U)?we:Re)}function B(U){return un(A(U))>un(A(U,!0))}function ce(U){if(e.is(ho)||!F){var le=de(U);if(le&&le<wl)return A(U)/le}return 0}function ie(U){return I()+ns(U)*oi(un(U)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(U,le){return se(U,le)-se(G(U),le)}function de(U){return ts(U)-ts(G(U))}function G(U){return V===U&&z||V}function se(U,le){return(Ie(U)?U.changedTouches[0]:U)["page"+f(le?"Y":"X")]}function oe(U){return U/(F&&e.is(eo)?em:1)}function he(U){var le=n.noDrag;return!Wo(U,"."+Ad+", ."+ra)&&(!le||!Wo(U,le))}function Ie(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function ve(){return M}function ue(U){T=U}return{mount:W,disable:ue,isDragging:ve}}var Sm={Spacebar:" ",Right:na,Left:ta,Up:Ld,Down:Rd};function Vs(e){return e=ii(e)?e:e.key,Sm[e]||e}var Sl="keydown";function $m(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){b(),o(cn,m),o(cn,b),o(Vn,f)}function b(){var I=n.keyboard;I&&(u=I==="global"?window:d,r(u,Sl,v))}function m(){l(u,Sl)}function g(I){p=I}function f(){var I=p;p=!0,id(function(){p=I})}function v(I){if(!p){var y=Vs(I);y===c(ta)?e.go("<"):y===c(na)&&e.go(">")}}return{mount:x,destroy:m,disable:g}}var Po=ks+"-lazy",kr=Po+"-srcset",Cm="["+Po+"], ["+kr+"]";function Tm(e,t,n){var i=Jt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[go,Ei],p=[];function x(){n.lazyLoad&&(b(),o(en,b))}function b(){Bn(p),m(),c?I():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(y){Ps(y.slide,Cm).forEach(function(w){var V=$n(w,Po),z=$n(w,kr);if(V!==w.src||z!==w.srcset){var Y=n.classes.spinner,M=w.parentElement,F=Zo(M,"."+Y)||Xi("span",Y,M);p.push([w,y,F]),w.src||Ho(w,"none")}})})}function g(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?f(y):!0}),p.length||r(u)}function f(y){var w=y[0];kn(y[1].slide,as),l(w,"load error",Ut(v,y)),Et(w,"src",$n(w,Po)),Et(w,"srcset",$n(w,kr)),An(w,Po),An(w,kr)}function v(y,w){var V=y[0],z=y[1];On(z.slide,as),w.type!=="error"&&(Li(y[2]),Ho(V,""),d(Os,V,z),d(Qi)),c&&I()}function I(){p.length&&f(p.shift())}return{mount:x,destroy:Ut(Bn,p),check:g}}function Lm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,b=u.go,m=t.Direction.resolve,g=c.pagination,f=[],v,I;function y(){w(),o([cn,en,Or],y);var T=n.pagination;g&&Ho(g,T?"":"none"),T&&(o([Vn,Jr,Ei],K),V(),K(),r(wd,{list:v,items:f},F(e.index)))}function w(){v&&(Li(g?li(v.children):v),On(v,I),Bn(f),v=null),i.destroy()}function V(){var T=e.length,L=n.classes,W=n.i18n,O=n.perPage,C=p()?u.getEnd()+1:Oo(T/O);v=g||Xi("ul",L.pagination,c.track.parentElement),kn(v,I=aa+"--"+M()),Et(v,Dn,"tablist"),Et(v,vn,W.select),Et(v,js,M()===ia?"vertical":"");for(var E=0;E<C;E++){var _=Xi("li",null,v),S=Xi("button",{class:L.page,type:"button"},_),Z=d.getIn(E).map(function(H){return H.slide.id}),$=!p()&&O>1?W.pageX:W.slideX;l(S,"click",Ut(z,E)),n.paginationKeyboard&&l(S,"keydown",Ut(Y,E)),Et(_,Dn,"presentation"),Et(S,Dn,"tab"),Et(S,Qo,Z.join(" ")),Et(S,vn,is($,E+1)),Et(S,Ui,-1),f.push({li:_,button:S,page:E})}}function z(T){b(">"+T,!0)}function Y(T,L){var W=f.length,O=Vs(L),C=M(),E=-1;O===m(na,!1,C)?E=++T%W:O===m(ta,!1,C)?E=(--T+W)%W:O==="Home"?E=0:O==="End"&&(E=W-1);var _=f[E];_&&(sd(_.button),b(">"+E),Nn(L,!0))}function M(){return n.paginationDirection||n.direction}function F(T){return f[u.toPage(T)]}function K(){var T=F(x(!0)),L=F(x());if(T){var W=T.button;On(W,Ri),An(W,fl),Et(W,Ui,-1)}if(L){var O=L.button;kn(O,Ri),Et(O,fl,!0),Et(O,Ui,"")}r(Sd,{list:v,items:f},T,L)}return{items:f,mount:y,destroy:w,getAt:F,update:K}}var Rm=[" ","Enter"];function Im(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),Bn(r)}function c(){d(),l()}function u(g,f){var v=Jt(g);v.on(Vn,function(I,y,w){f.go(f.is(ho)?w:I)}),r.push(v)}function p(){var g=Jt(e),f=g.on;f(Fs,b),f(Cd,m),f([ci,cn],x),r.push(g),g.emit(_s,e.splides)}function x(){Et(t.Elements.list,js,n.direction===ia?"vertical":"")}function b(g){e.go(g.index)}function m(g,f){Es(Rm,Vs(f))&&(b(g),Nn(f))}return{setup:Ut(t.Media.set,{slideFocus:Uo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Em(e,t,n){var i=Jt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Di)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,b=ts(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;un(p)>m&&b-r>g&&(e.go(x?"<":">"),r=b),c(x)&&Nn(u)}}function c(u){return!n.releaseWheel||e.state.is(mo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Mm=90;function Pm(e,t,n){var i=Jt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Xi("span",Yp),c=Qr(Mm,Ut(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),Et(r,xl,!0),d.textContent="…",o(Ns,Ut(b,!0)),o(Hs,Ut(b,!1)),o([go,Ei],Ut(p,!0)))}function p(m){Et(r,vl,m),m?(Ko(r,d),c.start()):(Li(d),c.cancel())}function x(){An(r,[yl,xl,vl]),Li(d)}function b(m){l&&Et(r,yl,m?"off":"polite")}return{mount:u,disable:b,destroy:x}}var km=Object.freeze({__proto__:null,Media:Dp,Direction:jp,Elements:tm,Slides:im,Layout:om,Clones:am,Move:sm,Controller:lm,Arrows:um,Autoplay:mm,Cover:gm,Scroll:bm,Drag:wm,Keyboard:$m,LazyLoad:Tm,Pagination:Lm,Sync:Im,Wheel:Em,Live:Pm}),Am={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"},Fm={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:Jp,i18n:Am,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Wm(e,t,n){var i=t.Slides;function o(){Jt(e).on([ci,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),id(c)}return{mount:o,start:l,cancel:es}}function _m(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Ut(Sn,l,"transition"),c;function u(){Jt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,g){var f=i.toPosition(m,!0),v=i.getPosition(),I=b(m);un(f-v)>=1&&I>=1?n.useScroll?r.scroll(f,I,!1,g):(d("transform "+I+"ms "+n.easing),i.translate(f,!0),c=g):(i.jump(m),g())}function x(){d(""),r.cancel()}function b(m){var g=n.rewindSpeed;if(e.is(eo)&&g){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:x}}var Nm=(function(){function e(n,i){this.event=Jt(),this.Components={},this.state=Hp(Bi),this.splides=[],this._o={},this._E={};var o=ii(n)?cd(document,n):n;Mo(o,o+" is invalid."),this.root=o,i=Zn({label:$n(o,vn)||"",labelledby:$n(o,Ds)||""},Fm,e.defaults,i||{});try{Zn(i,JSON.parse($n(o,ks)))}catch{Mo(!1,"Invalid JSON")}this._o=Object.create(Zn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Mo(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(er)?Wm:_m),this._E=i||this._E;var c=No({},km,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(ci),kn(this.root,Kp),l.set(Ji),this.emit(os),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(li(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(Bi)?Jt(this).on(os,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Ws),o.destroy(),i&&Bn(this.splides),r.set(_r)),this},Ap(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})(),Gs=Nm;Gs.defaults={};Gs.STATES=Wp;var $l=[[ci,"onMounted"],[os,"onReady"],[Vn,"onMove"],[go,"onMoved"],[Fs,"onClick"],[pd,"onActive"],[md,"onInactive"],[gd,"onVisible"],[hd,"onHidden"],[en,"onRefresh"],[cn,"onUpdated"],[Qi,"onResize"],[Zr,"onResized"],[fd,"onDrag"],[yd,"onDragging"],[vd,"onDragged"],[Jr,"onScroll"],[Ei,"onScrolled"],[Ws,"onDestroy"],[xd,"onArrowsMounted"],[bd,"onArrowsUpdated"],[wd,"onPaginationMounted"],[Sd,"onPaginationUpdated"],[_s,"onNavigationMounted"],[Ns,"onAutoplayPlay"],[$d,"onAutoplayPlaying"],[Hs,"onAutoplayPause"],[Os,"onLazyLoadLoaded"]];function qs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function ss(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!ss(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!ss(e[o],t[o]))}return e===t}function Hm(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 ls(e,t){const n=e;return Om(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=ls(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Dm=({children:e,className:t,...n})=>s.createElement("div",{className:qs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Xs=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 Gs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ls({},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&&!ss(this.options,e)&&(this.splide.options=e,this.options=ls({},e));const t=this.getSlides();Hm(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){$l.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:qs("splide",e),ref:this.splideRef,...this.omit(o,["options",...$l.map(r=>r[1])])},n?s.createElement(Dm,null,i):i)}},Us=({children:e,className:t,...n})=>s.createElement("li",{className:qs("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),$t=require("classnames"),j=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Gn=require("react-dom");function zu(e){return e.type==="object"&&e.version===1}const Bu="ControlSlider-module__wrapper___sHEkd",Vu="ControlSlider-module__hoverArrow___A-dOH",Gu="ControlSlider-module__sliderItem___QQSkR",qu="ControlSlider-module__sliderImage___9hRl-",Xu="ControlSlider-module__arrow___05ghY",Uu="ControlSlider-module__arrowVertical___tBfVN",Yu="ControlSlider-module__nextArrow___-30Yc",Ku="ControlSlider-module__arrowInner___aEra3",Zu="ControlSlider-module__arrowIcon___S4ztF",Ju="ControlSlider-module__arrowImg___2dwJW",Qu="ControlSlider-module__mirror___brd6U",ep="ControlSlider-module__pagination___bicLF",tp="ControlSlider-module__paginationInner___bT-P-",np="ControlSlider-module__paginationVertical___zYqKw",ip="ControlSlider-module__paginationItem___nTRbk",op="ControlSlider-module__dot___p1Qun",rp="ControlSlider-module__activeDot___LHFaj",ap="ControlSlider-module__paginationInsideBottom___R3FWn",sp="ControlSlider-module__paginationInsideTop___V-qb-",lp="ControlSlider-module__paginationOutsideBottom___14w8D",cp="ControlSlider-module__paginationOutsideTop___SCLqB",dp="ControlSlider-module__paginationInsideLeft___yOBRZ",up="ControlSlider-module__paginationInsideRight___Rtt3o",pp="ControlSlider-module__paginationOutsideLeft___lahaw",mp="ControlSlider-module__paginationOutsideRight___EtuQa",gp="ControlSlider-module__imgWrapper___UjEgB",hp="ControlSlider-module__captionBlock___dJ6-j",fp="ControlSlider-module__captionTextWrapper___HFlpf",yp="ControlSlider-module__captionText___uGBVc",vp="ControlSlider-module__active___WZK4G",xp="ControlSlider-module__withPointerEvents___t-18M",bp="ControlSlider-module__topLeftAlignment___zjnGM",wp="ControlSlider-module__topCenterAlignment___gD1xW",Sp="ControlSlider-module__topRightAlignment___NMapS",$p="ControlSlider-module__middleLeftAlignment___OnUrY",Cp="ControlSlider-module__middleCenterAlignment___Tdkl0",Tp="ControlSlider-module__middleRightAlignment___wEbfX",Lp="ControlSlider-module__bottomLeftAlignment___cTP2-",Rp="ControlSlider-module__bottomCenterAlignment___c54fB",Ip="ControlSlider-module__bottomRightAlignment___kEwrz",Ep="ControlSlider-module__clickOverlay___DZA28",Mp="ControlSlider-module__contain___pLyq7",Pp="ControlSlider-module__cover___KdDat",St={wrapper:Bu,hoverArrow:Vu,sliderItem:Gu,sliderImage:qu,arrow:Xu,arrowVertical:Uu,nextArrow:Yu,arrowInner:Ku,arrowIcon:Zu,arrowImg:Ju,mirror:Qu,pagination:ep,paginationInner:tp,paginationVertical:np,paginationItem:ip,dot:op,activeDot:rp,paginationInsideBottom:ap,paginationInsideTop:sp,paginationOutsideBottom:lp,paginationOutsideTop:cp,paginationInsideLeft:dp,paginationInsideRight:up,paginationOutsideLeft:pp,paginationOutsideRight:mp,imgWrapper:gp,captionBlock:hp,captionTextWrapper:fp,captionText:yp,active:vp,withPointerEvents:xp,topLeftAlignment:bp,topCenterAlignment:wp,topRightAlignment:Sp,middleLeftAlignment:$p,middleCenterAlignment:Cp,middleRightAlignment:Tp,bottomLeftAlignment:Lp,bottomCenterAlignment:Rp,bottomRightAlignment:Ip,clickOverlay:Ep,contain:Mp,cover:Pp};function kp(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 Ap(e,t,n){return t&&kp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var dl="(prefers-reduced-motion: reduce)",Bi=1,Fp=2,Ji=3,mo=4,Xo=5,Er=6,_r=7,Wp={CREATED:Bi,MOUNTED:Fp,IDLE:Ji,MOVING:mo,SCROLLING:Xo,DRAGGING:Er,DESTROYED:_r};function Bn(e){e.length=0}function si(e,t,n){return Array.prototype.slice.call(e,t,n)}function Kt(e){return e.bind.apply(e,[null].concat(si(arguments,1)))}var id=setTimeout,Qa=function(){};function ul(e){return requestAnimationFrame(e)}function Yr(e,t){return typeof t===e}function Fo(e){return!Is(e)&&Yr("object",e)}var Rs=Array.isArray,od=Kt(Yr,"function"),ni=Kt(Yr,"string"),Uo=Kt(Yr,"undefined");function Is(e){return e===null}function rd(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Yo(e){return Rs(e)?e:[e]}function bn(e,t){Yo(e).forEach(t)}function Es(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Yo(t)),e}function Hn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function kn(e,t){Hn(e,ni(t)?t.split(" "):t,!0)}function Ko(e,t){bn(t,e.appendChild.bind(e))}function Ms(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Wo(e,t){return rd(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function ad(e,t){var n=e?si(e.children):[];return t?n.filter(function(i){return Wo(i,t)}):n}function Zo(e,t){return t?ad(e,t)[0]:e.firstElementChild}var _o=Object.keys;function Ci(e,t,n){return e&&(n?_o(e).reverse():_o(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function No(e){return si(arguments,1).forEach(function(t){Ci(t,function(n,i){e[i]=t[i]})}),e}function Zn(e){return si(arguments,1).forEach(function(t){Ci(t,function(n,i){Rs(n)?e[i]=n.slice():Fo(n)?e[i]=Zn({},Fo(e[i])?e[i]:{},n):e[i]=n})}),e}function pl(e,t){bn(t||_o(e),function(n){delete e[n]})}function An(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Mt(e,t,n){Fo(t)?Ci(t,function(i,o){Mt(e,o,i)}):bn(e,function(i){Is(n)||n===""?An(i,t):i.setAttribute(t,String(n))})}function Xi(e,t,n){var i=document.createElement(e);return t&&(ni(t)?kn(i,t):Mt(i,t)),n&&Ko(n,i),i}function Sn(e,t,n){if(Uo(n))return getComputedStyle(e)[t];Is(n)||(e.style[t]=""+n)}function Ho(e,t){Sn(e,"display",t)}function sd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function ml(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Li(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function ld(e){return Zo(new DOMParser().parseFromString(e,"text/html").body)}function Nn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function cd(e,t){return e&&e.querySelector(t)}function Ps(e,t){return t?si(e.querySelectorAll(t)):[]}function On(e,t){Hn(e,t,!1)}function es(e){return e.timeStamp}function mi(e){return ni(e)?e:e?e+"px":""}var Jo="splide",ks="data-"+Jo;function Mo(e,t){if(!e)throw new Error("["+Jo+"] "+(t||""))}var ii=Math.min,Nr=Math.max,Hr=Math.floor,Oo=Math.ceil,un=Math.abs;function dd(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=ii(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Oi(e,t,n){var i=ii(t,n),o=Nr(t,n);return ii(Nr(i,e),o)}function ts(e){return+(e>0)-+(e<0)}function ns(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function As(e){return e<10?"0"+e:""+e}var gl={};function _p(e){return""+e+As(gl[e]=(gl[e]||0)+1)}function ud(){var e=[];function t(l,d,c,u){o(l,d,function(p,x,b){var m="addEventListener"in p,g=m?p.removeEventListener.bind(p,x,c,u):p.removeListener.bind(p,c);m?p.addEventListener(x,c,u):p.addListener(c),e.push([p,x,b,c,g])})}function n(l,d,c){o(l,d,function(u,p,x){e=e.filter(function(b){return b[0]===u&&b[1]===p&&b[2]===x&&(!c||b[3]===c)?(b[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){bn(l,function(u){u&&bn(d,function(p){p.split(" ").forEach(function(x){var b=x.split(".");c(u,b[0],b[1])})})})}function r(){e.forEach(function(l){l[4]()}),Bn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var li="mounted",is="ready",Vn="move",go="moved",Fs="click",pd="active",md="inactive",gd="visible",hd="hidden",en="refresh",cn="updated",Qi="resize",Kr="resized",fd="drag",yd="dragging",vd="dragged",Zr="scroll",Ei="scrolled",Np="overflow",Ws="destroy",xd="arrows:mounted",bd="arrows:updated",wd="pagination:mounted",Sd="pagination:updated",_s="navigation:mounted",Ns="autoplay:play",$d="autoplay:playing",Hs="autoplay:pause",Os="lazyload:loaded",Cd="sk",Td="sh",Or="ei";function Jt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ud();function i(r,l){n.bind(t,Yo(r).join(" "),function(d){l.apply(l,Rs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,si(arguments,1))}return e&&e.event.on(Ws,n.destroy),No(n,{bus:t,on:i,off:Kt(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?ii((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return b();d=ul(p)}}function x(I){I||g(),r=o()-(I?l*e:0),c=!1,d=ul(p)}function b(){c=!0}function m(){r=o(),l=0,n&&n(l)}function g(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(I){e=I}function v(){return c}return{start:x,rewind:m,pause:b,cancel:g,set:f,isPaused:v}}function Hp(e){var t=e;function n(o){t=o}function i(o){return Es(Yo(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 Dp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ud(),d=[];function c(){var g=n.mediaQuery==="min";_o(o).sort(function(f,v){return g?+f-+v:+v-+f}).forEach(function(f){p(o[f],"("+(g?"min":"max")+"-width:"+f+"px)")}),p(r,dl),x()}function u(g){g&&l.destroy()}function p(g,f){var v=matchMedia(f);l.bind(v,"change",x),d.push([g,v])}function x(){var g=i.is(_r),f=n.direction,v=d.reduce(function(I,y){return Zn(I,y[1].matches?y[0]:{})},{});pl(n),m(v),n.destroy?e.destroy(n.destroy==="completely"):g?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function b(g){matchMedia(dl).matches&&(g?Zn(n,r):pl(n,_o(r)))}function m(g,f,v){Zn(n,g),f&&Zn(Object.getPrototypeOf(n),g),(v||!i.is(Bi))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:b,set:m}}var Qr="Arrow",ea=Qr+"Left",ta=Qr+"Right",Ld=Qr+"Up",Rd=Qr+"Down",hl="rtl",na="ttb",ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ld,ta],ArrowRight:[Rd,ea]};function jp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===hl&&!l?1:d===na?0:-1;return ha[r]&&ha[r][c]||r.replace(/width|left|right/i,function(u,p){var x=ha[u.toLowerCase()][c]||u;return p>0?x.charAt(0).toUpperCase()+x.slice(1):x})}function o(r){return r*(n.direction===hl?1:-1)}return{resolve:i,orient:o}}var Dn="role",Ui="tabindex",zp="disabled",Cn="aria-",Qo=Cn+"controls",Id=Cn+"current",fl=Cn+"selected",vn=Cn+"label",Ds=Cn+"labelledby",Ed=Cn+"hidden",js=Cn+"orientation",Do=Cn+"roledescription",yl=Cn+"live",vl=Cn+"busy",xl=Cn+"atomic",zs=[Dn,Ui,zp,Qo,Id,vn,Ds,Ed,js,Do],Wn=Jo+"__",ci="is-",fa=Jo,bl=Wn+"track",Bp=Wn+"list",ia=Wn+"slide",Md=ia+"--clone",Vp=ia+"__container",Bs=Wn+"arrows",oa=Wn+"arrow",Pd=oa+"--prev",kd=oa+"--next",ra=Wn+"pagination",Ad=ra+"__page",Gp=Wn+"progress",qp=Gp+"__bar",Xp=Wn+"toggle",Up=Wn+"spinner",Yp=Wn+"sr",Kp=ci+"initialized",Ri=ci+"active",Fd=ci+"prev",Wd=ci+"next",os=ci+"visible",rs=ci+"loading",_d=ci+"focus-in",Nd=ci+"overflow",Zp=[Ri,os,Fd,Wd,rs,_d,Nd],Jp={slide:ia,clone:Md,arrows:Bs,arrow:oa,prev:Pd,next:kd,pagination:ra,page:Ad,spinner:Up};function Qp(e,t){if(od(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Wo(n,t);)n=n.parentElement;return n}var em=5,wl=200,Hd="touchstart mousedown",ya="touchmove mousemove",va="touchend touchcancel mouseup click";function tm(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],x=[],b,m,g;function f(){w(),V(),y()}function v(){o(en,I),o(en,f),o(cn,y),r(document,Hd+" keydown",function(M){g=M.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Hn(l,_d,!!g)})}function I(M){var F=zs.concat("style");Bn(u),On(l,p),On(b,x),An([b,m],F),An(l,M?F:["style",Do])}function y(){On(l,p),On(b,x),p=Y(fa),x=Y(bl),kn(l,p),kn(b,x),Mt(l,vn,n.label),Mt(l,Ds,n.labelledby)}function w(){b=z("."+bl),m=Zo(b,"."+Bp),Mo(b&&m,"A track/list element is missing."),Mr(u,ad(m,"."+ia+":not(."+Md+")")),Ci({arrows:Bs,pagination:ra,prev:Pd,next:kd,bar:qp,toggle:Xp},function(M,F){c[F]=z("."+M)}),No(c,{root:l,track:b,list:m,slides:u})}function V(){var M=l.id||_p(Jo),F=n.role;l.id=M,b.id=b.id||M+"-track",m.id=m.id||M+"-list",!$n(l,Dn)&&l.tagName!=="SECTION"&&F&&Mt(l,Dn,F),Mt(l,Do,d.carousel),Mt(m,Dn,"presentation")}function z(M){var F=cd(l,M);return F&&Qp(F,"."+fa)===l?F:void 0}function Y(M){return[M+"--"+n.type,M+"--"+n.direction,n.drag&&M+"--draggable",n.isNavigation&&M+"--nav",M===fa&&Ri]}return No(c,{setup:f,mount:v,destroy:I})}var eo="slide",ho="loop",er="fade";function nm(e,t,n,i){var o=Jt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,x=p.isNavigation,b=p.updateOnMove,m=p.i18n,g=p.pagination,f=p.slideFocus,v=c.Direction.resolve,I=$n(i,"style"),y=$n(i,vn),w=n>-1,V=Zo(i,"."+Vp),z;function Y(){w||(i.id=u.id+"-slide"+As(t+1),Mt(i,Dn,g?"tabpanel":"group"),Mt(i,Do,m.slide),Mt(i,vn,y||ns(m.slideLabel,[t+1,e.length]))),M()}function M(){d(i,"click",Kt(l,Fs,Z)),d(i,"keydown",Kt(l,Cd,Z)),r([go,Td,Ei],L),r(_s,K),b&&r(Vn,T)}function F(){z=!0,o.destroy(),On(i,Zp),An(i,zs),Mt(i,"style",I),Mt(i,vn,y||"")}function K(){var $=e.splides.map(function(H){var B=H.splide.Components.Slides.getAt(t);return B?B.slide.id:""}).join(" ");Mt(i,vn,ns(m.slideX,(w?n:t)+1)),Mt(i,Qo,$),Mt(i,Dn,f?"button":""),f&&An(i,Do)}function T(){z||L()}function L(){if(!z){var $=e.index;W(),O(),Hn(i,Fd,t===$-1),Hn(i,Wd,t===$+1)}}function W(){var $=E();$!==ml(i,Ri)&&(Hn(i,Ri,$),Mt(i,Id,x&&$||""),l($?pd:md,Z))}function O(){var $=_(),H=!$&&(!E()||w);if(e.state.is([mo,Xo])||Mt(i,Ed,H||""),Mt(Ps(i,p.focusableNodes||""),Ui,H?-1:""),f&&Mt(i,Ui,H?-1:0),$!==ml(i,os)&&(Hn(i,os,$),l($?gd:hd,Z)),!$&&document.activeElement===i){var B=c.Slides.getAt(e.index);B&&sd(B.slide)}}function C($,H,B){Sn(B&&V||i,$,H)}function E(){var $=e.index;return $===t||p.cloneStatus&&$===n}function _(){if(e.is(er))return E();var $=fn(c.Elements.track),H=fn(i),B=v("left",!0),le=v("right",!0);return Hr($[B])<=Oo(H[B])&&Hr(H[le])<=Oo($[le])}function S($,H){var B=un($-t);return!w&&(p.rewind||e.is(ho))&&(B=ii(B,e.length-B)),B<=H}var Z={index:t,slideIndex:n,slide:i,container:V,isClone:w,mount:Y,destroy:F,update:L,style:C,isWithin:S};return Z}function im(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function x(){b(),o(en,m),o(en,b)}function b(){c.forEach(function(L,W){f(L,W,-1)})}function m(){z(function(L){L.destroy()}),Bn(p)}function g(){z(function(L){L.update()})}function f(L,W,O){var C=nm(e,W,O,L);C.mount(),p.push(C),p.sort(function(E,_){return E.index-_.index})}function v(L){return L?Y(function(W){return!W.isClone}):p}function I(L){var W=t.Controller,O=W.toIndex(L),C=W.hasFocus()?1:n.perPage;return Y(function(E){return Pr(E.index,O,O+C-1)})}function y(L){return Y(L)[0]}function w(L,W){bn(L,function(O){if(ni(O)&&(O=ld(O)),rd(O)){var C=c[W];C?Ms(O,C):Ko(u,O),kn(O,n.classes.slide),F(O,Kt(r,Qi))}}),r(en)}function V(L){Li(Y(L).map(function(W){return W.slide})),r(en)}function z(L,W){v(W).forEach(L)}function Y(L){return p.filter(od(L)?L:function(W){return ni(L)?Wo(W.slide,L):Es(Yo(L),W.index)})}function M(L,W,O){z(function(C){C.style(L,W,O)})}function F(L,W){var O=Ps(L,"img"),C=O.length;C?O.forEach(function(E){l(E,"load error",function(){--C||W()})}):W()}function K(L){return L?c.length:p.length}function T(){return p.length>n.perPage}return{mount:x,destroy:m,update:g,register:f,get:v,getIn:I,getAt:y,add:w,remove:V,forEach:z,filter:Y,style:M,getLength:K,isEnough:T}}function om(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,x=u.track,b=u.list,m=d.getAt,g=d.style,f,v,I;function y(){w(),r(window,"resize load",Op(Kt(l,Qi))),o([cn,en],w),o(Qi,V)}function w(){f=n.direction===na,Sn(p,"maxWidth",mi(n.width)),Sn(x,c("paddingLeft"),z(!1)),Sn(x,c("paddingRight"),z(!0)),V(!0)}function V(Z){var $=fn(p);(Z||v.width!==$.width||v.height!==$.height)&&(Sn(x,"height",Y()),g(c("marginRight"),mi(n.gap)),g("width",F()),g("height",K(),!0),v=$,l(Kr),I!==(I=S())&&(Hn(p,Nd,I),l(Np,I)))}function z(Z){var $=n.padding,H=c(Z?"right":"left");return $&&mi($[H]||(Fo($)?0:$))||"0px"}function Y(){var Z="";return f&&(Z=M(),Mo(Z,"height or heightRatio is missing."),Z="calc("+Z+" - "+z(!1)+" - "+z(!0)+")"),Z}function M(){return mi(n.height||fn(b).width*n.heightRatio)}function F(){return n.autoWidth?null:mi(n.fixedWidth)||(f?"":T())}function K(){return mi(n.fixedHeight)||(f?n.autoHeight?null:T():M())}function T(){var Z=mi(n.gap);return"calc((100%"+(Z&&" + "+Z)+")/"+(n.perPage||1)+(Z&&" - "+Z)+")"}function L(){return fn(b)[c("width")]}function W(Z,$){var H=m(Z||0);return H?fn(H.slide)[c("width")]+($?0:E()):0}function O(Z,$){var H=m(Z);if(H){var B=fn(H.slide)[c("right")],le=fn(b)[c("left")];return un(B-le)+($?0:E())}return 0}function C(Z){return O(e.length-1)-O(0)+W(0,Z)}function E(){var Z=m(0);return Z&&parseFloat(Sn(Z.slide,c("marginRight")))||0}function _(Z){return parseFloat(Sn(x,c("padding"+(Z?"Right":"Left"))))||0}function S(){return e.is(er)||C(!0)>L()}return{mount:y,resize:V,listSize:L,slideSize:W,sliderSize:C,totalSize:O,getPadding:_,isOverflow:S}}var rm=2;function am(e,t,n){var i=Jt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(en,x),o([cn,Qi],m),(u=v())&&(g(u),t.Layout.resize(!0))}function x(){b(),p()}function b(){Li(c),Bn(c),i.destroy()}function m(){var I=v();u!==I&&(u<I||!I)&&i.emit(en)}function g(I){var y=l.get().slice(),w=y.length;if(w){for(;y.length<I;)Mr(y,y);Mr(y.slice(-I),y.slice(0,I)).forEach(function(V,z){var Y=z<I,M=f(V.slide,z);Y?Ms(M,y[0].slide):Ko(r.list,M),Mr(c,M),l.register(M,z-I+(Y?0:w),V.index)})}}function f(I,y){var w=I.cloneNode(!0);return kn(w,n.classes.clone),w.id=e.root.id+"-clone"+As(y+1),w}function v(){var I=n.clones;if(!e.is(ho))I=0;else if(Uo(I)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&Oo(fn(r.track)[d("width")]/y);I=w||n[d("autoWidth")]&&e.length||n.perPage*rm}return I}return{mount:p,destroy:b}}function sm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,x=d.listSize,b=d.sliderSize,m=t.Direction,g=m.resolve,f=m.orient,v=t.Elements,I=v.list,y=v.track,w;function V(){w=t.Transition,o([li,Kr,cn,en],z)}function z(){t.Controller.isBusy()||(t.Scroll.cancel(),M(e.index),t.Slides.update())}function Y(H,B,le,ie){H!==B&&Z(H>le)&&(L(),F(T(C(),H>le),!0)),l(mo),r(Vn,B,le,H),w.start(B,function(){l(Ji),r(go,B,le,H),ie&&ie()})}function M(H){F(O(H,!0))}function F(H,B){if(!e.is(er)){var le=B?H:K(H);Sn(I,"transform","translate"+g("X")+"("+le+"px)"),H!==le&&r(Td)}}function K(H){if(e.is(ho)){var B=W(H),le=B>t.Controller.getEnd(),ie=B<0;(ie||le)&&(H=T(H,le))}return H}function T(H,B){var le=H-S(B),ie=b();return H-=f(ie*(Oo(un(le)/ie)||1))*(B?1:-1),H}function L(){F(C(),!0),w.cancel()}function W(H){for(var B=t.Slides.get(),le=0,ie=1/0,k=0;k<B.length;k++){var de=B[k].index,G=un(O(de,!0)-H);if(G<=ie)ie=G,le=de;else break}return le}function O(H,B){var le=f(p(H-1)-_(H));return B?E(le):le}function C(){var H=g("left");return fn(I)[H]-fn(y)[H]+f(u(!1))}function E(H){return n.trimSpace&&e.is(eo)&&(H=Oi(H,0,f(b(!0)-x()))),H}function _(H){var B=n.focus;return B==="center"?(x()-c(H,!0))/2:+B*c(H)||0}function S(H){return O(H?t.Controller.getEnd():0,!!n.trimSpace)}function Z(H){var B=f(T(C(),H));return H?B>=0:B<=I[g("scrollWidth")]-fn(y)[g("width")]}function $(H,B){B=Uo(B)?C():B;var le=H!==!0&&f(B)<f(S(!1)),ie=H!==!1&&f(B)>f(S(!0));return le||ie}return{mount:V,move:Y,jump:M,translate:F,shift:T,cancel:L,toIndex:W,toPosition:O,getPosition:C,getLimit:S,exceededLimit:$,reposition:z}}function lm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,x=p.isEnough,b=p.getLength,m=n.omitEnd,g=e.is(ho),f=e.is(eo),v=Kt(C,!1),I=Kt(C,!0),y=n.start||0,w,V=y,z,Y,M;function F(){K(),o([cn,en,Or],K),o(Kr,T)}function K(){z=b(!0),Y=n.perMove,M=n.perPage,w=Z();var G=Oi(y,0,m?w:z-1);G!==y&&(y=G,l.reposition())}function T(){w!==Z()&&r(Or)}function L(G,ce,oe){if(!de()){var fe=O(G),Ie=S(fe);Ie>-1&&(ce||Ie!==y)&&(le(Ie),l.move(fe,Ie,V,oe))}}function W(G,ce,oe,fe){t.Scroll.scroll(G,ce,oe,function(){var Ie=S(l.toIndex(d()));le(m?ii(Ie,w):Ie),fe&&fe()})}function O(G){var ce=y;if(ni(G)){var oe=G.match(/([+\-<>])(\d+)?/)||[],fe=oe[1],Ie=oe[2];fe==="+"||fe==="-"?ce=E(y+ +(""+fe+(+Ie||1)),y):fe===">"?ce=Ie?$(+Ie):v(!0):fe==="<"&&(ce=I(!0))}else ce=g?G:Oi(G,0,w);return ce}function C(G,ce){var oe=Y||(k()?1:M),fe=E(y+oe*(G?-1:1),y,!(Y||k()));return fe===-1&&f&&!dd(d(),c(!G),1)?G?0:w:ce?fe:S(fe)}function E(G,ce,oe){if(x()||k()){var fe=_(G);fe!==G&&(ce=G,G=fe,oe=!1),G<0||G>w?!Y&&(Pr(0,G,ce,!0)||Pr(w,ce,G,!0))?G=$(H(G)):g?G=oe?G<0?-(z%M||M):z:G:n.rewind?G=G<0?w:0:G=-1:oe&&G!==ce&&(G=$(H(ce)+(G<ce?-1:1)))}else G=-1;return G}function _(G){if(f&&n.trimSpace==="move"&&G!==y)for(var ce=d();ce===u(G,!0)&&Pr(G,0,e.length-1,!n.rewind);)G<y?--G:++G;return G}function S(G){return g?(G+z)%z||0:G}function Z(){for(var G=z-(k()||g&&Y?1:M);m&&G-- >0;)if(u(z-1,!0)!==u(G,!0)){G++;break}return Oi(G,0,z-1)}function $(G){return Oi(k()?G:M*G,0,w)}function H(G){return k()?ii(G,w):Hr((G>=w?z-1:G)/M)}function B(G){var ce=l.toIndex(G);return f?Oi(ce,0,w):ce}function le(G){G!==y&&(V=y,y=G)}function ie(G){return G?V:y}function k(){return!Uo(n.focus)||n.isNavigation}function de(){return e.state.is([mo,Xo])&&!!n.waitForTransition}return{mount:F,go:L,scroll:W,getNext:v,getPrev:I,getAdjacent:C,getEnd:Z,setIndex:le,getIndex:ie,toIndex:$,toPage:H,toDest:B,hasFocus:k,isBusy:de}}var cm="http://www.w3.org/2000/svg",dm="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",sr=40;function um(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,x=u.arrows,b=u.track,m=x,g=u.prev,f=u.next,v,I,y={};function w(){z(),o(cn,V)}function V(){Y(),w()}function z(){var W=n.arrows;W&&!(g&&f)&&K(),g&&f&&(No(y,{prev:g,next:f}),Ho(m,W?"":"none"),kn(m,I=Bs+"--"+n.direction),W&&(M(),L(),Mt([g,f],Qo,b.id),l(xd,g,f)))}function Y(){i.destroy(),On(m,I),v?(Li(x?[g,f]:m),g=f=null):An([g,f],zs)}function M(){o([li,go,en,Ei,Or],L),r(f,"click",Kt(F,">")),r(g,"click",Kt(F,"<"))}function F(W){p.go(W,!0)}function K(){m=x||Xi("div",d.arrows),g=T(!0),f=T(!1),v=!0,Ko(m,[g,f]),!x&&Ms(m,b)}function T(W){var O='<button class="'+d.arrow+" "+(W?d.prev:d.next)+'" type="button"><svg xmlns="'+cm+'" viewBox="0 0 '+sr+" "+sr+'" width="'+sr+'" height="'+sr+'" focusable="false"><path d="'+(n.arrowPath||dm)+'" />';return ld(O)}function L(){if(g&&f){var W=e.index,O=p.getPrev(),C=p.getNext(),E=O>-1&&W<O?c.last:c.prev,_=C>-1&&W>C?c.first:c.next;g.disabled=O<0,f.disabled=C<0,Mt(g,vn,E),Mt(f,vn,_),l(bd,g,f,O,C)}}return{arrows:y,mount:w,destroy:Y,update:L}}var pm=ks+"-interval";function mm(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.emit,d=Jr(n.interval,e.go.bind(e,">"),M),c=d.isPaused,u=t.Elements,p=t.Elements,x=p.root,b=p.toggle,m=n.autoplay,g,f,v=m==="pause";function I(){m&&(y(),b&&Mt(b,Qo,u.track.id),v||w(),Y())}function y(){n.pauseOnHover&&r(x,"mouseenter mouseleave",function(K){g=K.type==="mouseenter",z()}),n.pauseOnFocus&&r(x,"focusin focusout",function(K){f=K.type==="focusin",z()}),b&&r(b,"click",function(){v?w():V(!0)}),o([Vn,Zr,en],d.rewind),o(Vn,F)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=g=v=!1,Y(),l(Ns))}function V(K){K===void 0&&(K=!0),v=!!K,Y(),c()||(d.pause(),l(Hs))}function z(){v||(g||f?V(!1):w())}function Y(){b&&(Hn(b,Ri,!v),Mt(b,vn,n.i18n[v?"play":"pause"]))}function M(K){var T=u.bar;T&&Sn(T,"width",K*100+"%"),l($d,K)}function F(K){var T=t.Slides.getAt(K);d.set(T&&+$n(T.slide,pm)||n.interval)}return{mount:I,destroy:d.cancel,play:w,pause:V,isPaused:c}}function gm(e,t,n){var i=Jt(e),o=i.on;function r(){n.cover&&(o(Os,Kt(d,!0)),o([li,cn,en],Kt(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),Ho(u,c?"none":"")}return{mount:r,destroy:Kt(l,!1)}}var hm=10,fm=600,ym=.6,vm=1.5,xm=800;function bm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,x=d.translate,b=e.is(eo),m,g,f=1;function v(){o(Vn,V),o([cn,en],z)}function I(M,F,K,T,L){var W=c();if(V(),K&&(!b||!p())){var O=t.Layout.sliderSize(),C=ts(M)*O*Hr(un(M)/O)||0;M=d.toPosition(t.Controller.toDest(M%O))+C}var E=dd(W,M,1);f=1,F=E?0:F||Nr(un(M-W)/vm,xm),g=T,m=Jr(F,y,Kt(w,W,M,L),1),l(Xo),r(Zr),m.start()}function y(){l(Ji),g&&g(),r(Ei)}function w(M,F,K,T){var L=c(),W=M+(F-M)*Y(T),O=(W-L)*f;x(L+O),b&&!K&&p()&&(f*=ym,un(O)<hm&&I(u(p(!0)),fm,!1,g,!0))}function V(){m&&m.cancel()}function z(){m&&!m.isPaused()&&(V(),y())}function Y(M){var F=n.easingFunc;return F?F(M):1-Math.pow(1-M,4)}return{mount:v,destroy:V,scroll:I,cancel:z}}var Di={passive:!1,capture:!0};function wm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,x=t.Controller,b=t.Elements.track,m=t.Media.reduce,g=t.Direction,f=g.resolve,v=g.orient,I=u.getPosition,y=u.exceededLimit,w,V,z,Y,M,F=!1,K,T,L;function W(){l(b,ya,Qa,Di),l(b,va,Qa,Di),l(b,Hd,C,Di),l(b,"click",S,{capture:!0}),l(b,"dragstart",Nn),o([li,cn],O)}function O(){var U=n.drag;ue(!U),Y=U==="free"}function C(U){if(K=!1,!T){var se=Ie(U);fe(U.target)&&(se||!U.button)&&(x.isBusy()?Nn(U,!0):(L=se?b:window,M=c.is([mo,Xo]),z=null,l(L,ya,E,Di),l(L,va,_,Di),u.cancel(),p.cancel(),Z(U)))}}function E(U){if(c.is(Er)||(c.set(Er),r(fd)),U.cancelable)if(M){u.translate(w+oe(k(U)));var se=de(U)>wl,re=F!==(F=y());(se||re)&&Z(U),K=!0,r(yd),Nn(U)}else B(U)&&(M=H(U),Nn(U))}function _(U){c.is(Er)&&(c.set(Ji),r(vd)),M&&($(U),Nn(U)),d(L,ya,E),d(L,va,_),M=!1}function S(U){!T&&K&&Nn(U,!0)}function Z(U){z=V,V=U,w=I()}function $(U){var se=le(U),re=ie(se),Re=n.rewind&&n.rewindByDrag;m(!1),Y?x.scroll(re,0,n.snap):e.is(er)?x.go(v(ts(se))<0?Re?"<":"-":Re?">":"+"):e.is(eo)&&F&&Re?x.go(y(!0)?">":"<"):x.go(x.toDest(re),!0),m(!0)}function H(U){var se=n.dragMinThreshold,re=Fo(se),Re=re&&se.mouse||0,Se=(re?se.touch:+se)||10;return un(k(U))>(Ie(U)?Se:Re)}function B(U){return un(k(U))>un(k(U,!0))}function le(U){if(e.is(ho)||!F){var se=de(U);if(se&&se<wl)return k(U)/se}return 0}function ie(U){return I()+ts(U)*ii(un(U)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function k(U,se){return ce(U,se)-ce(G(U),se)}function de(U){return es(U)-es(G(U))}function G(U){return V===U&&z||V}function ce(U,se){return(Ie(U)?U.changedTouches[0]:U)["page"+f(se?"Y":"X")]}function oe(U){return U/(F&&e.is(eo)?em:1)}function fe(U){var se=n.noDrag;return!Wo(U,"."+Ad+", ."+oa)&&(!se||!Wo(U,se))}function Ie(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function xe(){return M}function ue(U){T=U}return{mount:W,disable:ue,isDragging:xe}}var Sm={Spacebar:" ",Right:ta,Left:ea,Up:Ld,Down:Rd};function Vs(e){return e=ni(e)?e:e.key,Sm[e]||e}var Sl="keydown";function $m(e,t,n){var i=Jt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function x(){b(),o(cn,m),o(cn,b),o(Vn,f)}function b(){var I=n.keyboard;I&&(u=I==="global"?window:d,r(u,Sl,v))}function m(){l(u,Sl)}function g(I){p=I}function f(){var I=p;p=!0,id(function(){p=I})}function v(I){if(!p){var y=Vs(I);y===c(ea)?e.go("<"):y===c(ta)&&e.go(">")}}return{mount:x,destroy:m,disable:g}}var Po=ks+"-lazy",kr=Po+"-srcset",Cm="["+Po+"], ["+kr+"]";function Tm(e,t,n){var i=Jt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[go,Ei],p=[];function x(){n.lazyLoad&&(b(),o(en,b))}function b(){Bn(p),m(),c?I():(r(u),o(u,g),g())}function m(){t.Slides.forEach(function(y){Ps(y.slide,Cm).forEach(function(w){var V=$n(w,Po),z=$n(w,kr);if(V!==w.src||z!==w.srcset){var Y=n.classes.spinner,M=w.parentElement,F=Zo(M,"."+Y)||Xi("span",Y,M);p.push([w,y,F]),w.src||Ho(w,"none")}})})}function g(){p=p.filter(function(y){var w=n.perPage*((n.preloadPages||1)+1)-1;return y[1].isWithin(e.index,w)?f(y):!0}),p.length||r(u)}function f(y){var w=y[0];kn(y[1].slide,rs),l(w,"load error",Kt(v,y)),Mt(w,"src",$n(w,Po)),Mt(w,"srcset",$n(w,kr)),An(w,Po),An(w,kr)}function v(y,w){var V=y[0],z=y[1];On(z.slide,rs),w.type!=="error"&&(Li(y[2]),Ho(V,""),d(Os,V,z),d(Qi)),c&&I()}function I(){p.length&&f(p.shift())}return{mount:x,destroy:Kt(Bn,p),check:g}}function Lm(e,t,n){var i=Jt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,x=u.getIndex,b=u.go,m=t.Direction.resolve,g=c.pagination,f=[],v,I;function y(){w(),o([cn,en,Or],y);var T=n.pagination;g&&Ho(g,T?"":"none"),T&&(o([Vn,Zr,Ei],K),V(),K(),r(wd,{list:v,items:f},F(e.index)))}function w(){v&&(Li(g?si(v.children):v),On(v,I),Bn(f),v=null),i.destroy()}function V(){var T=e.length,L=n.classes,W=n.i18n,O=n.perPage,C=p()?u.getEnd()+1:Oo(T/O);v=g||Xi("ul",L.pagination,c.track.parentElement),kn(v,I=ra+"--"+M()),Mt(v,Dn,"tablist"),Mt(v,vn,W.select),Mt(v,js,M()===na?"vertical":"");for(var E=0;E<C;E++){var _=Xi("li",null,v),S=Xi("button",{class:L.page,type:"button"},_),Z=d.getIn(E).map(function(H){return H.slide.id}),$=!p()&&O>1?W.pageX:W.slideX;l(S,"click",Kt(z,E)),n.paginationKeyboard&&l(S,"keydown",Kt(Y,E)),Mt(_,Dn,"presentation"),Mt(S,Dn,"tab"),Mt(S,Qo,Z.join(" ")),Mt(S,vn,ns($,E+1)),Mt(S,Ui,-1),f.push({li:_,button:S,page:E})}}function z(T){b(">"+T,!0)}function Y(T,L){var W=f.length,O=Vs(L),C=M(),E=-1;O===m(ta,!1,C)?E=++T%W:O===m(ea,!1,C)?E=(--T+W)%W:O==="Home"?E=0:O==="End"&&(E=W-1);var _=f[E];_&&(sd(_.button),b(">"+E),Nn(L,!0))}function M(){return n.paginationDirection||n.direction}function F(T){return f[u.toPage(T)]}function K(){var T=F(x(!0)),L=F(x());if(T){var W=T.button;On(W,Ri),An(W,fl),Mt(W,Ui,-1)}if(L){var O=L.button;kn(O,Ri),Mt(O,fl,!0),Mt(O,Ui,"")}r(Sd,{list:v,items:f},T,L)}return{items:f,mount:y,destroy:w,getAt:F,update:K}}var Rm=[" ","Enter"];function Im(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(g){g.isParent||(u(e,g.splide),u(g.splide,e))}),i&&p()}function d(){r.forEach(function(g){g.destroy()}),Bn(r)}function c(){d(),l()}function u(g,f){var v=Jt(g);v.on(Vn,function(I,y,w){f.go(f.is(ho)?w:I)}),r.push(v)}function p(){var g=Jt(e),f=g.on;f(Fs,b),f(Cd,m),f([li,cn],x),r.push(g),g.emit(_s,e.splides)}function x(){Mt(t.Elements.list,js,n.direction===na?"vertical":"")}function b(g){e.go(g.index)}function m(g,f){Es(Rm,Vs(f))&&(b(g),Nn(f))}return{setup:Kt(t.Media.set,{slideFocus:Uo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Em(e,t,n){var i=Jt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Di)}function d(u){if(u.cancelable){var p=u.deltaY,x=p<0,b=es(u),m=n.wheelMinThreshold||0,g=n.wheelSleep||0;un(p)>m&&b-r>g&&(e.go(x?"<":">"),r=b),c(x)&&Nn(u)}}function c(u){return!n.releaseWheel||e.state.is(mo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Mm=90;function Pm(e,t,n){var i=Jt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Xi("span",Yp),c=Jr(Mm,Kt(p,!1));function u(){l&&(b(!t.Autoplay.isPaused()),Mt(r,xl,!0),d.textContent="…",o(Ns,Kt(b,!0)),o(Hs,Kt(b,!1)),o([go,Ei],Kt(p,!0)))}function p(m){Mt(r,vl,m),m?(Ko(r,d),c.start()):(Li(d),c.cancel())}function x(){An(r,[yl,xl,vl]),Li(d)}function b(m){l&&Mt(r,yl,m?"off":"polite")}return{mount:u,disable:b,destroy:x}}var km=Object.freeze({__proto__:null,Media:Dp,Direction:jp,Elements:tm,Slides:im,Layout:om,Clones:am,Move:sm,Controller:lm,Arrows:um,Autoplay:mm,Cover:gm,Scroll:bm,Drag:wm,Keyboard:$m,LazyLoad:Tm,Pagination:Lm,Sync:Im,Wheel:Em,Live:Pm}),Am={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"},Fm={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:Jp,i18n:Am,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Wm(e,t,n){var i=t.Slides;function o(){Jt(e).on([li,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),id(c)}return{mount:o,start:l,cancel:Qa}}function _m(e,t,n){var i=t.Move,o=t.Controller,r=t.Scroll,l=t.Elements.list,d=Kt(Sn,l,"transition"),c;function u(){Jt(e).bind(l,"transitionend",function(m){m.target===l&&c&&(x(),c())})}function p(m,g){var f=i.toPosition(m,!0),v=i.getPosition(),I=b(m);un(f-v)>=1&&I>=1?n.useScroll?r.scroll(f,I,!1,g):(d("transform "+I+"ms "+n.easing),i.translate(f,!0),c=g):(i.jump(m),g())}function x(){d(""),r.cancel()}function b(m){var g=n.rewindSpeed;if(e.is(eo)&&g){var f=o.getIndex(!0),v=o.getEnd();if(f===0&&m>=v||f>=v&&m===0)return g}return n.speed}return{mount:u,start:p,cancel:x}}var Nm=(function(){function e(n,i){this.event=Jt(),this.Components={},this.state=Hp(Bi),this.splides=[],this._o={},this._E={};var o=ni(n)?cd(document,n):n;Mo(o,o+" is invalid."),this.root=o,i=Zn({label:$n(o,vn)||"",labelledby:$n(o,Ds)||""},Fm,e.defaults,i||{});try{Zn(i,JSON.parse($n(o,ks)))}catch{Mo(!1,"Invalid JSON")}this._o=Object.create(Zn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Mo(l.is([Bi,_r]),"Already mounted!"),l.set(Bi),this._C=d,this._T=o||this._T||(this.is(er)?Wm:_m),this._E=i||this._E;var c=No({},km,this._E,{Transition:this._T});return Ci(c,function(u,p){var x=u(r,d,r._o);d[p]=x,x.setup&&x.setup()}),Ci(d,function(u){u.mount&&u.mount()}),this.emit(li),kn(this.root,Kp),l.set(Ji),this.emit(is),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(si(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(Bi)?Jt(this).on(is,this.destroy.bind(this,i)):(Ci(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Ws),o.destroy(),i&&Bn(this.splides),r.set(_r)),this},Ap(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})(),Gs=Nm;Gs.defaults={};Gs.STATES=Wp;var $l=[[li,"onMounted"],[is,"onReady"],[Vn,"onMove"],[go,"onMoved"],[Fs,"onClick"],[pd,"onActive"],[md,"onInactive"],[gd,"onVisible"],[hd,"onHidden"],[en,"onRefresh"],[cn,"onUpdated"],[Qi,"onResize"],[Kr,"onResized"],[fd,"onDrag"],[yd,"onDragging"],[vd,"onDragged"],[Zr,"onScroll"],[Ei,"onScrolled"],[Ws,"onDestroy"],[xd,"onArrowsMounted"],[bd,"onArrowsUpdated"],[wd,"onPaginationMounted"],[Sd,"onPaginationUpdated"],[_s,"onNavigationMounted"],[Ns,"onAutoplayPlay"],[$d,"onAutoplayPlaying"],[Hs,"onAutoplayPause"],[Os,"onLazyLoadLoaded"]];function qs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function as(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!as(n,t[i]));if(Dr(e)&&Dr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!as(e[o],t[o]))}return e===t}function Hm(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 ss(e,t){const n=e;return Om(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=ss(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Dm=({children:e,className:t,...n})=>s.createElement("div",{className:qs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Xs=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 Gs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=ss({},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&&!as(this.options,e)&&(this.splide.options=e,this.options=ss({},e));const t=this.getSlides();Hm(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){$l.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:qs("splide",e),ref:this.splideRef,...this.omit(o,["options",...$l.map(r=>r[1])])},n?s.createElement(Dm,null,i):i)}},Us=({children:e,className:t,...n})=>s.createElement("li",{className:qs("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 jm="RichTextRenderer-module__link___BWeZ2",zm={link:jm},Bm=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))},fo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Bm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Zt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:fo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(n,t),lineHeight:i!==void 0?j.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 Ii=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:zm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Vm(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 Vm(e){return{...e.fontFamily&&{fontFamily:fo(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 Gm="SvgImage-module__svg___q3xE-",qm="SvgImage-module__img___VsTm-",Cl={svg:Gm,img:qm},Xm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Um=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ln=({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)}},[]),!Xm(e)||!r?a.jsx("img",{src:e,alt:"",className:St(Cl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:St(Cl.svg,i),style:{"--svg":Um(e),"--fill":t,"--hover-fill":n,...o??{}}})},Ym={"top-left":wt.topLeftAlignment,"top-center":wt.topCenterAlignment,"top-right":wt.topRightAlignment,"middle-left":wt.middleLeftAlignment,"middle-center":wt.middleCenterAlignment,"middle-right":wt.middleRightAlignment,"bottom-left":wt.bottomLeftAlignment,"bottom-center":wt.bottomCenterAlignment,"bottom-right":wt.bottomRightAlignment};function Km({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:x,textAppearance:b,color:m}=n.imageCaption??{},[g,f]=s.useState(void 0),[v,I]=s.useState(null),[y,w]=s.useState(0),[V,z]=s.useState(0),{direction:Y,transition:M,controls:F,pagination:K,imageCaption:T,triggers:L}=e,W=s.useRef(M.type),{x:O,y:C}=e.controls.offset,E=_=>{o&&o.go(_)};return s.useEffect(()=>{if(!v)return;const _=new ResizeObserver(S=>{if(!o)return;const[Z]=S;f({width:Math.round(Z.contentRect.width),height:Math.round(Z.contentRect.height)})});return _.observe(v),()=>_.unobserve(v)},[v]),s.useEffect(()=>{!o||W.current===M.type||(z(_=>_+1),W.current=M.type)},[M.type]),a.jsx("div",{className:St(wt.wrapper,{[wt.editor]:i}),ref:I,children:a.jsxs("div",{className:wt.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:St(wt.captionBlock),children:a.jsx("div",{className:wt.captionTextWrapper,children:t.map((_,S)=>a.jsx("div",{className:St(wt.captionText,Ym[T.alignment],{[wt.withPointerEvents]:S===y&&i,[wt.active]:S===y}),style:{fontFamily:fo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":j.scalingValue(l.width,i),letterSpacing:j.scalingValue(c,i),wordSpacing:j.scalingValue(p,i),textAlign:u,fontSize:j.scalingValue(x.fontSize,i),lineHeight:j.scalingValue(x.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:m,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:wt.captionTextInner,style:{"--link-hover-color":T.linkHoverColor,"--link-color":T.linkColor,position:"relative",top:j.scalingValue(T.offset.y,i),left:j.scalingValue(T.offset.x,i)},children:a.jsx(Ii,{content:_.imageCaption})})},S))})}),a.jsx(Xs,{onMove:_=>{w(_.index)},ref:r,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:Y==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((_,S)=>a.jsx(Us,{children:a.jsx("div",{className:wt.sliderItem,children:a.jsx("div",{className:wt.imgWrapper,children:a.jsx("img",{className:St(wt.sliderImage,{[wt.contain]:_.image.objectFit==="contain",[wt.cover]:_.image.objectFit==="cover"}),src:_.image.url,alt:_.image.name??""})})})},S))},V),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:St(wt.arrow,{[wt.arrowVertical]:Y==="vert",[wt.hoverArrow]:F.show==="on hover"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{onClick:()=>{E("-1")},className:wt.arrowInner,style:{transform:`translate(${j.scalingValue(O,i)}, ${j.scalingValue(C*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[F.arrowsImgUrl&&a.jsx(ln,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:St(wt.arrowImg,wt.mirror)}),!F.arrowsImgUrl&&a.jsx(Tl,{color:F.color,className:St(wt.arrowIcon,wt.arrowImg,wt.mirror)})]})}),a.jsx("div",{className:St(wt.arrow,wt.nextArrow,{[wt.arrowVertical]:Y==="vert",[wt.hoverArrow]:F.show==="on hover"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:wt.arrowInner,onClick:()=>E("+1"),style:{transform:`translate(${j.scalingValue(O*(Y==="horiz"?-1:1),i)}, ${j.scalingValue(C,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[F.arrowsImgUrl&&a.jsx(ln,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:wt.arrowImg}),!F.arrowsImgUrl&&a.jsx(Tl,{color:F.color,className:St(wt.arrowIcon,wt.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:wt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),K.isActive&&a.jsx("div",{className:St(wt.pagination,{[wt.paginationInsideBottom]:K.position==="inside-1"&&Y==="horiz",[wt.paginationInsideTop]:K.position==="inside-2"&&Y==="horiz",[wt.paginationOutsideBottom]:K.position==="outside-1"&&Y==="horiz",[wt.paginationOutsideTop]:K.position==="outside-2"&&Y==="horiz",[wt.paginationInsideLeft]:K.position==="inside-1"&&Y==="vert",[wt.paginationInsideRight]:K.position==="inside-2"&&Y==="vert",[wt.paginationOutsideLeft]:K.position==="outside-1"&&Y==="vert",[wt.paginationOutsideRight]:K.position==="outside-2"&&Y==="vert",[wt.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:wt.paginationInner,style:{backgroundColor:K.colors[2],transform:`scale(${K.scale/100}) translate(${j.scalingValue(K.offset.x,i)}, ${j.scalingValue(K.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((_,S)=>a.jsx("button",{onClick:()=>{o&&o.go(S)},className:St(wt.paginationItem),children:a.jsx("div",{className:St(wt.dot,{[wt.activeDot]:S===y}),style:{backgroundColor:S===y?K.colors[0]:K.colors[1],"--pagination-hover-color":K.hover}})},S))})})]})})}function Tl({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 Zm={element:Km,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"]}},Jm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Qm="ImageRevealSlider-module__image___Qjt-e",eg="ImageRevealSlider-module__link___N-iLG",tg="ImageRevealSlider-module__cursor___2U03d",ki={imageRevealSlider:Jm,image:Qm,link:eg,cursor:tg};function Ll(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const r=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*r,d=r/2,c=l/2;if(e>=i.x-d&&e<=i.x+d&&t>=i.y-c&&t<=i.y+c)return!0}return!1}function ba(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ng(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await ba(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await ba(e);r=l.height/l.width*o}else{const l=await ba(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function ig({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,x]=s.useState({x:0,y:0}),[b,m]=s.useState(1),[g,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[I,y]=s.useState(!1),{sizeType:w,imageWidth:V,randomRangeImageWidth:z}=e.imageSize,{revealPosition:Y,visible:M}=e.position,{cursorType:F,target:K,defaultCursorScale:T,defaultCursor:L,hoverCursorScale:W,hoverCursor:O}=e.cursor;s.useEffect(()=>{if(!i)return;const _=($,H)=>{const B=i.getBoundingClientRect(),ce=$-B.left,ie=H-B.top;if(x({x:ce,y:ie}),F==="system"){f("none"),m(1);return}const A=ce,de=ie,G=document.elementFromPoint(B.left+A,B.top+de);if(G&&G.closest("a")){f("none"),m(1);return}const se=Ll(A,de,r)||K==="area"?{img:O??"none",scale:W}:{img:L??"none",scale:T};f(se.img),m(se.scale)},S=$=>{$.stopPropagation(),v.current={x:$.clientX,y:$.clientY},_($.clientX,$.clientY)},Z=()=>{I&&_(v.current.x,v.current.y)};return i.addEventListener("mousemove",S),window.addEventListener("scroll",Z,!0),()=>{i.removeEventListener("mousemove",S),window.removeEventListener("scroll",Z,!0)}},[i,I,p,F,K,O,L,W,T,r]),s.useEffect(()=>{I||(f("none"),m(0))},[I]);const C=async(_,S,Z,$={})=>{const{width:H,height:B,finalWidth:ce}=await ng(_.image.url,w,V,z);let ie=0,A=0;Y==="same"?(ie=S/2,A=Z/2):(ie=$.x??Math.random()*S,A=$.y??Math.random()*Z);const de=Math.min(Math.max(ie,H/2),S-H/2),G=Math.min(Math.max(A,B/2),Z-B/2);return{id:u.current++,url:_.image.url,link:_.link,name:_.image.name,x:de,y:G,width:ce}};s.useEffect(()=>{if(!i||t.length===0)return;const _=i.getBoundingClientRect(),S=_.width,Z=_.height,$=[];(async()=>{const B=t[0],ce=await C(B,S,Z);$.push(ce),l($),c(1)})()},[w,V,z,Y,i]),s.useEffect(()=>{M==="last One"&&l(_=>_.length>0?[_[_.length-1]]:[])},[M]);const E=async _=>{if(!i)return;const S=i.getBoundingClientRect(),Z=_.clientX-S.left,$=_.clientY-S.top;if(K==="image"&&!Ll(Z,$,r))return;let H=0,B=0;Y==="on Click"?(H=Z,B=$):Y==="same"?(H=S.width/2,B=S.height/2):(H=Math.random()*S.width,B=Math.random()*S.height);const ce=t[d],ie=await C(ce,S.width,S.height,{x:H,y:B});l(A=>M==="all"?[...A,ie]:[ie]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:E,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:ki.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(_=>a.jsx("div",{className:ki.wrapper,style:{top:`${_.y}px`,left:`${_.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:_.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:K==="area"&&_.link?a.jsx("a",{href:_.link,target:"_blank",className:ki.link,children:a.jsx("img",{src:_.url,alt:_.name,className:ki.image},_.id)}):a.jsx("img",{src:_.url,alt:_.name,className:ki.image},_.id)},_.id)),I&&a.jsx("div",{className:ki.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const og={element:ig,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:""}]}}}},rg="LightBox-module__hidden___9s-9x",ag="LightBox-module__heroImage___sTxNF",sg="LightBox-module__background___rm9ml",lg="LightBox-module__editor___4ACaY",cg="LightBox-module__contentStyle___Bgnsq",dg="LightBox-module__imageStyle___tLIlB",ug="LightBox-module__imgWrapper___LuFUp",pg="LightBox-module__contain___8-yaS",mg="LightBox-module__cover___hNvOG",gg="LightBox-module__caption___b6L2I",hg="LightBox-module__captionTextInner___rCGNH",fg="LightBox-module__lightboxSplide___XFuWC",yg="LightBox-module__arrow___iz38X",vg="LightBox-module__arrowVertical___Zfz81",xg="LightBox-module__nextArrow___zkAQN",bg="LightBox-module__arrowInner___p48sW",wg="LightBox-module__arrowIcon___3VaFf",Sg="LightBox-module__arrowImg___pNV88",$g="LightBox-module__mirror___pjeXc",Cg="LightBox-module__thumbsWrapper___GB-nU",Tg="LightBox-module__thumbsContainerVertical___wttk5",Lg="LightBox-module__thumbsContainer___osSma",Rg="LightBox-module__thumbsAlignStart___MO6tY",Ig="LightBox-module__thumbsAlignCenter___Q4sUx",Eg="LightBox-module__thumbsAlignEnd___p4y9R",Mg="LightBox-module__thumbItem___HvnF3",Pg="LightBox-module__closeButton___g2khP",kg="LightBox-module__fadeIn___0m5GW",Ag="LightBox-module__slideInLeft___gPYwC",Fg="LightBox-module__slideInRight___S-pPp",Wg="LightBox-module__slideInTop___DFdAj",_g="LightBox-module__slideInBottom___m27kZ",Ng="LightBox-module__fadeOut___55qBR",Hg="LightBox-module__slideOutLeft___NvU7P",Og="LightBox-module__slideOutRight___SK7eC",Dg="LightBox-module__slideOutTop___Vgg0z",jg="LightBox-module__slideOutBottom___nJ0Ef",zg="LightBox-module__scaleSlide___vZriG",ot={hidden:rg,heroImage:ag,background:sg,editor:lg,contentStyle:cg,imageStyle:dg,imgWrapper:ug,contain:pg,cover:mg,caption:gg,captionTextInner:hg,lightboxSplide:fg,arrow:yg,arrowVertical:vg,nextArrow:xg,arrowInner:bg,arrowIcon:wg,arrowImg:Sg,mirror:$g,thumbsWrapper:Cg,thumbsContainerVertical:Tg,thumbsContainer:Lg,thumbsAlignStart:Rg,thumbsAlignCenter:Ig,thumbsAlignEnd:Eg,thumbItem:Mg,closeButton:Pg,fadeIn:kg,slideInLeft:Ag,slideInRight:Fg,slideInTop:Wg,slideInBottom:_g,fadeOut:Ng,slideOutLeft:Hg,slideOutRight:Og,slideOutTop:Dg,slideOutBottom:jg,scaleSlide:zg},lr=(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% + ${j.scalingValue(t.x,n)}), calc(-50% + ${j.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${j.scalingValue(t.x,n)}, calc(-50% + ${j.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${j.scalingValue(t.x,n)}), ${j.scalingValue(t.y,n)})`:i.transform=`translate(${j.scalingValue(t.x,n)}, ${j.scalingValue(t.y,n)})`,i};function Od(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 Bg(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 Dd(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 Vg(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 jd(e,t,n,i,o){const{x:r,y:l}=Bg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Gg(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"?Vg:Dd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:b}=jd(n,i,u,p,d),m=(x+u/2)/n*100,g=(b+p/2)/i*100;return`${m}% ${g}%`}function qg(e){return Gg(e)}function jr(e){const t=e.getBoundingClientRect(),n=Od(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}=Dd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=jd(i,o,d,c,u),b=t.left+n.left,m=t.top+n.top;return{x:p+b,y:x+m,width:d,height:c}}function Rl(e){const t=e.getBoundingClientRect(),n=Od(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Il(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 Xg(e,t){const n=(()=>{if(e==="fade in")return ot.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return ot.slideInLeft;case"right":return ot.slideInRight;case"top":return ot.slideInTop;case"bottom":return ot.slideInBottom;default:return ot.slideInRight}return ot.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return ot.fadeIn;if(e==="slide in")switch(t){case"left":return ot.slideInLeft;case"right":return ot.slideInRight;case"top":return ot.slideInTop;case"bottom":return ot.slideInBottom;default:return ot.slideInRight}return ot.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return ot.fadeOut;if(e==="slide in")switch(t){case"left":return ot.slideOutLeft;case"right":return ot.slideOutRight;case"top":return ot.slideOutTop;case"bottom":return ot.slideOutBottom;default:return ot.slideOutRight}return ot.fadeOut})(),r=(()=>{if(e==="fade in")return ot.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return ot.slideOutLeft;case"right":return ot.slideOutRight;case"top":return ot.slideOutTop;case"bottom":return ot.slideOutBottom;default:return ot.slideOutRight}return ot.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Ug=({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:ot.heroImage,onClick:()=>c(!0)}),a.jsx(Yg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Yg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:b,fontSizeLineHeight:m,textAppearance:g,color:f}=i.imageCaption??{},[v,I]=s.useState(0),[y,w]=s.useState(0),[V,z]=s.useState(!1),[Y,M]=s.useState(!1),[F,K]=s.useState({}),T=s.useRef(null),L=s.useRef(null),W=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(null),Z=s.useRef(!1),$=s.useRef(null),[H,B]=s.useState(!1),{appear:ce,triggers:ie,slider:A,thumbnail:de,controls:G,area:se,caption:oe,layout:he}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:ve,backdropDisappearClass:ue,disappearClass:U}=Xg(ce.type,ce.direction),le=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var X,ee;(ee=(X=T.current)==null?void 0:X.splide)==null||ee.refresh()},16)},q=()=>{w(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!de.isActive){B(!1);return}const h=$.current;if(!h)return;const q=()=>{A.direction==="horiz"?B(h.scrollWidth>h.clientWidth):B(h.scrollHeight>h.clientHeight)};q();const X=new ResizeObserver(q);return X.observe(h),()=>X.disconnect()},[e,de.isActive,n.length,F,A.direction]);const re=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,q=Il(se.color);h&&!l&&q>.9&&(document.body.style.backgroundColor=""),z(!0),O.current=!0;const X=ee=>{ee.target===C.current&&ee.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,O.current&&(O.current=!1,t()),z(!1))};C.current&&(E.current=X,C.current.addEventListener("animationend",X))},[t,se.color,l]),Re=(h,q,X)=>{var ee,ye;if(h){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&v===n.length-1?re():(ee=T.current)==null||ee.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const D=h.getBoundingClientRect(),R=q-D.left,Q=X-D.top,ne=D.width,N=D.height;let te;A.direction==="horiz"?te=R<ne/2?"-1":"+1":te=Q<N/2?"-1":"+1",(ye=T.current)==null||ye.go(te)}}},we=h=>{if(Z.current){Z.current=!1;return}const q=n[v],X=(q==null?void 0:q.image.objectFit)==="cover";let ee,ye;if("changedTouches"in h&&h.changedTouches.length>0)ee=h.changedTouches[0].clientX,ye=h.changedTouches[0].clientY;else if("clientX"in h)ee=h.clientX,ye=h.clientY;else return;let D;if(X&&W.current){const R=Rl(W.current);D=ee>=R.left&&ee<=R.right&&ye>=R.top&&ye<=R.bottom}else{const R=W.current?jr(W.current):null;if(!R){h.target===h.currentTarget&&re();return}D=ee>=R.x&&ee<=R.x+R.width&&ye>=R.y&&ye<=R.y+R.height}D?Re(W.current,ee,ye):re()},ke=h=>{const q=h.target;(q.classList.contains(ot.thumbsWrapper)||q.classList.contains(ot.thumbsContainer))&&we(h)};s.useEffect(()=>{if(!e)return;const h=q=>{var X,ee;if(q.key==="Escape"){re();return}if(q.key==="ArrowRight"){I(ye=>(ye+1)%Math.max(n.length,1)),(X=T.current)==null||X.go("+1");return}q.key==="ArrowLeft"&&(I(ye=>(ye-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=T.current)==null||ee.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,re,n.length]),s.useEffect(()=>{if(e){if(I(0),w(q=>q+1),O.current=!1,z(!1),M(!1),K({}),!le)return;const h=new CustomEvent("page-overlay",{detail:{itemId:le}});window.dispatchEvent(h)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),M(!1)}},[e,le]),s.useEffect(()=>{L.current!==null&&L.current!==A.type&&w(h=>h+1),L.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,X=Il(se.color);document.body.style.overflow="hidden",M(!1);const ee=D=>{D.target===C.current&&!O.current&&D.animationName&&(q&&!l&&X>.9&&(document.body.style.backgroundColor=se.color),M(!0),C.current&&_.current&&C.current.removeEventListener("animationend",_.current),_.current=null)};C.current&&(_.current=ee,C.current.addEventListener("animationend",ee));const ye=D=>{const R=D.target;R&&(R.closest(`.${ot.thumbsWrapper}`)||R.closest(`.${ot.thumbsContainer}`))||A.type!=="slide"&&D.preventDefault()};return document.addEventListener("touchmove",ye,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",ye),C.current&&_.current&&(C.current.removeEventListener("animationend",_.current),_.current=null),M(!1)}},[e,l,se.color,A.type]),s.useEffect(()=>{if(!e)return;const h=q=>{var ee,ye;if(O.current){q.stopPropagation();return}if(Z.current){Z.current=!1;return}const X=q.target;if(!(X&&(X.closest(`.${ot.thumbsContainer}`)||X.closest(`.${ot.thumbItem}`)||X.closest(`.${ot.arrow}`)||X.closest(`.${ot.closeButton}`)||X.closest(`.${ot.caption}`)))){if(A.type==="slide"&&ie.type==="drag"&&((ye=(ee=T.current)==null?void 0:ee.splide)!=null&&ye.root)){const D=T.current.splide.root;if(X&&(D.contains(X)||D===X))return}if(q.touches.length===0&&q.changedTouches.length>0){const D=n[v],R=(D==null?void 0:D.image.objectFit)==="cover",Q=q.changedTouches[0];let ne;if(R&&W.current){const N=Rl(W.current);ne=Q.clientX>=N.left&&Q.clientX<=N.right&&Q.clientY>=N.top&&Q.clientY<=N.bottom}else{const N=W.current?jr(W.current):null;if(!N)return;ne=Q.clientX>=N.x&&Q.clientX<=N.x+N.width&&Q.clientY>=N.y&&Q.clientY<=N.y+N.height}if(!ne){q.stopPropagation(),O.current=!0;const N=te=>{te.stopPropagation(),te.preventDefault(),document.removeEventListener("click",N,!0)};document.addEventListener("click",N,!0),re()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,re,v,n]);const fe=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var te,Ee;if(!e||!fe||!((Ee=(te=T.current)==null?void 0:te.splide)!=null&&Ee.root))return;const h=T.current.splide.root,q=30,X=(me,J)=>{if(S.current){const Ke=Math.abs(me-S.current.x),Be=Math.abs(J-S.current.y);(Ke>0||Be>0)&&(Z.current=!0)}},ee=me=>{S.current&&(me.preventDefault(),X(me.clientX,me.clientY))},ye=me=>{S.current&&me.touches.length>0&&(me.preventDefault(),X(me.touches[0].clientX,me.touches[0].clientY))},D=(me,J)=>{if(!S.current||!T.current){S.current=null;return}const Ke=Math.abs(me-S.current.x),Be=Math.abs(J-S.current.y);Be>q&&Be>Ke&&T.current.go(J<S.current.y?"+1":"-1"),S.current=null},R=me=>{S.current&&D(me.clientX,me.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ee)},Q=me=>{if(S.current){if(me.changedTouches.length>0){const J=me.changedTouches[0];D(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",ye)}},ne=me=>{S.current={x:me.clientX,y:me.clientY},Z.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},N=me=>{me.touches.length>0&&(S.current={x:me.touches[0].clientX,y:me.touches[0].clientY},Z.current=!1,document.addEventListener("touchmove",ye,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",ne),h.addEventListener("touchstart",N),()=>{h.removeEventListener("pointerdown",ne),h.removeEventListener("touchstart",N),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",ye),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),S.current=null,Z.current=!1}},[e,fe,y]);const xe={backgroundColor:se.color,backdropFilter:`blur(${se.blur}px)`,animationDuration:`${parseInt(ce.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Gn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:C,className:St(ot.background,V?ue:ve,{[ot.editor]:l},{[ot.hidden]:!e}),style:{...xe,...Y&&!l&&!V?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?C:null,className:St(ot.contentStyle,V?U:Ie,{[ot.editor]:l},{[ot.hidden]:!e}),style:{animationDuration:`${parseInt(ce.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Xs,{onMove:h=>I(h.index),ref:T,className:ot.lightboxSplide,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,direction:A.direction==="horiz"||A.type==="fade"||A.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!fe,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((h,q)=>{const X=lr(he.position,he.offset,l),ee=`${j.scalingValue(he.padding.top,l)} ${j.scalingValue(he.padding.right,l)} ${j.scalingValue(he.padding.bottom,l)} ${j.scalingValue(he.padding.left,l)}`,ye=A.type==="scale"?(()=>{const{transform:D,...R}=X;return{...R,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":D||"none"}})():{...X,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(Us,{children:a.jsx("div",{className:ot.imgWrapper,onClick:we,children:a.jsx("img",{ref:q===v?W:null,className:St(ot.imageStyle,{[ot.contain]:h.image.objectFit==="contain",[ot.cover]:h.image.objectFit==="cover",[ot.scaleSlide]:A.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...ye,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},q)})},y),G.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:St(ot.arrow,{[ot.arrowVertical]:A.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:ot.arrowInner,style:{transform:`translate(${j.scalingValue(G.offset.x,l)}, ${j.scalingValue(G.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${G.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[G.arrowsImgUrl&&a.jsx(ln,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:St(ot.arrowImg,ot.mirror)}),!G.arrowsImgUrl&&a.jsx(El,{color:G.color,className:St(ot.arrowIcon,ot.arrowImg,ot.mirror)})]})}),a.jsx("div",{className:St(ot.arrow,ot.nextArrow,{[ot.arrowVertical]:A.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:ot.arrowInner,style:{transform:`translate(${j.scalingValue(G.offset.x*(A.direction==="horiz"?-1:1),l)}, ${j.scalingValue(G.offset.y,l)}) scale(${G.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[G.arrowsImgUrl&&a.jsx(ln,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:ot.arrowImg}),!G.arrowsImgUrl&&a.jsx(El,{color:G.color,className:St(ot.arrowIcon,ot.arrowImg)})]})})]}),se.closeIconUrl&&(()=>{const h=lr(se.closeIconAlign,se.closeIconOffset,l),q=`scale(${se.closeIconScale})`,X=h.transform?`${h.transform} ${q}`:q;return a.jsx("button",{className:ot.closeButton,style:{...h,transform:X},onClick:re,"aria-label":"Close lightbox",children:a.jsx(ln,{url:se.closeIconUrl,fill:se.closeIconColor??"#000000",hoverFill:se.closeIconHover??"#cccccc"})})})(),oe&&oe.isActive&&i.imageCaption&&((Ce=n[v])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:ot.caption,style:{...lr(oe.alignment,oe.offset,l),fontFamily:fo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":j.scalingValue(c.width,l),letterSpacing:j.scalingValue(p,l),wordSpacing:j.scalingValue(b,l),textAlign:x,fontSize:j.scalingValue(m.fontSize,l),lineHeight:j.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:f},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:ot.captionTextInner,style:{"--link-color":oe.linkColor,"--link-hover-color":oe.linkHoverColor},children:a.jsx(Ii,{content:n[v].imageCaption})})}),de.isActive&&(()=>{const[h,q]=de.position.split("-"),X=A.direction==="horiz"?`${h}-left`:de.position,ee=lr(X,de.offset,l),ye=()=>{if(A.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:$,className:ot.thumbsWrapper,onClick:D=>ke(D),style:{position:l?"absolute":"fixed",...ee,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:St(ot.thumbsContainer,{[ot.thumbsContainerVertical]:A.direction==="vert",[ot.thumbsAlignStart]:de.align==="start",[ot.thumbsAlignCenter]:de.align==="center",[ot.thumbsAlignEnd]:de.align==="end"}),style:{gap:j.scalingValue(de.grid.gap,l),justifyContent:H?"flex-start":ye()},children:n.map((D,R)=>{const Q=R===v,ne=F[R],te=de.grid.size*(Q?de.activeState.scale:1),Ee=()=>{if(de.fit!=="fit")return{};if(!ne)return A.direction==="horiz"?{height:j.scalingValue(te,l)}:{width:j.scalingValue(te,l)};const me=ne.width/ne.height;if(A.direction==="horiz"){const J=te,Ke=J*me;return{width:j.scalingValue(Ke,l),height:j.scalingValue(J,l)}}else{const J=te,Ke=J/me;return{width:j.scalingValue(J,l),height:j.scalingValue(Ke,l)}}};return a.jsx("button",{className:ot.thumbItem,style:{...A.direction==="horiz"&&de.fit!=="fit"?{height:j.scalingValue(te,l)}:{},...A.direction==="vert"&&de.fit!=="fit"?{width:j.scalingValue(te,l)}:{},...de.fit==="cover"?{width:j.scalingValue(te,l),height:j.scalingValue(te,l)}:{},...Ee(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:me=>{var J;me.stopPropagation(),I(R),(J=T.current)==null||J.go(R)},onMouseEnter:()=>{var me;de.triggers==="hov"&&((me=T.current)==null||me.go(R))},children:a.jsx("img",{src:D.image.url,alt:D.image.name??"",onLoad:me=>{const J=me.currentTarget;J.naturalWidth&&J.naturalHeight&&K(Ke=>({...Ke,[R]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${D.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function El({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 Kg={element:Ug,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zg(e){return`
|
|
6
|
+
*/const jm="RichTextRenderer-module__link___BWeZ2",zm={link:jm},Bm=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))},fo=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Bm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Zt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:fo(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:j.scalingValue(e.letterSpacing,t),wordSpacing:j.scalingValue(e.wordSpacing,t),fontSize:j.scalingValue(n,t),lineHeight:i!==void 0?j.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 Ii=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:zm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Vm(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 Vm(e){return{...e.fontFamily&&{fontFamily:fo(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 Gm="SvgImage-module__svg___q3xE-",qm="SvgImage-module__img___VsTm-",Cl={svg:Gm,img:qm},Xm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Um=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,ln=({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)}},[]),!Xm(e)||!r?a.jsx("img",{src:e,alt:"",className:$t(Cl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:$t(Cl.svg,i),style:{"--svg":Um(e),"--fill":t,"--hover-fill":n,...o??{}}})},Ym={"top-left":St.topLeftAlignment,"top-center":St.topCenterAlignment,"top-right":St.topRightAlignment,"middle-left":St.middleLeftAlignment,"middle-center":St.middleCenterAlignment,"middle-right":St.middleRightAlignment,"bottom-left":St.bottomLeftAlignment,"bottom-center":St.bottomCenterAlignment,"bottom-right":St.bottomRightAlignment};function Km({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:x,textAppearance:b,color:m}=n.imageCaption??{},[g,f]=s.useState(void 0),[v,I]=s.useState(null),[y,w]=s.useState(0),[V,z]=s.useState(0),{direction:Y,transition:M,controls:F,pagination:K,imageCaption:T,triggers:L}=e,W=s.useRef(M.type),{x:O,y:C}=e.controls.offset,E=_=>{o&&o.go(_)};return s.useEffect(()=>{if(!v)return;const _=new ResizeObserver(S=>{if(!o)return;const[Z]=S;f({width:Math.round(Z.contentRect.width),height:Math.round(Z.contentRect.height)})});return _.observe(v),()=>_.unobserve(v)},[v]),s.useEffect(()=>{!o||W.current===M.type||(z(_=>_+1),W.current=M.type)},[M.type]),a.jsx("div",{className:$t(St.wrapper,{[St.editor]:i}),ref:I,children:a.jsxs("div",{className:St.sliderInner,style:{width:g?g.width:"100%",height:g?g.height:"100%",backgroundColor:M.backgroundColor&&M.type==="fade in"?M.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:$t(St.captionBlock),children:a.jsx("div",{className:St.captionTextWrapper,children:t.map((_,S)=>a.jsx("div",{className:$t(St.captionText,Ym[T.alignment],{[St.withPointerEvents]:S===y&&i,[St.active]:S===y}),style:{fontFamily:fo(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":j.scalingValue(l.width,i),letterSpacing:j.scalingValue(c,i),wordSpacing:j.scalingValue(p,i),textAlign:u,fontSize:j.scalingValue(x.fontSize,i),lineHeight:j.scalingValue(x.lineHeight,i),textTransform:b.textTransform??"none",textDecoration:b.textDecoration??"none",fontVariant:b.fontVariant??"normal",color:m,transitionDuration:M.duration?`${Math.round(parseInt(M.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:St.captionTextInner,style:{"--link-hover-color":T.linkHoverColor,"--link-color":T.linkColor,position:"relative",top:j.scalingValue(T.offset.y,i),left:j.scalingValue(T.offset.x,i)},children:a.jsx(Ii,{content:_.imageCaption})})},S))})}),a.jsx(Xs,{onMove:_=>{w(_.index)},ref:r,options:{arrows:!1,speed:M.duration?parseInt(M.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:Y==="horiz"||M.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:g?g.width:"100%",height:g?g.height:"100%",type:M.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((_,S)=>a.jsx(Us,{children:a.jsx("div",{className:St.sliderItem,children:a.jsx("div",{className:St.imgWrapper,children:a.jsx("img",{className:$t(St.sliderImage,{[St.contain]:_.image.objectFit==="contain",[St.cover]:_.image.objectFit==="cover"}),src:_.image.url,alt:_.image.name??""})})})},S))},V),F.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:$t(St.arrow,{[St.arrowVertical]:Y==="vert",[St.hoverArrow]:F.show==="on hover"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{onClick:()=>{E("-1")},className:St.arrowInner,style:{transform:`translate(${j.scalingValue(O,i)}, ${j.scalingValue(C*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[F.arrowsImgUrl&&a.jsx(ln,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:$t(St.arrowImg,St.mirror)}),!F.arrowsImgUrl&&a.jsx(Tl,{color:F.color,className:$t(St.arrowIcon,St.arrowImg,St.mirror)})]})}),a.jsx("div",{className:$t(St.arrow,St.nextArrow,{[St.arrowVertical]:Y==="vert",[St.hoverArrow]:F.show==="on hover"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:a.jsxs("button",{className:St.arrowInner,onClick:()=>E("+1"),style:{transform:`translate(${j.scalingValue(O*(Y==="horiz"?-1:1),i)}, ${j.scalingValue(C,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[F.arrowsImgUrl&&a.jsx(ln,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:St.arrowImg}),!F.arrowsImgUrl&&a.jsx(Tl,{color:F.color,className:$t(St.arrowIcon,St.arrowImg)})]})})]}),L.triggersList.click&&a.jsx("div",{className:St.clickOverlay,onClick:()=>{o&&o.go("+1")}}),K.isActive&&a.jsx("div",{className:$t(St.pagination,{[St.paginationInsideBottom]:K.position==="inside-1"&&Y==="horiz",[St.paginationInsideTop]:K.position==="inside-2"&&Y==="horiz",[St.paginationOutsideBottom]:K.position==="outside-1"&&Y==="horiz",[St.paginationOutsideTop]:K.position==="outside-2"&&Y==="horiz",[St.paginationInsideLeft]:K.position==="inside-1"&&Y==="vert",[St.paginationInsideRight]:K.position==="inside-2"&&Y==="vert",[St.paginationOutsideLeft]:K.position==="outside-1"&&Y==="vert",[St.paginationOutsideRight]:K.position==="outside-2"&&Y==="vert",[St.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:St.paginationInner,style:{backgroundColor:K.colors[2],transform:`scale(${K.scale/100}) translate(${j.scalingValue(K.offset.x,i)}, ${j.scalingValue(K.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((_,S)=>a.jsx("button",{onClick:()=>{o&&o.go(S)},className:$t(St.paginationItem),children:a.jsx("div",{className:$t(St.dot,{[St.activeDot]:S===y}),style:{backgroundColor:S===y?K.colors[0]:K.colors[1],"--pagination-hover-color":K.hover}})},S))})})]})})}function Tl({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 Zm={element:Km,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"]}},Jm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Qm="ImageRevealSlider-module__image___Qjt-e",eg="ImageRevealSlider-module__link___N-iLG",tg="ImageRevealSlider-module__cursor___2U03d",ki={imageRevealSlider:Jm,image:Qm,link:eg,cursor:tg};function Ll(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 xa(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ng(e,t,n,i){let o,r;if(t==="custom"){o=n;const l=await xa(e);r=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await xa(e);r=l.height/l.width*o}else{const l=await xa(e);o=l.width,r=l.height}return{width:o,height:r,finalWidth:`${o}px`}}function ig({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,x]=s.useState({x:0,y:0}),[b,m]=s.useState(1),[g,f]=s.useState("none"),v=s.useRef({x:0,y:0}),[I,y]=s.useState(!1),{sizeType:w,imageWidth:V,randomRangeImageWidth:z}=e.imageSize,{revealPosition:Y,visible:M}=e.position,{cursorType:F,target:K,defaultCursorScale:T,defaultCursor:L,hoverCursorScale:W,hoverCursor:O}=e.cursor;s.useEffect(()=>{if(!i)return;const _=($,H)=>{const B=i.getBoundingClientRect(),le=$-B.left,ie=H-B.top;if(x({x:le,y:ie}),F==="system"){f("none"),m(1);return}const k=le,de=ie,G=document.elementFromPoint(B.left+k,B.top+de);if(G&&G.closest("a")){f("none"),m(1);return}const ce=Ll(k,de,r)||K==="area"?{img:O??"none",scale:W}:{img:L??"none",scale:T};f(ce.img),m(ce.scale)},S=$=>{$.stopPropagation(),v.current={x:$.clientX,y:$.clientY},_($.clientX,$.clientY)},Z=()=>{I&&_(v.current.x,v.current.y)};return i.addEventListener("mousemove",S),window.addEventListener("scroll",Z,!0),()=>{i.removeEventListener("mousemove",S),window.removeEventListener("scroll",Z,!0)}},[i,I,p,F,K,O,L,W,T,r]),s.useEffect(()=>{I||(f("none"),m(0))},[I]);const C=async(_,S,Z,$={})=>{const{width:H,height:B,finalWidth:le}=await ng(_.image.url,w,V,z);let ie=0,k=0;Y==="same"?(ie=S/2,k=Z/2):(ie=$.x??Math.random()*S,k=$.y??Math.random()*Z);const de=Math.min(Math.max(ie,H/2),S-H/2),G=Math.min(Math.max(k,B/2),Z-B/2);return{id:u.current++,url:_.image.url,link:_.link,name:_.image.name,x:de,y:G,width:le}};s.useEffect(()=>{if(!i||t.length===0)return;const _=i.getBoundingClientRect(),S=_.width,Z=_.height,$=[];(async()=>{const B=t[0],le=await C(B,S,Z);$.push(le),l($),c(1)})()},[w,V,z,Y,i]),s.useEffect(()=>{M==="last One"&&l(_=>_.length>0?[_[_.length-1]]:[])},[M]);const E=async _=>{if(!i)return;const S=i.getBoundingClientRect(),Z=_.clientX-S.left,$=_.clientY-S.top;if(K==="image"&&!Ll(Z,$,r))return;let H=0,B=0;Y==="on Click"?(H=Z,B=$):Y==="same"?(H=S.width/2,B=S.height/2):(H=Math.random()*S.width,B=Math.random()*S.height);const le=t[d],ie=await C(le,S.width,S.height,{x:H,y:B});l(k=>M==="all"?[...k,ie]:[ie]),c(k=>k>=t.length-1?0:k+1)};return a.jsxs("div",{ref:o,onClick:E,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:ki.imageRevealSlider,style:{cursor:g==="none"?"default":"none"},children:[r.map(_=>a.jsx("div",{className:ki.wrapper,style:{top:`${_.y}px`,left:`${_.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:_.width??"auto",height:"auto",cursor:g==="none"?"default":"none"},children:K==="area"&&_.link?a.jsx("a",{href:_.link,target:"_blank",className:ki.link,children:a.jsx("img",{src:_.url,alt:_.name,className:ki.image},_.id)}):a.jsx("img",{src:_.url,alt:_.name,className:ki.image},_.id)},_.id)),I&&a.jsx("div",{className:ki.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${b})`,backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const og={element:ig,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:""}]}}}},rg="LightBox-module__hidden___9s-9x",ag="LightBox-module__heroImage___sTxNF",sg="LightBox-module__background___rm9ml",lg="LightBox-module__editor___4ACaY",cg="LightBox-module__contentStyle___Bgnsq",dg="LightBox-module__imageStyle___tLIlB",ug="LightBox-module__imgWrapper___LuFUp",pg="LightBox-module__contain___8-yaS",mg="LightBox-module__cover___hNvOG",gg="LightBox-module__caption___b6L2I",hg="LightBox-module__captionTextInner___rCGNH",fg="LightBox-module__lightboxSplide___XFuWC",yg="LightBox-module__arrow___iz38X",vg="LightBox-module__arrowVertical___Zfz81",xg="LightBox-module__nextArrow___zkAQN",bg="LightBox-module__arrowInner___p48sW",wg="LightBox-module__arrowIcon___3VaFf",Sg="LightBox-module__arrowImg___pNV88",$g="LightBox-module__mirror___pjeXc",Cg="LightBox-module__thumbsWrapper___GB-nU",Tg="LightBox-module__thumbsContainerVertical___wttk5",Lg="LightBox-module__thumbsContainer___osSma",Rg="LightBox-module__thumbsAlignStart___MO6tY",Ig="LightBox-module__thumbsAlignCenter___Q4sUx",Eg="LightBox-module__thumbsAlignEnd___p4y9R",Mg="LightBox-module__thumbItem___HvnF3",Pg="LightBox-module__closeButton___g2khP",kg="LightBox-module__fadeIn___0m5GW",Ag="LightBox-module__slideInLeft___gPYwC",Fg="LightBox-module__slideInRight___S-pPp",Wg="LightBox-module__slideInTop___DFdAj",_g="LightBox-module__slideInBottom___m27kZ",Ng="LightBox-module__fadeOut___55qBR",Hg="LightBox-module__slideOutLeft___NvU7P",Og="LightBox-module__slideOutRight___SK7eC",Dg="LightBox-module__slideOutTop___Vgg0z",jg="LightBox-module__slideOutBottom___nJ0Ef",zg="LightBox-module__scaleSlide___vZriG",nt={hidden:rg,heroImage:ag,background:sg,editor:lg,contentStyle:cg,imageStyle:dg,imgWrapper:ug,contain:pg,cover:mg,caption:gg,captionTextInner:hg,lightboxSplide:fg,arrow:yg,arrowVertical:vg,nextArrow:xg,arrowInner:bg,arrowIcon:wg,arrowImg:Sg,mirror:$g,thumbsWrapper:Cg,thumbsContainerVertical:Tg,thumbsContainer:Lg,thumbsAlignStart:Rg,thumbsAlignCenter:Ig,thumbsAlignEnd:Eg,thumbItem:Mg,closeButton:Pg,fadeIn:kg,slideInLeft:Ag,slideInRight:Fg,slideInTop:Wg,slideInBottom:_g,fadeOut:Ng,slideOutLeft:Hg,slideOutRight:Og,slideOutTop:Dg,slideOutBottom:jg,scaleSlide:zg},lr=(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% + ${j.scalingValue(t.x,n)}), calc(-50% + ${j.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${j.scalingValue(t.x,n)}, calc(-50% + ${j.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${j.scalingValue(t.x,n)}), ${j.scalingValue(t.y,n)})`:i.transform=`translate(${j.scalingValue(t.x,n)}, ${j.scalingValue(t.y,n)})`,i};function Od(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 Bg(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 Dd(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 Vg(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 jd(e,t,n,i,o){const{x:r,y:l}=Bg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Gg(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"?Vg:Dd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:x,offsetY:b}=jd(n,i,u,p,d),m=(x+u/2)/n*100,g=(b+p/2)/i*100;return`${m}% ${g}%`}function qg(e){return Gg(e)}function jr(e){const t=e.getBoundingClientRect(),n=Od(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}=Dd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:x}=jd(i,o,d,c,u),b=t.left+n.left,m=t.top+n.top;return{x:p+b,y:x+m,width:d,height:c}}function Rl(e){const t=e.getBoundingClientRect(),n=Od(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Il(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 Xg(e,t){const n=(()=>{if(e==="fade in")return nt.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return nt.slideInLeft;case"right":return nt.slideInRight;case"top":return nt.slideInTop;case"bottom":return nt.slideInBottom;default:return nt.slideInRight}return nt.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return nt.fadeIn;if(e==="slide in")switch(t){case"left":return nt.slideInLeft;case"right":return nt.slideInRight;case"top":return nt.slideInTop;case"bottom":return nt.slideInBottom;default:return nt.slideInRight}return nt.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return nt.fadeOut;if(e==="slide in")switch(t){case"left":return nt.slideOutLeft;case"right":return nt.slideOutRight;case"top":return nt.slideOutTop;case"bottom":return nt.slideOutBottom;default:return nt.slideOutRight}return nt.fadeOut})(),r=(()=>{if(e==="fade in")return nt.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return nt.slideOutLeft;case"right":return nt.slideOutRight;case"top":return nt.slideOutTop;case"bottom":return nt.slideOutBottom;default:return nt.slideOutRight}return nt.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Ug=({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:nt.heroImage,onClick:()=>c(!0)}),a.jsx(Yg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Yg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var Ce;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:x,wordSpacing:b,fontSizeLineHeight:m,textAppearance:g,color:f}=i.imageCaption??{},[v,I]=s.useState(0),[y,w]=s.useState(0),[V,z]=s.useState(!1),[Y,M]=s.useState(!1),[F,K]=s.useState({}),T=s.useRef(null),L=s.useRef(null),W=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(null),Z=s.useRef(!1),$=s.useRef(null),[H,B]=s.useState(!1),{appear:le,triggers:ie,slider:k,thumbnail:de,controls:G,area:ce,caption:oe,layout:fe}=o.lightboxBlock,{appearClass:Ie,backdropAppearClass:xe,backdropDisappearClass:ue,disappearClass:U}=Xg(le.type,le.direction),se=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const h=()=>{setTimeout(()=>{var X,ee;(ee=(X=T.current)==null?void 0:X.splide)==null||ee.refresh()},16)},q=()=>{w(X=>X+1)};return window.addEventListener("ArticleEditor.Layout:change",h),window.addEventListener("ArticleEditor.ComponentContent:change",q),()=>{window.removeEventListener("ArticleEditor.Layout:change",h),window.removeEventListener("ArticleEditor.ComponentContent:change",q)}},[]),s.useEffect(()=>{if(!e||!de.isActive){B(!1);return}const h=$.current;if(!h)return;const q=()=>{k.direction==="horiz"?B(h.scrollWidth>h.clientWidth):B(h.scrollHeight>h.clientHeight)};q();const X=new ResizeObserver(q);return X.observe(h),()=>X.disconnect()},[e,de.isActive,n.length,F,k.direction]);const re=s.useCallback(()=>{const h=window.matchMedia("(max-width: 768px)").matches,q=Il(ce.color);h&&!l&&q>.9&&(document.body.style.backgroundColor=""),z(!0),O.current=!0;const X=ee=>{ee.target===C.current&&ee.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,O.current&&(O.current=!1,t()),z(!1))};C.current&&(E.current=X,C.current.addEventListener("animationend",X))},[t,ce.color,l]),Re=(h,q,X)=>{var ee,ve;if(h){if(ie.type==="click"&&ie.switch==="image")ie.repeat==="close"&&v===n.length-1?re():(ee=T.current)==null||ee.go("+1");else if(ie.type==="click"&&ie.switch==="50/50"){const D=h.getBoundingClientRect(),R=q-D.left,Q=X-D.top,ne=D.width,N=D.height;let te;k.direction==="horiz"?te=R<ne/2?"-1":"+1":te=Q<N/2?"-1":"+1",(ve=T.current)==null||ve.go(te)}}},Se=h=>{if(Z.current){Z.current=!1;return}const q=n[v],X=(q==null?void 0:q.image.objectFit)==="cover";let ee,ve;if("changedTouches"in h&&h.changedTouches.length>0)ee=h.changedTouches[0].clientX,ve=h.changedTouches[0].clientY;else if("clientX"in h)ee=h.clientX,ve=h.clientY;else return;let D;if(X&&W.current){const R=Rl(W.current);D=ee>=R.left&&ee<=R.right&&ve>=R.top&&ve<=R.bottom}else{const R=W.current?jr(W.current):null;if(!R){h.target===h.currentTarget&&re();return}D=ee>=R.x&&ee<=R.x+R.width&&ve>=R.y&&ve<=R.y+R.height}D?Re(W.current,ee,ve):re()},ke=h=>{const q=h.target;(q.classList.contains(nt.thumbsWrapper)||q.classList.contains(nt.thumbsContainer))&&Se(h)};s.useEffect(()=>{if(!e)return;const h=q=>{var X,ee;if(q.key==="Escape"){re();return}if(q.key==="ArrowRight"){I(ve=>(ve+1)%Math.max(n.length,1)),(X=T.current)==null||X.go("+1");return}q.key==="ArrowLeft"&&(I(ve=>(ve-1+Math.max(n.length,1))%Math.max(n.length,1)),(ee=T.current)==null||ee.go("-1"))};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[e,re,n.length]),s.useEffect(()=>{if(e){if(I(0),w(q=>q+1),O.current=!1,z(!1),M(!1),K({}),!se)return;const h=new CustomEvent("page-overlay",{detail:{itemId:se}});window.dispatchEvent(h)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),M(!1)}},[e,se]),s.useEffect(()=>{L.current!==null&&L.current!==k.type&&w(h=>h+1),L.current=k.type},[k.type]),s.useEffect(()=>{if(!e)return;const h=document.body.style.overflow,q=window.matchMedia("(max-width: 768px)").matches,X=Il(ce.color);document.body.style.overflow="hidden",M(!1);const ee=D=>{D.target===C.current&&!O.current&&D.animationName&&(q&&!l&&X>.9&&(document.body.style.backgroundColor=ce.color),M(!0),C.current&&_.current&&C.current.removeEventListener("animationend",_.current),_.current=null)};C.current&&(_.current=ee,C.current.addEventListener("animationend",ee));const ve=D=>{const R=D.target;R&&(R.closest(`.${nt.thumbsWrapper}`)||R.closest(`.${nt.thumbsContainer}`))||k.type!=="slide"&&D.preventDefault()};return document.addEventListener("touchmove",ve,{passive:!1}),()=>{document.body.style.overflow=h,document.removeEventListener("touchmove",ve),C.current&&_.current&&(C.current.removeEventListener("animationend",_.current),_.current=null),M(!1)}},[e,l,ce.color,k.type]),s.useEffect(()=>{if(!e)return;const h=q=>{var ee,ve;if(O.current){q.stopPropagation();return}if(Z.current){Z.current=!1;return}const X=q.target;if(!(X&&(X.closest(`.${nt.thumbsContainer}`)||X.closest(`.${nt.thumbItem}`)||X.closest(`.${nt.arrow}`)||X.closest(`.${nt.closeButton}`)||X.closest(`.${nt.caption}`)))){if(k.type==="slide"&&ie.type==="drag"&&((ve=(ee=T.current)==null?void 0:ee.splide)!=null&&ve.root)){const D=T.current.splide.root;if(X&&(D.contains(X)||D===X))return}if(q.touches.length===0&&q.changedTouches.length>0){const D=n[v],R=(D==null?void 0:D.image.objectFit)==="cover",Q=q.changedTouches[0];let ne;if(R&&W.current){const N=Rl(W.current);ne=Q.clientX>=N.left&&Q.clientX<=N.right&&Q.clientY>=N.top&&Q.clientY<=N.bottom}else{const N=W.current?jr(W.current):null;if(!N)return;ne=Q.clientX>=N.x&&Q.clientX<=N.x+N.width&&Q.clientY>=N.y&&Q.clientY<=N.y+N.height}if(!ne){q.stopPropagation(),O.current=!0;const N=te=>{te.stopPropagation(),te.preventDefault(),document.removeEventListener("click",N,!0)};document.addEventListener("click",N,!0),re()}}}};return document.addEventListener("touchend",h,{passive:!0}),()=>{document.removeEventListener("touchend",h)}},[e,re,v,n]);const ye=(k.type==="scale"||k.type==="fade")&&k.direction==="vert"&&ie.type==="drag";s.useEffect(()=>{var te,Ee;if(!e||!ye||!((Ee=(te=T.current)==null?void 0:te.splide)!=null&&Ee.root))return;const h=T.current.splide.root,q=30,X=(ge,J)=>{if(S.current){const Ye=Math.abs(ge-S.current.x),Be=Math.abs(J-S.current.y);(Ye>0||Be>0)&&(Z.current=!0)}},ee=ge=>{S.current&&(ge.preventDefault(),X(ge.clientX,ge.clientY))},ve=ge=>{S.current&&ge.touches.length>0&&(ge.preventDefault(),X(ge.touches[0].clientX,ge.touches[0].clientY))},D=(ge,J)=>{if(!S.current||!T.current){S.current=null;return}const Ye=Math.abs(ge-S.current.x),Be=Math.abs(J-S.current.y);Be>q&&Be>Ye&&T.current.go(J<S.current.y?"+1":"-1"),S.current=null},R=ge=>{S.current&&D(ge.clientX,ge.clientY),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("pointermove",ee)},Q=ge=>{if(S.current){if(ge.changedTouches.length>0){const J=ge.changedTouches[0];D(J.clientX,J.clientY)}document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),document.removeEventListener("touchmove",ve)}},ne=ge=>{S.current={x:ge.clientX,y:ge.clientY},Z.current=!1,document.addEventListener("pointermove",ee,{passive:!1}),document.addEventListener("pointerup",R),document.addEventListener("pointercancel",R)},N=ge=>{ge.touches.length>0&&(S.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},Z.current=!1,document.addEventListener("touchmove",ve,{passive:!1}),document.addEventListener("touchend",Q),document.addEventListener("touchcancel",Q))};return h.addEventListener("pointerdown",ne),h.addEventListener("touchstart",N),()=>{h.removeEventListener("pointerdown",ne),h.removeEventListener("touchstart",N),document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",R),document.removeEventListener("pointercancel",R),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",Q),document.removeEventListener("touchcancel",Q),S.current=null,Z.current=!1}},[e,ye,y]);const be={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Gn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:C,className:$t(nt.background,V?ue:xe,{[nt.editor]:l},{[nt.hidden]:!e}),style:{...be,...Y&&!l&&!V?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?C:null,className:$t(nt.contentStyle,V?U:Ie,{[nt.editor]:l},{[nt.hidden]:!e}),style:{animationDuration:`${parseInt(le.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Xs,{onMove:h=>I(h.index),ref:T,className:nt.lightboxSplide,options:{arrows:!1,speed:k.duration?parseInt(k.duration):500,direction:k.direction==="horiz"||k.type==="fade"||k.type==="scale"?"ltr":"ttb",pagination:!1,drag:ie.type==="drag"&&!ye,perPage:1,width:"100%",height:"100%",type:k.type==="fade"||k.type==="scale"?"fade":"loop",padding:0,rewind:ie.repeat!=="close",start:0},style:{"--splide-speed":k.duration},children:n.map((h,q)=>{const X=lr(fe.position,fe.offset,l),ee=`${j.scalingValue(fe.padding.top,l)} ${j.scalingValue(fe.padding.right,l)} ${j.scalingValue(fe.padding.bottom,l)} ${j.scalingValue(fe.padding.left,l)}`,ve=k.type==="scale"?(()=>{const{transform:D,...R}=X;return{...R,position:"absolute",padding:ee,boxSizing:"border-box","--position-transform":D||"none"}})():{...X,position:"absolute",padding:ee,boxSizing:"border-box"};return a.jsx(Us,{children:a.jsx("div",{className:nt.imgWrapper,onClick:Se,children:a.jsx("img",{ref:q===v?W:null,className:$t(nt.imageStyle,{[nt.contain]:h.image.objectFit==="contain",[nt.cover]:h.image.objectFit==="cover",[nt.scaleSlide]:k.type==="scale"}),src:h.image.url,alt:h.image.name??"",style:{...ve,pointerEvents:h.image.objectFit==="contain"?"none":"auto"}})})},q)})},y),G.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:$t(nt.arrow,{[nt.arrowVertical]:k.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:nt.arrowInner,style:{transform:`translate(${j.scalingValue(G.offset.x,l)}, ${j.scalingValue(G.offset.y*(k.direction==="horiz"?1:-1),l)}) scale(${G.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("-1")},"aria-label":"Previous",children:[G.arrowsImgUrl&&a.jsx(ln,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:$t(nt.arrowImg,nt.mirror)}),!G.arrowsImgUrl&&a.jsx(El,{color:G.color,className:$t(nt.arrowIcon,nt.arrowImg,nt.mirror)})]})}),a.jsx("div",{className:$t(nt.arrow,nt.nextArrow,{[nt.arrowVertical]:k.direction==="vert"}),style:{color:G.color,"--arrow-hover-color":G.hover},children:a.jsxs("button",{className:nt.arrowInner,style:{transform:`translate(${j.scalingValue(G.offset.x*(k.direction==="horiz"?-1:1),l)}, ${j.scalingValue(G.offset.y,l)}) scale(${G.scale}) rotate(${k.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var h;return(h=T.current)==null?void 0:h.go("+1")},"aria-label":"Next",children:[G.arrowsImgUrl&&a.jsx(ln,{url:G.arrowsImgUrl,fill:G.color,hoverFill:G.hover,className:nt.arrowImg}),!G.arrowsImgUrl&&a.jsx(El,{color:G.color,className:$t(nt.arrowIcon,nt.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const h=lr(ce.closeIconAlign,ce.closeIconOffset,l),q=`scale(${ce.closeIconScale})`,X=h.transform?`${h.transform} ${q}`:q;return a.jsx("button",{className:nt.closeButton,style:{...h,transform:X},onClick:re,"aria-label":"Close lightbox",children:a.jsx(ln,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),oe&&oe.isActive&&i.imageCaption&&((Ce=n[v])==null?void 0:Ce.imageCaption)&&a.jsx("div",{className:nt.caption,style:{...lr(oe.alignment,oe.offset,l),fontFamily:fo(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":j.scalingValue(c.width,l),letterSpacing:j.scalingValue(p,l),wordSpacing:j.scalingValue(b,l),textAlign:x,fontSize:j.scalingValue(m.fontSize,l),lineHeight:j.scalingValue(m.lineHeight,l),textTransform:g.textTransform??"none",textDecoration:g.textDecoration??"none",fontVariant:g.fontVariant??"normal",color:f},onClick:h=>h.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:nt.captionTextInner,style:{"--link-color":oe.linkColor,"--link-hover-color":oe.linkHoverColor},children:a.jsx(Ii,{content:n[v].imageCaption})})}),de.isActive&&(()=>{const[h,q]=de.position.split("-"),X=k.direction==="horiz"?`${h}-left`:de.position,ee=lr(X,de.offset,l),ve=()=>{if(k.direction==="horiz"){if(q==="left")return"flex-start";if(q==="center")return"center";if(q==="right")return"flex-end"}else{if(h==="top")return"flex-start";if(h==="middle")return"center";if(h==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:$,className:nt.thumbsWrapper,onClick:D=>ke(D),style:{position:l?"absolute":"fixed",...ee,...k.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:$t(nt.thumbsContainer,{[nt.thumbsContainerVertical]:k.direction==="vert",[nt.thumbsAlignStart]:de.align==="start",[nt.thumbsAlignCenter]:de.align==="center",[nt.thumbsAlignEnd]:de.align==="end"}),style:{gap:j.scalingValue(de.grid.gap,l),justifyContent:H?"flex-start":ve()},children:n.map((D,R)=>{const Q=R===v,ne=F[R],te=de.grid.size*(Q?de.activeState.scale:1),Ee=()=>{if(de.fit!=="fit")return{};if(!ne)return k.direction==="horiz"?{height:j.scalingValue(te,l)}:{width:j.scalingValue(te,l)};const ge=ne.width/ne.height;if(k.direction==="horiz"){const J=te,Ye=J*ge;return{width:j.scalingValue(Ye,l),height:j.scalingValue(J,l)}}else{const J=te,Ye=J/ge;return{width:j.scalingValue(J,l),height:j.scalingValue(Ye,l)}}};return a.jsx("button",{className:nt.thumbItem,style:{...k.direction==="horiz"&&de.fit!=="fit"?{height:j.scalingValue(te,l)}:{},...k.direction==="vert"&&de.fit!=="fit"?{width:j.scalingValue(te,l)}:{},...de.fit==="cover"?{width:j.scalingValue(te,l),height:j.scalingValue(te,l)}:{},...Ee(),transition:Q?"all 0.25s ease-out":"none",opacity:Q?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:ge=>{var J;ge.stopPropagation(),I(R),(J=T.current)==null||J.go(R)},onMouseEnter:()=>{var ge;de.triggers==="hov"&&((ge=T.current)==null||ge.go(R))},children:a.jsx("img",{src:D.image.url,alt:D.image.name??"",onLoad:ge=>{const J=ge.currentTarget;J.naturalWidth&&J.naturalHeight&&K(Ye=>({...Ye,[R]:{width:J.naturalWidth,height:J.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${D.image.name}-${R}`)})})})})()]})]}),document.getElementById(r))};function El({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 Kg={element:Ug,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 cr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zg(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 Jg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=j.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:b,gap:m,fieldsGap:g,buttonCorners:f,buttonStroke:v,buttonPadding:I,isButtonFullWidth:y,inputCorners:w,inputStroke:V,inputPadding:z,inputColor:Y,inputTextColor:M,inputBorderColor:F,placeholderColor:K,buttonColor:T,buttonTextColor:L,buttonBorderColor:W,labelTextColor:O,successColor:C,errorColor:E,fontFamily:_,inputFontSettings:S,inputFontSize:Z,inputLineHeight:$,inputLetterSpacing:H,inputWordSpacing:B,inputTextAppearance:
|
|
158
|
+
`}function Jg({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=j.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:x=[],buttonLabel:b,gap:m,fieldsGap:g,buttonCorners:f,buttonStroke:v,buttonPadding:I,isButtonFullWidth:y,inputCorners:w,inputStroke:V,inputPadding:z,inputColor:Y,inputTextColor:M,inputBorderColor:F,placeholderColor:K,buttonColor:T,buttonTextColor:L,buttonBorderColor:W,labelTextColor:O,successColor:C,errorColor:E,fontFamily:_,inputFontSettings:S,inputFontSize:Z,inputLineHeight:$,inputLetterSpacing:H,inputWordSpacing:B,inputTextAppearance:le,buttonFontSettings:ie,buttonFontSize:k,buttonLineHeight:de,buttonLetterSpacing:G,buttonWordSpacing:ce,buttonTextAppearance:oe,labelFontSettings:fe,labelFontSize:Ie,labelLineHeight:xe,labelLetterSpacing:ue,labelWordSpacing:U,labelTextAppearance:se,statusFontSettings:re,statusFontSize:Re,statusLineHeight:Se,statusLetterSpacing:ke,statusWordSpacing:ye,statusTextAppearance:be,successMessage:Ce,errorMessage:h,stateOverrides:q}=e,X=u==="B",ee=x.slice(0,Math.min(p,x.length)),ve={fontSettings:{fontFamily:_,fontWeight:(S==null?void 0:S.fontWeight)??400,fontStyle:(S==null?void 0:S.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:$,letterSpacing:H??0,wordSpacing:B??0,textAppearance:le,color:M},D=sn(Zt(ve,t)),R=j.scalingValue(V??0,t),Q=j.scalingValue(($??Z??.01)+((z==null?void 0:z.top)??0)+((z==null?void 0:z.bottom)??0)+(u==="C"?V??0:(V??0)*2),t),ne={...D,borderStyle:"solid",borderRadius:u==="C"?0:j.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:R,borderLeftWidth:0}:{borderWidth:R},paddingTop:j.scalingValue((z==null?void 0:z.top)??0,t),paddingRight:j.scalingValue((z==null?void 0:z.right)??0,t),paddingBottom:j.scalingValue((z==null?void 0:z.bottom)??0,t),paddingLeft:j.scalingValue((z==null?void 0:z.left)??0,t),height:Q,minHeight:Q},N={fontSettings:{fontFamily:_,fontWeight:(ie==null?void 0:ie.fontWeight)??400,fontStyle:(ie==null?void 0:ie.fontStyle)??"normal"},fontSize:k??.01,lineHeight:de,letterSpacing:G??0,wordSpacing:ce??0,textAppearance:oe,color:L},te=sn(Zt(N,t)),Ee=j.scalingValue(v??0,t),ge={fontSettings:{fontFamily:_,fontWeight:(fe==null?void 0:fe.fontWeight)??400,fontStyle:(fe==null?void 0:fe.fontStyle)??"normal"},fontSize:Ie??.01,lineHeight:xe,letterSpacing:ue??0,wordSpacing:U??0,textAppearance:se,color:O},J=Zt(ge,t),Ye={fontSettings:{fontFamily:_,fontWeight:(re==null?void 0:re.fontWeight)??400,fontStyle:(re==null?void 0:re.fontStyle)??"normal"},fontSize:Re??.01,lineHeight:Se,letterSpacing:ke??0,wordSpacing:ye??0,textAppearance:be,color:C},Be=sn(Zt(Ye,t)),it=j.buildColorVars(c,{inputColor:Y,inputTextColor:M,inputBorderColor:F,placeholderColor:K!=null&&K.trim()?K:"#cccccc",buttonColor:T,buttonTextColor:L,buttonBorderColor:W,labelTextColor:O,successColor:C,errorColor:E},Qg,eh,q),[Xe,et]=s.useState(()=>Object.fromEntries(ee.map(Pe=>[Pe.name,""]))),[Je,Ge]=s.useState("idle"),[$e,He]=s.useState(null),De=r==="success"?"success":r==="error"?"error":Je,Qe=r==="error"?h:$e,he=r==="filled",_e=s.useMemo(()=>{if(!he)return Xe;let Pe=null;for(const Ze of ee)(Xe[Ze.name]??"").trim().length>0||(Pe=Pe??{...Xe},Pe[Ze.name]="Filled");return Pe??Xe},[Xe,he,ee]),Ve=De==="error"?j.getFormFieldValidationError(ee,_e):null,ht=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),at=o==null?void 0:o.submitUrl,Oe=(Pe,Ze)=>{et(Ne=>({...Ne,[Pe]:Ze}))},Ae=async Pe=>{if(Pe.preventDefault(),!d)return;const Ze=Object.fromEntries(ee.map(rt=>{var ot;return[rt.name,((ot=Xe[rt.name])==null?void 0:ot.trim())??""]}).filter(([,rt])=>rt));if(!at){Ge("error"),He("No integrations were found for this form.");return}if(Object.keys(Ze).length===0)return;const Ne=j.getFormFieldValidationError(ee,Xe);if(Ne){Ge("error"),He(Ne);return}Ge("submitting"),He(null);try{const rt=await fetch(at,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ze)});if(!rt.ok){const ot=await rt.text();throw new Error(ot||`Request failed: ${rt.status}`)}Ge("success"),et(Object.fromEntries(ee.map(ot=>[ot.name,""])))}catch(rt){Ge("error"),He(rt instanceof Error?rt.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${ht}`.trim(),style:it,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Zg(c)}}),a.jsxs("form",{onSubmit:Ae,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:ee.map((Pe,Ze)=>a.jsxs(s.Fragment,{children:[Ze>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:j.scalingValue(g??0,t)}}),a.jsxs("div",{className:`${c}-field-group${X?` ${c}-labeled`:""}`,children:[X&&a.jsx("span",{className:`${c}-field-label`,style:J?{...J,lineHeight:J.fontSize}:void 0,children:Pe.label||Pe.name}),Pe.type==="textarea"?a.jsx("textarea",{name:Pe.name,autoComplete:"off",value:_e[Pe.name]??"",onChange:Ne=>Oe(Pe.name,Ne.target.value),placeholder:Pe.placeholder,className:`${c}-input`,style:ne,rows:1,"data-filled":he||(_e[Pe.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Pe.type==="phone"?"tel":Pe.type==="email"?"email":"text",name:Pe.name,autoComplete:"off",value:_e[Pe.name]??"",onChange:Ne=>Oe(Pe.name,Ne.target.value),placeholder:Pe.placeholder,required:Pe.isRequired??Pe.type==="email",className:`${c}-input`,style:ne,"data-filled":he||(_e[Pe.name]??"").trim().length>0})]})]},Ze))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:j.scalingValue(m??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:j.scalingValue(f??0,t),borderWidth:Ee,paddingTop:j.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:j.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:j.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:j.scalingValue((I==null?void 0:I.left)??0,t),pointerEvents:d?"auto":void 0,...te,...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:Je==="submitting"?"...":b})})})]}),De==="success"&&a.jsx("p",{className:`${c}-success`,style:{...Be},children:Ce}),De==="error"&&a.jsx("p",{className:`${c}-error`,style:{...Be},role:"alert",children:Ve??Qe??h})]})}const Qg={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"},eh=["hover","focus","filled","success","error"],th=`import React, { useMemo, useState } from 'react';
|
|
159
159
|
import { CommonComponentProps } from '../props';
|
|
160
160
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
161
161
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
982
982
|
font-size: ${ur(14)};
|
|
983
983
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
984
984
|
}
|
|
985
|
-
`}const sh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=j.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:b,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:I,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:V,buttonLetterSpacing:z,buttonWordSpacing:Y,buttonTextAppearance:M,statusFontSettings:F,statusFontSize:K,statusLineHeight:T,statusLetterSpacing:L,statusWordSpacing:W,statusTextAppearance:O,iconMaxWidth:C,minHeight:E,corners:_,stroke:S,stateOverrides:Z,inputPadding:$,buttonPadding:H,successMessage:B="Thanks for subscribing!",errorMessage:
|
|
985
|
+
`}const sh=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=j.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:x,inputFontSettings:b,inputFontSize:m,inputLineHeight:g,inputLetterSpacing:f,inputWordSpacing:v,inputTextAppearance:I,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:V,buttonLetterSpacing:z,buttonWordSpacing:Y,buttonTextAppearance:M,statusFontSettings:F,statusFontSize:K,statusLineHeight:T,statusLetterSpacing:L,statusWordSpacing:W,statusTextAppearance:O,iconMaxWidth:C,minHeight:E,corners:_,stroke:S,stateOverrides:Z,inputPadding:$,buttonPadding:H,successMessage:B="Thanks for subscribing!",errorMessage:le="Please, fill all required fields."}=e,ie=d.slice(0,Math.min(p,d.length)),[k,de]=s.useState(()=>Object.fromEntries(ie.map(ge=>[ge.name,""]))),[G,ce]=s.useState("idle"),[oe,fe]=s.useState(null),Ie=o==="success"?"success":o==="error"?"error":G,xe=o==="error"?le:oe,ue=o==="filled",U=s.useMemo(()=>{if(!ue)return k;let ge=null;for(const J of ie)(k[J.name]??"").trim().length>0||(ge=ge??{...k},ge[J.name]="Filled");return ge??k},[ue,k,ie]),se=Ie==="error"?j.getFormFieldValidationError(ie,U):null,re=o&&o!=="default"?`${r}-state-${o}`:"",Re=ie.some(ge=>(U[ge.name]??"").trim().length>0),Se=re!==`${r}-state-filled`&&Re?`${r}-state-filled`:"",ke=`${re} ${Se}`.trim(),ye=i==null?void 0:i.submitUrl,be=u??"",Ce=(c==null?void 0:c.icon)??"",h=(c==null?void 0:c.mode)==="On",q=be||"Submit",X={fontSettings:{fontFamily:x,fontWeight:(b==null?void 0:b.fontWeight)??400,fontStyle:(b==null?void 0:b.fontStyle)??"normal"},fontSize:m??.01,lineHeight:g,letterSpacing:f??0,wordSpacing:v??0,textAppearance:I,color:e.inputTextColor??"#111111"},ee={fontSettings:{fontFamily:x,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:V,letterSpacing:z??0,wordSpacing:Y??0,textAppearance:M,color:e.buttonTextColor??"#ffffff"},ve={fontSettings:{fontFamily:x,fontWeight:(F==null?void 0:F.fontWeight)??400,fontStyle:(F==null?void 0:F.fontStyle)??"normal"},fontSize:K??.01,lineHeight:T,letterSpacing:L??0,wordSpacing:W??0,textAppearance:O,color:e.successColor??"#22c55e"},D=sn(Zt(X,t)),R=sn(Zt(ee,t)),Q=sn(Zt(ve,t)),ne=j.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(X==null?void 0:X.color)??"#111111",buttonTextColor:e.buttonTextColor??(ee==null?void 0:ee.color)??"#ffffff"},lh,ch,Z),N={borderRadius:j.scalingValue(_,t),borderWidth:j.scalingValue(S,t),borderStyle:"solid"},te={borderLeftWidth:j.scalingValue(S,t)},Ee=async ge=>{if(ge.preventDefault(),!l)return;const J=Object.fromEntries(ie.map(Be=>{var it;return[Be.name,((it=k[Be.name])==null?void 0:it.trim())??""]}).filter(([,Be])=>Be));if(!ye){ce("error"),fe("No integrations were found for this form.");return}if(Object.keys(J).length===0)return;const Ye=j.getFormFieldValidationError(ie,k);if(Ye){ce("error"),fe(Ye);return}ce("submitting"),fe(null);try{const Be=await fetch(ye,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(!Be.ok){const it=await Be.text();throw new Error(it||`Request failed: ${Be.status}`)}ce("success"),de(Object.fromEntries(ie.map(it=>[it.name,""])))}catch(Be){ce("error"),fe(Be instanceof Error?Be.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${ke}`.trim(),style:ne,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ah(r)}}),a.jsxs("form",{onSubmit:Ee,className:`${r}-form`,style:{...N,height:j.scalingValue(E,t),minHeight:j.scalingValue(E,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:ie.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:U[ge.name]??"",onChange:J=>de(Ye=>({...Ye,[ge.name]:J.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...D,paddingRight:j.scalingValue($.right,t),paddingLeft:j.scalingValue($.left,t),paddingTop:j.scalingValue($.top,t),paddingBottom:j.scalingValue($.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":q,style:{...R,...te,paddingRight:j.scalingValue(H.right,t),paddingLeft:j.scalingValue(H.left,t),paddingTop:j.scalingValue(H.top,t),paddingBottom:j.scalingValue(H.bottom,t),pointerEvents:l?"auto":void 0},children:G==="submitting"?"...":h?Ce&&a.jsx(ln,{url:Ce,className:`${r}-submitBtnIcon`,style:{maxWidth:j.scalingValue(C??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):be})})]}),Ie==="success"&&a.jsx("p",{className:`${r}-success`,style:{...Q},children:B}),Ie==="error"&&a.jsx("p",{className:`${r}-error`,style:{...Q},role:"alert",children:se??xe??le})]})},lh={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"},ch=["hover","focus","filled","success","error"],dh=`import React, { useMemo, useState } from 'react';
|
|
986
986
|
import { CommonComponentProps } from '../props';
|
|
987
987
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
988
988
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1561,7 +1561,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1561
1561
|
};
|
|
1562
1562
|
|
|
1563
1563
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1564
|
-
`,uh="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),ph=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],wa={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mh=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],gh={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...wa.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...wa.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...wa.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:ph,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:uh},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...mh],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},hh={element:sh,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:gh,sourceCode:dh};function fh(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1564
|
+
`,uh="data:image/svg+xml,"+encodeURIComponent('<svg width="23px" height="20px" viewBox="0 0 23 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Newsletter" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Tutorials-pop-up-Copy-12" transform="translate(-43, -687)" fill="#FFFFFF" fill-rule="nonzero"><path d="M66,697 C66,697.552285 65.5522847,698 65,698 L44,698 C43.4477153,698 43,697.552285 43,697 C43,696.447715 43.4477153,696 44,696 L65,696 C65.5522847,696 66,696.447715 66,697 Z M55.6689647,687.256706 L65.6689647,696.256706 C66.1103451,696.653948 66.1103451,697.346052 65.6689647,697.743294 L55.6689647,706.743294 C55.2584547,707.112753 54.6261649,707.079475 54.2567059,706.668965 C53.8872468,706.258455 53.9205252,705.626165 54.3310353,705.256706 L63.5051529,697 L54.3310353,688.743294 C53.9205252,688.373835 53.8872468,687.741545 54.2567059,687.331035 C54.6261649,686.920525 55.2584547,686.887247 55.6689647,687.256706 Z" id="Combined-Shape"></path></g></g></svg>'),ph=[{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"company",type:"text",placeholder:"Enter company",label:"Company",isRequired:!1,error:"Please, enter your company name."},{name:"phone",type:"phone",placeholder:"Enter your phone",label:"Phone",isRequired:!1,error:"Please, enter a valid phone number."}],ba={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},mh=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],gh={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:3},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonLabel:{type:"string",scope:"common",title:"Button Label",display:{type:"text-input"}},buttonIcon:{type:"object",scope:"common",title:"Button Icon",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},iconMaxWidth:{type:"number",scope:"common",title:"Icon Max Width",display:{type:"full-width-input"},min:0,max:1},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"Input Padding",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"Button Padding",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"numeric-input"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},strokeColor:{type:"string",scope:"common",title:"Stroke All",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"common",title:"Fill Input",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"common",title:"Input Label",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"common",title:"Filler Input",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"common",title:"Fill Button",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"common",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"common",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"common"},inputFontSettings:{...ba.fontSettings,scope:"common",title:"Input"},inputFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},inputLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},inputLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},inputWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},inputTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},buttonFontSettings:{...ba.fontSettings,scope:"common",title:"Button"},buttonFontSize:{type:"number",scope:"layout",title:"Button Font Size",display:{type:"font-size"}},buttonLineHeight:{type:"number",scope:"layout",title:"Button Line Height",display:{type:"line-height-input"}},buttonLetterSpacing:{type:"number",scope:"layout",title:"Button Letter Spacing",display:{type:"letter-spacing-input"}},buttonWordSpacing:{type:"number",scope:"layout",title:"Button Word Spacing",display:{type:"word-spacing-input"}},buttonTextAppearance:{type:"object",scope:"layout",title:"Button Text Appearance",display:{type:"text-appearance"}},statusFontSettings:{...ba.fontSettings,scope:"common",title:"Success/Error"},statusFontSize:{type:"number",scope:"layout",title:"Success/Error Font Size",display:{type:"font-size"}},statusLineHeight:{type:"number",scope:"layout",title:"Success/Error Line Height",display:{type:"line-height-input"}},statusLetterSpacing:{type:"number",scope:"layout",title:"Success/Error Letter Spacing",display:{type:"letter-spacing-input"}},statusWordSpacing:{type:"number",scope:"layout",title:"Success/Error Word Spacing",display:{type:"word-spacing-input"}},statusTextAppearance:{type:"object",scope:"layout",title:"Success/Error Text Appearance",display:{type:"text-appearance"}}},defaults:{fields:ph,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:uh},fontFamily:"Arial",strokeColor:"#000000",inputColor:"#ffffff",inputTextColor:"#0A00F8",placeholderColor:"#000000",buttonColor:"#000000",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{hover:{buttonColor:"#33A2F2"}},inputFontSettings:{fontWeight:400,fontStyle:"normal"},inputLetterSpacing:0,inputWordSpacing:0,inputTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},buttonFontSettings:{fontWeight:400,fontStyle:"normal"},buttonLetterSpacing:0,buttonWordSpacing:0,buttonTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{minHeight:.1,iconMaxWidth:.1,stroke:.001,corners:.0053,buttonPadding:{top:.02,right:.04,bottom:.02,left:.04},inputPadding:{top:.01,right:.03,bottom:.01,left:.03},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0373,buttonLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{minHeight:.0651,iconMaxWidth:.1,stroke:.001,corners:.0026,buttonPadding:{top:.02604,right:.02604,bottom:.02604,left:.02604},inputPadding:{top:.02604,right:.02604,bottom:.02604,left:.0182},inputFontSize:.0208,inputLineHeight:.02604,buttonFontSize:.0208,buttonLineHeight:.02604,statusFontSize:.0208,statusLineHeight:.02604},d:{minHeight:.028,iconMaxWidth:.028,stroke:.001,corners:.0027,buttonPadding:{right:.0175,left:.0175,top:.005,bottom:.004},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.009,buttonLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSettings.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonFontSize.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLineHeight.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonLetterSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonWordSpacing.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"On"},then:{name:"properties.buttonTextAppearance.display.visible",value:!1}},{if:{name:"buttonIcon.mode",value:"Off"},then:{name:"properties.iconMaxWidth.display.visible",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["fieldsToShow","minHeight"]},{type:"row",items:["corners","stroke"]},{type:"row",title:"",items:["inputPadding","buttonPadding"]},{type:"row",title:"",items:["buttonIcon"]},"iconMaxWidth"]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily",{type:"group",title:"",items:["inputFontSettings",{type:"row",items:["inputFontSize","inputLineHeight","inputLetterSpacing","inputWordSpacing"]},"inputTextAppearance"]},{type:"group",title:"",items:["buttonFontSettings",{type:"row",items:["buttonFontSize","buttonLineHeight","buttonLetterSpacing","buttonWordSpacing"]},"buttonTextAppearance"]},{type:"group",title:"",items:["statusFontSettings",{type:"row",items:["statusFontSize","statusLineHeight","statusLetterSpacing","statusWordSpacing"]},"statusTextAppearance"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["__componentName__","fields","buttonLabel","successMessage","errorMessage"]}],paletteBookmark:{items:[...mh],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","placeholderColor","inputColor","buttonTextColor","buttonColor"],hover:["strokeColor","inputColor","buttonTextColor","buttonColor"],focus:["strokeColor","inputTextColor","buttonTextColor","buttonColor"],filled:["strokeColor","inputColor","inputTextColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},hh={element:sh,id:"oneliner-form",name:"Newsletter Single Line",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Single_Line.png"},defaultSize:{d:{width:400},t:{width:500},m:{width:340}},assetsPaths:{content:[],parameters:[{path:"buttonIcon.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",statusFontSettings:"fontFamily"},schema:gh,sourceCode:dh};function fh(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1565
1565
|
.${e}-marquee-wrapper {
|
|
1566
1566
|
overflow: hidden;
|
|
1567
1567
|
width: 100%;
|
|
@@ -1693,7 +1693,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1693
1693
|
.${e}-image-hover-grayscale:hover video {
|
|
1694
1694
|
filter: grayscale(100%);
|
|
1695
1695
|
}
|
|
1696
|
-
`}const yh=30,vh=20,
|
|
1696
|
+
`}const yh=30,vh=20,wa=3,xh=12,bh=32,wh=3,Sh=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")},$h=(e,t)=>Array.from({length:t},()=>e).flat(),Ch=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},zd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ml=(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=zd(d);return c<=0?0:c+r*Math.max(0,t-1)},Th=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=zd(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},Lh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Rh=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Lh(i,e))},Ih=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??"")},Eh=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Mh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var W,O,C,E;const p=s.useRef(null),x=!!((W=e.image)!=null&&W.url&&Ih(e.image));s.useLayoutEffect(()=>{d&&Eh(p.current)&&(u==null||u())},[d,(O=e.image)==null?void 0:O.url,u]);const b=n.display==="cover",m=n.ratioValue??"1:1",g=n.reversed??!1,[f,v]=m.split(":").map(Number),w=(g?v:f)/(g?f:v),V=i/w,z=V>o?o:V,Y=V>o?o*w:i,M=c(Y),F=c(z),K={borderRadius:c(r)},T=b?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...K}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...K},L=((C=e.image)==null?void 0:C.url)&&(x?a.jsx("video",{ref:_=>{p.current=_},src:e.image.url,style:T,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:_=>{p.current=_},src:e.image.url,alt:((E=e.image)==null?void 0:E.name)??"",style:T,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...b?{width:M}:{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,...b?{width:M,height:F,overflow:"hidden",...K}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:L&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:$t(`${t}-marquee-link`,!b&&`${t}-marquee-link-contain`),children:L}):L})})},Ph=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=j.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>fh(r,c),[r,c]),{speed:p,direction:x,pauseOnHover:b,gap:m,imageMaxWidth:g,imageMaxHeight:f,hoverEffect:v,cornerRadius:I=0}=e,y=s.useMemo(()=>Ch(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,V=!!o,z=!n||!!i,Y=z&&v!=="off"&&v!=="randomize"?`${r}-image-hover-${v}`:void 0,M=n?!!i:!0,K=((t==null?void 0:t.length)??0)>0&&(M||!!n),T=Math.max(0,p)*yh,L=Se=>j.scalingValue(Se,n??!1),W=s.useRef(null),O=s.useRef(null),C=s.useRef(null),[E,_]=s.useState(0),S=M&&b==="on",[Z,$]=s.useState(!1),[H,B]=s.useState({}),le=s.useRef(H);le.current=H;const ie=s.useRef(null),k=s.useRef(0),de=s.useRef(null),G=s.useMemo(()=>(t??[]).map(Se=>{var ke;return((ke=Se.image)==null?void 0:ke.url)??""}).join("\0"),[t]),[ce,oe]=s.useState(wa),fe=s.useMemo(()=>{const Se=t??[];return Se.length===0||!(M||!!n)?Se:$h(Se,ce)},[t,M,ce,n]),Ie=s.useMemo(()=>(t??[]).filter(Se=>{var ke;return!!((ke=Se.image)!=null&&ke.url)}).length,[t]),xe=K?wh:1;s.useLayoutEffect(()=>{k.current=0,B({}),ie.current=null,oe(wa),d(0)},[G]),s.useEffect(()=>{if(!z||v!=="randomize")return;const Se=W.current;if(!Se)return;const ke=h=>{B(q=>{const X=Array.from(h).filter(ve=>ve in q&&!Rh(Se,ve));if(X.length===0)return q;const ee={...q};return X.forEach(ve=>{delete ee[ve]}),ee})},ye=new IntersectionObserver(h=>{const q=new Set;for(const X of h){const ee=X.target.dataset.marqueeItemIndex,ve=ee!==void 0?Number(ee):NaN;Number.isNaN(ve)||q.add(ve)}q.size>0&&ke(q)},{root:Se,threshold:0});Object.keys(H).forEach(h=>{const q=Number(h);Se.querySelectorAll(`[data-marquee-item-index="${q}"]`).forEach(X=>ye.observe(X))});const be={current:0},Ce=()=>{const h=Object.keys(le.current);h.length!==0&&(ke(h.map(Number)),be.current=requestAnimationFrame(Ce))};return Object.keys(le.current).length>0&&(be.current=requestAnimationFrame(Ce)),()=>{cancelAnimationFrame(be.current),ye.disconnect()}},[v,H,z]),s.useLayoutEffect(()=>{if(!K)return;const Se=W.current,ke=C.current;if(!Se||!ke)return;const ye={current:0},be=()=>{const q=Se.getBoundingClientRect().width||Se.offsetWidth,X=Th(ke),ee=ie.current,ve=typeof ee=="number"&&Math.abs(ee-X)<=.25;ie.current=X;let D=ce,R=0;if((M||n)&&w>0&&q>0){const N=Ml(ke,w);if(N>=bh){R=N;const te=Math.min(xh,Math.max(wa,Math.ceil(q/N)+1));D=te,te!==ce&&oe(te)}}const ne=D!==ce&&R>0?R*D:X>0?X:R>0?R*D:(()=>{const N=Ml(ke,w);return N>0?N*D:0})();ne>0?d(N=>N<=0?ne:!ve||Math.round(N)===Math.round(ne)?N:ne):!ve&&l<=0&&(cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be))},Ce=()=>{cancelAnimationFrame(ye.current),ye.current=requestAnimationFrame(be)};de.current=Ce,Ce();const h=new ResizeObserver(Ce);return h.observe(Se),h.observe(ke),()=>{de.current=null,cancelAnimationFrame(ye.current),h.disconnect()}},[M,K,l,G,ce,w,n]),s.useLayoutEffect(()=>{if(!K||c<=0)return;const Se=O.current;Se&&Sh(Se)},[K,c,x,T]),s.useLayoutEffect(()=>{if(!K||l<=0){_(0);return}const Se=O.current,ke=C.current;if(!Se||!ke)return;const ye=()=>{const Ce=Se.offsetHeight||Se.getBoundingClientRect().height,h=Array.from(ke.children).reduce((X,ee)=>Math.max(X,ee.offsetHeight||ee.getBoundingClientRect().height),0),q=Ce>0?Ce:h;_(q>0?q:0)};ye();const be=new ResizeObserver(ye);return be.observe(Se),be.observe(ke),()=>be.disconnect()},[K,xe,fe,n,m,g,f,l,y,H]),s.useLayoutEffect(()=>{if(!n||!V||!K||typeof window>"u")return;const Se=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Se)},[n,V,K,x,l,E,m,fe]);const ue=()=>{S&&$(!0)},U=()=>{S&&$(!1)},se=s.useCallback(()=>{var Se;k.current=Math.min(Ie,k.current+1),(Se=de.current)==null||Se.call(de)},[Ie]),re=s.useCallback((Se,ke)=>{B(ye=>{const be=ye[Se]??ke,Ce=(t??[]).filter(q=>q!==be);if(Ce.length===0)return ye;const h=Ce[Math.floor(Math.random()*Ce.length)];return{...ye,[Se]:h}})},[t]),Re=(Se,ke,ye,be)=>{const Ce=z&&v==="randomize"&&y.display==="cover"?H[ye]??Se:Se,h=`max(${L(m)}, ${vh}px)`,q=`calc(-0.5 * (${h} + ${L(m)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":ye,onMouseEnter:z&&v==="randomize"&&y.display==="cover"?()=>re(ye,Se):void 0,children:[a.jsx(Mh,{item:Ce,prefix:r,imageFit:y,imageMaxWidth:g,imageMaxHeight:f,cornerRadius:I,imageHoverClass:Y,isEditor:n,isFirstSet:be,scaled:L,onFirstSetImageDone:se}),V&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:q,width:h,height:"100%"}})]},`${ke}-${ye}`)};if(K){const Se=M?S&&Z?"paused":"running":"paused",ke=c>0&&T>0?c/T*1e3:0,ye=`${Math.max(0,ke)/1e3}s`;return a.jsxs("div",{ref:W,className:$t(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:E>0?{height:E}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:O,className:`${r}-marquee-track`,"data-direction":x,onMouseEnter:ue,onMouseLeave:U,style:{WebkitAnimationDuration:ye,animationDuration:ye,WebkitAnimationPlayState:Se,animationPlayState:Se},children:Array.from({length:xe},(be,Ce)=>a.jsx("div",{ref:Ce===0?C:void 0,className:$t(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:L(m),paddingRight:L(m)},"aria-hidden":Ce>0,children:fe.map((h,q)=>Re(h,Ce,q,Ce===0&&q<w))},`set-${Ce}`))})]})}return a.jsxs("div",{ref:W,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:$t(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:L(m),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Se,ke)=>Re(Se,0,ke))},"marquee-static")]})},kh=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1697
1697
|
import cn from 'classnames';
|
|
1698
1698
|
import { CommonComponentProps } from '../props';
|
|
1699
1699
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2605,7 +2605,7 @@ ${o}
|
|
|
2605
2605
|
left: -9999px;
|
|
2606
2606
|
top: 0;
|
|
2607
2607
|
}
|
|
2608
|
-
`}const _h=30,$a=3,Nh=12,Hh=96,Pl=3,cs=.72,Oh=100,Dh=10,jh=e=>e/Oh,zh=e=>Math.max(0,e)/Dh,Bh=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")},Vh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Ai={ctx:void 0},Gh=()=>Ai.ctx!==void 0?Ai.ctx:typeof document>"u"?(Ai.ctx=null,Ai.ctx):(Ai.ctx=document.createElement("canvas").getContext("2d"),Ai.ctx),qh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},kl=e=>{e.style.transform=""},Xh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Uh=(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)},Bd=96,Vd=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,b=x+c;o[p+1]=b,r[p+1]=r[p]+(d(x)+d(b))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Yh=(e,t)=>{const n=Vd(e,t,Bd);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Kh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const f=m+g>>1;return l[f]<=r?c(f,g):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],b=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*b)},Zh=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,x=e+o-u,b=Math.max(4,Math.ceil(r*4*(x/Math.max(e,1)))),m=Array.from({length:b},(g,f)=>{const v=u+f/b*x,I=u+(f+1)/b*x,y=I-v,w=d(v),V=d(I),z=v+y/3,Y=w+c(v)*y/3,M=I-y/3,F=V-c(I)*y/3;return`C${z.toFixed(2)} ${Y.toFixed(2)} ${M.toFixed(2)} ${F.toFixed(2)} ${I.toFixed(2)} ${V.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Jh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${cs}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((g,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),b=a.jsxs(a.Fragment,{children:[p,x]});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:b}):b})},Qh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=j.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:b,curveAmplitude:m,curveFrequency:g,textFontFamily:f,textFontSettings:v,textFontSize:I,textLineHeight:y,textLetterSpacing:w,textWordSpacing:V,textTextAppearance:z,textColor:Y,backgroundColor:M,ribbonWidth:F}=e,K=F??y,T=b==="curve",L=jh(m),W=zh(g),O=s.useMemo(()=>Wh(o,d,T),[o,d,T]),C=s.useMemo(()=>Zt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:w,wordSpacing:V,fontSize:I,lineHeight:y,textAppearance:z,color:Y},n),[f,v,w,V,I,y,z,Y,n]),E=Ne=>j.scalingValue(Ne,n??!1),_=((t==null?void 0:t.length)??0)>0,S=n?!!i:!0,Z=_&&(S||!!n),$=Math.max(0,c)*_h,H=S&&p==="on",[B,ce]=s.useState(!1),ie=S?H&&B?"paused":"running":"paused",A=ie==="running"&&$>0&&d>0,de=d>0&&$>0?d/$*1e3:0,G=s.useRef(null),se=s.useRef(null),oe=s.useRef(null),he=s.useRef(null),Ie=s.useRef(null),ve=s.useRef(null),ue=s.useRef(A),U=s.useRef(null),le=s.useRef(null),re=s.useRef(L),Re=s.useRef(W);ue.current=A,re.current=L,Re.current=W;const[we,ke]=s.useState(0),[fe,xe]=s.useState(0),[Ce,h]=s.useState(0),[q,X]=s.useState(0),[ee,ye]=s.useState(0),D=s.useMemo(()=>(t??[]).map(Ne=>{var Ae;return`${Ne.text}\0${((Ae=Ne.image)==null?void 0:Ae.url)??""}\0${Ne.link??""}`}).join("\0"),[t]),[R,Q]=s.useState($a),ne=s.useMemo(()=>{const Ne=t??[];return Ne.length===0||!(S||n)?Ne:Vh(Ne,R)},[t,S,R,n]),N=Z?Pl:1;s.useLayoutEffect(()=>{Q($a),l(0)},[D]),s.useLayoutEffect(()=>{var He;const Ne=ve.current;if(!Ne)return;const Ae=()=>{const tt=getComputedStyle(Ne),at=parseFloat(tt.fontSize)||0;if(at<=0)return;const st=Gh();if(!st){ke(at*cs),xe(0);return}st.font=`${tt.fontStyle} ${tt.fontWeight} ${at}px ${tt.fontFamily}`;const $e=st.measureText("H"),De=$e.actualBoundingBoxAscent>0?$e.actualBoundingBoxAscent:at*cs,lt=Math.max(0,$e.actualBoundingBoxDescent||0),Ue=$e.fontBoundingBoxAscent||0,qe=$e.fontBoundingBoxDescent||0;ke(Ct=>Math.abs(Ct-De)>.5?De:Ct);const $t=Ue>0||qe>0?(qe-lt-(Ue-De))/2:0;xe(Ct=>Math.abs(Ct-$t)>.25?$t:Ct)};Ae();const Pe=typeof document<"u"?document.fonts:void 0;(He=Pe==null?void 0:Pe.ready)==null||He.then(Ae).catch(()=>{});const Je=new ResizeObserver(Ae);return Je.observe(Ne),()=>Je.disconnect()},[C.fontFamily,C.fontWeight,C.fontStyle,C.fontSize,C.lineHeight]),s.useLayoutEffect(()=>{if(!Z)return;const Ne=G.current,Ae=he.current;if(!Ne||!Ae)return;const Pe={id:0},Je=()=>{const st=Ne.offsetWidth||Ne.getBoundingClientRect().width,$e=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(_&&st>0&&$e>0){const De=$e/R;if(De>0){let lt=st,Ue=Nh;if(T){const $t=st*re.current,Ct=Re.current,vt=Ct>0?2*Math.PI*Ct/st:0,Pt=Yh($t,vt);lt=Math.max(st,Pt*st/(Pl-1)),Ue=Hh}const qe=Math.min(Ue,Math.max($a,Math.ceil(lt/De)+1));if(qe!==R){Q(qe);return}}}$e>0&&l($e)},He=()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Je)};He();const tt=new ResizeObserver(He);tt.observe(Ne),tt.observe(Ae);const at=()=>{document.hidden||He()};return document.addEventListener("visibilitychange",at),window.addEventListener("pageshow",at),window.addEventListener("focus",at),()=>{cancelAnimationFrame(Pe.id),tt.disconnect(),document.removeEventListener("visibilitychange",at),window.removeEventListener("pageshow",at),window.removeEventListener("focus",at)}},[Z,D,R,_,we,T,L,W]),s.useLayoutEffect(()=>{const Ne=Ie.current;if(!Ne)return;const Ae={id:0},Pe=()=>{const He=Ne.offsetHeight;He>0&&ye(tt=>Math.abs(tt-He)>.5?He:tt)};Ae.id=requestAnimationFrame(Pe);const Je=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Pe)});return Je.observe(Ne),()=>{cancelAnimationFrame(Ae.id),Je.disconnect()}},[K,n]),s.useLayoutEffect(()=>{if(!T){h(0),X(0);return}const Ne=G.current,Ae=he.current;if(!Ne||!Ae)return;const Pe={id:0},Je=()=>{const tt=Ne.offsetWidth,at=Ae.offsetHeight;tt>0&&X(st=>Math.abs(st-tt)>.5?tt:st),at>0&&h(st=>Math.abs(st-at)>.5?at:st)};Pe.id=requestAnimationFrame(Je);const He=new ResizeObserver(()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Je)});return He.observe(Ne),He.observe(Ae),()=>{cancelAnimationFrame(Pe.id),He.disconnect()}},[T,D,we,y,I,Z]),s.useLayoutEffect(()=>{if(!Z||d<=0)return;const Ne=oe.current;Ne&&Bh(Ne)},[Z,d,u,$]),s.useLayoutEffect(()=>{if(!T||!_)return;const Ne=G.current;if(!Ne)return;const Ae={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Pe=()=>{for(const De of Ae.itemsCache)for(const lt of De.glyphs)kl(lt.inner)},Je=()=>{const De=se.current??Ne;Ae.itemsCache=Array.from(Ne.querySelectorAll("[data-marquee-text-item]"),lt=>{const Ue=[];return lt.querySelectorAll("[data-marquee-wave-node]").forEach(qe=>{const $t=qe.firstElementChild;$t&&Ue.push({inner:$t,layoutLocalX:Uh(qe,De)})}),{item:lt,glyphs:Ue}}),Ae.cacheDirty=!1},He=()=>{Ae.cacheDirty&&Je();const lt=(se.current??Ne).offsetWidth||1,Ue=lt*re.current,qe=Re.current,$t=2*Math.PI*qe/lt,Ct=`${lt}|${Ue}|${$t}`;if(Ct!==Ae.lutKey&&(Ae.lutKey=Ct,Ae.lut=Vd(Ue,$t,Bd)),Math.abs(Ue)<=0||$t<=0){Pe();return}const vt=oe.current,Pt=vt?Xh(getComputedStyle(vt).transform):0,Ht=Ne.getBoundingClientRect(),Yt=Ht.left,Kt=Ht.right,Lt=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*lt):0;for(const{item:Ot,glyphs:tn}of Ae.itemsCache){const xt=Ot.getBoundingClientRect();if(xt.right<Yt||xt.left>Kt+Lt){for(const Le of tn)kl(Le.inner);continue}for(const Le of tn){const je=Le.layoutLocalX+Pt,ut=Ae.lut?Kh(Ae.lut,je):je,ft=$t*ut,bt=Ue*Math.sin(ft),Mt=Ue*$t*Math.cos(ft),yt=Math.atan(Mt)*(180/Math.PI);qh(Le.inner,ut-je,bt,yt)}}},tt=()=>{Ae.cancelled||(Ae.raf=0,He(),ue.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(tt)))},at=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(tt))},st=()=>{Ae.cacheDirty=!0,He(),at()};U.current=at,le.current=st,He(),at();const $e=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,st()};return document.addEventListener("visibilitychange",$e),window.addEventListener("pageshow",$e),window.addEventListener("focus",$e),()=>{Ae.cancelled=!0,U.current=null,le.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",$e),window.removeEventListener("pageshow",$e),window.removeEventListener("focus",$e),Pe()}},[T,_]),s.useLayoutEffect(()=>{var Ne;!T||!_||(Ne=le.current)==null||Ne.call(le)},[T,_,r,D,R,we,L,W,q]),s.useLayoutEffect(()=>{var Ne;(Ne=U.current)==null||Ne.call(U)},[A,u]);const te=()=>{H&&ce(!0)},Ee=()=>{H&&ce(!1)},me=T?Math.abs(L)*100:0,J=E(K),Ke={minHeight:J,...T?{paddingTop:`${me}%`,paddingBottom:`${me}%`}:{}},Be={height:J,...T?{visibility:"hidden"}:{backgroundColor:M}},rt={gap:E(x),minHeight:J},Xe=q*L,nt=Math.abs(Xe),Qe=ee>0?ee:Ce,Ge=Math.max(Ce,Qe),Se=nt+Ge/2,_e=Math.max(Qe,1),Oe=T&&q>0&&Ge>0?Zh(q,Xe,W,Se,_e):"",et=nt*2+Ge,ge=Oe?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${et}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Oe,fill:"none",stroke:M,strokeWidth:Qe,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,We=a.jsx("div",{ref:Ie,className:`${o}-ribbon`,style:Be,"aria-hidden":!0}),Ve=(Ne,Ae,Pe)=>a.jsx(Jh,{item:Ne,prefix:o,textCss:C,capHeightPx:we,opticalOffsetY:fe,imageGapPx:E(x),isCurve:T},`${Ae}-${Pe}`),it=a.jsx("span",{ref:ve,"aria-hidden":!0,className:`${o}-cap-ref`,style:C,children:"H"}),ht=`${Math.max(0,de)/1e3}s`,ct=Z?a.jsx("div",{ref:oe,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:te,onMouseLeave:Ee,style:{WebkitAnimationDuration:ht,animationDuration:ht,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:N},(Ne,Ae)=>a.jsx("div",{ref:Ae===0?he:void 0,className:`${o}-marquee-set`,style:{...rt,paddingRight:E(x)},"aria-hidden":Ae>0,children:ne.map((Pe,Je)=>Ve(Pe,Ae,Je))},`set-${Ae}`))}):a.jsx("div",{ref:he,className:St(`${o}-marquee-set`,`${o}-marquee-static`),style:rt,children:t==null?void 0:t.map((Ne,Ae)=>Ve(Ne,0,Ae))});return a.jsxs("div",{ref:G,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),it,a.jsxs("div",{ref:se,className:`${o}-marquee-wrapper`,style:Ke,children:[We,ge,ct]})]})},ef=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2608
|
+
`}const _h=30,Sa=3,Nh=12,Hh=96,Pl=3,ls=.72,Oh=100,Dh=10,jh=e=>e/Oh,zh=e=>Math.max(0,e)/Dh,Bh=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")},Vh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Ai={ctx:void 0},Gh=()=>Ai.ctx!==void 0?Ai.ctx:typeof document>"u"?(Ai.ctx=null,Ai.ctx):(Ai.ctx=document.createElement("canvas").getContext("2d"),Ai.ctx),qh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},kl=e=>{e.style.transform=""},Xh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Uh=(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)},Bd=96,Vd=(e,t,n)=>{if(t<=0||Math.abs(e)<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),r=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const x=p*c,b=x+c;o[p+1]=b,r[p+1]=r[p]+(d(x)+d(b))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Yh=(e,t)=>{const n=Vd(e,t,Bd);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},Kh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(m,g)=>{if(g-m<=1)return[m,g];const f=m+g>>1;return l[f]<=r?c(f,g):c(m,f)},[u,p]=c(0,l.length-1),x=l[p]-l[u],b=x>0?(r-l[u])/x:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*b)},Zh=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=g=>i+t*Math.sin(l*g),c=g=>t*l*Math.cos(l*g),u=-o,x=e+o-u,b=Math.max(4,Math.ceil(r*4*(x/Math.max(e,1)))),m=Array.from({length:b},(g,f)=>{const v=u+f/b*x,I=u+(f+1)/b*x,y=I-v,w=d(v),V=d(I),z=v+y/3,Y=w+c(v)*y/3,M=I-y/3,F=V-c(I)*y/3;return`C${z.toFixed(2)} ${Y.toFixed(2)} ${M.toFixed(2)} ${F.toFixed(2)} ${I.toFixed(2)} ${V.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...m].join(" ")},Jh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var m;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${ls}em`},u=((m=e.image)==null?void 0:m.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),x=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((g,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:g===" "?" ":g})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),b=a.jsxs(a.Fragment,{children:[p,x]});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:b}):b})},Qh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=j.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:x,layoutType:b,curveAmplitude:m,curveFrequency:g,textFontFamily:f,textFontSettings:v,textFontSize:I,textLineHeight:y,textLetterSpacing:w,textWordSpacing:V,textTextAppearance:z,textColor:Y,backgroundColor:M,ribbonWidth:F}=e,K=F??y,T=b==="curve",L=jh(m),W=zh(g),O=s.useMemo(()=>Wh(o,d,T),[o,d,T]),C=s.useMemo(()=>Zt({fontSettings:{fontFamily:f,fontWeight:v.fontWeight,fontStyle:v.fontStyle},letterSpacing:w,wordSpacing:V,fontSize:I,lineHeight:y,textAppearance:z,color:Y},n),[f,v,w,V,I,y,z,Y,n]),E=Oe=>j.scalingValue(Oe,n??!1),_=((t==null?void 0:t.length)??0)>0,S=n?!!i:!0,Z=_&&(S||!!n),$=Math.max(0,c)*_h,H=S&&p==="on",[B,le]=s.useState(!1),ie=S?H&&B?"paused":"running":"paused",k=ie==="running"&&$>0&&d>0,de=d>0&&$>0?d/$*1e3:0,G=s.useRef(null),ce=s.useRef(null),oe=s.useRef(null),fe=s.useRef(null),Ie=s.useRef(null),xe=s.useRef(null),ue=s.useRef(k),U=s.useRef(null),se=s.useRef(null),re=s.useRef(L),Re=s.useRef(W);ue.current=k,re.current=L,Re.current=W;const[Se,ke]=s.useState(0),[ye,be]=s.useState(0),[Ce,h]=s.useState(0),[q,X]=s.useState(0),[ee,ve]=s.useState(0),D=s.useMemo(()=>(t??[]).map(Oe=>{var Ae;return`${Oe.text}\0${((Ae=Oe.image)==null?void 0:Ae.url)??""}\0${Oe.link??""}`}).join("\0"),[t]),[R,Q]=s.useState(Sa),ne=s.useMemo(()=>{const Oe=t??[];return Oe.length===0||!(S||n)?Oe:Vh(Oe,R)},[t,S,R,n]),N=Z?Pl:1;s.useLayoutEffect(()=>{Q(Sa),l(0)},[D]),s.useLayoutEffect(()=>{var Ne;const Oe=xe.current;if(!Oe)return;const Ae=()=>{const rt=getComputedStyle(Oe),ot=parseFloat(rt.fontSize)||0;if(ot<=0)return;const me=Gh();if(!me){ke(ot*ls),be(0);return}me.font=`${rt.fontStyle} ${rt.fontWeight} ${ot}px ${rt.fontFamily}`;const Fe=me.measureText("H"),st=Fe.actualBoundingBoxAscent>0?Fe.actualBoundingBoxAscent:ot*ls,dt=Math.max(0,Fe.actualBoundingBoxDescent||0),ze=Fe.fontBoundingBoxAscent||0,ut=Fe.fontBoundingBoxDescent||0;ke(Tt=>Math.abs(Tt-st)>.5?st:Tt);const Ct=ze>0||ut>0?(ut-dt-(ze-st))/2:0;be(Tt=>Math.abs(Tt-Ct)>.25?Ct:Tt)};Ae();const Pe=typeof document<"u"?document.fonts:void 0;(Ne=Pe==null?void 0:Pe.ready)==null||Ne.then(Ae).catch(()=>{});const Ze=new ResizeObserver(Ae);return Ze.observe(Oe),()=>Ze.disconnect()},[C.fontFamily,C.fontWeight,C.fontStyle,C.fontSize,C.lineHeight]),s.useLayoutEffect(()=>{if(!Z)return;const Oe=G.current,Ae=fe.current;if(!Oe||!Ae)return;const Pe={id:0},Ze=()=>{const me=Oe.offsetWidth||Oe.getBoundingClientRect().width,Fe=Ae.offsetWidth||Ae.getBoundingClientRect().width;if(_&&me>0&&Fe>0){const st=Fe/R;if(st>0){let dt=me,ze=Nh;if(T){const Ct=me*re.current,Tt=Re.current,xt=Tt>0?2*Math.PI*Tt/me:0,Pt=Yh(Ct,xt);dt=Math.max(me,Pt*me/(Pl-1)),ze=Hh}const ut=Math.min(ze,Math.max(Sa,Math.ceil(dt/st)+1));if(ut!==R){Q(ut);return}}}Fe>0&&l(Fe)},Ne=()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Ze)};Ne();const rt=new ResizeObserver(Ne);rt.observe(Oe),rt.observe(Ae);const ot=()=>{document.hidden||Ne()};return document.addEventListener("visibilitychange",ot),window.addEventListener("pageshow",ot),window.addEventListener("focus",ot),()=>{cancelAnimationFrame(Pe.id),rt.disconnect(),document.removeEventListener("visibilitychange",ot),window.removeEventListener("pageshow",ot),window.removeEventListener("focus",ot)}},[Z,D,R,_,Se,T,L,W]),s.useLayoutEffect(()=>{const Oe=Ie.current;if(!Oe)return;const Ae={id:0},Pe=()=>{const Ne=Oe.offsetHeight;Ne>0&&ve(rt=>Math.abs(rt-Ne)>.5?Ne:rt)};Ae.id=requestAnimationFrame(Pe);const Ze=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Pe)});return Ze.observe(Oe),()=>{cancelAnimationFrame(Ae.id),Ze.disconnect()}},[K,n]),s.useLayoutEffect(()=>{if(!T){h(0),X(0);return}const Oe=G.current,Ae=fe.current;if(!Oe||!Ae)return;const Pe={id:0},Ze=()=>{const rt=Oe.offsetWidth,ot=Ae.offsetHeight;rt>0&&X(me=>Math.abs(me-rt)>.5?rt:me),ot>0&&h(me=>Math.abs(me-ot)>.5?ot:me)};Pe.id=requestAnimationFrame(Ze);const Ne=new ResizeObserver(()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Ze)});return Ne.observe(Oe),Ne.observe(Ae),()=>{cancelAnimationFrame(Pe.id),Ne.disconnect()}},[T,D,Se,y,I,Z]),s.useLayoutEffect(()=>{if(!Z||d<=0)return;const Oe=oe.current;Oe&&Bh(Oe)},[Z,d,u,$]),s.useLayoutEffect(()=>{if(!T||!_)return;const Oe=G.current;if(!Oe)return;const Ae={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Pe=()=>{for(const st of Ae.itemsCache)for(const dt of st.glyphs)kl(dt.inner)},Ze=()=>{const st=ce.current??Oe;Ae.itemsCache=Array.from(Oe.querySelectorAll("[data-marquee-text-item]"),dt=>{const ze=[];return dt.querySelectorAll("[data-marquee-wave-node]").forEach(ut=>{const Ct=ut.firstElementChild;Ct&&ze.push({inner:Ct,layoutLocalX:Uh(ut,st)})}),{item:dt,glyphs:ze}}),Ae.cacheDirty=!1},Ne=()=>{Ae.cacheDirty&&Ze();const dt=(ce.current??Oe).offsetWidth||1,ze=dt*re.current,ut=Re.current,Ct=2*Math.PI*ut/dt,Tt=`${dt}|${ze}|${Ct}`;if(Tt!==Ae.lutKey&&(Ae.lutKey=Tt,Ae.lut=Vd(ze,Ct,Bd)),Math.abs(ze)<=0||Ct<=0){Pe();return}const xt=oe.current,Pt=xt?Xh(getComputedStyle(xt).transform):0,zt=Oe.getBoundingClientRect(),Xt=zt.left,Yt=zt.right,It=Ae.lut&&Ae.lut.wavelength>0?Math.max(0,(Ae.lut.periodArc/Ae.lut.wavelength-1)*dt):0;for(const{item:Ot,glyphs:tn}of Ae.itemsCache){const yt=Ot.getBoundingClientRect();if(yt.right<Xt||yt.left>Yt+It){for(const Le of tn)kl(Le.inner);continue}for(const Le of tn){const qe=Le.layoutLocalX+Pt,lt=Ae.lut?Kh(Ae.lut,qe):qe,vt=Ct*lt,wt=ze*Math.sin(vt),Et=ze*Ct*Math.cos(vt),ft=Math.atan(Et)*(180/Math.PI);qh(Le.inner,lt-qe,wt,ft)}}},rt=()=>{Ae.cancelled||(Ae.raf=0,Ne(),ue.current&&!document.hidden&&(Ae.raf=requestAnimationFrame(rt)))},ot=()=>{Ae.cancelled||Ae.raf||(Ae.raf=requestAnimationFrame(rt))},me=()=>{Ae.cacheDirty=!0,Ne(),ot()};U.current=ot,se.current=me,Ne(),ot();const Fe=()=>{if(document.hidden){cancelAnimationFrame(Ae.raf),Ae.raf=0;return}cancelAnimationFrame(Ae.raf),Ae.raf=0,me()};return document.addEventListener("visibilitychange",Fe),window.addEventListener("pageshow",Fe),window.addEventListener("focus",Fe),()=>{Ae.cancelled=!0,U.current=null,se.current=null,cancelAnimationFrame(Ae.raf),document.removeEventListener("visibilitychange",Fe),window.removeEventListener("pageshow",Fe),window.removeEventListener("focus",Fe),Pe()}},[T,_]),s.useLayoutEffect(()=>{var Oe;!T||!_||(Oe=se.current)==null||Oe.call(se)},[T,_,r,D,R,Se,L,W,q]),s.useLayoutEffect(()=>{var Oe;(Oe=U.current)==null||Oe.call(U)},[k,u]);const te=()=>{H&&le(!0)},Ee=()=>{H&&le(!1)},ge=T?Math.abs(L)*100:0,J=E(K),Ye={minHeight:J,...T?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},Be={height:J,...T?{visibility:"hidden"}:{backgroundColor:M}},it={gap:E(x),minHeight:J},Xe=q*L,et=Math.abs(Xe),Je=ee>0?ee:Ce,Ge=Math.max(Ce,Je),$e=et+Ge/2,He=Math.max(Je,1),De=T&&q>0&&Ge>0?Zh(q,Xe,W,$e,He):"",Qe=et*2+Ge,he=De?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${q} ${Qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:De,fill:"none",stroke:M,strokeWidth:Je,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,_e=a.jsx("div",{ref:Ie,className:`${o}-ribbon`,style:Be,"aria-hidden":!0}),Ve=(Oe,Ae,Pe)=>a.jsx(Jh,{item:Oe,prefix:o,textCss:C,capHeightPx:Se,opticalOffsetY:ye,imageGapPx:E(x),isCurve:T},`${Ae}-${Pe}`),tt=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:C,children:"H"}),ht=`${Math.max(0,de)/1e3}s`,at=Z?a.jsx("div",{ref:oe,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:te,onMouseLeave:Ee,style:{WebkitAnimationDuration:ht,animationDuration:ht,WebkitAnimationPlayState:ie,animationPlayState:ie},children:Array.from({length:N},(Oe,Ae)=>a.jsx("div",{ref:Ae===0?fe:void 0,className:`${o}-marquee-set`,style:{...it,paddingRight:E(x)},"aria-hidden":Ae>0,children:ne.map((Pe,Ze)=>Ve(Pe,Ae,Ze))},`set-${Ae}`))}):a.jsx("div",{ref:fe,className:$t(`${o}-marquee-set`,`${o}-marquee-static`),style:it,children:t==null?void 0:t.map((Oe,Ae)=>Ve(Oe,0,Ae))});return a.jsxs("div",{ref:G,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),tt,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Ye,children:[_e,he,at]})]})},ef=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2609
2609
|
import cn from 'classnames';
|
|
2610
2610
|
import { CommonComponentProps } from '../props';
|
|
2611
2611
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -3624,7 +3624,7 @@ type MarqueeTextProps = {
|
|
|
3624
3624
|
pointer-events: auto;
|
|
3625
3625
|
z-index: 10;
|
|
3626
3626
|
}
|
|
3627
|
-
`}const af=30,Al=2,sf=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")},lf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=j.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:b,stroke:m,strokeColor:g,bgColor:f,padding:v,logoMarginTop:I,logoWidth:y,logoHeight:w,captionMarginTop:V}=e,z=!!o,Y=((t==null?void 0:t.length)??0)>0,M=d>0&&(!n||i),F=Y&&(M||n),K=Math.max(0,d)*af,T=R=>j.scalingValue(R,n??!1),L=s.useRef(null),W=s.useRef(null),O=s.useRef(null),[C,E]=s.useState(0),[_,S]=s.useState(0),Z=_>0?_:0,$=s.useMemo(()=>rf(r,Z),[r,Z]),[H,B]=s.useState(0),
|
|
3627
|
+
`}const af=30,Al=2,sf=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")},lf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=j.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:x,corners:b,stroke:m,strokeColor:g,bgColor:f,padding:v,logoMarginTop:I,logoWidth:y,logoHeight:w,captionMarginTop:V}=e,z=!!o,Y=((t==null?void 0:t.length)??0)>0,M=d>0&&(!n||i),F=Y&&(M||n),K=Math.max(0,d)*af,T=R=>j.scalingValue(R,n??!1),L=s.useRef(null),W=s.useRef(null),O=s.useRef(null),[C,E]=s.useState(0),[_,S]=s.useState(0),Z=_>0?_:0,$=s.useMemo(()=>rf(r,Z),[r,Z]),[H,B]=s.useState(0),le=M&&u==="on",[ie,k]=s.useState(!1),de=s.useRef(null),[G,ce]=s.useState(0),[oe,fe]=s.useState(0),Ie=s.useRef(null),xe=R=>{var ne,N,te,Ee,ge;return{fontSettings:{fontFamily:(e==null?void 0:e[`${R}FontFamily`])??"Arial",fontWeight:((ne=e==null?void 0:e[`${R}FontSettings`])==null?void 0:ne.fontWeight)??400,fontStyle:((N=e==null?void 0:e[`${R}FontSettings`])==null?void 0:N.fontStyle)??"normal"},textAppearance:{textTransform:((te=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:te.textTransform)??"none",textDecoration:((Ee=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:Ee.textDecoration)??"none",fontVariant:((ge=e==null?void 0:e[`${R}TextAppearance`])==null?void 0:ge.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${R}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${R}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${R}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${R}LineHeight`])??.01,color:(e==null?void 0:e[`${R}Color`])??"#000000"}},ue=xe("text"),U=xe("caption"),se=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(R=>{var Q,ne;return(((Q=R.text)==null?void 0:Q.length)??0)>0||(((ne=R.caption)==null?void 0:ne.length)??0)>0}),[t]),re=s.useMemo(()=>!F||(t==null?void 0:t.length)===0?1:_<=0||C<=0?Al:Math.max(Al,Math.ceil(C/_)+1),[F,t==null?void 0:t.length,_,C]);s.useLayoutEffect(()=>{if(!F)return;const R=L.current,Q=O.current;if(!R||!Q)return;let ne=0;const N=()=>{const ge=R.getBoundingClientRect().width,J=Q.getBoundingClientRect().width,Ye=Ie.current,Be=typeof Ye=="number"&&Math.abs(Ye-J)<=.25;if(Ie.current=J,E(ge),typeof J=="number"&&J>0&&_<=0){S(J);return}Be&&J!==_?S(J):!Be&&_<=0&&(cancelAnimationFrame(ne),ne=requestAnimationFrame(N))},te=()=>{cancelAnimationFrame(ne),ne=requestAnimationFrame(N)};te();const Ee=new ResizeObserver(te);return Ee.observe(R),Ee.observe(Q),()=>{cancelAnimationFrame(ne),Ee.disconnect()}},[M,F,_]);const Re=Z>0&&K>0?Z/K*1e3:0,Se=`${Math.max(0,Re)/1e3}s`;s.useLayoutEffect(()=>{if(!F||Z<=0)return;const R=W.current;R&&sf(R)},[F,Z,c]),s.useLayoutEffect(()=>{if(!F){B(0);return}const R=O.current,Q=W.current;if(!R||!Q)return;const ne=()=>{let te=0;for(let Ee=0;Ee<R.children.length;Ee++){const J=R.children[Ee].firstElementChild;J&&(te=Math.max(te,J.offsetHeight))}te<=0&&(te=Q.offsetHeight),B(te>0?te:0)};ne();const N=new ResizeObserver(ne);return N.observe(R),N.observe(Q),()=>{N.disconnect()}},[F,re,t,n,p,x,v,m,b,y,w,G,oe]);const ke=()=>{le&&k(!0)},ye=()=>{le&&k(!1)},be=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),Ce=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),h=s.useCallback((R,Q,ne,N)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":z?N==null?void 0:N.controlsName:void 0,"data-controls-axis":z?"y":void 0,className:z?`${r}-control`:void 0,style:{height:T((N==null?void 0:N.marginTop)??0)}}),a.jsx("div",{...N!=null&&N.dataMeasureKind?{"data-testimonial-measure":N.dataMeasureKind}:{},style:{...Zt(R,n),textAlign:Ce,pointerEvents:"auto",...typeof(N==null?void 0:N.minHeightPx)=="number"&&N.minHeightPx>0?{minHeight:N.minHeightPx}:{}},children:a.jsx(Ii,{content:Q})})]},ne),[be,Ce,n,z,r,T]),q=s.useCallback((R,Q,ne)=>{var N,te,Ee;return a.jsxs("div",{style:{padding:`${T(v.top)} ${T(v.right)} ${T(v.bottom)} ${T(v.left)}`,width:T(x+m*2),height:"100%",borderRadius:T(b),border:`${T(m)} solid ${g}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[a.jsx("div",{className:`${r}-cover`,style:{background:f}}),a.jsxs("div",{className:`${r}-elements-overlay`,style:{alignItems:be,textAlign:Ce},children:[R.text&&h(ue,R.text,"text",ne!=null&&ne.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ne==null?void 0:ne.textMinHeightPx)=="number"&&ne.textMinHeightPx>0?{minHeightPx:ne.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:be,width:"100%"},children:[a.jsx("div",{"data-controls":z&&!(ne!=null&&ne.dataMeasureAttrs)?"logoMarginTop":void 0,className:z&&!(ne!=null&&ne.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:T(I)}}),a.jsx("div",{style:{width:T(y),height:T(w)},children:((N=R.logo)==null?void 0:N.url)&&a.jsx("img",{src:R.logo.url,alt:((te=R.logo)==null?void 0:te.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Ee=R.logo)==null?void 0:Ee.objectFit)||"contain"}})})]}),R.caption&&h(U,R.caption,"caption",{...ne!=null&&ne.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:V,...ne!=null&&ne.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ne==null?void 0:ne.captionMinHeightPx)=="number"&&ne.captionMinHeightPx>0?{minHeightPx:ne.captionMinHeightPx}:{}})]})]},Q)},[f,V,U,x,b,w,I,y,be,Ce,v.bottom,v.left,v.right,v.top,h,m,g,ue,n,z,r]),X=s.useCallback(R=>{ce(R.maxTextPx),fe(R.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!se){X({maxTextPx:0,maxCaptionPx:0});return}const R=de.current;if(!R)return;const Q=()=>{j.readTestimonialTextMeasure(R,X)};Q();const ne=new ResizeObserver(Q);return ne.observe(R),()=>{ne.disconnect()}},[se,X,t,q]);const ee=se?{textMinHeightPx:G,captionMinHeightPx:oe}:void 0,ve=se?a.jsx("div",{ref:de,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((R,Q)=>q(R,`measure-${Q}`,{dataMeasureAttrs:!0}))}):null,D=(R,Q)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[q(R,`card-${Q}`,ee),z&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${T(p)})`,width:T(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},Q);if(F){const R=M?le&&ie?"paused":"running":"paused";return a.jsxs("div",{ref:L,className:$t(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...H>0?{height:H}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),ve,a.jsx("div",{ref:W,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:ke,onMouseLeave:ye,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:Se,WebkitAnimationDuration:Se,animationPlayState:R,WebkitAnimationPlayState:R},children:Array.from({length:re},(Q,ne)=>a.jsx("div",{ref:ne===0?O:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:T(p),paddingRight:T(p)},"aria-hidden":ne>0,children:t==null?void 0:t.map((N,te)=>D(N,`${ne}-${te}`))},`set-${ne}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:$}}),ve,a.jsx("div",{style:{gap:T(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((R,Q)=>D(R,Q))})]})},cf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3628
3628
|
import cn from 'classnames';
|
|
3629
3629
|
import { CommonComponentProps } from '../props';
|
|
3630
3630
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4379,7 +4379,7 @@ type TestimonialsSettings = {
|
|
|
4379
4379
|
width: 100%;
|
|
4380
4380
|
height: 100%;
|
|
4381
4381
|
}
|
|
4382
|
-
`}const mf=3e3,gf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=j.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:b,imageWidth:m,imageHeight:g,controlsWidth:f,controlsColor:v,controlsHoverColor:I}=e,y=d>0&&(!n||!!i),[w,V]=s.useState(0),[z,Y]=s.useState(null),[M,F]=s.useState(!1),K=s.useRef(null),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{V(0),Y(null),F(!1)},[l.length]);const W=l[w],O=z===null?null:l[z],C=
|
|
4382
|
+
`}const mf=3e3,gf=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=j.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:x,captionMarginTop:b,imageWidth:m,imageHeight:g,controlsWidth:f,controlsColor:v,controlsHoverColor:I}=e,y=d>0&&(!n||!!i),[w,V]=s.useState(0),[z,Y]=s.useState(null),[M,F]=s.useState(!1),K=s.useRef(null),T=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),L=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{V(0),Y(null),F(!1)},[l.length]);const W=l[w],O=z===null?null:l[z],C=xe=>{var U,se,re,Re,Se;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((U=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:U.fontWeight)??400,fontStyle:((se=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:se.fontStyle)??"normal"},textAppearance:{textTransform:((re=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:re.textTransform)??"none",textDecoration:((Re=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Re.textDecoration)??"none",fontVariant:((Se=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Se.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${xe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${xe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${xe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${xe}WordSpacing`])??0,color:(e==null?void 0:e[`${xe}Color`])??"#000000"}},E=C("text"),_=C("caption"),S=l.length>1&&l.some(xe=>{var ue,U;return(((ue=xe.text)==null?void 0:ue.length)??0)>0||(((U=xe.caption)==null?void 0:U.length)??0)>0}),Z=s.useRef(null),[$,H]=s.useState(0),[B,le]=s.useState(0),ie=e.controls??{mode:"Off",icon:null},k=l.length>1,de=s.useCallback((xe,ue)=>!k||ue===xe?xe:(K.current&&window.clearTimeout(K.current),Y(xe),F(!0),K.current=window.setTimeout(()=>{Y(null),F(!1),K.current=null},300),ue),[k]),G=s.useCallback(()=>{k&&V(xe=>de(xe,(xe-1+l.length)%l.length))},[k,de,l.length]),ce=s.useCallback(()=>{k&&V(xe=>de(xe,(xe+1)%l.length))},[k,de,l.length]);s.useEffect(()=>{if(!y||!k)return;const xe=Math.max(300,mf/d),ue=window.setInterval(()=>{V(U=>de(U,(U+1)%l.length))},xe);return()=>{window.clearInterval(ue)}},[y,k,de,l.length,d]),s.useEffect(()=>()=>{K.current&&window.clearTimeout(K.current)},[]);const oe=(xe,ue)=>{var Se,ke,ye,be;const U=ue==null?void 0:ue.textMinHeightPx,se=ue==null?void 0:ue.captionMinHeightPx,re=ue==null?void 0:ue.dataMeasureAttrs,Re=o&&!(ue!=null&&ue.dataMeasureAttrs)&&!(ue!=null&&ue.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"textMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:j.scalingValue(x??0,n??!1)}}),a.jsx("div",{...re&&{"data-testimonial-measure":"text"},style:{...Zt(E,n),...U&&U>0?{minHeight:U}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ii,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"imageMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:j.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:j.scalingValue(m??0,n??!1),height:j.scalingValue(g??0,n??!1)},children:((Se=xe.image)==null?void 0:Se.url)&&a.jsx("img",{src:(ke=xe.image)==null?void 0:ke.url,alt:((ye=xe.image)==null?void 0:ye.name)??"",className:`${r}-icon`,style:{objectFit:((be=xe.image)==null?void 0:be.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:T,width:"100%"},children:[a.jsx("div",{"data-controls":Re?"captionMarginTop":void 0,className:Re?`${r}-control`:void 0,style:{height:j.scalingValue(b??0,n??!1)}}),a.jsx("div",{...re?{"data-testimonial-measure":"caption"}:{},style:{...Zt(_,n),...se&&se>0?{minHeight:se}:{},textAlign:L,pointerEvents:"auto"},children:a.jsx(Ii,{content:xe.caption})})]})]})},fe=s.useCallback(xe=>{H(xe.maxTextPx),le(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!S){fe({maxTextPx:0,maxCaptionPx:0});return}const xe=Z.current;if(!xe)return;const ue=()=>{j.readTestimonialTextMeasure(xe,fe)};ue();const U=new ResizeObserver(ue);return U.observe(xe),()=>{U.disconnect()}},[S,fe,t]),!W)return a.jsx(a.Fragment,{});const Ie=S?{textMinHeightPx:$,captionMinHeightPx:B}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pf(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:j.scalingValue(u??0,n??!1),alignItems:T},children:[S&&a.jsx("div",{ref:Z,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,ue)=>a.jsx("div",{style:{width:"100%"},children:oe(xe,{dataMeasureAttrs:!0})},ue))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[O&&M&&a.jsx("div",{className:$t(`${r}-fade-item-prev`,`${r}-fade-out`),children:oe(O,{...Ie,hideControls:!0})}),a.jsx("div",{className:$t(`${r}-fade-item-current`,M?`${r}-fade-in`:void 0),children:oe(W,Ie)})]})]}),ie.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:j.scalingValue(f??.02,n??!1),height:j.scalingValue(f??.02,n??!1),"--arrow-hover-color":I},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:G,disabled:!k,"aria-label":"Previous testimonial",children:ie.icon&&a.jsx(ln,{url:ie.icon,fill:v,hoverFill:I,className:$t(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:$t(`${r}-arrow`,`${r}-next-arrow`),style:{width:j.scalingValue(f??.02,n??!1),height:j.scalingValue(f??.02,n??!1),"--arrow-hover-color":I},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!k,"aria-label":"Next testimonial",children:ie.icon&&a.jsx(ln,{url:ie.icon,fill:v,hoverFill:I,className:`${r}-arrow-img`})})})]})]})})},hf=`import cn from 'classnames';
|
|
4383
4383
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4384
4384
|
import { CommonComponentProps } from '../props';
|
|
4385
4385
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4875,7 +4875,7 @@ type TestimonialsSettings = {
|
|
|
4875
4875
|
icon?: string | null;
|
|
4876
4876
|
};
|
|
4877
4877
|
};
|
|
4878
|
-
`,ff="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Wl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},yf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Wl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Wl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:ff},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},vf={element:gf,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:yf,sourceCode:hf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function xf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _l(e){return((e==null?void 0:e.trim().length)??0)>0}function
|
|
4878
|
+
`,ff="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 18" width="10" height="18"><path fill="#000000" fill-rule="evenodd" d="M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z" transform="translate(5, 9) rotate(-90) translate(-5, -9)"/></svg>'),Wl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},yf={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},align:{type:"string",scope:"common",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},width:{type:"number",scope:"layout",title:"width",min:0,max:1e3,display:{type:"numeric-input"}},imageWidth:{type:"number",scope:"layout",title:"width",min:0,max:300,display:{type:"numeric-input"}},imageHeight:{type:"number",scope:"layout",title:"height",min:0,max:300,display:{type:"numeric-input"}},imageMarginTop:{type:"number",scope:"layout",title:"Image margin top",min:0,max:200,display:{type:"range-control"}},textMarginTop:{type:"number",scope:"layout",title:"Text margin top",min:0,max:200,display:{type:"range-control"}},controls:{type:"object",scope:"common",title:"Controls",display:{type:"button-icon-switch"},properties:{mode:{type:"string",enum:["On","Off"]},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},controlsWidth:{type:"number",scope:"layout",title:"Controls width",min:0,max:100,display:{type:"numeric-input"}},controlsColor:{type:"string",scope:"common",title:"Controls Default",display:{type:"settings-color-picker"}},controlsHoverColor:{type:"string",scope:"common",title:"Controls Hover",display:{type:"settings-color-picker"}},captionMarginTop:{type:"number",scope:"layout",title:"Caption margin top",min:0,max:200,display:{type:"range-control"}},captionFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},captionFontSettings:{...Wl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},captionFontSize:{type:"number",scope:"layout",title:"Caption Font Size",display:{type:"font-size"}},captionLineHeight:{type:"number",scope:"layout",title:"Caption Line Height",display:{type:"line-height-input"}},captionLetterSpacing:{type:"number",scope:"layout",title:"Caption Letter Spacing",display:{type:"letter-spacing-input"}},captionWordSpacing:{type:"number",scope:"layout",title:"Caption Word Spacing",display:{type:"word-spacing-input"}},captionTextAppearance:{type:"object",scope:"layout",title:"Caption Text Appearance",display:{type:"text-appearance"}},captionColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Caption Default"},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Wl.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Text Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Text Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Text Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Text Word Spacing",display:{type:"word-spacing-input"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Default"}},defaults:{controls:{mode:"On",icon:ff},controlsColor:"#000000",controlsHoverColor:"#EABC01",align:"center",textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},captionColor:"#000000"},layoutDefaults:{m:{speed:1,width:.69,imageMarginTop:.08,captionMarginTop:.04,textMarginTop:0,textFontSize:.069,captionFontSize:.053,textLineHeight:.093,captionLineHeight:.069,imageWidth:.21,imageHeight:.21,controlsWidth:.06},t:{speed:1,width:.65,imageMarginTop:.026,captionMarginTop:.01,textMarginTop:0,textFontSize:.035,captionFontSize:.023,textLineHeight:.04,captionLineHeight:.029,imageWidth:.05,imageHeight:.05,controlsWidth:.026},d:{speed:1,width:.35,imageMarginTop:.02,textMarginTop:0,captionMarginTop:.01,textFontSize:.016,captionFontSize:.009,textLineHeight:.018,captionLineHeight:.009,imageWidth:.027,imageHeight:.027,controlsWidth:.014}},layout:["__componentName__","speed","width","imageMarginTop","textMarginTop","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["width","align"]},{type:"row",items:["controls"]},{type:"row",items:["controlsWidth","speed"]},{type:"row",title:"Image Container",items:["imageWidth","imageHeight"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"Text",items:["textFontFamily","textFontSettings",{type:"group",title:"",items:["text",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}]},{type:"group",title:"Caption",items:["captionFontFamily","captionFontSettings",{type:"group",title:"",items:["caption",{type:"row",items:["captionFontSize","captionLineHeight","captionLetterSpacing","captionWordSpacing"]},"captionTextAppearance"]}]}]}],paletteBookmark:{items:["textColor","captionColor","controlsColor","controlsHoverColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input"}},text:{placeholder:"Add Text...",label:"Text",display:{type:"rich-text"}},caption:{placeholder:"Add Caption...",label:"Caption",display:{type:"rich-text"}}}},default:[{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/julia.png",name:""},text:[{type:"paragraph",children:[{text:"This website is a great tool for designers and developers. The ease of creating animations here is mesmerizing. Bravo to the creators of this product!"}]}],caption:[{type:"paragraph",children:[{text:"Julia Smith,"}]},{type:"paragraph",children:[{text:"Freelance Designer"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/mark.png",name:""},text:[{type:"paragraph",children:[{text:"This is super cool. The on onboarding terminal style animation brings me back to what made the Internet simple and fun."}]}],caption:[{type:"paragraph",children:[{text:"Mark Travis,"}]},{type:"paragraph",children:[{text:"Architect @ United Architects"}]}]},{image:{objectFit:"contain",url:"https://cdn.cntrl.site/component-assets/pia.png",name:""},text:[{type:"paragraph",children:[{text:"Great tool for someone who wants to quickly and easily build a site that has fancy scrolling animations. Totally addictive!"}]}],caption:[{type:"paragraph",children:[{text:"Pia,"}]},{type:"paragraph",children:[{text:"Media Buyer"}]}]}]}},vf={element:gf,id:"testimonial-single",name:"Clara",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Single.png"},defaultSize:{d:{width:700},t:{width:700},m:{width:334}},schema:yf,sourceCode:hf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function xf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function _l(e){return((e==null?void 0:e.trim().length)??0)>0}function $a(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ca(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:j.scalingValue((o-t)/2,i)}}function bf(e){return`
|
|
4879
4879
|
.${e}-wrapper {
|
|
4880
4880
|
display: grid;
|
|
4881
4881
|
align-items: start;
|
|
@@ -5222,7 +5222,7 @@ type TestimonialsSettings = {
|
|
|
5222
5222
|
z-index: 2;
|
|
5223
5223
|
width: 100%;
|
|
5224
5224
|
}
|
|
5225
|
-
`}function wf(){return Math.random()<.5?"ltr":"ttb"}function Sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function $f(e){const t=wf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Sf(e)})})}const wn=500,Cf=750,qn="cubic-bezier(0.22, 1, 0.36, 1)",Tf=72,Lf=50;function Rf(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 If(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Ef(e){const[t]=e.media;return t!=null&&t.url?t:null}function Gd(e){return!Array.isArray(e)||e.length===0?[]:Rf(e)?e.flatMap(t=>{const n=If(t);if(!n)return[];const i=Ef(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 Ti(e){return e.type==="video"}function Mf(e){const t=new Set,n=[];for(const i of e){const o=Gd(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 Pf({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=>Ti(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 kf(e){e.pause(),e.removeAttribute("src"),e.load()}function Nl({media:e,className:t,style:n,onMediaClick:i}){return Ti(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 Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Af(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 Ff({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{kf(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 Wf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),b=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),v=s.useRef(0),I=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),V=s.useRef(null),z=s.useRef(0),Y=s.useRef(null),M=s.useRef(!1),F=s.useRef(null),K=s.useRef(null),T=s.useRef(null),L=s.useRef(()=>{}),[W,O]=s.useState(null),[C,E]=s.useState(null),[_,S]=s.useState("opening"),[Z,$]=s.useState(0),[H,B]=s.useState(0),[ce,ie]=s.useState(null),[A,de]=s.useState(!1),[G,se]=s.useState(!1),[oe,he]=s.useState(!1),[Ie,ve]=s.useState(null),ue=s.useRef(n),U=s.useRef(void 0),le=t[n],re=le?Ti(le):!1,Re=H!==0||A,we=ce!==null,ke=s.useCallback(ge=>{const We=ge.currentTarget,Ve=We instanceof HTMLVideoElement?{width:We.videoWidth,height:We.videoHeight}:{width:We.naturalWidth,height:We.naturalHeight};!Ve.width||!Ve.height||ve(Ve)},[]);s.useEffect(()=>{V.current=C},[C]),s.useEffect(()=>{const ge=x.current;if(!ge)return;const We=()=>E(Hl(ge));We();const Ve=new ResizeObserver(We);return Ve.observe(ge),()=>Ve.disconnect()},[]);const fe=s.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),xe=s.useCallback(()=>{const ge=K.current;K.current=null,fe(),Y.current=null,M.current=!1,ie(null),de(!1),B(0),z.current=0,se(!1),y.current=!1,v.current=0,I.current="none",ge===1?d():ge===-1&&l()},[fe,d,l]),Ce=s.useCallback(()=>{fe(),K.current=null,Y.current=null,M.current=!1,ie(null),de(!1),B(0),z.current=0},[fe]),h=s.useCallback(()=>{fe(),F.current=window.setTimeout(()=>{K.current!==null&&xe()},wn+32)},[fe,xe]),q=s.useCallback((ge,We)=>{var it;const Ve=((it=V.current)==null?void 0:it.width)??0;if(fe(),Y.current=ge,ie(ge),M.current=!0,de(!0),We){K.current=ge;const ht=-ge*Ve;z.current=ht,B(ht),h();return}z.current=0,B(0),F.current=window.setTimeout(()=>{F.current=null,Ce()},wn+32)},[fe,Ce,h]),X=s.useCallback(ge=>{if(!(t.length<=1)){if(M.current){if(K.current===ge){T.current=ge,xe();return}Ce()}fe(),Y.current=ge,ie(ge),M.current=!1,de(!1),z.current=0,B(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(ge,!0)})})}},[t.length,q,xe,Ce,fe]);L.current=X;const ee=s.useCallback(ge=>{ge.propertyName!=="transform"||!M.current||K.current!==null&&xe()},[xe]),ye=s.useCallback(()=>{const ge=b.current;if(!ge)return;const We=Hl(ge);!We.width||!We.height||O(We)},[]);s.useEffect(()=>{ye();const ge=b.current;if(!ge)return;const We=new ResizeObserver(()=>ye());return We.observe(ge),()=>We.disconnect()},[ye]),s.useEffect(()=>{_==="opening"&&W&&S("open")},[_,W]),s.useEffect(()=>{if(_!=="closing")return;const ge=setTimeout(()=>r(),wn);return()=>clearTimeout(ge)},[_,r]),s.useEffect(()=>()=>{fe()},[fe]),s.useLayoutEffect(()=>{ue.current===n&&U.current===(le==null?void 0:le.url)||(fe(),K.current=null,ie(null),$(0),B(0),de(!1),he(!1),se(!1),ve(null),f.current=0,v.current=0,I.current="none",y.current=!1,M.current=!1,z.current=0,Y.current=null,g.current=null,w.current=!1,ue.current=n,U.current=le==null?void 0:le.url)},[n,le==null?void 0:le.url,fe]),s.useLayoutEffect(()=>{const ge=T.current;ge!==null&&(T.current=null,requestAnimationFrame(()=>{L.current(ge)}))},[n,le==null?void 0:le.url]),s.useEffect(()=>{if(_!=="open")return;let ge=null;const We=()=>{ge&&(document.removeEventListener("click",ge,!0),ge=null)},Ve=()=>{We(),ge=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),We()},document.addEventListener("click",ge,!0)},it=Ae=>{const Pe=Ae<0?1:-1;if(Math.abs(Ae)>Lf&&t.length>1){q(Pe,!0);return}q(Pe,!1)},ht=Ae=>{if(Ae.touches.length!==1||M.current)return;const Pe=Ae.touches[0];w.current=!0,g.current={x:Pe.clientX,y:Pe.clientY},I.current="none",v.current=0,y.current=!1},ct=Ae=>{if(!g.current||Ae.touches.length!==1||M.current)return;const Pe=Ae.touches[0],Je=Pe.clientX-g.current.x,He=Pe.clientY-g.current.y;if(I.current==="none"){if(Math.abs(Je)<10&&Math.abs(He)<10)return;if(Math.abs(Je)>Math.abs(He)){if(t.length<=1)return;I.current="horizontal"}else if(He>0)I.current="vertical";else return}if(I.current==="horizontal"){y.current=!0,se(!0),v.current=Je;const tt=Je<0?1:-1;Y.current!==tt&&(Y.current=tt,ie(tt)),z.current=Je,B(Je),Ae.preventDefault();return}I.current==="vertical"&&(y.current=!0,se(!0),f.current=He,$(He),Ae.preventDefault())},Ne=()=>{if(!g.current)return;const Ae=I.current,Pe=y.current;if(Pe&&Ae==="horizontal")it(v.current),Ve();else if(Pe&&Ae==="vertical")if(f.current>Tf){const He=window.innerHeight;f.current=He,he(!0),$(He),S("closing")}else f.current=0,$(0),Ve();else Ae==="horizontal"&&Math.abs(v.current)>0&&(it(v.current),Ve());g.current=null,I.current="none",v.current=0,y.current=!1,se(!1)};return document.addEventListener("touchstart",ht,{passive:!0}),document.addEventListener("touchmove",ct,{passive:!1}),document.addEventListener("touchend",Ne),document.addEventListener("touchcancel",Ne),()=>{document.removeEventListener("touchstart",ht),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",Ne),document.removeEventListener("touchcancel",Ne),We()}},[_,t.length,q]),s.useEffect(()=>{const ge=We=>{We.key==="Escape"&&(We.preventDefault(),We.stopPropagation(),_!=="closing"&&S("closing"))};return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[_]);const D=()=>{_!=="closing"&&S("closing")},R=_==="open",Q=_==="closing",ne=Z>0?Math.max(0,1-Z/500):1,N=Z>0?Math.max(.35,1-Z/500):1,te=W?p?W:Af(W,Ie):null,Ee=ge=>{if(ge.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const We=te??ge.currentTarget.getBoundingClientRect(),Ve=ge.clientY-We.top,it=Math.min(52,We.height*.2);if(!(Ve>We.height-it)){if(ge.clientX-We.left<We.width/2){X(-1);return}X(1)}},me=ge=>{if(t.length<=1)return;const We=te??ge.currentTarget.getBoundingClientRect(),Ve=ge.clientX-We.left,it=ge.clientY-We.top,ht=Math.min(52,We.height*.2);if(it>We.height-ht){ge.currentTarget.style.cursor="default";return}ge.currentTarget.style.cursor=Ve<We.width/2?"w-resize":"e-resize"},J={position:"fixed",top:C==null?void 0:C.top,left:C==null?void 0:C.left,width:C==null?void 0:C.width,height:C==null?void 0:C.height,zIndex:9998},Ke=p?"cover":"contain",Be=H!==0||Z>0?`translate(${H}px, ${Z}px)`:void 0,rt=G&&!A?"none":A?`transform ${wn}ms ${qn}`:oe?`transform ${wn}ms ${qn}, opacity ${wn}ms ${qn}`:_==="opening"||Q?`opacity ${wn}ms ${qn}`:"none",Xe={...J,transform:Be,opacity:Z>0?N:_==="opening"||Q?0:1,transition:rt,pointerEvents:"none"},nt={position:"absolute",top:((te==null?void 0:te.top)??0)-((C==null?void 0:C.top)??0),left:((te==null?void 0:te.left)??0)-((C==null?void 0:C.left)??0),width:te==null?void 0:te.width,height:te==null?void 0:te.height,objectFit:Ke,pointerEvents:re&&R&&!Re?"auto":"none",touchAction:re&&R?"none":void 0},Qe=(C==null?void 0:C.width)??0,Ge=we?(n+ce+t.length)%t.length:null,Se=Ge!==null?t[Ge]:null,_e={...J,transform:we?`translateX(${ce*Qe+H}px)`:void 0,opacity:1,transition:A?`transform ${wn}ms ${qn}`:"none",pointerEvents:"none"},Oe={position:"absolute",top:((W==null?void 0:W.top)??0)-((C==null?void 0:C.top)??0),left:((W==null?void 0:W.left)??0)-((C==null?void 0:C.left)??0),width:W==null?void 0:W.width,height:W==null?void 0:W.height,objectFit:Ke,pointerEvents:"none"},et=te?{position:"fixed",top:te.top,height:te.height,width:te.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:D,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?ne:0,transition:G?"none":`opacity ${wn}ms ${qn}`,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:b,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${wn}ms ${qn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${wn}ms ${qn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),W&&C&&Se&&a.jsx("div",{style:_e,onTransitionEnd:ee,children:Ti(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Oe},`neighbor-${Ge}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Oe},`neighbor-${Ge}-${Se.url}`)}),W&&C&&le&&a.jsx("div",{style:Xe,onTransitionEnd:ee,children:re?a.jsx(Ff,{src:le.url,phase:_,mediaRef:m,mediaStyle:nt,onLoadedMetadata:ke,onClick:Ee,onMouseMove:me},`${n}-${le.url}`):a.jsx("img",{ref:m,src:le.url,alt:le.name,onLoad:ke,style:nt},`${n}-${le.url}`)}),R&&et&&t.length>1&&!re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...et,left:te.left,cursor:"w-resize",pointerEvents:G?"none":"auto"},onClick:ge=>{if(w.current){w.current=!1;return}ge.stopPropagation(),X(-1)}}),a.jsx("div",{style:{...et,left:te.left+te.width/2,cursor:"e-resize",pointerEvents:G?"none":"auto"},onClick:ge=>{if(w.current){w.current=!1;return}ge.stopPropagation(),X(1)}})]})]})}function _f(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Nf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=j.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:b=100,verticalGap:m,entriesCount:g,lightbox:f,imageDisplay:v,imageCorners:I,lightboxImageDisplay:y,slider:w,sliderTiming:V,direction:z,transition:Y,titleMarginTop:M,subtitleMarginTop:F,titleColor:K,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:W,titleFontSettings:O,titleFontSize:C,titleLineHeight:E,titleLetterSpacing:_,titleWordSpacing:S,titleTextAppearance:Z,subtitleFontFamily:$,subtitleFontSettings:H,subtitleFontSize:B,subtitleLineHeight:ce,subtitleLetterSpacing:ie,subtitleWordSpacing:A,subtitleTextAppearance:de,lightboxCounterFontFamily:G,lightboxCounterFontSettings:se,lightboxCounterFontSize:oe,lightboxCounterLineHeight:he,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:ve,lightboxCounterTextAppearance:ue,showText:U="always",alignEntries:le="off",align:re="top"}=e,Re={fontSettings:{fontFamily:W,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:C??.01,lineHeight:E,letterSpacing:_??0,wordSpacing:S??0,textAppearance:Z,color:K},ke={...sn(Zt(Re,n))},fe={fontSettings:{fontFamily:$,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:B??.01,lineHeight:ce,letterSpacing:ie??0,wordSpacing:A??0,textAppearance:de,color:T},Ce={...sn(Zt(fe,n))},h={fontSettings:{fontFamily:G,fontWeight:(se==null?void 0:se.fontWeight)??400,fontStyle:(se==null?void 0:se.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:he,letterSpacing:Ie??0,wordSpacing:ve??0,textAppearance:ue,color:L},X={...sn(Zt(h,n)),...Ta(oe,he,u,n)},ee=Ca(C,E,`${u}-item-title`,`${u}-text-tight-leading`),ye=Ca(B,ce,`${u}-item-subtitle`,`${u}-text-tight-leading`),D=Ta(C,E,u,n),R=Ta(B,ce,u,n),Q=Ca(oe,he,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=j.buildColorVars(u,{titleColor:K,subtitleColor:T,lightboxCounterColor:L},Hf,Of),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${U==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),me=g===0?1/0:g,J=(t??[]).slice(0,me),Ke=s.useMemo(()=>f==="on"?Mf(J):[],[J,f]),Be=x.entryWidth??.2,rt=(v==null?void 0:v.display)==="cover",Xe=(v==null?void 0:v.ratioValue)??"1:1",nt=(v==null?void 0:v.reversed)??!1,[Qe,Ge]=Xe.split(":").map(Number),Oe=`${nt?Ge:Qe} / ${nt?Qe:Ge}`,et=x.columnsCount,ge=j.scalingValue(Be??0,n),We=ge,Ve=!rt&&w!=="off",it=J.length%et||et,ht=it<et&&J.length>0,ct=J.length-it,Ne=ht?Math.floor((et-it)/2)+1:1,Ae=I?j.scalingValue(I,n):void 0,Pe={width:We,...rt?{aspectRatio:Oe,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},Je=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),He=p==="d"||p==="e"||p==="f",tt=le==="on",at=`calc(${j.scalingValue(Be??0,n)} * (${b} / 100))`,st=j.scalingValue(Be*b/100,n),$e=rt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}},[De,lt]=s.useState(0),Ue=s.useRef(null),qe=Y==="fade"||z==="horizontal"?"ltr":z==="vertical"?"ttb":"ltr";s.useEffect(()=>{const xt=Ue.current;if(!xt)return;const Le=new ResizeObserver(je=>{lt(Math.round(je[0].contentRect.width))});return Le.observe(xt),()=>Le.disconnect()},[]);const $t=(()=>{const xt={...ne},Le=Ue.current?getComputedStyle(Ue.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(xt["--cntrl-article-width"]=Le),xt})(),[Ct,vt]=s.useState(!1),[Pt,Ht]=s.useState([]),[Yt,Kt]=s.useState(0),Lt=f==="on"&&(!n||i),Ot=(xt,Le)=>{n&&!i||f!=="off"&&(Ht(xt),Kt(Le),vt(!0))};s.useEffect(()=>{if(!Ct||f!=="on"||typeof document>"u")return;const xt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xt}},[Ct,f]),s.useEffect(()=>{!n||i||vt(!1)},[n,i]);const tn=s.useMemo(()=>bf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:tn}}),f==="on"&&a.jsx(Pf,{mediaList:Ke}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:Ue,className:`${u}-wrapper ${u}-type-${p}${tt?` ${u}-align-entries`:""} ${u}-image-align-${re} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${et}, ${ge})`,rowGap:tt?0:j.scalingValue(m??0,n),columnGap:j.scalingValue(x.horizontalGap??0,n),width:j.scalingValue(x.wrapperWidth??0,n),...tt?{[`--${u}-align-entries-row-gap`]:j.scalingValue(m??0,n)}:{}},children:J.map((xt,Le)=>{var jt;const je=_l(xt.title),ut=_l(xt.subtitle),ft=(((jt=xt.link)==null?void 0:jt.length)??0)>0&&f==="off"?xt.link:void 0,bt=Math.floor(Le/et)===Math.ceil(J.length/et)-1,Mt=ht&&Le>=ct?`${Ne+(Le-ct)}`:void 0,yt=He?a.jsxs("div",{className:`${u}-item-text-block`,children:[je&&a.jsx("p",{className:ee,style:{width:at,...ke,...D},children:xt.title}),je&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(M??0,n),width:st}}),ut&&a.jsx("p",{className:ye,style:{width:at,...Ce,...R},children:xt.subtitle}),ut&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(F??0,n),width:st}})]}):null,Dt=tt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!He&&a.jsx("div",{"data-controls":o&&je?"titleMarginTop":void 0,className:o&&je?`${u}-control`:void 0,style:{height:je?j.scalingValue(M??0,n):0,width:st}}),je&&a.jsx("p",{className:ee,style:{width:at,...ke,...D},children:xt.title}),He&&je&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(M??0,n),width:st}})]}):null,_t=tt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!He&&a.jsx("div",{"data-controls":o&&ut?"subtitleMarginTop":void 0,className:o&&ut?`${u}-control`:void 0,style:{height:ut?j.scalingValue(F??0,n):0,width:st}}),ut&&a.jsx("p",{className:ye,style:{width:at,...Ce,...R},children:xt.subtitle}),He&&ut&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(F??0,n),width:st}})]}):null,Nt=ft?a.jsxs("a",{href:ft,target:"_blank",className:`${u}-item-text-link`,children:[Dt,_t]}):a.jsxs(a.Fragment,{children:[Dt,_t]}),Vt=Gd(xt.gallery),Gt=Vt.filter(It=>It.lightboxMedia).map(It=>It.lightboxMedia),zt=a.jsx("div",{className:Je,style:Pe,children:Vt.length===0?null:w==="off"?(()=>{const{displayMedia:It,lightboxMedia:P}=Vt[0],Te=P?Gt.findIndex(Fe=>Fe.url===P.url):-1;return a.jsx(Nl,{media:It,className:`${u}-item-${Ti(It)?"video":"image"}`.trim(),style:$e,onMediaClick:Lt&&Te>=0?()=>Ot(Gt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ve&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:It})=>Ti(It)?a.jsx("video",{src:It.url,muted:!0,playsInline:!0},`sizer-${It.url}`):a.jsx("img",{src:It.url,alt:""},`sizer-${It.url}`))}),a.jsx(Xs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:V*1e3,width:"100%",height:"100%",speed:Cf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:qe},onMoved:It=>{z!=="random"||Y==="fade"||$f(It)},children:Vt.map(({displayMedia:It,lightboxMedia:P},Te)=>{const Fe=P?Gt.findIndex(ze=>ze.url===P.url):-1;return a.jsx(Us,{children:a.jsx(Nl,{media:It,className:`${u}-item-${Ti(It)?"video":"image"}`.trim(),style:$e,onMediaClick:Lt&&Fe>=0?()=>Ot(Gt,Fe):void 0})},Te)})},`${Y}-${Be}-${z}-${V}-${De}-${d}`)]})}),Bt=He?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&je?"titleMarginTop":void 0,className:o&&je?`${u}-control`:void 0,style:{height:je?j.scalingValue(M??0,n):0,width:st}}),a.jsx("p",{className:ee,style:{width:at,...ke,...D},children:xt.title}),a.jsx("div",{"data-controls":o&&ut?"subtitleMarginTop":void 0,className:o&&ut?`${u}-control`:void 0,style:{height:ut?j.scalingValue(F??0,n):0,width:st}}),a.jsx("p",{className:ye,style:{width:at,...Ce,...R},children:xt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Mt&&!tt?{gridColumn:Mt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${tt&&bt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${ge} * (${b} / 100))`:ge,...Mt&&tt?{gridColumn:Mt}:{}},children:tt?a.jsx(a.Fragment,{children:He?a.jsxs(a.Fragment,{children:[Nt,a.jsx("a",{href:ft,target:"_blank",className:`${u}-item-image-link`,children:zt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:ft,target:"_blank",className:`${u}-item-image-link`,children:zt}),Nt]})}):ft?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:ft,target:"_blank",className:`${u}-item-image-link`,children:[yt,zt]}),!He&&a.jsx("a",{href:ft,target:"_blank",className:`${u}-item-text-link`,children:Bt})]}):a.jsxs(a.Fragment,{children:[yt,zt,Bt]})})},Le)})})}),(!n||i)&&Ct&&typeof document<"u"&&f==="on"&&(()=>{const xt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{style:$t,"data-selection":"none",children:a.jsx(Wf,{prefix:u,items:Pt,index:Yt,imageDisplay:_f(y),isEditor:n,onClose:()=>vt(!1),onPrev:()=>Kt(Le=>(Le-1+Pt.length)%Pt.length),onNext:()=>Kt(Le=>(Le+1)%Pt.length),counterClassName:Q,counterStyle:X})}),xt)})()]})}const Hf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Of=["hover","focus","filled","success","error"],Df=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5225
|
+
`}function wf(){return Math.random()<.5?"ltr":"ttb"}function Sf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function $f(e){const t=wf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Sf(e)})})}const wn=500,Cf=750,qn="cubic-bezier(0.22, 1, 0.36, 1)",Tf=72,Lf=50;function Rf(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 If(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Ef(e){const[t]=e.media;return t!=null&&t.url?t:null}function Gd(e){return!Array.isArray(e)||e.length===0?[]:Rf(e)?e.flatMap(t=>{const n=If(t);if(!n)return[];const i=Ef(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 Ti(e){return e.type==="video"}function Mf(e){const t=new Set,n=[];for(const i of e){const o=Gd(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 Pf({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=>Ti(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 kf(e){e.pause(),e.removeAttribute("src"),e.load()}function Nl({media:e,className:t,style:n,onMediaClick:i}){return Ti(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 Hl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Af(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 Ff({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{kf(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 Wf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",x=s.useRef(null),b=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),v=s.useRef(0),I=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),V=s.useRef(null),z=s.useRef(0),Y=s.useRef(null),M=s.useRef(!1),F=s.useRef(null),K=s.useRef(null),T=s.useRef(null),L=s.useRef(()=>{}),[W,O]=s.useState(null),[C,E]=s.useState(null),[_,S]=s.useState("opening"),[Z,$]=s.useState(0),[H,B]=s.useState(0),[le,ie]=s.useState(null),[k,de]=s.useState(!1),[G,ce]=s.useState(!1),[oe,fe]=s.useState(!1),[Ie,xe]=s.useState(null),ue=s.useRef(n),U=s.useRef(void 0),se=t[n],re=se?Ti(se):!1,Re=H!==0||k,Se=le!==null,ke=s.useCallback(he=>{const _e=he.currentTarget,Ve=_e instanceof HTMLVideoElement?{width:_e.videoWidth,height:_e.videoHeight}:{width:_e.naturalWidth,height:_e.naturalHeight};!Ve.width||!Ve.height||xe(Ve)},[]);s.useEffect(()=>{V.current=C},[C]),s.useEffect(()=>{const he=x.current;if(!he)return;const _e=()=>E(Hl(he));_e();const Ve=new ResizeObserver(_e);return Ve.observe(he),()=>Ve.disconnect()},[]);const ye=s.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),be=s.useCallback(()=>{const he=K.current;K.current=null,ye(),Y.current=null,M.current=!1,ie(null),de(!1),B(0),z.current=0,ce(!1),y.current=!1,v.current=0,I.current="none",he===1?d():he===-1&&l()},[ye,d,l]),Ce=s.useCallback(()=>{ye(),K.current=null,Y.current=null,M.current=!1,ie(null),de(!1),B(0),z.current=0},[ye]),h=s.useCallback(()=>{ye(),F.current=window.setTimeout(()=>{K.current!==null&&be()},wn+32)},[ye,be]),q=s.useCallback((he,_e)=>{var tt;const Ve=((tt=V.current)==null?void 0:tt.width)??0;if(ye(),Y.current=he,ie(he),M.current=!0,de(!0),_e){K.current=he;const ht=-he*Ve;z.current=ht,B(ht),h();return}z.current=0,B(0),F.current=window.setTimeout(()=>{F.current=null,Ce()},wn+32)},[ye,Ce,h]),X=s.useCallback(he=>{if(!(t.length<=1)){if(M.current){if(K.current===he){T.current=he,be();return}Ce()}ye(),Y.current=he,ie(he),M.current=!1,de(!1),z.current=0,B(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(he,!0)})})}},[t.length,q,be,Ce,ye]);L.current=X;const ee=s.useCallback(he=>{he.propertyName!=="transform"||!M.current||K.current!==null&&be()},[be]),ve=s.useCallback(()=>{const he=b.current;if(!he)return;const _e=Hl(he);!_e.width||!_e.height||O(_e)},[]);s.useEffect(()=>{ve();const he=b.current;if(!he)return;const _e=new ResizeObserver(()=>ve());return _e.observe(he),()=>_e.disconnect()},[ve]),s.useEffect(()=>{_==="opening"&&W&&S("open")},[_,W]),s.useEffect(()=>{if(_!=="closing")return;const he=setTimeout(()=>r(),wn);return()=>clearTimeout(he)},[_,r]),s.useEffect(()=>()=>{ye()},[ye]),s.useLayoutEffect(()=>{ue.current===n&&U.current===(se==null?void 0:se.url)||(ye(),K.current=null,ie(null),$(0),B(0),de(!1),fe(!1),ce(!1),xe(null),f.current=0,v.current=0,I.current="none",y.current=!1,M.current=!1,z.current=0,Y.current=null,g.current=null,w.current=!1,ue.current=n,U.current=se==null?void 0:se.url)},[n,se==null?void 0:se.url,ye]),s.useLayoutEffect(()=>{const he=T.current;he!==null&&(T.current=null,requestAnimationFrame(()=>{L.current(he)}))},[n,se==null?void 0:se.url]),s.useEffect(()=>{if(_!=="open")return;let he=null;const _e=()=>{he&&(document.removeEventListener("click",he,!0),he=null)},Ve=()=>{_e(),he=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),_e()},document.addEventListener("click",he,!0)},tt=Ae=>{const Pe=Ae<0?1:-1;if(Math.abs(Ae)>Lf&&t.length>1){q(Pe,!0);return}q(Pe,!1)},ht=Ae=>{if(Ae.touches.length!==1||M.current)return;const Pe=Ae.touches[0];w.current=!0,g.current={x:Pe.clientX,y:Pe.clientY},I.current="none",v.current=0,y.current=!1},at=Ae=>{if(!g.current||Ae.touches.length!==1||M.current)return;const Pe=Ae.touches[0],Ze=Pe.clientX-g.current.x,Ne=Pe.clientY-g.current.y;if(I.current==="none"){if(Math.abs(Ze)<10&&Math.abs(Ne)<10)return;if(Math.abs(Ze)>Math.abs(Ne)){if(t.length<=1)return;I.current="horizontal"}else if(Ne>0)I.current="vertical";else return}if(I.current==="horizontal"){y.current=!0,ce(!0),v.current=Ze;const rt=Ze<0?1:-1;Y.current!==rt&&(Y.current=rt,ie(rt)),z.current=Ze,B(Ze),Ae.preventDefault();return}I.current==="vertical"&&(y.current=!0,ce(!0),f.current=Ne,$(Ne),Ae.preventDefault())},Oe=()=>{if(!g.current)return;const Ae=I.current,Pe=y.current;if(Pe&&Ae==="horizontal")tt(v.current),Ve();else if(Pe&&Ae==="vertical")if(f.current>Tf){const Ne=window.innerHeight;f.current=Ne,fe(!0),$(Ne),S("closing")}else f.current=0,$(0),Ve();else Ae==="horizontal"&&Math.abs(v.current)>0&&(tt(v.current),Ve());g.current=null,I.current="none",v.current=0,y.current=!1,ce(!1)};return document.addEventListener("touchstart",ht,{passive:!0}),document.addEventListener("touchmove",at,{passive:!1}),document.addEventListener("touchend",Oe),document.addEventListener("touchcancel",Oe),()=>{document.removeEventListener("touchstart",ht),document.removeEventListener("touchmove",at),document.removeEventListener("touchend",Oe),document.removeEventListener("touchcancel",Oe),_e()}},[_,t.length,q]),s.useEffect(()=>{const he=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),_!=="closing"&&S("closing"))};return window.addEventListener("keydown",he,!0),()=>window.removeEventListener("keydown",he,!0)},[_]);const D=()=>{_!=="closing"&&S("closing")},R=_==="open",Q=_==="closing",ne=Z>0?Math.max(0,1-Z/500):1,N=Z>0?Math.max(.35,1-Z/500):1,te=W?p?W:Af(W,Ie):null,Ee=he=>{if(he.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientY-_e.top,tt=Math.min(52,_e.height*.2);if(!(Ve>_e.height-tt)){if(he.clientX-_e.left<_e.width/2){X(-1);return}X(1)}},ge=he=>{if(t.length<=1)return;const _e=te??he.currentTarget.getBoundingClientRect(),Ve=he.clientX-_e.left,tt=he.clientY-_e.top,ht=Math.min(52,_e.height*.2);if(tt>_e.height-ht){he.currentTarget.style.cursor="default";return}he.currentTarget.style.cursor=Ve<_e.width/2?"w-resize":"e-resize"},J={position:"fixed",top:C==null?void 0:C.top,left:C==null?void 0:C.left,width:C==null?void 0:C.width,height:C==null?void 0:C.height,zIndex:9998},Ye=p?"cover":"contain",Be=H!==0||Z>0?`translate(${H}px, ${Z}px)`:void 0,it=G&&!k?"none":k?`transform ${wn}ms ${qn}`:oe?`transform ${wn}ms ${qn}, opacity ${wn}ms ${qn}`:_==="opening"||Q?`opacity ${wn}ms ${qn}`:"none",Xe={...J,transform:Be,opacity:Z>0?N:_==="opening"||Q?0:1,transition:it,pointerEvents:"none"},et={position:"absolute",top:((te==null?void 0:te.top)??0)-((C==null?void 0:C.top)??0),left:((te==null?void 0:te.left)??0)-((C==null?void 0:C.left)??0),width:te==null?void 0:te.width,height:te==null?void 0:te.height,objectFit:Ye,pointerEvents:re&&R&&!Re?"auto":"none",touchAction:re&&R?"none":void 0},Je=(C==null?void 0:C.width)??0,Ge=Se?(n+le+t.length)%t.length:null,$e=Ge!==null?t[Ge]:null,He={...J,transform:Se?`translateX(${le*Je+H}px)`:void 0,opacity:1,transition:k?`transform ${wn}ms ${qn}`:"none",pointerEvents:"none"},De={position:"absolute",top:((W==null?void 0:W.top)??0)-((C==null?void 0:C.top)??0),left:((W==null?void 0:W.left)??0)-((C==null?void 0:C.left)??0),width:W==null?void 0:W.width,height:W==null?void 0:W.height,objectFit:Ye,pointerEvents:"none"},Qe=te?{position:"fixed",top:te.top,height:te.height,width:te.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:x,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:_==="open"?"none":void 0},onClick:D,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:R?ne:0,transition:G?"none":`opacity ${wn}ms ${qn}`,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:b,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${wn}ms ${qn}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:R?1:0,transition:`opacity ${wn}ms ${qn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),W&&C&&$e&&a.jsx("div",{style:He,onTransitionEnd:ee,children:Ti($e)?a.jsx("video",{src:$e.url,muted:!0,playsInline:!0,preload:"auto",style:De},`neighbor-${Ge}-${$e.url}`):a.jsx("img",{src:$e.url,alt:$e.name,style:De},`neighbor-${Ge}-${$e.url}`)}),W&&C&&se&&a.jsx("div",{style:Xe,onTransitionEnd:ee,children:re?a.jsx(Ff,{src:se.url,phase:_,mediaRef:m,mediaStyle:et,onLoadedMetadata:ke,onClick:Ee,onMouseMove:ge},`${n}-${se.url}`):a.jsx("img",{ref:m,src:se.url,alt:se.name,onLoad:ke,style:et},`${n}-${se.url}`)}),R&&Qe&&t.length>1&&!re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Qe,left:te.left,cursor:"w-resize",pointerEvents:G?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),X(-1)}}),a.jsx("div",{style:{...Qe,left:te.left+te.width/2,cursor:"e-resize",pointerEvents:G?"none":"auto"},onClick:he=>{if(w.current){w.current=!1;return}he.stopPropagation(),X(1)}})]})]})}function _f(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Nf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=j.useScopedStyles(),{type:p="a",gridLayout:x,textBoxWidth:b=100,verticalGap:m,entriesCount:g,lightbox:f,imageDisplay:v,imageCorners:I,lightboxImageDisplay:y,slider:w,sliderTiming:V,direction:z,transition:Y,titleMarginTop:M,subtitleMarginTop:F,titleColor:K,subtitleColor:T,lightboxCounterColor:L,titleFontFamily:W,titleFontSettings:O,titleFontSize:C,titleLineHeight:E,titleLetterSpacing:_,titleWordSpacing:S,titleTextAppearance:Z,subtitleFontFamily:$,subtitleFontSettings:H,subtitleFontSize:B,subtitleLineHeight:le,subtitleLetterSpacing:ie,subtitleWordSpacing:k,subtitleTextAppearance:de,lightboxCounterFontFamily:G,lightboxCounterFontSettings:ce,lightboxCounterFontSize:oe,lightboxCounterLineHeight:fe,lightboxCounterLetterSpacing:Ie,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:ue,showText:U="always",alignEntries:se="off",align:re="top"}=e,Re={fontSettings:{fontFamily:W,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:C??.01,lineHeight:E,letterSpacing:_??0,wordSpacing:S??0,textAppearance:Z,color:K},ke={...sn(Zt(Re,n))},ye={fontSettings:{fontFamily:$,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:B??.01,lineHeight:le,letterSpacing:ie??0,wordSpacing:k??0,textAppearance:de,color:T},Ce={...sn(Zt(ye,n))},h={fontSettings:{fontFamily:G,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:oe??.01,lineHeight:fe,letterSpacing:Ie??0,wordSpacing:xe??0,textAppearance:ue,color:L},X={...sn(Zt(h,n)),...Ca(oe,fe,u,n)},ee=$a(C,E,`${u}-item-title`,`${u}-text-tight-leading`),ve=$a(B,le,`${u}-item-subtitle`,`${u}-text-tight-leading`),D=Ca(C,E,u,n),R=Ca(B,le,u,n),Q=$a(oe,fe,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=j.buildColorVars(u,{titleColor:K,subtitleColor:T,lightboxCounterColor:L},Hf,Of),Ee=`${l&&l!=="default"?`${u}-state-${l}`:""}${U==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=g===0?1/0:g,J=(t??[]).slice(0,ge),Ye=s.useMemo(()=>f==="on"?Mf(J):[],[J,f]),Be=x.entryWidth??.2,it=(v==null?void 0:v.display)==="cover",Xe=(v==null?void 0:v.ratioValue)??"1:1",et=(v==null?void 0:v.reversed)??!1,[Je,Ge]=Xe.split(":").map(Number),De=`${et?Ge:Je} / ${et?Je:Ge}`,Qe=x.columnsCount,he=j.scalingValue(Be??0,n),_e=he,Ve=!it&&w!=="off",tt=J.length%Qe||Qe,ht=tt<Qe&&J.length>0,at=J.length-tt,Oe=ht?Math.floor((Qe-tt)/2)+1:1,Ae=I?j.scalingValue(I,n):void 0,Pe={width:_e,...it?{aspectRatio:De,height:"auto",overflow:"hidden"}:{height:"auto"},...Ae?{borderRadius:Ae,overflow:"hidden"}:{}},Ze=`${u}-item-image-wrapper${Ve?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ne=p==="d"||p==="e"||p==="f",rt=se==="on",ot=`calc(${j.scalingValue(Be??0,n)} * (${b} / 100))`,me=j.scalingValue(Be*b/100,n),Fe=it?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ae?{borderRadius:Ae}:{}},[st,dt]=s.useState(0),ze=s.useRef(null),ut=Y==="fade"||z==="horizontal"?"ltr":z==="vertical"?"ttb":"ltr";s.useEffect(()=>{const yt=ze.current;if(!yt)return;const Le=new ResizeObserver(qe=>{dt(Math.round(qe[0].contentRect.width))});return Le.observe(yt),()=>Le.disconnect()},[]);const Ct=(()=>{const yt={...ne},Le=ze.current?getComputedStyle(ze.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(yt["--cntrl-article-width"]=Le),yt})(),[Tt,xt]=s.useState(!1),[Pt,zt]=s.useState([]),[Xt,Yt]=s.useState(0),It=f==="on"&&(!n||i),Ot=(yt,Le)=>{n&&!i||f!=="off"&&(zt(yt),Yt(Le),xt(!0))};s.useEffect(()=>{if(!Tt||f!=="on"||typeof document>"u")return;const yt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=yt}},[Tt,f]),s.useEffect(()=>{!n||i||xt(!1)},[n,i]);const tn=s.useMemo(()=>bf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:tn}}),f==="on"&&a.jsx(Pf,{mediaList:Ye}),a.jsx("div",{style:ne,children:a.jsx("div",{ref:ze,className:`${u}-wrapper ${u}-type-${p}${rt?` ${u}-align-entries`:""} ${u}-image-align-${re} ${Ee}`.trim(),style:{gridTemplateColumns:`repeat(${Qe}, ${he})`,rowGap:rt?0:j.scalingValue(m??0,n),columnGap:j.scalingValue(x.horizontalGap??0,n),width:j.scalingValue(x.wrapperWidth??0,n),...rt?{[`--${u}-align-entries-row-gap`]:j.scalingValue(m??0,n)}:{}},children:J.map((yt,Le)=>{var Ht;const qe=_l(yt.title),lt=_l(yt.subtitle),vt=(((Ht=yt.link)==null?void 0:Ht.length)??0)>0&&f==="off"?yt.link:void 0,wt=Math.floor(Le/Qe)===Math.ceil(J.length/Qe)-1,Et=ht&&Le>=at?`${Oe+(Le-at)}`:void 0,ft=Ne?a.jsxs("div",{className:`${u}-item-text-block`,children:[qe&&a.jsx("p",{className:ee,style:{width:ot,...ke,...D},children:yt.title}),qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(M??0,n),width:me}}),lt&&a.jsx("p",{className:ve,style:{width:ot,...Ce,...R},children:yt.subtitle}),lt&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(F??0,n),width:me}})]}):null,Bt=rt?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Ne&&a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?j.scalingValue(M??0,n):0,width:me}}),qe&&a.jsx("p",{className:ee,style:{width:ot,...ke,...D},children:yt.title}),Ne&&qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(M??0,n),width:me}})]}):null,Nt=rt?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ne&&a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?j.scalingValue(F??0,n):0,width:me}}),lt&&a.jsx("p",{className:ve,style:{width:ot,...Ce,...R},children:yt.subtitle}),Ne&<&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:j.scalingValue(F??0,n),width:me}})]}):null,Ft=vt?a.jsxs("a",{href:vt,target:"_blank",className:`${u}-item-text-link`,children:[Bt,Nt]}):a.jsxs(a.Fragment,{children:[Bt,Nt]}),Vt=Gd(yt.gallery),Gt=Vt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),Dt=a.jsx("div",{className:Ze,style:Pe,children:Vt.length===0?null:w==="off"?(()=>{const{displayMedia:bt,lightboxMedia:A}=Vt[0],Te=A?Gt.findIndex(We=>We.url===A.url):-1;return a.jsx(Nl,{media:bt,className:`${u}-item-${Ti(bt)?"video":"image"}`.trim(),style:Fe,onMediaClick:It&&Te>=0?()=>Ot(Gt,Te):void 0})})():a.jsxs(a.Fragment,{children:[Ve&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:bt})=>Ti(bt)?a.jsx("video",{src:bt.url,muted:!0,playsInline:!0},`sizer-${bt.url}`):a.jsx("img",{src:bt.url,alt:""},`sizer-${bt.url}`))}),a.jsx(Xs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:V*1e3,width:"100%",height:"100%",speed:Cf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ut},onMoved:bt=>{z!=="random"||Y==="fade"||$f(bt)},children:Vt.map(({displayMedia:bt,lightboxMedia:A},Te)=>{const We=A?Gt.findIndex(je=>je.url===A.url):-1;return a.jsx(Us,{children:a.jsx(Nl,{media:bt,className:`${u}-item-${Ti(bt)?"video":"image"}`.trim(),style:Fe,onMediaClick:It&&We>=0?()=>Ot(Gt,We):void 0})},Te)})},`${Y}-${Be}-${z}-${V}-${st}-${d}`)]})}),jt=Ne?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?j.scalingValue(M??0,n):0,width:me}}),a.jsx("p",{className:ee,style:{width:ot,...ke,...D},children:yt.title}),a.jsx("div",{"data-controls":o&<?"subtitleMarginTop":void 0,className:o&<?`${u}-control`:void 0,style:{height:lt?j.scalingValue(F??0,n):0,width:me}}),a.jsx("p",{className:ve,style:{width:ot,...Ce,...R},children:yt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Et&&!rt?{gridColumn:Et}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${rt&&wt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(b??0)>100?`calc(${he} * (${b} / 100))`:he,...Et&&rt?{gridColumn:Et}:{}},children:rt?a.jsx(a.Fragment,{children:Ne?a.jsxs(a.Fragment,{children:[Ft,a.jsx("a",{href:vt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:vt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Ft]})}):vt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:vt,target:"_blank",className:`${u}-item-image-link`,children:[ft,Dt]}),!Ne&&a.jsx("a",{href:vt,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):a.jsxs(a.Fragment,{children:[ft,Dt,jt]})})},Le)})})}),(!n||i)&&Tt&&typeof document<"u"&&f==="on"&&(()=>{const yt=(c?document.getElementById(c):null)??document.body;return Gn.createPortal(a.jsx("div",{style:Ct,"data-selection":"none",children:a.jsx(Wf,{prefix:u,items:Pt,index:Xt,imageDisplay:_f(y),isEditor:n,onClose:()=>xt(!1),onPrev:()=>Yt(Le=>(Le-1+Pt.length)%Pt.length),onNext:()=>Yt(Le=>(Le+1)%Pt.length),counterClassName:Q,counterStyle:X})}),yt)})()]})}const Hf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Of=["hover","focus","filled","success","error"],Df=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5226
5226
|
import '@splidejs/react-splide/css/core';
|
|
5227
5227
|
import { CommonComponentProps } from '../props';
|
|
5228
5228
|
import {
|
|
@@ -7275,7 +7275,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7275
7275
|
};
|
|
7276
7276
|
|
|
7277
7277
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7278
|
-
`,La={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},jf=["titleColor","subtitleColor","lightboxCounterColor"],zf={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:{...La.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:{...La.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:{...La.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:[...jf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Bf={element:Nf,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:zf,sourceCode:Df},Vf=50,Ol=10,Ys="cntrl-lightbox-journal",sa=Ys,ds=`${Ys}-`,la=e=>`${Ys}-${e}`,Ks=e=>e===sa||e.startsWith(ds),Dl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},jl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Dl(t.get(la(e)));if(i)return i}const n=Dl(t.get(sa));if(n)return n;for(const[i]of t){if(!i.startsWith(ds))continue;const o=i.slice(ds.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},zl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},qd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ks(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(la(t),String(e)):i.searchParams.set(sa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Gf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===la(e)||i===sa:Ks(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)}},Xd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(la(e)):[...t.keys()].some(n=>Ks(n))},qf=(e,t)=>{if(Xd(t)){if(e){window.history.back();return}Gf(t)}},Xf=20,Uf=2,Ra=e=>`max(${e}, ${Xf}px)`,to=e=>((e==null?void 0:e.image)??[]).slice(0,Uf),Ud=e=>e.reduce((t,n)=>t+to(n).length,0),Yf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+to(r).length,1),i=to(e[t]).length;return{start:n,end:n+i-1}},Kf=(e,t)=>{const n=Ud(e),{start:i,end:o}=Yf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>to(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:to(n)})),Zf=(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 Kf(i,o)},Bl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Jf=(e,t,n)=>e==="B"?t.length>1:Ud(n)>1,yn=.004,Jn=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Qn=(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},no=(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},jo=(e,t)=>no(e,t),dn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ei=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:no(e.length,n),effective:jo(e.length,n)}},Yd=(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),Kd=(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),ri=["title1","title2","title3","count"],gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Zs={title1:"1",title2:"2",title3:"3",count:"Count"},Js=e=>[gt(e,"fontFamily"),gt(e,"fontSettings"),{type:"row",items:[gt(e,"fontSize"),gt(e,"lineHeight"),gt(e,"letterSpacing"),gt(e,"wordSpacing")]},gt(e,"textAlign"),gt(e,"textAppearance")],Qf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ri.map(e=>[Zs[e],Js(e)]))}),ey={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},ty={title1:.02,title2:.02,title3:.02,count:.017},Si=(e,t)=>{const n=i=>{const o=gt(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[ey[t]]}},$i=(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??ty[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Zt(i,n)};function Zd({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:x=0,title3MarginLeft:b=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:I=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:V="#cccccc"}=n,z=j.scalingValue(f,i),Y=j.scalingValue(v,i),M=j.scalingValue(m,i),F=g==="mobile",K=$i("title1",Si(n,"title1"),i),T=$i("title2",Si(n,"title2"),i),L=$i("title3",Si(n,"title3"),i),W=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),O=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),C=s.useMemo(()=>Qn(e,t,K,T,L),[e,t,K,T,L]),E=s.useMemo(()=>C.map(N=>W[N.widthKey]),[C,W]),_=s.useMemo(()=>no(C.length,E),[C.length,E]),S=s.useMemo(()=>jo(C.length,E),[C.length,E]),Z=s.useMemo(()=>C.filter(N=>N.prefix==="title1"),[C]),$=s.useMemo(()=>C.filter(N=>N.prefix==="title2"||N.prefix==="title3"),[C]),H=s.useMemo(()=>ei(Z,W),[Z,W]),B=s.useMemo(()=>ei($,W),[$,W]),ce=!!(t.title1||t.title2||t.title3),ie=I!==null;if(!(ce||ie))return null;const de=(p??0)>0||o,G=(N,te)=>{const Ee=C.findIndex(J=>J.prefix===N.prefix);if(!F||te==="single-row")return{effectiveWidth:S[Ee]??0,resolvedWidth:_[Ee]??0,maxWidth:dn(Ee,_)};if(te==="two-row-top"){const J=Z.findIndex(Ke=>Ke.prefix===N.prefix);return{effectiveWidth:H.effective[J]??0,resolvedWidth:H.resolved[J]??0,maxWidth:dn(J,H.resolved)}}const me=$.findIndex(J=>J.prefix===N.prefix);return{effectiveWidth:B.effective[me]??0,resolvedWidth:B.resolved[me]??0,maxWidth:dn(me,B.resolved)}},se=(N,te,Ee)=>{if(!F||Ee==="single-row"){const rt=N.findIndex(Ge=>Ge.prefix===te.prefix),Xe=N.map(Ge=>W[Ge.widthKey]),nt=no(N.length,Xe);return{effectiveWidth:jo(N.length,Xe)[rt]??0,resolvedWidth:nt[rt]??0,maxWidth:dn(rt,nt)}}if(Ee==="two-row-top"){const rt=N.filter(Ge=>Ge.prefix==="title1"),Xe=rt.findIndex(Ge=>Ge.prefix===te.prefix),{resolved:nt,effective:Qe}=ei(rt,W);return{effectiveWidth:Qe[Xe]??0,resolvedWidth:nt[Xe]??0,maxWidth:dn(Xe,nt)}}const me=N.filter(rt=>rt.prefix==="title2"||rt.prefix==="title3"),J=me.findIndex(rt=>rt.prefix===te.prefix),{resolved:Ke,effective:Be}=ei(me,W);return{effectiveWidth:Be[J]??0,resolvedWidth:Ke[J]??0,maxWidth:dn(J,Ke)}},oe=N=>Kd(C,_,O,N)+(F?0:p??0),he=()=>F?0:p??0,Ie=N=>$.slice(0,N).reduce((te,Ee,me)=>te+(Ee.marginLeftKey?O[Ee.marginLeftKey]??0:0)+(B.resolved[me]??0),0),ve=N=>{const te=$[N];return Ie(N)+(te.marginLeftKey?O[te.marginLeftKey]??0:0)+(B.resolved[N]??0)},ue=(N,te,Ee)=>{const me=N.marginLeftKey?O[N.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ke,maxWidth:Be}=Ee??G(N,te),rt=Math.max(me,Jn),Xe=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":N.prefix,style:{width:j.scalingValue(J,i),...me>0?{marginLeft:j.scalingValue(me,i)}:{}},children:[a.jsx("p",{className:N.className,style:N.style,children:N.text}),Xe&&N.marginLeftKey?a.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:j.scalingValue(-me,i),width:j.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}}):null,Xe?a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j.scalingValue(-yn/2,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},N.className)},U=(N="two-row")=>{const te=C.findIndex(J=>J.prefix==="title1"),Ee=te>=0?_[te]:W.title1Width,me=N==="two-row"&&o;return a.jsx("div",{...me?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:j.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...me?{pointerEvents:"auto"}:{}}})},le=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:K,"aria-hidden":"true",children:" "}),re=N=>{const te=Qn(e,N,K,T,L);return a.jsx(a.Fragment,{children:te.map(Ee=>ue(Ee,"single-row",se(te,Ee,"single-row")))})},Re=N=>{const te=Qn(e,N,K,T,L),Ee=te.find(me=>me.prefix==="title1");return Ee?ue(Ee,"two-row-top",se(te,Ee,"two-row-top")):null},we=(N,te=!1)=>{const Ee=Qn(e,N,K,T,L),me=Ee.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),J=o&&te;return me.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[me.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:me.map(Be=>ue(Be,"two-row-bottom",se(Ee,Be,"two-row-bottom")))}),te&&o?a.jsxs(a.Fragment,{children:[ee(),ye()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:M,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},ke=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:j.scalingValue(y??0,i),height:j.scalingValue(y??0,i),marginRight:Y,"--close-icon-hover-color":V},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:N=>{N.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:I??"",fill:w,hoverFill:i&&!r?w:V,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:Y,height:"100%",pointerEvents:"auto"}})]}),fe=()=>ie?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,xe=N=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:N})}),Ce=N=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||ce?le():null,de?U("two-row"):null,xe(N),fe()]}),h=(N,te=!1)=>a.jsxs(a.Fragment,{children:[Ce(Re(N)),we(N,te)]}),q=()=>{const N=F?-1:C.findIndex(me=>me.prefix==="title1"),te=!F&&(o||(p??0)>0)?(()=>{const me=p??0,J=N>=0?_[N]:W.title1Width,Ke=Math.max(me,Jn);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:j.scalingValue(Ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=C.flatMap((me,J)=>{if(!me.marginLeftKey)return[];const Ke=O[me.marginLeftKey]??0,Be=Yd(C,_,O,J)+he(),rt=Math.max(Ke,Jn);return a.jsx("div",{"data-controls":me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_[J]),style:{position:"absolute",top:0,left:j.scalingValue(Be,i),width:j.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}},me.marginLeftKey)});return te?[te,...Ee]:Ee},X=()=>C.map((N,te)=>{const Ee=dn(te,_),J=oe(te)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j.scalingValue(J,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),ee=()=>$.flatMap((N,te)=>{if(!N.marginLeftKey)return[];const Ee=O[N.marginLeftKey]??0,me=Ie(te),J=Math.max(Ee,Jn),{resolvedWidth:Ke}=G(N,"two-row-bottom");return a.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ke),style:{position:"absolute",top:0,left:j.scalingValue(me,i),width:j.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)}),ye=()=>$.map((N,te)=>{const{maxWidth:Ee}=G(N,"two-row-bottom"),J=ve(te)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j.scalingValue(J,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),D=()=>!o||F?null:a.jsxs(a.Fragment,{children:[q(),X()]}),R=!!(t.title2||t.title3||(m??0)>0||o),Q=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||ce?le():null,de?U("single-row"):null,ce?xe(re(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),fe(),D()]}),ne=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...R?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:R?void 0:{flex:"0 0 auto",height:"auto"},children:h(t,!0)}),D()]});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:z,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...F?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${F?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${F?` ${e}-text-bar-cell-stacked`:""}`,style:F?void 0:{flex:1,minWidth:0,width:"100%"},children:F?ne():Q()})})})]})}function ny(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function iy(e){return`
|
|
7278
|
+
`,Ta={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},jf=["titleColor","subtitleColor","lightboxCounterColor"],zf={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:{...Ta.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:{...Ta.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:{...Ta.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:[...jf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Bf={element:Nf,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:zf,sourceCode:Df},Vf=50,Ol=10,Ys="cntrl-lightbox-journal",aa=Ys,cs=`${Ys}-`,sa=e=>`${Ys}-${e}`,Ks=e=>e===aa||e.startsWith(cs),Dl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},jl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Dl(t.get(sa(e)));if(i)return i}const n=Dl(t.get(aa));if(n)return n;for(const[i]of t){if(!i.startsWith(cs))continue;const o=i.slice(cs.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},zl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},qd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Ks(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(sa(t),String(e)):i.searchParams.set(aa,String(e));const o=n?"replaceState":"pushState",r=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",r)},Gf=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===sa(e)||i===aa:Ks(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)}},Xd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(sa(e)):[...t.keys()].some(n=>Ks(n))},qf=(e,t)=>{if(Xd(t)){if(e){window.history.back();return}Gf(t)}},Xf=20,Uf=2,La=e=>`max(${e}, ${Xf}px)`,to=e=>((e==null?void 0:e.image)??[]).slice(0,Uf),Ud=e=>e.reduce((t,n)=>t+to(n).length,0),Yf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+to(r).length,1),i=to(e[t]).length;return{start:n,end:n+i-1}},Kf=(e,t)=>{const n=Ud(e),{start:i,end:o}=Yf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>to(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:to(n)})),Zf=(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 Kf(i,o)},Bl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Jf=(e,t,n)=>e==="B"?t.length>1:Ud(n)>1,yn=.004,Jn=.004,Yi={title1Width:.13,title2Width:.13,title3Width:.14},Qn=(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},no=(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},jo=(e,t)=>no(e,t),dn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ei=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:no(e.length,n),effective:jo(e.length,n)}},Yd=(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),Kd=(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),oi=["title1","title2","title3","count"],gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Zs={title1:"1",title2:"2",title3:"3",count:"Count"},Js=e=>[gt(e,"fontFamily"),gt(e,"fontSettings"),{type:"row",items:[gt(e,"fontSize"),gt(e,"lineHeight"),gt(e,"letterSpacing"),gt(e,"wordSpacing")]},gt(e,"textAlign"),gt(e,"textAppearance")],Qf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oi.map(e=>[Zs[e],Js(e)]))}),ey={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},ty={title1:.02,title2:.02,title3:.02,count:.017},wi=(e,t)=>{const n=i=>{const o=gt(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[ey[t]]}},Si=(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??ty[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Zt(i,n)};function Zd({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:x=0,title3MarginLeft:b=0,titleRowMarginBottom:m=0,titleHeaderLayout:g="desktop",contentMarginTop:f=0,iconMarginRight:v=0,closeIcon:I=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:V="#cccccc"}=n,z=j.scalingValue(f,i),Y=j.scalingValue(v,i),M=j.scalingValue(m,i),F=g==="mobile",K=Si("title1",wi(n,"title1"),i),T=Si("title2",wi(n,"title2"),i),L=Si("title3",wi(n,"title3"),i),W=s.useMemo(()=>({title1Width:d??Yi.title1Width,title2Width:c??Yi.title2Width,title3Width:u??Yi.title3Width}),[d,c,u]),O=s.useMemo(()=>({title2MarginLeft:x,title3MarginLeft:b}),[x,b]),C=s.useMemo(()=>Qn(e,t,K,T,L),[e,t,K,T,L]),E=s.useMemo(()=>C.map(N=>W[N.widthKey]),[C,W]),_=s.useMemo(()=>no(C.length,E),[C.length,E]),S=s.useMemo(()=>jo(C.length,E),[C.length,E]),Z=s.useMemo(()=>C.filter(N=>N.prefix==="title1"),[C]),$=s.useMemo(()=>C.filter(N=>N.prefix==="title2"||N.prefix==="title3"),[C]),H=s.useMemo(()=>ei(Z,W),[Z,W]),B=s.useMemo(()=>ei($,W),[$,W]),le=!!(t.title1||t.title2||t.title3),ie=I!==null;if(!(le||ie))return null;const de=(p??0)>0||o,G=(N,te)=>{const Ee=C.findIndex(J=>J.prefix===N.prefix);if(!F||te==="single-row")return{effectiveWidth:S[Ee]??0,resolvedWidth:_[Ee]??0,maxWidth:dn(Ee,_)};if(te==="two-row-top"){const J=Z.findIndex(Ye=>Ye.prefix===N.prefix);return{effectiveWidth:H.effective[J]??0,resolvedWidth:H.resolved[J]??0,maxWidth:dn(J,H.resolved)}}const ge=$.findIndex(J=>J.prefix===N.prefix);return{effectiveWidth:B.effective[ge]??0,resolvedWidth:B.resolved[ge]??0,maxWidth:dn(ge,B.resolved)}},ce=(N,te,Ee)=>{if(!F||Ee==="single-row"){const it=N.findIndex(Ge=>Ge.prefix===te.prefix),Xe=N.map(Ge=>W[Ge.widthKey]),et=no(N.length,Xe);return{effectiveWidth:jo(N.length,Xe)[it]??0,resolvedWidth:et[it]??0,maxWidth:dn(it,et)}}if(Ee==="two-row-top"){const it=N.filter(Ge=>Ge.prefix==="title1"),Xe=it.findIndex(Ge=>Ge.prefix===te.prefix),{resolved:et,effective:Je}=ei(it,W);return{effectiveWidth:Je[Xe]??0,resolvedWidth:et[Xe]??0,maxWidth:dn(Xe,et)}}const ge=N.filter(it=>it.prefix==="title2"||it.prefix==="title3"),J=ge.findIndex(it=>it.prefix===te.prefix),{resolved:Ye,effective:Be}=ei(ge,W);return{effectiveWidth:Be[J]??0,resolvedWidth:Ye[J]??0,maxWidth:dn(J,Ye)}},oe=N=>Kd(C,_,O,N)+(F?0:p??0),fe=()=>F?0:p??0,Ie=N=>$.slice(0,N).reduce((te,Ee,ge)=>te+(Ee.marginLeftKey?O[Ee.marginLeftKey]??0:0)+(B.resolved[ge]??0),0),xe=N=>{const te=$[N];return Ie(N)+(te.marginLeftKey?O[te.marginLeftKey]??0:0)+(B.resolved[N]??0)},ue=(N,te,Ee)=>{const ge=N.marginLeftKey?O[N.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ye,maxWidth:Be}=Ee??G(N,te),it=Math.max(ge,Jn),Xe=o&&te==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":N.prefix,style:{width:j.scalingValue(J,i),...ge>0?{marginLeft:j.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:N.className,style:N.style,children:N.text}),Xe&&N.marginLeftKey?a.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:j.scalingValue(-ge,i),width:j.scalingValue(it,i),height:"100%",pointerEvents:"auto"}}):null,Xe?a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:j.scalingValue(-yn/2,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},N.className)},U=(N="two-row")=>{const te=C.findIndex(J=>J.prefix==="title1"),Ee=te>=0?_[te]:W.title1Width,ge=N==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ee)}:{},style:{width:j.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},se=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:K,"aria-hidden":"true",children:" "}),re=N=>{const te=Qn(e,N,K,T,L);return a.jsx(a.Fragment,{children:te.map(Ee=>ue(Ee,"single-row",ce(te,Ee,"single-row")))})},Re=N=>{const te=Qn(e,N,K,T,L),Ee=te.find(ge=>ge.prefix==="title1");return Ee?ue(Ee,"two-row-top",ce(te,Ee,"two-row-top")):null},Se=(N,te=!1)=>{const Ee=Qn(e,N,K,T,L),ge=Ee.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),J=o&&te;return ge.length>0||J||(m??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ge.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[a.jsx("div",{className:`${e}-titles-stack`,children:ge.map(Be=>ue(Be,"two-row-bottom",ce(Ee,Be,"two-row-bottom")))}),te&&o?a.jsxs(a.Fragment,{children:[ee(),ve()]}):null]}):null,(m??0)>0||J?a.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:M,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},ke=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:j.scalingValue(y??0,i),height:j.scalingValue(y??0,i),marginRight:Y,"--close-icon-hover-color":V},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:N=>{N.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:I??"",fill:w,hoverFill:i&&!r?w:V,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:Y,height:"100%",pointerEvents:"auto"}})]}),ye=()=>ie?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:ke()}):null,be=N=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:N})}),Ce=N=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[ie||le?se():null,de?U("two-row"):null,be(N),ye()]}),h=(N,te=!1)=>a.jsxs(a.Fragment,{children:[Ce(Re(N)),Se(N,te)]}),q=()=>{const N=F?-1:C.findIndex(ge=>ge.prefix==="title1"),te=!F&&(o||(p??0)>0)?(()=>{const ge=p??0,J=N>=0?_[N]:W.title1Width,Ye=Math.max(ge,Jn);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:j.scalingValue(Ye,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Ee=C.flatMap((ge,J)=>{if(!ge.marginLeftKey)return[];const Ye=O[ge.marginLeftKey]??0,Be=Yd(C,_,O,J)+fe(),it=Math.max(Ye,Jn);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(_[J]),style:{position:"absolute",top:0,left:j.scalingValue(Be,i),width:j.scalingValue(it,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return te?[te,...Ee]:Ee},X=()=>C.map((N,te)=>{const Ee=dn(te,_),J=oe(te)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j.scalingValue(J,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),ee=()=>$.flatMap((N,te)=>{if(!N.marginLeftKey)return[];const Ee=O[N.marginLeftKey]??0,ge=Ie(te),J=Math.max(Ee,Jn),{resolvedWidth:Ye}=G(N,"two-row-bottom");return a.jsx("div",{"data-controls":N.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:j.scalingValue(ge,i),width:j.scalingValue(J,i),height:"100%",pointerEvents:"auto"}},N.marginLeftKey)}),ve=()=>$.map((N,te)=>{const{maxWidth:Ee}=G(N,"two-row-bottom"),J=xe(te)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":N.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ee),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:j.scalingValue(J,i),width:j.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${N.widthKey}-junction`)}),D=()=>!o||F?null:a.jsxs(a.Fragment,{children:[q(),X()]}),R=!!(t.title2||t.title3||(m??0)>0||o),Q=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[ie||le?se():null,de?U("single-row"):null,le?be(re(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ye(),D()]}),ne=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...R?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:R?void 0:{flex:"0 0 auto",height:"auto"},children:h(t,!0)}),D()]});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:z,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...F?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${F?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${F?` ${e}-text-bar-cell-stacked`:""}`,style:F?void 0:{flex:1,minWidth:0,width:"100%"},children:F?ne():Q()})})})]})}function ny(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function iy(e){return`
|
|
7279
7279
|
.${e}-wrapper {
|
|
7280
7280
|
display: grid;
|
|
7281
7281
|
align-items: start;
|
|
@@ -7595,7 +7595,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7595
7595
|
pointer-events: auto;
|
|
7596
7596
|
flex-shrink: 0;
|
|
7597
7597
|
}
|
|
7598
|
-
`}const Vl={url:"",name:"",objectFit:"cover"},Ln=500,wo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",oy=72,ry=50,ay=1e4,sy=650,ly=500;function cy(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 Jd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 dy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Jd(i,n):null}function uy(e){return e.reduce((t,n,i)=>{const o=Qs(n.gallery),l=el(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 Ro(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 Gl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ro(e,i,n)}const py=.03;function Qd(e){return e.width*py}const Ia={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 ql(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function my(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function us(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 gy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:us(e,t.width,t.height)}function hy(e,t){if(yo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function fy(e){const t=new Set,n=[];for(const i of e){const o=Qs(i.gallery),r=el(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 yy({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=>yo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function io(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Qd(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 zr(e,t,n){const i=io(e,t,n);return{...i,left:2*i.left-e.left}}function vy(e,t,n){const{left:i,width:o}=n,r=Qd(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 eu(e,t,n,i){const o=io(e,"left",i),r=io(e,"right",i),l=zr(e,"left",i),d=zr(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 xy(e,t,n,i){const{start:o,end:r}=eu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function by(e,t,n){const i=io(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function tu(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 Qs(e){if(!e)return;if(tu(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??Vl,i??o??Vl]}]}function wy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function el(e){if(!Array.isArray(e)||e.length===0)return[];if(tu(e)){const t=[];for(const n of e){const i=wy(n);if(!i)continue;const o=Sy(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 yo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $y({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return yo(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 Cy({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 yo(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 Ty({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:b,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:v}){const I=s.useRef(null),y=s.useRef(null),w=s.useRef(null),V=s.useRef(new Map),[z,Y]=s.useState(0),M=s.useRef(null),F=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),W=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(()=>{}),Z=s.useRef(null),$=s.useRef(null),H=s.useRef(null),B=s.useRef(!1),[ce,ie]=s.useState(null),[A,de]=s.useState(Ia),[G,se]=s.useState(0),[oe,he]=s.useState("opening"),[Ie,ve]=s.useState(0),[ue,U]=s.useState(0),[le,re]=s.useState(!1),[Re,we]=s.useState(null),[ke,fe]=s.useState(null),[xe,Ce]=s.useState(null),[h,q]=s.useState(!1),[X,ee]=s.useState(null),[ye,D]=s.useState(!1),R=s.useRef(!1),[Q,ne]=s.useState(!1),[N,te]=s.useState(!1),Ee=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?yo(J):!1,Be=ue!==0||le,rt=!l&&(!r||!!d),Xe=c&&!l,nt=u.length>1,Qe=s.useCallback((P,Te)=>t.length<=1?null:t[(P+Te+t.length)%t.length]??null,[t]),Ge=nt?Ro(u,p,-1):Qe(n,-1),Se=nt?Ro(u,p,1):Qe(n,1),_e=Re===-1&&Be?nt&&ke!==null?Ro(u,ke,-1):xe!==null?Qe(xe,-1):null:null,Oe=Re===1&&Be?nt&&ke!==null?Ro(u,ke,1):xe!==null?Qe(xe,1):null:null,et=_e&&_e.url!==(Ge==null?void 0:Ge.url)?_e:null,ge=Oe&&Oe.url!==(Se==null?void 0:Se.url)?Oe:null,We=Ge&&Xe?(()=>{const P=nt?Gl(u,p,-1):t.length>2?Qe((n-1+t.length)%t.length,-1):null;return P&&P.url!==Ge.url?P:null})():null,Ve=Se&&Xe?(()=>{const P=nt?Gl(u,p,1):t.length>2?Qe((n+1)%t.length,1):null;return P&&P.url!==Se.url?P:null})():null,it=et??We,ht=ge??Ve,ct=s.useCallback((P,Te,Fe)=>{if(!P||!Te||!Fe)return;const ze=V.current,pt=ze.get(P);(pt==null?void 0:pt.width)===Te&&(pt==null?void 0:pt.height)===Fe||(ze.set(P,{width:Te,height:Fe}),Y(kt=>kt+1))},[]),Ne=s.useCallback(P=>{if(!(P!=null&&P.url))return null;const Te=V.current.get(P.url);return gy(y.current,Te)},[z,G]),Ae=s.useCallback(()=>{if(!J)return;const P=Ne(J);if(P){ie(P);return}const Te=y.current;Te&&ie(ql(Te))},[J,Ne]),Pe=s.useCallback(P=>{if(nt){const Te=u.length;fe((p+P+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+P+t.length)%t.length),fe(null))},[nt,u.length,p,t.length,n]),Je=s.useCallback(P=>{O.current=P,re(P)},[]),He=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),tt=s.useCallback(()=>{He(),C.current=window.setTimeout(()=>{He(),Je(!1)},wo+32)},[He,Je]),at=s.useCallback(()=>{const P=I.current;if(!P){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ia.width,height:typeof window<"u"?window.innerHeight:Ia.height});return}const Te=P.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),st=s.useCallback((P,Te)=>{if(Be){if(Q&&!le)return`translate(${ue}px, 0px)`;if(le&&Re!==null){const Fe=Ne(P);if(!Fe)return;const{x:ze,y:pt}=xy(Fe,Te,Re,A);return`translate(${ze}px, ${pt}px)`}if(le)return"translate(0px, 0px)"}},[Be,Q,le,ue,Re,A,Ne]),$e=s.useCallback(()=>{const P=E.current;E.current=null,He(),Je(!1),we(null),fe(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none",P===-1?f():P===1&&v()},[He,Je,f,v]),De=s.useCallback(()=>{He(),C.current=window.setTimeout(()=>{E.current!==null&&$e()},wo+32)},[He,$e]),lt=s.useCallback(()=>{He(),E.current=null,Je(!1),we(null),fe(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[He,Je]),Ue=s.useCallback(P=>{if(!(!Xe||!ce)){if(O.current){if(E.current===P){_.current=P,$e();return}lt()}He(),Pe(P),E.current=P,we(P),Je(!0),De()}},[Xe,ce,$e,lt,He,Pe,Je,De]);S.current=Ue;const qe=s.useCallback(()=>{Z.current=null,B.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),$t=s.useCallback(P=>{$.current!==null&&window.clearInterval($.current);const Te=B.current?ly:sy;$.current=window.setInterval(()=>{S.current(P)},Te)},[]),Ct=s.useCallback(P=>{Z.current!==P&&(qe(),Z.current=P,B.current=!1,S.current(P),$t(P),H.current=window.setTimeout(()=>{H.current=null,Z.current===P&&(B.current=!0,$t(P))},ay))},[qe,$t]),vt=s.useCallback(()=>{const P=y.current;if(!P)return;const Te=J==null?void 0:J.url,Fe=Te?V.current.get(Te):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ie(us(P,Fe.width,Fe.height));return}const ze=w.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:kt,height:mt}=my(ze);if(kt&&mt){ct(Te,kt,mt),ie(us(P,kt,mt));return}}const pt=ql(P);!pt.width||!pt.height||ie(pt)},[J==null?void 0:J.url,ct]),Pt=s.useCallback(P=>{if(w.current=P,!!P){if(P instanceof HTMLVideoElement){P.readyState>=1&&P.videoWidth>0&&vt();return}P.complete&&P.naturalWidth>0&&vt()}},[vt]),Ht=s.useCallback(()=>{at(),vt(),se(P=>P+1)},[at,vt]);s.useEffect(()=>{Ht();const P=y.current,Te=I.current,Fe=new ResizeObserver(()=>Ht());return P&&Fe.observe(P),Te&&Fe.observe(Te),window.addEventListener("resize",Ht),()=>{Fe.disconnect(),window.removeEventListener("resize",Ht)}},[Ht,n,x]),s.useLayoutEffect(()=>{if(!J)return;const P=w.current;if(P){if(P instanceof HTMLImageElement&&P.complete&&P.naturalWidth>0){vt();return}P instanceof HTMLVideoElement&&P.readyState>=1&&P.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Ae()},[Ae,z]),s.useEffect(()=>{const P=new Set,Te=[],Fe=ze=>{!(ze!=null&&ze.url)||P.has(ze.url)||(P.add(ze.url),Te.push(ze))};t.forEach(Fe),u.forEach(ze=>ze.items.forEach(Fe)),Te.forEach(ze=>{V.current.has(ze.url)||hy(ze,ct)})},[t,u,ct]),s.useEffect(()=>{if(oe!=="opening"||!ce)return;if(!b){he("open");return}q(!1);const P=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),he("open")})});return()=>cancelAnimationFrame(P)},[oe,ce,b]),s.useEffect(()=>{if(oe!=="closing")return;const P=setTimeout(()=>g(),Ln);return()=>clearTimeout(P)},[oe,g]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Ee.current===n&&me.current===(J==null?void 0:J.url)||(He(),E.current=null,we(null),fe(null),Ce(null),ve(0),U(0),Je(!1),te(!1),ne(!1),F.current=0,K.current=0,T.current="none",L.current=!1,M.current=null,W.current=!1,w.current=null,Ae(),Ee.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Je,He,Ae]),s.useLayoutEffect(()=>{const P=_.current;P!==null&&(_.current=null,requestAnimationFrame(()=>{S.current(P)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){R.current=!1,D(!1);return}if(oe!=="open"||R.current)return;if(!Ge&&!Se){R.current=!0;return}D(!1);const P=requestAnimationFrame(()=>{requestAnimationFrame(()=>{D(!0),R.current=!0})});return()=>cancelAnimationFrame(P)},[oe,Ge==null?void 0:Ge.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(oe!=="open")return;const P=()=>{const mt=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Te=mt=>{const Tt=mt<0?1:-1;He(),Pe(Tt),E.current=Tt,we(Tt),Je(!0),De()},Fe=mt=>{if(Math.abs(mt)>ry&&Xe){Te(mt);return}E.current=null,we(null),fe(null),Ce(null),Je(!0),U(0),tt()},ze=mt=>{if(mt.touches.length!==1||O.current)return;const Tt=mt.touches[0];W.current=!0,M.current={x:Tt.clientX,y:Tt.clientY},T.current="none",K.current=0,L.current=!1},pt=mt=>{if(!M.current||mt.touches.length!==1||O.current)return;const Tt=mt.touches[0],qt=Tt.clientX-M.current.x,At=Tt.clientY-M.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Xe)return;T.current="horizontal"}else if(At>0){if(!rt)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,U(qt),mt.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),F.current=At,ve(At),mt.preventDefault())},kt=()=>{if(!M.current)return;const mt=T.current,Tt=L.current;if(Tt&&mt==="horizontal")Fe(K.current),P();else if(Tt&&mt==="vertical"){const qt=F.current;if(rt&&qt>oy){const At=window.innerHeight;F.current=At,te(!0),ve(At),he("closing")}else F.current=0,ve(0);P()}else mt==="horizontal"&&Math.abs(K.current)>0&&(Fe(K.current),P());M.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",pt,{passive:!1}),document.addEventListener("touchend",kt),document.addEventListener("touchcancel",kt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",kt),document.removeEventListener("touchcancel",kt)}},[oe,Xe,Je,tt,He,rt,De,Pe]);const Yt=s.useCallback(()=>{const P=(m==null?void 0:m())??b??null;P&&ce&&(ee(P),q(!0)),he("closing")},[m,b,ce]);s.useEffect(()=>{const P=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;qe(),Yt();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!Xe)return;ze.preventDefault();const pt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&Z.current===pt||Ct(pt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const pt=ze.key==="ArrowLeft"?-1:1;Z.current===pt&&qe()},Fe=()=>{qe()};return window.addEventListener("keydown",P),window.addEventListener("keyup",Te),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",P),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Fe),qe()}},[oe,r,d,Yt,Xe,Ct,qe]),s.useEffect(()=>{oe!=="open"&&qe()},[oe,qe]);const Kt=()=>{oe==="closing"||l||Yt()},Lt=oe==="open",Ot=oe==="closing",tn=Ie>0?Math.max(0,1-Ie/500):1,xt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(P=>{if(!(P.propertyName!=="transform"||!O.current)){if(E.current!==null){$e();return}He(),Je(!1)}},[He,Je,$e]),je=oe==="closing"?X??b:b,ut=je&&ce&&(oe==="opening"||Ot)?cy(je,ce):void 0,ft=Be&&J?st(J,"center"):Ie>0?`translateY(${Ie}px)`:ut,bt=ce?pr(ce,A):null,Mt=!!(je&&ce),yt=Mt&&(oe==="closing"||oe==="open"&&h),Dt={position:"absolute",top:bt==null?void 0:bt.top,left:bt==null?void 0:bt.left,width:bt==null?void 0:bt.width,height:bt==null?void 0:bt.height,objectFit:"contain",transformOrigin:"top left",transform:ft,opacity:Ie>0?xt:Mt?1:oe==="opening"||Ot?0:1,transition:Q&&!le?"none":le?`transform ${wo}ms ${mn}`:N?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:yt?`transform ${Ln}ms ${mn}`:oe==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Ke&&Lt&&!Be?"auto":"none",touchAction:Ke&&Lt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Lt&&!Be?"auto":"none"},Nt=(P,Te,Fe="adjacent")=>{const ze=Ne(P);if(!ze)return{display:"none"};const pt=Fe==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:kt}=Re!==null?eu(ze,pt,Re,A):{start:Fe==="far"?zr(ze,Te,A):io(ze,Te,A)},mt=pr(kt,A),Tt=st(P,pt),qt=!Be&&Fe==="adjacent"&&Lt&&!ye?by(ze,Te,A):null,At=Fe==="far"&&Be&&Re===(Te==="left"?-1:1),rn=Q&&!le?!1:le,pn=Fe==="adjacent"&&Lt&&ye&&!Be;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Tt??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Fe==="far"?Lt&&At?1:0:Lt?1:0,transition:rn?Fe==="far"?`transform ${wo}ms ${mn}`:`transform ${wo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:oe==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(P,Te)=>{const Fe=Ne(P);return Fe?vy(io(Fe,Te,A),Te,A):null},Gt=P=>Te=>{if(!l){if(W.current){W.current=!1;return}Te.stopPropagation(),Ue(P)}},zt=Ge?Vt(Ge,"left"):null,Bt=Se?Vt(Se,"right"):null,jt=zt?pr(zt,A):null,It=Bt?pr(Bt,A):null;return a.jsxs("div",{ref:I,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Lt?tn:0,transition:Q?"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:Lt?1:0,transition:Q?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Zd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Lt&&it&&a.jsx(mr,{media:it,style:Nt(it,"left","far"),onMeasure:ct,onTransitionEnd:Le},`far-prev-${it.url}`),Lt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ge,style:Nt(Ge,"left"),onMeasure:ct,onTransitionEnd:Le},`prev-${Ge.url}`),jt&&a.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Lt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Se,style:Nt(Se,"right"),onMeasure:ct,onTransitionEnd:Le},`next-${Se.url}`),It&&a.jsx("div",{style:{position:"absolute",top:It.top,left:It.left,width:It.width,height:It.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Lt&&ht&&a.jsx(mr,{media:ht,style:Nt(ht,"right","far"),onMeasure:ct,onTransitionEnd:Le},`far-next-${ht.url}`),ce&&J&&(Ke?a.jsx(Cy,{src:J.url,phase:oe,onMediaElement:Pt,wrapperStyle:Dt,videoStyle:_t,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Pt,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:Dt},`${n}-${J.url}`))]})}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=j.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,b=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",g=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),w=`${g?v:f} / ${g?f:v}`,V=c.entryWidth??.2,z=c.columnsCount,Y=j.scalingValue(V,n),M=j.scalingValue(c.horizontalGap??0,n),F=Y,K=Y,T={width:F,...b?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},L=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},W=s.useRef(null),[O,C]=s.useState(!1),[E,_]=s.useState([]),[S,Z]=s.useState(0),[$,H]=s.useState(0),[B,ce]=s.useState(null),[ie,A]=s.useState({title1:"",title2:"",title3:""}),de=(()=>{const xe={},Ce=W.current?getComputedStyle(W.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(xe["--cntrl-article-width"]=Ce),xe})(),G=!n||i||o,se=s.useMemo(()=>iy(d),[d]),oe=t??[],he=oe.length%z||z,Ie=he<z&&oe.length>0,ve=oe.length-he,ue=Ie?Math.floor((z-he)/2)+1:1,U=s.useMemo(()=>uy(oe),[oe]),le=s.useMemo(()=>fy(oe),[oe]),re=(xe,Ce,h)=>{if(n&&!o&&!i)return;const q=U.findIndex(ee=>ee.gridIndex===xe);if(q<0)return;const X=U[q];H(q),_(X.items),Z(Ce),A(X.entry),ce(h??null),C(!0)},Re=s.useCallback(()=>{C(!1),ce(null)},[]),we=s.useCallback(()=>{const xe=U[$];return!xe||!W.current?B:dy(W.current,xe.gridIndex,b?"cover":"contain")??B},[U,$,B,b]),ke=s.useCallback(xe=>{if(U.length>1){const Ce=U.length,h=($+xe+Ce)%Ce,q=U[h],X=Math.min(S,q.items.length-1);H(h),_(q.items),Z(X),A(q.entry);return}Z(Ce=>(Ce+xe+E.length)%E.length)},[U,$,S,E.length]),fe=U.length>1||E.length>1;return s.useEffect(()=>{if(!O||typeof document>"u")return;const xe=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=xe}},[O]),s.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:se}}),a.jsx(yy,{mediaList:le}),a.jsx("div",{ref:W,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${z}, ${Y})`,rowGap:0,columnGap:M,width:j.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:j.scalingValue(u??0,n)},children:oe.map((xe,Ce)=>{const h=Qs(xe.gallery),q=el(h),X=q.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),ee=Math.floor(Ce/z)===Math.ceil(oe.length/z)-1,ye=Ie&&Ce>=ve?`${ue+(Ce-ve)}`:void 0,D=q[0],R=D!=null&&D.lightboxMedia?X.findIndex(ne=>ne.url===D.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:T,children:q.length>0&&a.jsx($y,{media:D.displayMedia,gridIndex:Ce,className:`${d}-item-${yo(D.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:G&&R>=0?ne=>re(Ce,R,Jd(ne.currentTarget,b?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ee?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...ye?{gridColumn:ye}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:K}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:K}})})]})},Ce)})}),O&&typeof document<"u"&&(()=>{const xe=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(Ty,{prefix:d,items:E,index:S,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:U,entryIdx:$,layoutId:r,sourceRect:B,resolveCloseSourceRect:we,onClose:Re,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),xe)})()]})}const Ry=`import { CommonComponentProps } from '../props';
|
|
7598
|
+
`}const Vl={url:"",name:"",objectFit:"cover"},Ln=500,wo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",oy=72,ry=50,ay=1e4,sy=650,ly=500;function cy(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 Jd(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 dy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Jd(i,n):null}function uy(e){return e.reduce((t,n,i)=>{const o=Qs(n.gallery),l=el(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 Ro(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 Gl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Ro(e,i,n)}const py=.03;function Qd(e){return e.width*py}const Ra={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 ql(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function my(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ds(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 gy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ds(e,t.width,t.height)}function hy(e,t){if(yo(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function fy(e){const t=new Set,n=[];for(const i of e){const o=Qs(i.gallery),r=el(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 yy({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=>yo(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function io(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Qd(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 zr(e,t,n){const i=io(e,t,n);return{...i,left:2*i.left-e.left}}function vy(e,t,n){const{left:i,width:o}=n,r=Qd(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 eu(e,t,n,i){const o=io(e,"left",i),r=io(e,"right",i),l=zr(e,"left",i),d=zr(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 xy(e,t,n,i){const{start:o,end:r}=eu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function by(e,t,n){const i=io(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function tu(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 Qs(e){if(!e)return;if(tu(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??Vl,i??o??Vl]}]}function wy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Sy(e){const[t]=e.media;return t!=null&&t.url?t:null}function el(e){if(!Array.isArray(e)||e.length===0)return[];if(tu(e)){const t=[];for(const n of e){const i=wy(n);if(!i)continue;const o=Sy(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 yo(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function $y({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return yo(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 Cy({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 yo(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 Ty({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:b,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:v}){const I=s.useRef(null),y=s.useRef(null),w=s.useRef(null),V=s.useRef(new Map),[z,Y]=s.useState(0),M=s.useRef(null),F=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),W=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(()=>{}),Z=s.useRef(null),$=s.useRef(null),H=s.useRef(null),B=s.useRef(!1),[le,ie]=s.useState(null),[k,de]=s.useState(Ra),[G,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Ie,xe]=s.useState(0),[ue,U]=s.useState(0),[se,re]=s.useState(!1),[Re,Se]=s.useState(null),[ke,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[X,ee]=s.useState(null),[ve,D]=s.useState(!1),R=s.useRef(!1),[Q,ne]=s.useState(!1),[N,te]=s.useState(!1),Ee=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?yo(J):!1,Be=ue!==0||se,it=!l&&(!r||!!d),Xe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?Ro(u,p,-1):Je(n,-1),$e=et?Ro(u,p,1):Je(n,1),He=Re===-1&&Be?et&&ke!==null?Ro(u,ke,-1):be!==null?Je(be,-1):null:null,De=Re===1&&Be?et&&ke!==null?Ro(u,ke,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&Xe?(()=>{const A=et?Gl(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&Xe?(()=>{const A=et?Gl(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ht=he??Ve,at=s.useCallback((A,Te,We)=>{if(!A||!Te||!We)return;const je=V.current,pt=je.get(A);(pt==null?void 0:pt.width)===Te&&(pt==null?void 0:pt.height)===We||(je.set(A,{width:Te,height:We}),Y(_t=>_t+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=V.current.get(A.url);return gy(y.current,Te)},[z,G]),Ae=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=y.current;Te&&ie(ql(Te))},[J,Oe]),Pe=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{O.current=A,re(A)},[]),Ne=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),rt=s.useCallback(()=>{Ne(),C.current=window.setTimeout(()=>{Ne(),Ze(!1)},wo+32)},[Ne,Ze]),ot=s.useCallback(()=>{const A=I.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ra.width,height:typeof window<"u"?window.innerHeight:Ra.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(Be){if(Q&&!se)return`translate(${ue}px, 0px)`;if(se&&Re!==null){const We=Oe(A);if(!We)return;const{x:je,y:pt}=xy(We,Te,Re,k);return`translate(${je}px, ${pt}px)`}if(se)return"translate(0px, 0px)"}},[Be,Q,se,ue,Re,k,Oe]),Fe=s.useCallback(()=>{const A=E.current;E.current=null,Ne(),Ze(!1),Se(null),ye(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&v()},[Ne,Ze,f,v]),st=s.useCallback(()=>{Ne(),C.current=window.setTimeout(()=>{E.current!==null&&Fe()},wo+32)},[Ne,Fe]),dt=s.useCallback(()=>{Ne(),E.current=null,Ze(!1),Se(null),ye(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[Ne,Ze]),ze=s.useCallback(A=>{if(!(!Xe||!le)){if(O.current){if(E.current===A){_.current=A,Fe();return}dt()}Ne(),Pe(A),E.current=A,Se(A),Ze(!0),st()}},[Xe,le,Fe,dt,Ne,Pe,Ze,st]);S.current=ze;const ut=s.useCallback(()=>{Z.current=null,B.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),Ct=s.useCallback(A=>{$.current!==null&&window.clearInterval($.current);const Te=B.current?ly:sy;$.current=window.setInterval(()=>{S.current(A)},Te)},[]),Tt=s.useCallback(A=>{Z.current!==A&&(ut(),Z.current=A,B.current=!1,S.current(A),Ct(A),H.current=window.setTimeout(()=>{H.current=null,Z.current===A&&(B.current=!0,Ct(A))},ay))},[ut,Ct]),xt=s.useCallback(()=>{const A=y.current;if(!A)return;const Te=J==null?void 0:J.url,We=Te?V.current.get(Te):void 0;if(We!=null&&We.width&&(We!=null&&We.height)){ie(ds(A,We.width,We.height));return}const je=w.current;if(je&&Te&&(je.src===Te||je.currentSrc===Te)){const{width:_t,height:mt}=my(je);if(_t&&mt){at(Te,_t,mt),ie(ds(A,_t,mt));return}}const pt=ql(A);!pt.width||!pt.height||ie(pt)},[J==null?void 0:J.url,at]),Pt=s.useCallback(A=>{if(w.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),zt=s.useCallback(()=>{ot(),xt(),ce(A=>A+1)},[ot,xt]);s.useEffect(()=>{zt();const A=y.current,Te=I.current,We=new ResizeObserver(()=>zt());return A&&We.observe(A),Te&&We.observe(Te),window.addEventListener("resize",zt),()=>{We.disconnect(),window.removeEventListener("resize",zt)}},[zt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const A=w.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ae()},[Ae,z]),s.useEffect(()=>{const A=new Set,Te=[],We=je=>{!(je!=null&&je.url)||A.has(je.url)||(A.add(je.url),Te.push(je))};t.forEach(We),u.forEach(je=>je.items.forEach(We)),Te.forEach(je=>{V.current.has(je.url)||hy(je,at)})},[t,u,at]),s.useEffect(()=>{if(oe!=="opening"||!le)return;if(!b){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,le,b]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),Ln);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{Ne()},[Ne]),s.useLayoutEffect(()=>{Ee.current===n&&ge.current===(J==null?void 0:J.url)||(Ne(),E.current=null,Se(null),ye(null),Ce(null),xe(0),U(0),Ze(!1),te(!1),ne(!1),F.current=0,K.current=0,T.current="none",L.current=!1,M.current=null,W.current=!1,w.current=null,Ae(),Ee.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,Ne,Ae]),s.useLayoutEffect(()=>{const A=_.current;A!==null&&(_.current=null,requestAnimationFrame(()=>{S.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){R.current=!1,D(!1);return}if(oe!=="open"||R.current)return;if(!Ge&&!$e){R.current=!0;return}D(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{D(!0),R.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Te=mt=>{const Lt=mt<0?1:-1;Ne(),Pe(Lt),E.current=Lt,Se(Lt),Ze(!0),st()},We=mt=>{if(Math.abs(mt)>ry&&Xe){Te(mt);return}E.current=null,Se(null),ye(null),Ce(null),Ze(!0),U(0),rt()},je=mt=>{if(mt.touches.length!==1||O.current)return;const Lt=mt.touches[0];W.current=!0,M.current={x:Lt.clientX,y:Lt.clientY},T.current="none",K.current=0,L.current=!1},pt=mt=>{if(!M.current||mt.touches.length!==1||O.current)return;const Lt=mt.touches[0],qt=Lt.clientX-M.current.x,kt=Lt.clientY-M.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(kt)<10)return;if(Math.abs(qt)>Math.abs(kt)){if(!Xe)return;T.current="horizontal"}else if(kt>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,U(qt),mt.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),F.current=kt,xe(kt),mt.preventDefault())},_t=()=>{if(!M.current)return;const mt=T.current,Lt=L.current;if(Lt&&mt==="horizontal")We(K.current),A();else if(Lt&&mt==="vertical"){const qt=F.current;if(it&&qt>oy){const kt=window.innerHeight;F.current=kt,te(!0),xe(kt),fe("closing")}else F.current=0,xe(0);A()}else mt==="horizontal"&&Math.abs(K.current)>0&&(We(K.current),A());M.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",je,{passive:!0}),document.addEventListener("touchmove",pt,{passive:!1}),document.addEventListener("touchend",_t),document.addEventListener("touchcancel",_t),()=>{document.removeEventListener("touchstart",je),document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",_t),document.removeEventListener("touchcancel",_t)}},[oe,Xe,Ze,rt,Ne,it,st,Pe]);const Xt=s.useCallback(()=>{const A=(m==null?void 0:m())??b??null;A&&le&&(ee(A),q(!0)),fe("closing")},[m,b,le]);s.useEffect(()=>{const A=je=>{if(je.key==="Escape"){if(r&&d||oe==="closing")return;ut(),Xt();return}if(je.key!=="ArrowLeft"&&je.key!=="ArrowRight"||oe!=="open"||!Xe)return;je.preventDefault();const pt=je.key==="ArrowLeft"?-1:1;je.repeat&&Z.current===pt||Tt(pt)},Te=je=>{if(je.key!=="ArrowLeft"&&je.key!=="ArrowRight")return;const pt=je.key==="ArrowLeft"?-1:1;Z.current===pt&&ut()},We=()=>{ut()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",We),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",We),ut()}},[oe,r,d,Xt,Xe,Tt,ut]),s.useEffect(()=>{oe!=="open"&&ut()},[oe,ut]);const Yt=()=>{oe==="closing"||l||Xt()},It=oe==="open",Ot=oe==="closing",tn=Ie>0?Math.max(0,1-Ie/500):1,yt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!O.current)){if(E.current!==null){Fe();return}Ne(),Ze(!1)}},[Ne,Ze,Fe]),qe=oe==="closing"?X??b:b,lt=qe&&le&&(oe==="opening"||Ot)?cy(qe,le):void 0,vt=Be&&J?me(J,"center"):Ie>0?`translateY(${Ie}px)`:lt,wt=le?pr(le,k):null,Et=!!(qe&&le),ft=Et&&(oe==="closing"||oe==="open"&&h),Bt={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:vt,opacity:Ie>0?yt:Et?1:oe==="opening"||Ot?0:1,transition:Q&&!se?"none":se?`transform ${wo}ms ${mn}`:N?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:ft?`transform ${Ln}ms ${mn}`:oe==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Ye&&It&&!Be?"auto":"none",touchAction:Ye&&It?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:It&&!Be?"auto":"none"},Ft=(A,Te,We="adjacent")=>{const je=Oe(A);if(!je)return{display:"none"};const pt=We==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:_t}=Re!==null?eu(je,pt,Re,k):{start:We==="far"?zr(je,Te,k):io(je,Te,k)},mt=pr(_t,k),Lt=me(A,pt),qt=!Be&&We==="adjacent"&&It&&!ve?by(je,Te,k):null,kt=We==="far"&&Be&&Re===(Te==="left"?-1:1),rn=Q&&!se?!1:se,pn=We==="adjacent"&&It&&ve&&!Be;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:We==="far"?It&&kt?1:0:It?1:0,transition:rn?We==="far"?`transform ${wo}ms ${mn}`:`transform ${wo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:oe==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,Te)=>{const We=Oe(A);return We?vy(io(We,Te,k),Te,k):null},Gt=A=>Te=>{if(!l){if(W.current){W.current=!1;return}Te.stopPropagation(),ze(A)}},Dt=Ge?Vt(Ge,"left"):null,jt=$e?Vt($e,"right"):null,Ht=Dt?pr(Dt,k):null,bt=jt?pr(jt,k):null;return a.jsxs("div",{ref:I,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:It?tn:0,transition:Q?"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:It?1:0,transition:Q?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Zd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Yt})})]}),It&&tt&&a.jsx(mr,{media:tt,style:Ft(tt,"left","far"),onMeasure:at,onTransitionEnd:Le},`far-prev-${tt.url}`),It&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:Ge,style:Ft(Ge,"left"),onMeasure:at,onTransitionEnd:Le},`prev-${Ge.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),It&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(mr,{media:$e,style:Ft($e,"right"),onMeasure:at,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),It&&ht&&a.jsx(mr,{media:ht,style:Ft(ht,"right","far"),onMeasure:at,onTransitionEnd:Le},`far-next-${ht.url}`),le&&J&&(Ye?a.jsx(Cy,{src:J.url,phase:oe,onMediaElement:Pt,wrapperStyle:Bt,videoStyle:Nt,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Pt,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Bt},`${n}-${J.url}`))]})}function Ly({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=j.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:x}=e,b=(x==null?void 0:x.display)==="cover",m=(x==null?void 0:x.ratioValue)??"1:1",g=(x==null?void 0:x.reversed)??!1,[f,v]=m.split(":").map(Number),w=`${g?v:f} / ${g?f:v}`,V=c.entryWidth??.2,z=c.columnsCount,Y=j.scalingValue(V,n),M=j.scalingValue(c.horizontalGap??0,n),F=Y,K=Y,T={width:F,...b?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},L=b?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},W=s.useRef(null),[O,C]=s.useState(!1),[E,_]=s.useState([]),[S,Z]=s.useState(0),[$,H]=s.useState(0),[B,le]=s.useState(null),[ie,k]=s.useState({title1:"",title2:"",title3:""}),de=(()=>{const be={},Ce=W.current?getComputedStyle(W.current).getPropertyValue("--cntrl-article-width").trim():"";return Ce&&(be["--cntrl-article-width"]=Ce),be})(),G=!n||i||o,ce=s.useMemo(()=>iy(d),[d]),oe=t??[],fe=oe.length%z||z,Ie=fe<z&&oe.length>0,xe=oe.length-fe,ue=Ie?Math.floor((z-fe)/2)+1:1,U=s.useMemo(()=>uy(oe),[oe]),se=s.useMemo(()=>fy(oe),[oe]),re=(be,Ce,h)=>{if(n&&!o&&!i)return;const q=U.findIndex(ee=>ee.gridIndex===be);if(q<0)return;const X=U[q];H(q),_(X.items),Z(Ce),k(X.entry),le(h??null),C(!0)},Re=s.useCallback(()=>{C(!1),le(null)},[]),Se=s.useCallback(()=>{const be=U[$];return!be||!W.current?B:dy(W.current,be.gridIndex,b?"cover":"contain")??B},[U,$,B,b]),ke=s.useCallback(be=>{if(U.length>1){const Ce=U.length,h=($+be+Ce)%Ce,q=U[h],X=Math.min(S,q.items.length-1);H(h),_(q.items),Z(X),k(q.entry);return}Z(Ce=>(Ce+be+E.length)%E.length)},[U,$,S,E.length]),ye=U.length>1||E.length>1;return s.useEffect(()=>{if(!O||typeof document>"u")return;const be=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=be}},[O]),s.useEffect(()=>{!n||o||i||C(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(yy,{mediaList:se}),a.jsx("div",{ref:W,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${z}, ${Y})`,rowGap:0,columnGap:M,width:j.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:j.scalingValue(u??0,n)},children:oe.map((be,Ce)=>{const h=Qs(be.gallery),q=el(h),X=q.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),ee=Math.floor(Ce/z)===Math.ceil(oe.length/z)-1,ve=Ie&&Ce>=xe?`${ue+(Ce-xe)}`:void 0,D=q[0],R=D!=null&&D.lightboxMedia?X.findIndex(ne=>ne.url===D.lightboxMedia.url):-1,Q=a.jsx("div",{className:`${d}-item-image-wrapper`,style:T,children:q.length>0&&a.jsx($y,{media:D.displayMedia,gridIndex:Ce,className:`${d}-item-${yo(D.displayMedia)?"video":"image"}`.trim(),style:L,onMediaClick:G&&R>=0?ne=>re(Ce,R,Jd(ne.currentTarget,b?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,ee?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...ve?{gridColumn:ve}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:K}})}),a.jsx("a",{className:`${d}-item-image-link`,children:Q}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:K}})})]})},Ce)})}),O&&typeof document<"u"&&(()=>{const be=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(Ty,{prefix:d,items:E,index:S,entry:ie,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ye,lightboxEntries:U,entryIdx:$,layoutId:r,sourceRect:B,resolveCloseSourceRect:Se,onClose:Re,onPrev:()=>ke(-1),onNext:()=>ke(1)})}),be)})()]})}const Ry=`import { CommonComponentProps } from '../props';
|
|
7599
7599
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7600
7600
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7601
7601
|
import { createPortal } from 'react-dom';
|
|
@@ -9938,11 +9938,11 @@ export function Hive({
|
|
|
9938
9938
|
</>
|
|
9939
9939
|
);
|
|
9940
9940
|
}
|
|
9941
|
-
`,Iy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ey(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const oo=ri.filter(e=>e!=="count"),My=oo.reduce((e,t)=>({...e,...Ey(t)}),{}),Py=oo.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Arial",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ea(e){return oo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const ky={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oo.map(e=>[Zs[e],Js(e)]))},Ay={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Fy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ay,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Wy={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:Fy},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"}},...My},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Iy,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Py},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,...Ea({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,...Ea({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,...Ea({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:[ky]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},_y={element:Ly,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:[...oo.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{...oo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})},schema:Wy,sourceCode:Ry};function Ny(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 Hy({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 Ma(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Oy(e){return String(e??"").trim().length>0}function Xl(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 Ul(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 Yl(e,t,n,i,o,r,l){const d=j.scalingValue(r,l),c=j.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Dy(e,t,n){const i=j.scalingValue(t,n),o=j.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Kl=10,Zl=10,So={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function jy(e,t,n){return Math.max(t,Math.min(n,e))}function Pa(e,t,n){return e+(t-e)*n}function zy(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+Kl,y:n.clientY-d.top+Kl}}switch(e){case"left":return{x:Zl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Zl-i/2,y:l};default:return{x:o/2,y:l}}}function By(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Pa(m.x,m.targetX,So.positionEase),m.y=Pa(m.y,m.targetY,So.positionEase),m.rotation=Pa(m.rotation,m.targetRotation,So.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!g||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,g)=>{const f=i.current;f.targetX=m,f.targetY=g,f.targetRotation=0,f.x=m,f.y=g,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,g)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=jy(v*So.rotationFactor,-20,So.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=g,t){c();return}f.x=m,f.y=g,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),b=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||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:b}}function Vy(e){return`
|
|
9941
|
+
`,Iy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),gi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ey(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const oo=oi.filter(e=>e!=="count"),My=oo.reduce((e,t)=>({...e,...Ey(t)}),{}),Py=oo.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Arial",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ia(e){return oo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const ky={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(oo.map(e=>[Zs[e],Js(e)]))},Ay={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Fy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ay,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Wy={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:Fy},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"}},...My},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Iy,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Py},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,...Ia({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,...Ia({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,...Ia({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:[ky]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},_y={element:Ly,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:[...oo.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{...oo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})},schema:Wy,sourceCode:Ry};function Ny(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 Hy({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 Ea(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Oy(e){return String(e??"").trim().length>0}function Xl(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 Ul(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 Yl(e,t,n,i,o,r,l){const d=j.scalingValue(r,l),c=j.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Dy(e,t,n){const i=j.scalingValue(t,n),o=j.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Kl=10,Zl=10,So={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function jy(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function zy(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+Kl,y:n.clientY-d.top+Kl}}switch(e){case"left":return{x:Zl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Zl-i/2,y:l};default:return{x:o/2,y:l}}}function By(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const m=n.current,g=i.current;m&&(m.style.transform=`translate3d(${g.x}px, ${g.y}px, 0) translate(-50%, -50%) rotate(${g.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const m=i.current;t?(m.x=Ma(m.x,m.targetX,So.positionEase),m.y=Ma(m.y,m.targetY,So.positionEase),m.rotation=Ma(m.rotation,m.targetRotation,So.rotationEase)):(m.x=m.targetX,m.y=m.targetY,m.rotation=m.targetRotation),r();const g=Math.abs(m.x-m.targetX)<.4&&Math.abs(m.y-m.targetY)<.4,f=Math.abs(m.rotation-m.targetRotation)<.08;!g||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((m,g)=>{const f=i.current;f.targetX=m,f.targetY=g,f.targetRotation=0,f.x=m,f.y=g,f.rotation=0,f.lastX=m,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((m,g)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const v=m-f.lastX;f.targetRotation=jy(v*So.rotationFactor,-20,So.maxRotation)}else f.targetRotation=0;if(f.lastX=m,f.hasLastX=!0,f.targetX=m,f.targetY=g,t){c();return}f.x=m,f.y=g,f.rotation=f.targetRotation,r()},[e,r,t,c]),x=s.useCallback(m=>{l(),i.current.hasLastX=!1,m==null||m()},[l]),b=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||b(),l),[e,b,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:x,reset:b}}function Vy(e){return`
|
|
9942
9942
|
.${e}-wrapper {
|
|
9943
9943
|
display: grid;
|
|
9944
9944
|
align-items: start;
|
|
9945
|
-
min-height: ${
|
|
9945
|
+
min-height: ${Ea(48)};
|
|
9946
9946
|
position: relative;
|
|
9947
9947
|
overflow: visible;
|
|
9948
9948
|
box-sizing: border-box;
|
|
@@ -10071,7 +10071,7 @@ a.${e}-list-item {
|
|
|
10071
10071
|
flex-shrink: 0;
|
|
10072
10072
|
overflow: visible;
|
|
10073
10073
|
box-sizing: border-box;
|
|
10074
|
-
min-width: ${
|
|
10074
|
+
min-width: ${Ea(50)};
|
|
10075
10075
|
position: relative;
|
|
10076
10076
|
display: flex;
|
|
10077
10077
|
align-items: flex-start;
|
|
@@ -10079,7 +10079,7 @@ a.${e}-list-item {
|
|
|
10079
10079
|
|
|
10080
10080
|
.${e}-list-col-last {
|
|
10081
10081
|
flex: 1 1 auto;
|
|
10082
|
-
min-width: ${
|
|
10082
|
+
min-width: ${Ea(50)};
|
|
10083
10083
|
}
|
|
10084
10084
|
|
|
10085
10085
|
.${e}-list-col-title {
|
|
@@ -10314,7 +10314,7 @@ a.${e}-list-item {
|
|
|
10314
10314
|
overflow-wrap: anywhere;
|
|
10315
10315
|
word-break: break-word;
|
|
10316
10316
|
}
|
|
10317
|
-
`}const ai=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],tl=["AColumn","BColumn","CColumn","DColumn","EColumn"],jn="cutLabel",zo=[...tl,jn],ca=["A","B","C","D","E"];function nu(e){return`${e}ColumnVerticalAlign`}const ps=["Top","Center","Bottom"];function nl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return ca.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Gy(e){const t=nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function qy(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return ca.includes(n)?n:null}function iu(e,t,n){const i=qy(e);return i?i===t?!1:Gy(n[nu(i)]):!0}function Bo(e){const t=nl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return ca.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Xy(e,t,n){if(ou(e,t,n))return Bo(e);const i=Bo(e);return i.kind==="baseline"?{kind:"top"}:i}function Uy(e){const t=Bo(e);return t.kind==="baseline"?{kind:"top"}:t}function ou(e,t,n){return iu(e,n,t)?Bo(e).kind==="baseline":!1}function Yy(e){const t={};let n=!1;for(const i of ca){const o=nu(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}iu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ky(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Zy(e){const t=Bo(e).kind;return t==="baseline"?"center":t}function Jy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Jl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Qy(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 ka(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Qy(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 ev(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 tv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const nv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Wt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const iv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ov(e){return[Wt(e,"textFontFamily"),Wt(e,"textFontSettings"),{type:"row",items:[Wt(e,"textFontSize"),Wt(e,"textLineHeight"),Wt(e,"textLetterSpacing"),Wt(e,"textWordSpacing")]},Wt(e,"textTextAlign"),Wt(e,"textTextAppearance"),`${e}VerticalAlign`]}function rv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(zo.map(e=>[iv[e],ov(e)]))}}function Br(e,t){const n=i=>{const o=Wt(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===jn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ql(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 sn(Zt(n,t))}function ec(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function tc(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:j.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ro=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],ao=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],so=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],av={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},sv=["hover","focus","filled","success","error"],nc=.004,ji=.004,Aa=ji,il=50,Vo=1440,Go=il/Vo;function ru(e){const t=typeof e=="number"&&e>0?e:Vo;return il/t}function lv(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 Vo}const au={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ko(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function cv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function dv(){return Object.fromEntries([...ro.map(e=>[e,0]),...ao.map(e=>[e,0])])}function uv(){return Object.fromEntries(so.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:au[t]]))}function su(e,t,n){const i=e-Go,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 Fr(e,t,n){const i=ol(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 pv(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ro[o],l=ao[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=su(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ol(e,t,n){if(e<=0)return[];const i=xn.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)+Go;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]-Go;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function mv(e,t,n){if(e<=1)return{};const i=ol(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function ic(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ai]}function gv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function hv(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=ro[c],x=ao[c],b=so[c],m=xn[l],g=ro[l],f=ao[l],v=so[l],I=n[u],y=n[p],w=n[x],V=n[b];typeof I=="number"&&(r[m]=I),typeof y=="number"&&(r[g]=y),typeof w=="number"&&(r[f]=w),typeof V=="number"&&(r[v]=V)}return r}function lu(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 fv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ko(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...cv(n,o),...dv()};if(r)for(const d of so)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,uv());return lu(e,l)?l:e}function yv(e,t,n){const i=Yy(e);i&&(e={...e,...i});const o=ru(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=ko(e),c=ko(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ai.length,x=w=>{if(u)return w;const V=gr({...t,...w}),z=ko(w),Y=Fr(p,z,V),M=pv(p,Y,{...t,...w});return Object.keys(M).length===0?w:{...w,...M}};if(typeof r=="number"&&r!==l)return e;const b=ic(e),m=ic(t);if(!gv(b,m))return x({...e,...hv(b,m,t,p)});if(d<c&&typeof p=="number"&&!u){const w=gr({...t,...e});return x({...e,...mv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,V=Math.max(0,(d-o)/2);return w>V?{...e,textPaddingLR:V}:e}const g=gr({...t,...e}),f=Fr(p,c,gr(t)),I=Fr(p,d,g).some((w,V)=>w<(f[V]??w)),y=xn.some(w=>{const V=e[w],z=t[w];return typeof V=="number"&&typeof z=="number"&&V!==z});return I||y?x(e):e}function vv(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(Go,i-o-r-Go)}function xv(e,t){return Math.random()*(t-e)+e}function bv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:au[t]]))}function Fa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function wv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=ro[d],u=ao[d],p=so[d];return{key:l,textPrefix:nv[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function Sv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=j.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:b,entriesCount:m,cellMinHeight:g,dividerWidth:f,showVisibility:v,cut:I,showCut:y,cutCellMinHeight:w,cutLabel:V,imageSize:z,imageOnHover:Y,imagePosition:M="cursor",imageInterpolation:F="on",entryHoverEffect:K,entryHoverShowOption:T,rowPaddingTop:L,rowPaddingBottom:W,rowPaddingTopB:O,columnsOrder:C,textPaddingLR:E,textColor:_,backgroundColor:S,dividerColor:Z,textHoverColor:$,backgroundHoverColor:H,dividerHoverColor:B}=e,[ce,ie]=s.useState(void 0),[A,de]=s.useState(null),G=s.useRef(null),se=Y==="on"&&(!n||i),oe=M==="cursor",he=oe&&F==="on",{anchorRef:Ie,onShow:ve,onCursorMove:ue,exit:U}=By(!!(se&&A!==null),he),le=(I??0)>0,re=x==="b",Re=s.useRef(null),we=s.useRef(null),[ke,fe]=s.useState(null),[xe,Ce]=s.useState(Vo),h=ru(xe),q=Math.max(0,((b??0)-h)/2),X=Math.min(E??0,q),ee=Math.max(X,ji),ye=((b??0)+h)/2;s.useLayoutEffect(()=>{if(!n){Ce(Vo);return}const Le=()=>{Ce(lv(Re.current))};Le();const je=Re.current;if(!je)return;const ut=new ResizeObserver(Le);ut.observe(je);let ft=je;for(;ft&&!ft.style.getPropertyValue("--cntrl-article-width");)ft=ft.parentElement;return ft&&ut.observe(ft),()=>ut.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[I,y,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const D=j.buildColorVars(c,{textColor:_,backgroundColor:S,dividerColor:Z,textHoverColor:$,backgroundHoverColor:H,dividerHoverColor:B},av,sv),R=r&&r!=="default"?`${c}-state-${r}`:"",ne=`${!n||i?K==="default"?`${c}-entry-hover-default`:K==="blinds"?`${c}-entry-hover-blinds`:K==="reveal"?`${c}-entry-hover-reveal`:"":""} ${R}`.trim(),N=K==="reveal"&&(!n||i),te=(v==null?void 0:v[0])??!1,Ee=(v==null?void 0:v[1])??!1,me=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){me.current=e,J.current=l;return}if(J.current!==l){me.current=e,J.current=l;return}const Le=me.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){me.current=e;return}const ut=yv(e,Le,{designWidth:xe});me.current=e,lu(e,ut)&&d(ut)},[e,d,n,l,xe]);const Ke=s.useMemo(()=>bv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Be=s.useMemo(()=>Fa(e,ro),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),rt=s.useMemo(()=>Fa(e,ao),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Xe=s.useMemo(()=>Fa(e,so),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),nt=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...ai],[C]),Qe=s.useMemo(()=>wv(nt,p,Ke,Be,rt,Xe),[nt,p,Ke,Be,rt,Xe]),Ge=ko(e),Se=s.useMemo(()=>xn.slice(0,p).map(Le=>Ke[Le]),[p,Ke]),_e=s.useMemo(()=>ol(p,Ge,Ke),[p,Ge,Ke]),Oe=s.useMemo(()=>Fr(p,Ge,Ke),[p,Ge,Ke]),et=s.useMemo(()=>Qe.map((Le,je)=>su(Oe[je]??0,Le.paddingLeft,Le.paddingRight)),[Qe,Oe]),ge=s.useMemo(()=>{const Le=m===0?1/0:m;return(t??[]).slice(0,Le).map((ut,ft)=>({id:ft,cells:Object.fromEntries(ai.map(bt=>[bt,ut[bt]??""])),image:ut.image,link:ut.link}))},[t,m]),We=le?ce??I:ge.length,Ve=s.useMemo(()=>le?ge.slice(0,We):ge,[ge,le,We]),it=le&&We<ge.length,ht=Ve.length>1||it,ct=[te?`${c}-divider-top`:"",Ee||ht?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Ne=!n||i,Ae=()=>{if(!Ne)return;const Le=ce??I;if(!y){ie(ge.length);return}ie(Math.min(Le+y,ge.length))},Pe=Le=>j.scalingValue(Le,n??!1),Je=re?O??0:L??0,He=W??0,tt=g??0,at=Math.max(He,Aa),st=Yl(0,Ve.length,te,Ee,it,f??0,n??!1).borderTopWidth,$e=re?"rowPaddingTopB":"rowPaddingTop",De=Qe[0],lt=Qe[Qe.length-1],Ue=et[0],qe=et[et.length-1],$t=De&&Ue?Math.max(Ue.paddingLeft,ji):0,Ct=lt&&qe?Math.max(qe.paddingRight,ji):0,vt=Ge,Pt=(Le,je)=>zy(M,Re.current,oe?Le:null,je),Ht=(Le,je)=>{if(!se)return;const ut=Le.image;if(!(ut!=null&&ut.url)){U(()=>de(null));return}const ft=(z==null?void 0:z.min)??80,bt=(z==null?void 0:z.max)??320,Mt=(A==null?void 0:A.rowId)===Le.id,yt=Mt?A.widthPx:xv(ft,bt),{x:Dt,y:_t}=Pt(je,yt);if(Mt&&oe){ue(Dt,_t);return}de({rowId:Le.id,url:ut.url,objectFit:"contain",isVideo:Ny(ut),widthPx:yt}),G.current={x:Dt,y:_t}},Yt=Le=>{if(!se||!A||!oe)return;const{x:je,y:ut}=Pt(Le,A.widthPx);ue(je,ut)},Kt=()=>{A&&U(()=>de(null))},Lt=Le=>{N&&Xl(Le,c),!(!se||!A)&&U(()=>de(null))},Ot=Le=>{N&&Ul(Le,c)};s.useLayoutEffect(()=>{if(!A||!G.current)return;const{x:Le,y:je}=G.current;G.current=null,ve(Le,je)},[A==null?void 0:A.rowId,A==null?void 0:A.url,ve]),s.useLayoutEffect(()=>{if(!u||re){fe(null);return}const Le=we.current,je=Le==null?void 0:Le.parentElement;if(!Le||!je){fe(null);return}const ut=()=>{const bt=Le.querySelector("[data-list-row]");if(!bt){fe(null);return}const Mt=je.getBoundingClientRect(),yt=bt.getBoundingClientRect();fe(yt.top-Mt.top+yt.height/2)};ut();const ft=new ResizeObserver(ut);return ft.observe(Le),ft.observe(je),()=>ft.disconnect()},[u,re,Ve,Je,He,tt,t,e,Qe,Oe,xe,f,te,Ee,it]);const tn=s.useMemo(()=>!re&&tl.some(Le=>{const je=Le.charAt(0),ut=e[`${Le}VerticalAlign`];return ou(ut,e,je)}),[re,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Dt;const Le=Re.current;if(!Le)return;const je=()=>{Le.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Nt=_t.querySelector(`.${c}-list-col`);Nt&&(Nt.style.minHeight="",Nt.style.height="");const Vt=_t.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(re||!tn){je();return}const ut=()=>{const _t=Array.from(Le.querySelectorAll("[data-list-row]")),Nt=`${c}-list-col`,Vt=`${c}-baseline-probe`;_t.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(zt=>{zt.style.transform="";const Bt=zt.querySelector(`.${Nt}`);Bt&&(Bt.style.minHeight="",Bt.style.height="");const jt=zt.querySelector(`.${c}-list-col-title`);jt&&(jt.style.transform="")})}),_t.forEach(Gt=>{const zt=Array.from(Gt.querySelectorAll("[data-list-col]"));ev(Gt,zt,Nt)}),Le.offsetHeight,_t.forEach(Gt=>{const zt=Array.from(Gt.querySelectorAll("[data-list-col]")),Bt=Gt.getBoundingClientRect().top,jt=new Map,It=zt.map(Fe=>{const ze=Fe.querySelector(`.${c}-list-col-title`),pt={el:Fe,titleEl:ze,letter:Fe.getAttribute("data-col-letter")??"",kind:Fe.getAttribute("data-valign")??"top",anchor:Fe.getAttribute("data-valign-anchor")};return jt.set(pt.letter,pt),pt}),P=new Map,Te=(Fe,ze)=>{const pt=P.get(Fe.letter);if(pt!==void 0)return pt;const kt=Fe.anchor?jt.get(Fe.anchor):void 0;if(Fe.kind!=="baseline"||!kt||ze.has(Fe.letter)){const rn=ka(Fe,Bt,Nt,Vt);return P.set(Fe.letter,rn),rn}ze.add(Fe.letter);const mt=Te(kt,ze);ze.delete(Fe.letter);const Tt=ka(Fe,Bt,Nt,Vt),qt=mt-Tt;tv(Fe.titleEl,qt);const At=ka(Fe,Bt,Nt,Vt);return P.set(Fe.letter,At),At};It.forEach(Fe=>Te(Fe,new Set))})};let ft=null;const bt=()=>{ft===null&&(ft=requestAnimationFrame(()=>{ft=null,ut()}))};ut();const Mt=new ResizeObserver(()=>bt());Mt.observe(Le);let yt=!1;return typeof document<"u"&&((Dt=document.fonts)!=null&&Dt.ready)&&document.fonts.ready.then(()=>{yt||bt()}),()=>{yt=!0,ft!==null&&(cancelAnimationFrame(ft),ft=null),Mt.disconnect(),je()}},[tn,re,e,t,xe,Ve,Oe]);const xt=s.useMemo(()=>Vy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:xt}}),a.jsx("div",{style:D,children:a.jsxs("div",{ref:Re,className:`${c}-wrapper ${ne}${ct?` ${ct}`:""}${re?` ${c}-type-b`:""}`.trim(),style:{width:j.scalingValue(b??0,n)},onMouseMove:se?Yt:void 0,onMouseLeave:se?Kt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Le,je)=>{var Mt;const ut=(((Mt=Le.link)==null?void 0:Mt.length)??0)>0,ft=ut&&(!n||i)?"a":"div",bt=Yl(je,Ve.length,te,Ee,it,f??0,n??!1);return a.jsxs(ft,{ref:je===0?yt=>{we.current=yt}:void 0,className:`${c}-list-item${ut||T==="always"?` ${c}-list-item-has-link`:""}${it&&je===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...ut?{href:Le.link,target:"_blank"}:{},style:bt,onMouseEnter:yt=>{N&&(ut||T==="always")&&Xl(yt,c),se&&Ht(Le,yt)},onMouseLeave:yt=>{N&&(ut||T==="always")&&Ul(yt,c)},children:[Je>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(Je)}}),a.jsxs("div",{className:`${c}-list-cols-row${re?"":` ${c}-list-cols-row-h`}${u&&je===0&&re?` ${c}-list-cols-row-controls`:""}`,...re?{}:{"data-list-row":""},style:re?void 0:{minHeight:Pe(tt)},children:[Qe.map((yt,Dt)=>{const _t=Dt===Qe.length-1,Nt=et[Dt],Vt=yt.paddingBottom,Gt=Oy(Le.cells[yt.key]),zt=re&&Gt&&Vt>0,Bt=re?{minHeight:Pe(tt)}:{width:Pe(Oe[Dt])},jt=re?{paddingLeft:Pe(X),paddingRight:Pe(X)}:{paddingLeft:Pe(Nt.paddingLeft),paddingRight:Pe(Nt.paddingRight)},It=yt.textPrefix.charAt(0),P=re?Uy(e[`${yt.textPrefix}VerticalAlign`]):Xy(e[`${yt.textPrefix}VerticalAlign`],e,It),Te=re&&Gt&&u&&je===0;return re&&!Gt?null:a.jsxs("div",{className:re?`${c}-list-col-wrap`:void 0,...re?{}:{"data-list-col":"","data-col-letter":It,"data-valign":P.kind,...P.kind==="baseline"?{"data-valign-anchor":P.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...jt,...Bt,...re?{justifyContent:Jl(P.kind)}:{}},"data-test":yt.width,children:a.jsx("span",{className:ec(e,yt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Ql(Br(e,yt.textPrefix),n),...tc(e,yt.textPrefix,c,n),...re?{}:Ky(P.kind)},children:Le.cells[yt.key]??null})}),zt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(Vt)}}),Te&&a.jsx("div",{"data-controls":yt.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:Pe(Math.max(Vt,Aa))}})]},yt.key)}),u&&je===0&&re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ye),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Pe(ee),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ye),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Pe(Math.max(ee,Ge-ee)),width:Pe(ee),height:"100%"}})]})]}),!re&&He>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(He)}}),u&&je===0&&!re&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Pe(at)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":$e,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":re?"center":"left-y",className:`${c}-control-anchor`,style:{top:st,left:0,width:"100%",height:Pe(Math.max(Je,Aa))}})},"row-padding-handles"),u&&!re&&De&<&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":De.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[0]-((Ue==null?void 0:Ue.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Pe($t),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Oe[Qe.length-1]-((qe==null?void 0:qe.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(vt-Ct),width:Pe(Ct),height:"100%"}})]},"column-edge-padding-handles"),u&&!re&&Qe.slice(0,-1).map((Le,je)=>{const ut=Qe[je+1],ft=_e.slice(0,je+1).reduce((_t,Nt)=>_t+Nt,0),bt=et[je],Mt=et[je+1],yt=Math.max(bt.paddingRight,ji),Dt=Math.max(Mt.paddingLeft,ji);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(Oe[je]-bt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(ft-yt),width:Pe(yt),height:"100%"}}),a.jsx("div",{"data-controls":ut.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Oe[je+1]-Mt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(ft),width:Pe(Dt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!re&&Qe.slice(0,-1).map((Le,je)=>{const ut=vv(je,_e,Se,Ge),bt=_e.slice(0,je+1).reduce((Mt,yt)=>Mt+yt,0)-nc/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(il),"data-controls-max-fraction":String(ut),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Pe(bt),width:Pe(nc),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),it&&(()=>{const Le=Br(e,jn),je=Zy(e.cutLabelVerticalAlign),ut=Le.textTextAlign==="justify"||re;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Pe(w??0),cursor:Ne?"pointer":"default",...Dy(Ee,f??0,n??!1)},onClick:Ne?Ae:void 0,onMouseEnter:N||se?Lt:void 0,onMouseLeave:N?Ot:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...re?{paddingLeft:Pe(X),paddingRight:Pe(X)}:{},justifyContent:Jy(Le.textTextAlign),alignItems:Jl(je)},children:a.jsx("span",{className:ec(e,jn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Ql(Le,n),...tc(e,jn,c,n),...ut?{width:"100%"}:{}},children:V})})})})(),se&&A&&(()=>{const Le=`${A.widthPx}px`,je={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:a.jsx(Hy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:je},`${A.rowId}-${A.url}`)})})()]})})]})}const $v=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10317
|
+
`}const ri=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],tl=["AColumn","BColumn","CColumn","DColumn","EColumn"],jn="cutLabel",zo=[...tl,jn],la=["A","B","C","D","E"];function nu(e){return`${e}ColumnVerticalAlign`}const us=["Top","Center","Bottom"];function nl(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return la.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Gy(e){const t=nl(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function qy(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return la.includes(n)?n:null}function iu(e,t,n){const i=qy(e);return i?i===t?!1:Gy(n[nu(i)]):!0}function Bo(e){const t=nl(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return la.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function Xy(e,t,n){if(ou(e,t,n))return Bo(e);const i=Bo(e);return i.kind==="baseline"?{kind:"top"}:i}function Uy(e){const t=Bo(e);return t.kind==="baseline"?{kind:"top"}:t}function ou(e,t,n){return iu(e,n,t)?Bo(e).kind==="baseline":!1}function Yy(e){const t={};let n=!1;for(const i of la){const o=nu(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}iu(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Ky(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Zy(e){const t=Bo(e).kind;return t==="baseline"?"center":t}function Jy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Jl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Qy(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 Pa(e,t,n,i){const o=e.titleEl;if(!o)return 0;const r=o.closest(`.${n}`);if(!r)return 0;const l=Qy(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 ev(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 tv(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const nv={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Wt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const iv={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ov(e){return[Wt(e,"textFontFamily"),Wt(e,"textFontSettings"),{type:"row",items:[Wt(e,"textFontSize"),Wt(e,"textLineHeight"),Wt(e,"textLetterSpacing"),Wt(e,"textWordSpacing")]},Wt(e,"textTextAlign"),Wt(e,"textTextAppearance"),`${e}VerticalAlign`]}function rv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(zo.map(e=>[iv[e],ov(e)]))}}function Br(e,t){const n=i=>{const o=Wt(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===jn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Ql(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 sn(Zt(n,t))}function ec(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<r?`${n} ${i}`:n}function tc(e,t,n,i){const o=Br(e,t),r=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=r?{}:{[`--${n}-title-leading-gap`]:j.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],ro=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],ao=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],so=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],av={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},sv=["hover","focus","filled","success","error"],nc=.004,ji=.004,ka=ji,il=50,Vo=1440,Go=il/Vo;function ru(e){const t=typeof e=="number"&&e>0?e:Vo;return il/t}function lv(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 Vo}const au={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function ko(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function cv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function dv(){return Object.fromEntries([...ro.map(e=>[e,0]),...ao.map(e=>[e,0])])}function uv(){return Object.fromEntries(so.map(e=>[e,0]))}function gr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:au[t]]))}function su(e,t,n){const i=e-Go,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 Fr(e,t,n){const i=ol(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 pv(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=ro[o],l=ao[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=su(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ol(e,t,n){if(e<=0)return[];const i=xn.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)+Go;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]-Go;if(p<=0)continue;const x=Math.min(c,p);d[u]-=x,c-=x}return[...d,i[e-1]]}function mv(e,t,n){if(e<=1)return{};const i=ol(e,t,n),o={};for(let r=0;r<e-1;r+=1){const l=xn[r];i[r]!==n[l]&&(o[l]=i[r])}return o}function ic(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...ri]}function gv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function hv(e,t,n,i){const o=Math.min(i,e.length,xn.length),r={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=xn[c],p=ro[c],x=ao[c],b=so[c],m=xn[l],g=ro[l],f=ao[l],v=so[l],I=n[u],y=n[p],w=n[x],V=n[b];typeof I=="number"&&(r[m]=I),typeof y=="number"&&(r[g]=y),typeof w=="number"&&(r[f]=w),typeof V=="number"&&(r[v]=V)}return r}function lu(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 fv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=ko(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...cv(n,o),...dv()};if(r)for(const d of so)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,uv());return lu(e,l)?l:e}function yv(e,t,n){const i=Yy(e);i&&(e={...e,...i});const o=ru(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=ko(e),c=ko(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:ri.length,x=w=>{if(u)return w;const V=gr({...t,...w}),z=ko(w),Y=Fr(p,z,V),M=pv(p,Y,{...t,...w});return Object.keys(M).length===0?w:{...w,...M}};if(typeof r=="number"&&r!==l)return e;const b=ic(e),m=ic(t);if(!gv(b,m))return x({...e,...hv(b,m,t,p)});if(d<c&&typeof p=="number"&&!u){const w=gr({...t,...e});return x({...e,...mv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,V=Math.max(0,(d-o)/2);return w>V?{...e,textPaddingLR:V}:e}const g=gr({...t,...e}),f=Fr(p,c,gr(t)),I=Fr(p,d,g).some((w,V)=>w<(f[V]??w)),y=xn.some(w=>{const V=e[w],z=t[w];return typeof V=="number"&&typeof z=="number"&&V!==z});return I||y?x(e):e}function vv(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(Go,i-o-r-Go)}function xv(e,t){return Math.random()*(t-e)+e}function bv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:au[t]]))}function Aa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function wv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=ro[d],u=ao[d],p=so[d];return{key:l,textPrefix:nv[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function Sv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=j.useScopedStyles(),u=!!o,{columns:p,type:x,wrapperWidth:b,entriesCount:m,cellMinHeight:g,dividerWidth:f,showVisibility:v,cut:I,showCut:y,cutCellMinHeight:w,cutLabel:V,imageSize:z,imageOnHover:Y,imagePosition:M="cursor",imageInterpolation:F="on",entryHoverEffect:K,entryHoverShowOption:T,rowPaddingTop:L,rowPaddingBottom:W,rowPaddingTopB:O,columnsOrder:C,textPaddingLR:E,textColor:_,backgroundColor:S,dividerColor:Z,textHoverColor:$,backgroundHoverColor:H,dividerHoverColor:B}=e,[le,ie]=s.useState(void 0),[k,de]=s.useState(null),G=s.useRef(null),ce=Y==="on"&&(!n||i),oe=M==="cursor",fe=oe&&F==="on",{anchorRef:Ie,onShow:xe,onCursorMove:ue,exit:U}=By(!!(ce&&k!==null),fe),se=(I??0)>0,re=x==="b",Re=s.useRef(null),Se=s.useRef(null),[ke,ye]=s.useState(null),[be,Ce]=s.useState(Vo),h=ru(be),q=Math.max(0,((b??0)-h)/2),X=Math.min(E??0,q),ee=Math.max(X,ji),ve=((b??0)+h)/2;s.useLayoutEffect(()=>{if(!n){Ce(Vo);return}const Le=()=>{Ce(lv(Re.current))};Le();const qe=Re.current;if(!qe)return;const lt=new ResizeObserver(Le);lt.observe(qe);let vt=qe;for(;vt&&!vt.style.getPropertyValue("--cntrl-article-width");)vt=vt.parentElement;return vt&<.observe(vt),()=>lt.disconnect()},[n,l]),s.useEffect(()=>{ie(void 0)},[I,y,t,m]),s.useEffect(()=>{n&&!i&&ie(void 0)},[n,i]);const D=j.buildColorVars(c,{textColor:_,backgroundColor:S,dividerColor:Z,textHoverColor:$,backgroundHoverColor:H,dividerHoverColor:B},av,sv),R=r&&r!=="default"?`${c}-state-${r}`:"",ne=`${!n||i?K==="default"?`${c}-entry-hover-default`:K==="blinds"?`${c}-entry-hover-blinds`:K==="reveal"?`${c}-entry-hover-reveal`:"":""} ${R}`.trim(),N=K==="reveal"&&(!n||i),te=(v==null?void 0:v[0])??!1,Ee=(v==null?void 0:v[1])??!1,ge=s.useRef(e),J=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,J.current=l;return}if(J.current!==l){ge.current=e,J.current=l;return}const Le=ge.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){ge.current=e;return}const lt=yv(e,Le,{designWidth:be});ge.current=e,lu(e,lt)&&d(lt)},[e,d,n,l,be]);const Ye=s.useMemo(()=>bv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Be=s.useMemo(()=>Aa(e,ro),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),it=s.useMemo(()=>Aa(e,ao),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Xe=s.useMemo(()=>Aa(e,so),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),et=s.useMemo(()=>Array.isArray(C)&&C.length>0?C:[...ri],[C]),Je=s.useMemo(()=>wv(et,p,Ye,Be,it,Xe),[et,p,Ye,Be,it,Xe]),Ge=ko(e),$e=s.useMemo(()=>xn.slice(0,p).map(Le=>Ye[Le]),[p,Ye]),He=s.useMemo(()=>ol(p,Ge,Ye),[p,Ge,Ye]),De=s.useMemo(()=>Fr(p,Ge,Ye),[p,Ge,Ye]),Qe=s.useMemo(()=>Je.map((Le,qe)=>su(De[qe]??0,Le.paddingLeft,Le.paddingRight)),[Je,De]),he=s.useMemo(()=>{const Le=m===0?1/0:m;return(t??[]).slice(0,Le).map((lt,vt)=>({id:vt,cells:Object.fromEntries(ri.map(wt=>[wt,lt[wt]??""])),image:lt.image,link:lt.link}))},[t,m]),_e=se?le??I:he.length,Ve=s.useMemo(()=>se?he.slice(0,_e):he,[he,se,_e]),tt=se&&_e<he.length,ht=Ve.length>1||tt,at=[te?`${c}-divider-top`:"",Ee||ht?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Oe=!n||i,Ae=()=>{if(!Oe)return;const Le=le??I;if(!y){ie(he.length);return}ie(Math.min(Le+y,he.length))},Pe=Le=>j.scalingValue(Le,n??!1),Ze=re?O??0:L??0,Ne=W??0,rt=g??0,ot=Math.max(Ne,ka),me=Yl(0,Ve.length,te,Ee,tt,f??0,n??!1).borderTopWidth,Fe=re?"rowPaddingTopB":"rowPaddingTop",st=Je[0],dt=Je[Je.length-1],ze=Qe[0],ut=Qe[Qe.length-1],Ct=st&&ze?Math.max(ze.paddingLeft,ji):0,Tt=dt&&ut?Math.max(ut.paddingRight,ji):0,xt=Ge,Pt=(Le,qe)=>zy(M,Re.current,oe?Le:null,qe),zt=(Le,qe)=>{if(!ce)return;const lt=Le.image;if(!(lt!=null&<.url)){U(()=>de(null));return}const vt=(z==null?void 0:z.min)??80,wt=(z==null?void 0:z.max)??320,Et=(k==null?void 0:k.rowId)===Le.id,ft=Et?k.widthPx:xv(vt,wt),{x:Bt,y:Nt}=Pt(qe,ft);if(Et&&oe){ue(Bt,Nt);return}de({rowId:Le.id,url:lt.url,objectFit:"contain",isVideo:Ny(lt),widthPx:ft}),G.current={x:Bt,y:Nt}},Xt=Le=>{if(!ce||!k||!oe)return;const{x:qe,y:lt}=Pt(Le,k.widthPx);ue(qe,lt)},Yt=()=>{k&&U(()=>de(null))},It=Le=>{N&&Xl(Le,c),!(!ce||!k)&&U(()=>de(null))},Ot=Le=>{N&&Ul(Le,c)};s.useLayoutEffect(()=>{if(!k||!G.current)return;const{x:Le,y:qe}=G.current;G.current=null,xe(Le,qe)},[k==null?void 0:k.rowId,k==null?void 0:k.url,xe]),s.useLayoutEffect(()=>{if(!u||re){ye(null);return}const Le=Se.current,qe=Le==null?void 0:Le.parentElement;if(!Le||!qe){ye(null);return}const lt=()=>{const wt=Le.querySelector("[data-list-row]");if(!wt){ye(null);return}const Et=qe.getBoundingClientRect(),ft=wt.getBoundingClientRect();ye(ft.top-Et.top+ft.height/2)};lt();const vt=new ResizeObserver(lt);return vt.observe(Le),vt.observe(qe),()=>vt.disconnect()},[u,re,Ve,Ze,Ne,rt,t,e,Je,De,be,f,te,Ee,tt]);const tn=s.useMemo(()=>!re&&tl.some(Le=>{const qe=Le.charAt(0),lt=e[`${Le}VerticalAlign`];return ou(lt,e,qe)}),[re,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Bt;const Le=Re.current;if(!Le)return;const qe=()=>{Le.querySelectorAll("[data-list-col]").forEach(Nt=>{Nt.style.transform="";const Ft=Nt.querySelector(`.${c}-list-col`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const Vt=Nt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(re||!tn){qe();return}const lt=()=>{const Nt=Array.from(Le.querySelectorAll("[data-list-row]")),Ft=`${c}-list-col`,Vt=`${c}-baseline-probe`;Nt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const jt=Dt.querySelector(`.${Ft}`);jt&&(jt.style.minHeight="",jt.style.height="");const Ht=Dt.querySelector(`.${c}-list-col-title`);Ht&&(Ht.style.transform="")})}),Nt.forEach(Gt=>{const Dt=Array.from(Gt.querySelectorAll("[data-list-col]"));ev(Gt,Dt,Ft)}),Le.offsetHeight,Nt.forEach(Gt=>{const Dt=Array.from(Gt.querySelectorAll("[data-list-col]")),jt=Gt.getBoundingClientRect().top,Ht=new Map,bt=Dt.map(We=>{const je=We.querySelector(`.${c}-list-col-title`),pt={el:We,titleEl:je,letter:We.getAttribute("data-col-letter")??"",kind:We.getAttribute("data-valign")??"top",anchor:We.getAttribute("data-valign-anchor")};return Ht.set(pt.letter,pt),pt}),A=new Map,Te=(We,je)=>{const pt=A.get(We.letter);if(pt!==void 0)return pt;const _t=We.anchor?Ht.get(We.anchor):void 0;if(We.kind!=="baseline"||!_t||je.has(We.letter)){const rn=Pa(We,jt,Ft,Vt);return A.set(We.letter,rn),rn}je.add(We.letter);const mt=Te(_t,je);je.delete(We.letter);const Lt=Pa(We,jt,Ft,Vt),qt=mt-Lt;tv(We.titleEl,qt);const kt=Pa(We,jt,Ft,Vt);return A.set(We.letter,kt),kt};bt.forEach(We=>Te(We,new Set))})};let vt=null;const wt=()=>{vt===null&&(vt=requestAnimationFrame(()=>{vt=null,lt()}))};lt();const Et=new ResizeObserver(()=>wt());Et.observe(Le);let ft=!1;return typeof document<"u"&&((Bt=document.fonts)!=null&&Bt.ready)&&document.fonts.ready.then(()=>{ft||wt()}),()=>{ft=!0,vt!==null&&(cancelAnimationFrame(vt),vt=null),Et.disconnect(),qe()}},[tn,re,e,t,be,Ve,De]);const yt=s.useMemo(()=>Vy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:yt}}),a.jsx("div",{style:D,children:a.jsxs("div",{ref:Re,className:`${c}-wrapper ${ne}${at?` ${at}`:""}${re?` ${c}-type-b`:""}`.trim(),style:{width:j.scalingValue(b??0,n)},onMouseMove:ce?Xt:void 0,onMouseLeave:ce?Yt:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[Ve.map((Le,qe)=>{var Et;const lt=(((Et=Le.link)==null?void 0:Et.length)??0)>0,vt=lt&&(!n||i)?"a":"div",wt=Yl(qe,Ve.length,te,Ee,tt,f??0,n??!1);return a.jsxs(vt,{ref:qe===0?ft=>{Se.current=ft}:void 0,className:`${c}-list-item${lt||T==="always"?` ${c}-list-item-has-link`:""}${tt&&qe===Ve.length-1?` ${c}-list-item-before-cut`:""}`,...lt?{href:Le.link,target:"_blank"}:{},style:wt,onMouseEnter:ft=>{N&&(lt||T==="always")&&Xl(ft,c),ce&&zt(Le,ft)},onMouseLeave:ft=>{N&&(lt||T==="always")&&Ul(ft,c)},children:[Ze>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(Ze)}}),a.jsxs("div",{className:`${c}-list-cols-row${re?"":` ${c}-list-cols-row-h`}${u&&qe===0&&re?` ${c}-list-cols-row-controls`:""}`,...re?{}:{"data-list-row":""},style:re?void 0:{minHeight:Pe(rt)},children:[Je.map((ft,Bt)=>{const Nt=Bt===Je.length-1,Ft=Qe[Bt],Vt=ft.paddingBottom,Gt=Oy(Le.cells[ft.key]),Dt=re&&Gt&&Vt>0,jt=re?{minHeight:Pe(rt)}:{width:Pe(De[Bt])},Ht=re?{paddingLeft:Pe(X),paddingRight:Pe(X)}:{paddingLeft:Pe(Ft.paddingLeft),paddingRight:Pe(Ft.paddingRight)},bt=ft.textPrefix.charAt(0),A=re?Uy(e[`${ft.textPrefix}VerticalAlign`]):Xy(e[`${ft.textPrefix}VerticalAlign`],e,bt),Te=re&&Gt&&u&&qe===0;return re&&!Gt?null:a.jsxs("div",{className:re?`${c}-list-col-wrap`:void 0,...re?{}:{"data-list-col":"","data-col-letter":bt,"data-valign":A.kind,...A.kind==="baseline"?{"data-valign-anchor":A.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Nt?` ${c}-list-col-last`:""}`,style:{...Ht,...jt,...re?{justifyContent:Jl(A.kind)}:{}},"data-test":ft.width,children:a.jsx("span",{className:ec(e,ft.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Ql(Br(e,ft.textPrefix),n),...tc(e,ft.textPrefix,c,n),...re?{}:Ky(A.kind)},children:Le.cells[ft.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(Vt)}}),Te&&a.jsx("div",{"data-controls":ft.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:Pe(Math.max(Vt,ka))}})]},ft.key)}),u&&qe===0&&re&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Pe(ee),height:"100%"}}),a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ve),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Pe(Math.max(ee,Ge-ee)),width:Pe(ee),height:"100%"}})]})]}),!re&&Ne>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Pe(Ne)}}),u&&qe===0&&!re&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Pe(ot)}})]},Le.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Fe,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":re?"center":"left-y",className:`${c}-control-anchor`,style:{top:me,left:0,width:"100%",height:Pe(Math.max(Ze,ka))}})},"row-padding-handles"),u&&!re&&st&&dt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[0]-((ze==null?void 0:ze.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Pe(Ct),height:"100%"}}),a.jsx("div",{"data-controls":dt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[Je.length-1]-((ut==null?void 0:ut.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(xt-Tt),width:Pe(Tt),height:"100%"}})]},"column-edge-padding-handles"),u&&!re&&Je.slice(0,-1).map((Le,qe)=>{const lt=Je[qe+1],vt=He.slice(0,qe+1).reduce((Nt,Ft)=>Nt+Ft,0),wt=Qe[qe],Et=Qe[qe+1],ft=Math.max(wt.paddingRight,ji),Bt=Math.max(Et.paddingLeft,ji);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(De[qe]-wt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(vt-ft),width:Pe(ft),height:"100%"}}),a.jsx("div",{"data-controls":lt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(De[qe+1]-Et.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":ke??void 0,className:`${c}-control-anchor`,style:{top:0,left:Pe(vt),width:Pe(Bt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!re&&Je.slice(0,-1).map((Le,qe)=>{const lt=vv(qe,He,$e,Ge),wt=He.slice(0,qe+1).reduce((Et,ft)=>Et+ft,0)-nc/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(il),"data-controls-max-fraction":String(lt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Pe(wt),width:Pe(nc),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),tt&&(()=>{const Le=Br(e,jn),qe=Zy(e.cutLabelVerticalAlign),lt=Le.textTextAlign==="justify"||re;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Pe(w??0),cursor:Oe?"pointer":"default",...Dy(Ee,f??0,n??!1)},onClick:Oe?Ae:void 0,onMouseEnter:N||ce?It:void 0,onMouseLeave:N?Ot:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...re?{paddingLeft:Pe(X),paddingRight:Pe(X)}:{},justifyContent:Jy(Le.textTextAlign),alignItems:Jl(qe)},children:a.jsx("span",{className:ec(e,jn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Ql(Le,n),...tc(e,jn,c,n),...lt?{width:"100%"}:{}},children:V})})})})(),ce&&k&&(()=>{const Le=`${k.widthPx}px`,qe={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return a.jsx("div",{ref:Ie,className:`${c}-hover-media-anchor`,children:a.jsx(Hy,{media:k,className:k.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:qe},`${k.rowId}-${k.url}`)})})()]})})]})}const $v=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10318
10318
|
import { CommonComponentProps } from '../props';
|
|
10319
10319
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10320
10320
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13402,7 +13402,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13402
13402
|
</>
|
|
13403
13403
|
);
|
|
13404
13404
|
}
|
|
13405
|
-
`,vo=["A","B","C","D","E"],oc=[...ps,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Cv(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Tv(){return Object.fromEntries(vo.map((e,t)=>{const n=ai[t],i=`${e} column`;return[n,Cv(i)]}))}function Lv(){const e={};for(const t of vo)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function rc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ai]};for(const r of vo)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 Rv(e){const t={};if(e===jn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ps]},enum:[...ps]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...oc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...oc]}}return t[Wt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Wt(e,"textFontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Wt(e,"textFontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"textLineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"textLetterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"textWordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textTextAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textTextAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Iv=zo.reduce((e,t)=>({...e,...Rv(t)}),{});function Ev(e){return{verticalAlign:e===jn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===jn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Mv(e,t={}){var n;return{...Ev(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const ac=new Set(["textFontFamily","textFontSettings"]);function Pv(e,t,n){const i=r=>n===void 0?!0:n==="common"?ac.has(r):!ac.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Wt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Wt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Wt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Wt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Wt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Wt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Wt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Wt(e,"textTextAppearance")]=t.textTextAppearance),o}function Wr(e={},t){return zo.reduce((n,i)=>({...n,...Pv(i,Mv(i,e),t)}),{})}const kv=Wr(),Av=rv();function cu(e){return[Wt(e,"textFontFamily"),Wt(e,"textFontSettings"),Wt(e,"textFontSize"),Wt(e,"textLineHeight"),Wt(e,"textLetterSpacing"),Wt(e,"textWordSpacing"),Wt(e,"textTextAlign"),Wt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Fv(){const e=[];return tl.forEach((t,n)=>{const i=ai[n],o=cu(t);for(let r=1;r<ai.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 Wv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];cu(jn);const _v=[...vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],yi=[{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"}],Nv=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:yi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:yi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:yi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:yi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:yi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:yi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:yi[6],link:""}],Hv=[...vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Ov={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:{...Tv(),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:Nv},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"}},...Lv(),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"}},...Iv,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",...kv,...Wr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:rc({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},...Wr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:rc({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},...Wr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Fv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},..._v.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}},...vo.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",...Hv]},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__",Av]}],paletteBookmark:{items:[...Wv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Dv={element:Sv,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>fv(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:[...zo.map(e=>({path:`${Wt(e,"textFontFamily")}`}))]},fontRelations:{...zo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Wt(t,"textFontFamily")}`}),{})},schema:Ov,sourceCode:$v},sc=300,Xn=.004,jv={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"},zv=["hover","focus","filled","success","error"];function Bv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function lc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function cc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:j.scalingValue((o-t)/2,i)}}function Vv(e){return`
|
|
13405
|
+
`,vo=["A","B","C","D","E"],oc=[...us,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],hi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Cv(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function hr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Tv(){return Object.fromEntries(vo.map((e,t)=>{const n=ri[t],i=`${e} column`;return[n,Cv(i)]}))}function Lv(){const e={};for(const t of vo)e[`${t}ColumnWidth`]=hr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=hr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=hr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=hr(`${t} column padding bottom`);return e}function rc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...ri]};for(const r of vo)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 Rv(e){const t={};if(e===jn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...us]},enum:[...us]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...oc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...oc]}}return t[Wt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Wt(e,"textFontSettings")]={...hi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Wt(e,"textFontSize")]={...hi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Wt(e,"textLineHeight")]={...hi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Wt(e,"textLetterSpacing")]={...hi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Wt(e,"textWordSpacing")]={...hi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Wt(e,"textTextAlign")]={...hi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Wt(e,"textTextAppearance")]={...hi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Iv=zo.reduce((e,t)=>({...e,...Rv(t)}),{});function Ev(e){return{verticalAlign:e===jn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===jn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Mv(e,t={}){var n;return{...Ev(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const ac=new Set(["textFontFamily","textFontSettings"]);function Pv(e,t,n){const i=r=>n===void 0?!0:n==="common"?ac.has(r):!ac.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=nl(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Wt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Wt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Wt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Wt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Wt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Wt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Wt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Wt(e,"textTextAppearance")]=t.textTextAppearance),o}function Wr(e={},t){return zo.reduce((n,i)=>({...n,...Pv(i,Mv(i,e),t)}),{})}const kv=Wr(),Av=rv();function cu(e){return[Wt(e,"textFontFamily"),Wt(e,"textFontSettings"),Wt(e,"textFontSize"),Wt(e,"textLineHeight"),Wt(e,"textLetterSpacing"),Wt(e,"textWordSpacing"),Wt(e,"textTextAlign"),Wt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Fv(){const e=[];return tl.forEach((t,n)=>{const i=ri[n],o=cu(t);for(let r=1;r<ri.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 Wv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];cu(jn);const _v=[...vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],fi=[{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"}],Nv=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:fi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:fi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:fi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:fi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:fi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:fi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:fi[6],link:""}],Hv=[...vo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Ov={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:{...Tv(),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:Nv},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"}},...Lv(),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"}},...Iv,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",...kv,...Wr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:rc({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},...Wr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:rc({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},...Wr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Fv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},..._v.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}},...vo.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",...Hv]},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__",Av]}],paletteBookmark:{items:[...Wv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Dv={element:Sv,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>fv(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:[...zo.map(e=>({path:`${Wt(e,"textFontFamily")}`}))]},fontRelations:{...zo.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Wt(t,"textFontFamily")}`}),{})},schema:Ov,sourceCode:$v},sc=300,Xn=.004,jv={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"},zv=["hover","focus","filled","success","error"];function Bv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function lc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function cc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:j.scalingValue((o-t)/2,i)}}function Vv(e){return`
|
|
13406
13406
|
.${e}-wrapper {
|
|
13407
13407
|
box-sizing: border-box;
|
|
13408
13408
|
display: flex;
|
|
@@ -13567,7 +13567,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13567
13567
|
pointer-events: none;
|
|
13568
13568
|
z-index: 2;
|
|
13569
13569
|
}
|
|
13570
|
-
`}function dc(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 Gv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=j.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:b="default",autoclose:m="off",icon:g,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:I="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:V="#0000001F",iconColor:z="#000000",questionHoverColor:Y="#666666",iconHoverColor:M="#666666",iconActiveColor:F="#000000",dividerHoverColor:K="#000000",questionFontFamily:T,questionFontSettings:L,questionFontSize:W,questionLineHeight:O,questionLetterSpacing:C,questionWordSpacing:E,questionTextAppearance:_,answerFontFamily:S,answerFontSettings:Z,answerFontSize:$,answerLineHeight:H,answerLetterSpacing:B,answerWordSpacing:
|
|
13570
|
+
`}function dc(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 Gv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=j.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:x="solid",entryHoverEffect:b="default",autoclose:m="off",icon:g,iconMaxWidth:f=.00833,iconPaddingRight:v=0,iconAnimation:I="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:V="#0000001F",iconColor:z="#000000",questionHoverColor:Y="#666666",iconHoverColor:M="#666666",iconActiveColor:F="#000000",dividerHoverColor:K="#000000",questionFontFamily:T,questionFontSettings:L,questionFontSize:W,questionLineHeight:O,questionLetterSpacing:C,questionWordSpacing:E,questionTextAppearance:_,answerFontFamily:S,answerFontSettings:Z,answerFontSize:$,answerLineHeight:H,answerLetterSpacing:B,answerWordSpacing:le,answerTextAppearance:ie,questionPaddingLeft:k=0,questionPaddingTop:de=0,questionPaddingBottom:G=0,answerPaddingLeft:ce=0,answerPaddingRight:oe=0,answerPaddingTop:fe=0,answerPaddingBottom:Ie=0}=e,xe=t??[],[ue,U]=s.useState(()=>new Set),se=!n||i;s.useEffect(()=>{U(new Set)},[m]),s.useEffect(()=>{n&&!o&&!i&&U(new Set)},[n,o,i]);const re=Qe=>j.scalingValue(Qe,n??!1),Re=Math.max(k,Xn),Se=Math.max(de,Xn),ke=Math.max(G,Xn),ye=Math.max(ce,Xn),be=Math.max(oe,Xn),Ce=Math.max(fe,Xn),h=Math.max(Ie,Xn),q=Math.max(0,(c??1)-v-f),X=Math.max(0,(c??1)-oe),ee=Math.max(0,(c??1)-ce),ve=Math.max(v,Xn),D=Math.max(0,(c??1)-k-f),R=s.useMemo(()=>ue.size===0?0:Math.min(...ue),[ue]),Q=s.useCallback(Qe=>ue.has(Qe),[ue]),ne=se&&b==="default"?`${l}-entry-hover-default`:"",N=g??"",te=N!=="",Ee=I.replace(/^rotate /,""),ge=`${l}-icon-anim-${Ee}`,J=sn(Zt(dc(T,L,W,O,C,E,_,y),n)),Ye=sn(Zt(dc(S,Z,$,H,B,le,ie,w),n)),Be=lc(W,O,`${l}-question`,`${l}-text-tight-leading`),it=lc($,H,`${l}-answer-text`,`${l}-text-tight-leading`),Xe=cc(W,O,l,n),et=cc($,H,l,n),Je=j.buildColorVars(l,{questionColor:y,answerColor:w,dividerColor:V,iconColor:z,questionHoverColor:Y,iconHoverColor:M,iconActiveColor:F,dividerHoverColor:K},jv,zv),Ge=r&&r!=="default"?`${l}-state-${r}`:"",$e=s.useCallback(Qe=>{se&&U(he=>{if(he.has(Qe)){const Ve=new Set(he);return Ve.delete(Qe),Ve}if(m==="on")return new Set([Qe]);const _e=new Set(he);return _e.add(Qe),_e})},[se,m]),He=s.useMemo(()=>Vv(l),[l]),De={[`--${l}-divider-width`]:j.scalingValue(p,n??!1),[`--${l}-divider-style`]:x,[`--${l}-icon-max-width`]:j.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:j.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:He}}),a.jsx("div",{style:Je,children:a.jsx("div",{className:$t(`${l}-wrapper`,n&&!i&&`${l}-editor`,ne,Ge),style:{width:j.scalingValue(c,n??!1),maxWidth:"100%",...De},children:xe.map((Qe,he)=>{var Oe;const _e=Q(he),Ve=((Oe=Qe.question)==null?void 0:Oe.trim())??"",tt=Qe.answer,ht=((tt==null?void 0:tt.length)??0)>0,at=d&&he===R;return a.jsxs("div",{className:$t(`${l}-item`,_e&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[at&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:re(Se)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(q),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(Re),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(D),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:re(ve),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":_e,style:{...J,...Xe,paddingLeft:re(k),paddingRight:re(v)},onClick:()=>$e(he),children:[de>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(de)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:Be,children:Ve}),ht&&(te?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ge}`,"aria-hidden":"true",children:a.jsx(ln,{url:N,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):a.jsx("span",{className:`${l}-icon ${l}-icon-default ${ge}`,"aria-hidden":"true"}))]}),G>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:re(G)},"aria-hidden":"true"})]}),at&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:re(ke)}})]}),ht&&tt&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!_e,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[at&&_e&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:re(Ce)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(X),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:re(ye),height:"100%"}}),a.jsx("div",{"data-controls":"answerPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ee),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:re(be),height:"100%"}})]}),fe>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(fe)}}),a.jsx("div",{className:`${l}-answer`,style:{...Ye,...et,paddingLeft:re(ce),paddingRight:re(oe)},children:a.jsx("div",{className:it,children:a.jsx(Ii,{content:tt})})}),Ie>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:re(Ie)}}),at&&_e&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:re(h)}})]})})})]},he)})})})]})}const qv=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13571
13571
|
import cn from 'classnames';
|
|
13572
13572
|
import { CommonComponentProps } from '../props';
|
|
13573
13573
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14315,7 +14315,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14315
14315
|
</>
|
|
14316
14316
|
);
|
|
14317
14317
|
}
|
|
14318
|
-
`;function Un(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const uc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Uv={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:Un("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...uc.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...uc.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Un("Question Padding Left"),questionPaddingTop:Un("Question Padding Top"),questionPaddingBottom:Un("Question Padding Bottom"),answerPaddingLeft:Un("Answer Padding Left"),answerPaddingRight:Un("Answer Padding Right"),answerPaddingTop:Un("Answer Padding Top"),answerPaddingBottom:Un("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:[...Xv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Yv={element:Gv,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:Uv,sourceCode:qv},zn=e=>e.display==="cover",da=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},pc=100,Kv=.2,mc=8,du=({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"?pc:Math.max(pc,window.innerHeight*Kv),[]),x=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),b=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${W})`},[]),g=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),v=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;d(!0),r(T),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),I=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(c.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),y=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const W=T.clientX-L.startX,O=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(W)<mc&&Math.abs(O)<mc)return;if(O>0&&O>Math.abs(W))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;T.preventDefault();const C=Math.max(0,O);u.current=C,r(C)},[e,g]),w=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const W=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!W){g();return}T.clientY-L.startY>=p?v():f()},[p,v,e,g,f]),V=s.useCallback(T=>{w(T)},[w]),z=s.useCallback(T=>{w(T)},[w]),Y=o>0,M=l?`transform ${n}ms ease`:"none",F=l?`opacity ${n}ms ease`:"none",K=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:x(o),transition:F},mediaAreaStyle:{transform:m(o),transition:M,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:K?{opacity:b(o),transition:F}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:y,onPointerUp:V,onPointerCancel:z}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Zv="[data-lightbox-scrollable]",uu=()=>{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(Zv)||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"})}},[])},Jv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Qv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},e0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},t0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,f)=>{Qv(t),e.scrollLeft=g,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const b=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,b(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,x=window.setTimeout(()=>{p||(p=!0,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-e0(t),!1))}},Ao=300,n0=900,i0=1500,o0="cubic-bezier(0.16, 1, 0.3, 1)",r0=3e3,a0=2,s0=16,l0=.05,c0=1,fr=.3,d0=50,u0=20,Fi=.004,lo=["title1","title2","title3"],p0={title1:"1",title2:"2",title3:"3"},m0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},g0={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${u0}px)`,h0=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]}},f0=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=h0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Xt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,y0=e=>[Xt(e,"fontFamily"),Xt(e,"fontSettings"),{type:"row",items:[Xt(e,"fontSize"),Xt(e,"lineHeight"),Xt(e,"letterSpacing"),Xt(e,"wordSpacing")]},Xt(e,"textAlign"),Xt(e,"textAppearance")],v0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(lo.map(e=>[p0[e],y0(e)]))}),rl=(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},pu=(e,t)=>rl(e,t),vr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},gc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:rl(e.length,n),effective:pu(e.length,n)}},x0=(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},Wa=(e,t)=>{const n=i=>{const o=Xt(t,i);return e[o]};return{fontFamily:n("fontFamily")??"Arial",fontSettings:n("fontSettings")??{fontWeight:400,fontStyle:"normal"},fontSize:n("fontSize"),lineHeight:n("lineHeight"),letterSpacing:n("letterSpacing")??0,wordSpacing:n("wordSpacing")??0,textAlign:n("textAlign")??"left",textAppearance:n("textAppearance"),color:e[m0[t]]}},b0=(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),_a=(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??g0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Zt(i,n)},w0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:b,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:I,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:V,title1Width:z,title2Width:Y,title3Width:M,title1MarginLeft:F=0,title2MarginLeft:K=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:W="desktop",contentMarginTop:O,iconMarginLeft:C}=n,E=k=>j.scalingValue(k,i??!1),_=c??n.thumnailSize??.03,S=E(_),Z=E(u),$=E(p??.02),H=E(x??0),B=E(O??0),ce=yr(B),ie=E(C??0),[A,de]=s.useState(0),G=s.useRef(A);G.current=A;const se=t[A],{title1:oe,title2:he,title3:Ie}=f0(se),ve=_a("title1",Wa(n,"title1"),i),ue=_a("title2",Wa(n,"title2"),i),U=_a("title3",Wa(n,"title3"),i),le=W==="mobile",re=!o&&(!i||r),Re=re,we=re,ke=re,fe=zn(y),xe=fe?{"--image-aspect-ratio":da(y)}:void 0,Ce=!!(oe||he||Ie),h=s.useMemo(()=>x0(e,oe,he,Ie,ve,ue,U),[e,A,oe,he,Ie,ve,ue,U]),q=s.useMemo(()=>({title1Width:z,title2Width:Y,title3Width:M}),[z,Y,M]),X=s.useMemo(()=>h.map(k=>q[k.widthKey]),[h,q]),ee=s.useMemo(()=>rl(h.length,X),[h.length,X]),ye=s.useMemo(()=>pu(h.length,X),[h.length,X]),D=s.useMemo(()=>h.filter(k=>k.prefix==="title1"),[h]),R=s.useMemo(()=>h.filter(k=>k.prefix==="title2"||k.prefix==="title3"),[h]),Q=s.useMemo(()=>gc(D,q),[D,q]),ne=s.useMemo(()=>gc(R,q),[R,q]),N=s.useCallback((k,ae)=>{const pe=h.indexOf(k);if(!le||ae==="single-row")return{effectiveWidth:ye[pe]??0,resolvedWidth:ee[pe]??0,maxWidth:vr(pe,ee)};if(ae==="two-row-top"){const Ye=D.indexOf(k);return{effectiveWidth:Q.effective[Ye]??0,resolvedWidth:Q.resolved[Ye]??0,maxWidth:vr(Ye,Q.resolved)}}const Me=R.indexOf(k);return{effectiveWidth:ne.effective[Me]??0,resolvedWidth:ne.resolved[Me]??0,maxWidth:vr(Me,ne.resolved)}},[R,ne,ye,ee,h,D,Q,le]),te=s.useCallback(k=>j.scalingValue(k,i??!1),[i]),Ee=te(L??0),me=s.useMemo(()=>({title1MarginLeft:F,title2MarginLeft:K,title3MarginLeft:T}),[F,K,T]),J=s.useCallback(k=>h.slice(0,k+1).reduce((ae,pe,Me)=>ae+(pe!=null&&pe.marginLeftKey?me[pe.marginLeftKey]??0:0)+(ee[Me]??0),0)+(le?0:F??0),[h,me,ee,le,F]),Ke=s.useCallback(()=>le?0:F??0,[le,F]),Be=s.useCallback(k=>R.slice(0,k).reduce((ae,pe,Me)=>ae+(pe.marginLeftKey?me[pe.marginLeftKey]??0:0)+(ne.resolved[Me]??0),0),[R,ne.resolved,me]),rt=s.useCallback(k=>{const ae=R[k];return Be(k)+(ae.marginLeftKey?me[ae.marginLeftKey]??0:0)+(ne.resolved[k]??0)},[R,ne.resolved,Be,me]),Xe=(k,ae)=>{const pe=k.marginLeftKey?me[k.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:Ye,maxWidth:dt}=N(k,ae),Rt=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":k.prefix,style:{...ae==="single-row"?{gridArea:k.prefix}:{},width:te(Me),...pe>0?{marginLeft:te(pe)}:{}},children:[a.jsx("p",{className:k.className,style:k.style,children:k.text}),Rt&&k.marginLeftKey&&a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:te(-pe),width:`max(${te(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(dt),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:te(-Fi/2),width:te(Fi),height:"100%",pointerEvents:"auto"}})]},k.className)},nt=()=>{const k=le?-1:h.findIndex(Me=>Me.prefix==="title1"),ae=!le&&(o||(F??0)>0)?(()=>{const Me=F??0,Ye=k>=0?ee[k]:z??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:0,width:`max(${te(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,pe=h.flatMap((Me,Ye)=>{if(!Me.marginLeftKey)return[];const dt=me[Me.marginLeftKey]??0,Rt=b0(h,ee,me,Ye)+Ke();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee[Ye]),style:{position:"absolute",top:0,left:te(Rt),width:`max(${te(dt)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return ae?[ae,...pe]:pe},Qe=()=>h.map((k,ae)=>{const pe=vr(ae,ee),Ye=J(ae)-Fi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ye),width:te(Fi),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),Ge=()=>R.flatMap((k,ae)=>{if(!k.marginLeftKey)return[];const pe=me[k.marginLeftKey]??0,Me=Be(ae),{resolvedWidth:Ye}=N(k,"two-row-bottom");return a.jsx("div",{"data-controls":k.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ye),style:{position:"absolute",top:0,left:te(Me),width:`max(${te(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},k.marginLeftKey)}),Se=()=>R.map((k,ae)=>{const{maxWidth:pe}=N(k,"two-row-bottom"),Ye=rt(ae)-Fi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":k.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ye),width:te(Fi),height:"100%",pointerEvents:"auto"}})},`${k.widthKey}-junction`)}),_e=s.useRef(null),Oe=s.useRef(null),et=s.useRef(null),ge=s.useRef(null),We=s.useRef([]),Ve=s.useRef([]),it=s.useRef(0),ht=s.useRef(null),ct=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Ne=s.useRef(null),Ae=s.useRef(null),Pe=s.useRef(0),Je=s.useRef("forward"),He=s.useRef(0),tt=s.useRef(null),at=s.useRef(!1),st=t.length>1&&(!o||!!r),$e=st?3:1,De=s.useMemo(()=>Array.from({length:$e},()=>t).flat(),[t,$e]),[lt,Ue]=s.useState(!1),[qe,$t]=s.useState(!1),[Ct,vt]=s.useState(!0),Pt=s.useRef(null),Ht=s.useRef(null),Yt=s.useRef(!1),Kt=s.useRef(!1),Lt=s.useRef(null),Ot=s.useRef(null),tn=Re&&!Ct,xt=s.useCallback(()=>{Re&&(vt(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{ct.current.isActive||vt(!1)},r0))},[Re]),Le=s.useCallback(()=>{o||Kt.current||(Kt.current=!0,$t(!1),Lt.current=setTimeout(()=>{l()},Ao))},[o,l]),je=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":tn?"true":"false",style:{width:j.scalingValue(m??0,i),height:j.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(ln,{url:b,fill:g,hoverFill:i&&!r?g:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),ut=(k="two-row")=>a.jsx("div",{...k==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:te(F??0),flexShrink:0,...k==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...k==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ft=()=>{const k=h.find(Me=>Me.prefix==="title1"),ae=h.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),pe=ae.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(F??0)>0||o?ut():null,k&&Xe(k,"two-row-top"),b&&je()]}),pe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Me=>Xe(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),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:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},bt=()=>a.jsxs(a.Fragment,{children:[(F??0)>0||o?ut("single-row"):null,h.map(k=>Xe(k,"single-row")),o?a.jsxs(a.Fragment,{children:[nt(),Qe()]}):null,b?je():null]}),Mt=s.useCallback(k=>!!(k.closest("[data-controls]")||k.closest(`.${e}-thumbnails`)||k.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:yt,backdropStyle:Dt,mediaAreaStyle:_t,overlayContentStyle:Nt,swipeHandlers:Vt,dismissAreaStyle:Gt}=du({enabled:re??!1,onClose:Le,animMs:Ao,isBlockedTarget:Mt}),zt=()=>{if(!st||t.length===0)return it.current=0,0;const k=Ve.current[0],ae=Ve.current[t.length];if(!k||!ae)return it.current;const pe=ae.offsetLeft-k.offsetLeft;return pe>0&&(it.current=pe),it.current},Bt=(k=!1)=>{if(!st)return;const ae=Oe.current,pe=zt();!ae||pe<=0||pe<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=pe,k&&(ct.current.scrollLeft+=pe),at.current&&(He.current+=pe)):ae.scrollLeft>=pe*2&&(ae.scrollLeft-=pe,k&&(ct.current.scrollLeft-=pe),at.current&&(He.current-=pe)))},jt=(k,ae=(pe=>(pe=Oe.current)==null?void 0:pe.scrollLeft)()??0)=>{if(!st)return k;let Me=t.length+k,Ye=1/0;for(let dt=0;dt<$e;dt++){const Rt=dt*t.length+k,Ft=Ve.current[Rt];if(!Ft)continue;const nn=Math.abs(Ft.offsetLeft-ae);nn<Ye&&(Ye=nn,Me=Rt)}return Me},It=k=>{const ae=Oe.current;return!k||!ae?!1:k.offsetWidth>ae.clientWidth+1},P=k=>{const ae=Oe.current;if(!k||!ae||!It(k))return!1;const pe=k.offsetLeft,Me=pe+k.offsetWidth;return ae.scrollLeft>=pe-1&&ae.scrollLeft+ae.clientWidth<=Me+1},Te=(k=(ae=>(ae=Oe.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Me=0;Me<Ve.current.length;Me+=1){const Ye=Ve.current[Me];if(Ye&&P(Ye))return Me}let pe={flatIndex:0,distance:1/0};return Ve.current.forEach((Me,Ye)=>{if(!Me)return;const dt=Math.abs(Me.offsetLeft-k);dt<pe.distance&&(pe={flatIndex:Ye,distance:dt})}),pe.flatIndex},Fe=k=>{Oe.current&&Ve.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=It(ae)&&k==="backward"?"end":"start")})},ze=(k,ae,pe)=>{const Me=k-ae,Ye=Te(ae),dt=Ve.current[Ye];if(P(dt))return Te(k)%t.length;const Rt=Ve.current[Ye+1],Ft=dt?Rt?Rt.offsetLeft-dt.offsetLeft:dt.offsetWidth:0,nn=Ft>0?Me>Ft*fr?1:Me<-Ft*fr?-1:0:0;return nn===0?pe:st?(pe+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,pe+nn))},pt=s.useCallback((k=!1)=>{if(I!=="on"||o)return;const ae=ge.current,pe=G.current,Me=We.current[pe];if(!ae||!Me||ae.scrollWidth<=ae.clientWidth)return;const Ye=ae.scrollLeft,dt=Ye+ae.clientWidth,Rt=Me.offsetLeft,Ft=Rt+Me.offsetWidth;if(Rt>=Ye&&Ft<=dt)return;const nn=ae.scrollWidth-ae.clientWidth;let Qt=Ye;if(!k&&Pt.current===null){const Pi=We.current[pe-1],bo=We.current[pe+1],ar=Pi?Me.offsetLeft-Pi.offsetLeft:bo?bo.offsetLeft-Me.offsetLeft:Me.offsetWidth;Ft>dt?Qt+=ar:Rt<Ye&&(Qt-=ar)}else Ft>dt?Qt=Ft-ae.clientWidth:Qt=Rt;ae.scrollLeft=Math.max(0,Math.min(nn,Qt))},[o,I]),kt=s.useCallback((k=!1)=>{k&&(Yt.current=!0),Ht.current===null&&(Ht.current=requestAnimationFrame(()=>{Ht.current=null;const ae=Yt.current;Yt.current=!1,pt(ae)}))},[pt]),mt=s.useCallback(k=>{if(k===G.current)return;const ae=G.current;G.current=k;const pe=Math.abs(k-ae)>1,Me=st&&t.length>1&&(ae===t.length-1&&k===0||ae===0&&k===t.length-1);de(k),kt(pe||Me)},[t.length,st,kt]),Tt=()=>{if(!Oe.current||t.length===0||Pt.current!==null||ct.current.isActive&&ct.current.hasMoved)return;const k=Oe.current.scrollLeft,ae=Te(k)%t.length;ae!==G.current&&mt(ae)},qt=()=>{Pt.current=null},At=k=>{const ae=Oe.current;ae&&(ae.style.scrollSnapType=k?"":"none")},rn=()=>{var k;(k=Ae.current)==null||k.call(Ae),Ae.current=null},pn=()=>{tt.current!==null&&(cancelAnimationFrame(tt.current),tt.current=null),at.current=!1},ui=()=>{const k=Oe.current;if(!k){tt.current=null,at.current=!1;return}const ae=He.current-k.scrollLeft;if(Math.abs(ae)<.5){k.scrollLeft=He.current,Bt(),Tt(),tt.current=null,at.current=!1;return}k.scrollLeft+=ae*l0,Bt(),Tt(),xt(),tt.current=requestAnimationFrame(ui)},pi=()=>{const k=et.current;k&&(k.style.transition="",k.style.transform="",k.style.willChange="")},nr=(k,ae,pe,Me)=>{pi(),k.scrollLeft=ae,Pe.current=k.scrollLeft,Bt(),pe!==void 0?(G.current=pe,de(pe)):Tt(),At(!0),Me==null||Me()},ir=(k,{behavior:ae="smooth",activeIndex:pe,onComplete:Me}={})=>{const Ye=Oe.current,dt=et.current;if(!Ye||!dt)return;if(pn(),rn(),At(!1),ae==="auto"){nr(Ye,k,pe,Me);return}const Rt=Math.abs(k-Ye.scrollLeft),Ft=Jv(Rt,n0,i0,Ye.clientWidth*.55);Ae.current=t0(Ye,dt,k,{duration:Ft,easing:o0,onComplete:()=>{Ae.current=null,nr(Ye,k,pe,Me)}})},pa=(k="smooth")=>{const ae=Oe.current;if(!ae||t.length===0)return;const pe=Te()%t.length,Me=jt(pe,ae.scrollLeft),Ye=Ve.current[Me];Ye&&ir(Ye.offsetLeft,{behavior:k,activeIndex:pe})},ma=(k,ae="smooth",pe,Me)=>{const Ye=Oe.current;if(!Ye||t.length===0)return;const dt=(Me??Ye.scrollLeft)-k,Rt=Te(k),Ft=Ve.current[Rt];if(P(Ft)){At(!0),Tt();return}const nn=Ve.current[Rt+1],Qt=Ft?nn?nn.offsetLeft-Ft.offsetLeft:Ft.offsetWidth:0;if((Qt>0?dt>Qt*fr?1:dt<-Qt*fr?-1:0:0)!==0){const Du=pe??Rt%t.length,ju=ze(Me??Ye.scrollLeft,k,Du);Tn(ju,ae);return}const bo=Me??Ye.scrollLeft,ar=Te(bo),cl=Ve.current[ar];if(cl&&Math.abs(cl.offsetLeft-bo)<1){At(!0),Tt();return}pa("auto")},Tn=(k,ae="smooth")=>{const pe=Oe.current;if(!pe||t.length===0)return;const Me=jt(k,pe.scrollLeft),Ye=Ve.current[Me];Ye&&(ae==="smooth"?Pt.current=k:Pt.current=null,G.current=k,de(k),kt(!0),ir(Ye.offsetLeft,{behavior:ae,activeIndex:k,onComplete:ae==="smooth"?qt:void 0}))},Mi=()=>{Ne.current&&(window.removeEventListener("pointerup",Ne.current),window.removeEventListener("pointercancel",Ne.current),Ne.current=null)},or=(k,ae,pe,Me,Ye)=>{const dt=pe-k,Rt=Me-ae,Ft=Math.abs(dt),nn=Math.abs(Rt);if(Ft<d0||Ft<=nn)return!1;const Qt=dt<0?1:-1,Pi=st?(Ye+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ye+Qt));return Pi===Ye?!1:(Tn(Pi),!0)},mi=k=>{if(!ct.current.isActive)return;Mi();const ae=Oe.current;if(!ae)return;const{scrollLeft:pe,startActiveIndex:Me,hasMoved:Ye}=ct.current,dt=ae.scrollLeft;Bt(!0),ct.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},Ue(!1),k!==void 0&&ae.hasPointerCapture(k)&&ae.releasePointerCapture(k),Ye?ma(pe,"smooth",Me,dt):(At(!0),Tt()),xt()},rr=(k,ae)=>{const pe=ht.current;ht.current=null,pe&&(or(pe.startX,pe.startY,k,ae,pe.startActiveIndex),xt())},ga=k=>{if(!we)return;if(k.pointerType==="touch"){if(pn(),At(!0),Mt(k.target))return;ht.current={startX:k.clientX,startY:k.clientY,startActiveIndex:G.current};return}if(k.pointerType!=="mouse"||k.button!==0||Mt(k.target))return;const ae=Oe.current;if(!ae)return;pn(),rn(),pi(),Pt.current=null,ct.current={isActive:!0,startX:k.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:G.current,hasMoved:!1},At(!1),xt(),ae.setPointerCapture(k.pointerId),Mi();const pe=Me=>{Me.pointerType==="mouse"&&mi(Me.pointerId)};Ne.current=pe,window.addEventListener("pointerup",pe),window.addEventListener("pointercancel",pe)},ha=k=>{if(!we||k.pointerType!=="mouse")return;const ae=Oe.current;if(!ae||!ct.current.isActive)return;if(k.buttons===0){mi(k.pointerId);return}const pe=k.clientX-ct.current.startX;Math.abs(pe)>c0&&(ct.current.hasMoved=!0,Ue(!0)),ct.current.hasMoved&&(k.preventDefault(),ae.scrollLeft=ct.current.scrollLeft-pe,Bt(!0),Tt(),xt())},be=k=>{if(we){if(k.pointerType==="touch"){k.type==="pointerup"?rr(k.clientX,k.clientY):ht.current=null;return}k.pointerType==="mouse"&&mi(k.pointerId)}},Ze=k=>{!we||k.pointerType!=="mouse"||mi(k.pointerId)};return uu(),s.useEffect(()=>{const k=requestAnimationFrame(()=>$t(!0));return()=>{cancelAnimationFrame(k),rn(),Mi(),Ht.current!==null&&(cancelAnimationFrame(Ht.current),Ht.current=null),Lt.current&&clearTimeout(Lt.current),Ot.current&&clearTimeout(Ot.current)}},[]),s.useEffect(()=>{if(!Re){vt(!0);return}xt();const k=()=>xt();return document.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerdown",k,{passive:!0}),()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerdown",k),Ot.current&&clearTimeout(Ot.current)}},[Re,xt]),s.useEffect(()=>{const k=ae=>{ae.key==="Escape"&&Le()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[Le]),s.useLayoutEffect(()=>{zt()},[H,t.length,st]),s.useLayoutEffect(()=>{o||Tn(G.current,"auto")},[H,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,st]),s.useEffect(()=>{const k=Oe.current;if(!k||o||!re)return;const ae=pe=>{if(pe.preventDefault(),Math.abs(pe.deltaY)<=Math.abs(pe.deltaX))return;const Me=pe.deltaMode===1?s0:pe.deltaMode===2?k.clientHeight:1,Ye=pe.deltaY*Me*a0;if(Ye!==0){if(rn(),at.current||(at.current=!0,He.current=k.scrollLeft,Pt.current=null,At(!1)),He.current+=Ye,!st){const dt=k.scrollWidth-k.clientWidth;He.current=Math.max(0,Math.min(dt,He.current))}xt(),tt.current===null&&(tt.current=requestAnimationFrame(ui))}};return k.addEventListener("wheel",ae,{passive:!1}),()=>{k.removeEventListener("wheel",ae),pn()}},[o,re,st]),s.useEffect(()=>{const k=Oe.current;if(!k)return;const ae=()=>{Bt(ct.current.isActive);const Me=k.scrollLeft,Ye=Me-Pe.current;Pe.current=Me;const dt=it.current>0?it.current*.5:1/0;if(Ye!==0&&Math.abs(Ye)<dt){const Rt=Ye>0?"forward":"backward";Rt!==Je.current&&(Je.current=Rt,Fe(Rt))}ct.current.isActive&&ct.current.hasMoved||Tt()};k.addEventListener("scroll",ae,{passive:!0});const pe=new ResizeObserver(()=>{zt(),Bt(ct.current.isActive),Fe(Je.current),Tt()});return pe.observe(k),()=>{rn(),k.removeEventListener("scroll",ae),pe.disconnect()}},[t.length,st]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{yt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:qe?1:0,transition:`opacity ${Ao}ms ease`,pointerEvents:qe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Dt}}),a.jsxs("div",{ref:_e,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:k=>k.stopPropagation(),children:a.jsx("div",{ref:Oe,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":we&&t.length>0?"true":"false","data-mouse-dragging":lt?"true":"false",onPointerDown:ga,onPointerMove:ha,onPointerUp:be,onPointerCancel:be,onLostPointerCapture:Ze,children:a.jsx("div",{ref:et,className:`${e}-lightbox-strip-track`,style:{gap:H},children:De.map((k,ae)=>{const pe=k.image.objectFit??"contain",Me=ae%t.length,Ye=Math.floor(ae/t.length),dt=yr(H),Rt=`calc(-0.5 * (${dt} + ${H}))`;return a.jsxs("div",{ref:Ft=>Ve.current[ae]=Ft,className:`${e}-strip-item`,style:{height:W==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:k.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:pe}}),o&&Me<t.length-1&&Ye===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:dt,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ye}-${k.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":tn?"true":"false",style:Nt,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:B,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:ce,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${le?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||b)&&a.jsx("div",{className:`${e}-header ${le?`${e}-header-two-row`:`${e}-header-single-row`}`,children:le?ft():Ce||b?bt():null})})})]}),t.length>1&&I==="on"&&(()=>{const k=yr($),ae=`calc(-0.5 * (${$} + ${k}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:a.jsx("div",{ref:ge,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:pe=>pe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:Z,"--thumbnail-active-color":V},children:[t.map((pe,Me)=>{const Ye=yr(Z),dt=`calc(-0.5 * (${Ye} + ${Z}))`;return a.jsxs("div",{ref:Rt=>{We.current[Me]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Me?"true":"false",onClick:()=>re&&v==="click"&&Tn(Me),onMouseEnter:()=>ke&&v==="hover"&&Tn(Me),"aria-label":pe.image.name?`View ${pe.image.name}`:`View image ${Me+1}`,"aria-current":A===Me?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${fe?` ${e}-thumb-image-cover`:""}`,src:pe.image.url,alt:"",draggable:!1,style:{...xe,maxWidth:S,maxHeight:S,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:dt,width:Ye,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${pe.image.url}-${Me}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:k,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function S0(e){return`
|
|
14318
|
+
`;function Un(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const uc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Xv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Uv={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:Un("Icon Padding Right"),iconAnimation:{type:"string",scope:"common",title:"Icon Animation",display:{type:"toggle-cycle",enum:["rotate 180","rotate 90","rotate 45"]}},questionColor:{type:"string",scope:"common",title:"Question Default",display:{type:"palette-color-picker"}},answerColor:{type:"string",scope:"common",title:"Answer Default",display:{type:"palette-color-picker"}},dividerColor:{type:"string",scope:"common",title:"Divider Default",display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",display:{type:"palette-color-picker"}},questionHoverColor:{type:"string",scope:"common",title:"Question Hover",display:{type:"palette-color-picker"}},iconHoverColor:{type:"string",scope:"common",title:"Icon Hover",display:{type:"palette-color-picker"}},iconActiveColor:{type:"string",scope:"common",title:"Icon Active",display:{type:"palette-color-picker"}},dividerHoverColor:{type:"string",scope:"common",title:"Divider Hover",display:{type:"palette-color-picker"}},questionFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},questionFontSettings:{...uc.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},questionFontSize:{type:"number",scope:"layout",title:"Question Font Size",display:{type:"font-size"}},questionLineHeight:{type:"number",scope:"layout",title:"Question Line Height",display:{type:"line-height-input"}},questionLetterSpacing:{type:"number",scope:"layout",title:"Question Letter Spacing",display:{type:"letter-spacing-input"}},questionWordSpacing:{type:"number",scope:"layout",title:"Question Word Spacing",display:{type:"word-spacing-input"}},questionTextAppearance:{type:"object",scope:"layout",title:"Question Text Appearance",display:{type:"text-appearance"}},answerFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},answerFontSettings:{...uc.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},answerFontSize:{type:"number",scope:"layout",title:"Answer Font Size",display:{type:"font-size"}},answerLineHeight:{type:"number",scope:"layout",title:"Answer Line Height",display:{type:"line-height-input"}},answerLetterSpacing:{type:"number",scope:"layout",title:"Answer Letter Spacing",display:{type:"letter-spacing-input"}},answerWordSpacing:{type:"number",scope:"layout",title:"Answer Word Spacing",display:{type:"word-spacing-input"}},answerTextAppearance:{type:"object",scope:"layout",title:"Answer Text Appearance",display:{type:"text-appearance"}},questionPaddingLeft:Un("Question Padding Left"),questionPaddingTop:Un("Question Padding Top"),questionPaddingBottom:Un("Question Padding Bottom"),answerPaddingLeft:Un("Answer Padding Left"),answerPaddingRight:Un("Answer Padding Right"),answerPaddingTop:Un("Answer Padding Top"),answerPaddingBottom:Un("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:[...Xv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Yv={element:Gv,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:Uv,sourceCode:qv},zn=e=>e.display==="cover",ca=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},pc=100,Kv=.2,mc=8,du=({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"?pc:Math.max(pc,window.innerHeight*Kv),[]),x=s.useCallback(T=>Math.max(0,1-T/(p*1.5)),[p]),b=s.useCallback(T=>Math.max(0,1-T/(p*.45)),[p]),m=s.useCallback(T=>{const L=typeof window<"u"?window.innerHeight:800,W=Math.max(.88,1-T/L*.12);return`translateY(${T}px) scale(${W})`},[]),g=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),g()},[n,g]),v=s.useCallback(()=>{const T=typeof window<"u"?window.innerHeight:800;d(!0),r(T),window.setTimeout(()=>{t(),g(),d(!1)},Math.min(n,200))},[n,t,g]),I=s.useCallback(T=>{!e||l||T.pointerType==="touch"&&(i!=null&&i(T.target)||(c.current={startX:T.clientX,startY:T.clientY,isLocked:null,pointerId:T.pointerId}))},[e,l,i]),y=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const W=T.clientX-L.startX,O=T.clientY-L.startY;if(L.isLocked===null){if(Math.abs(W)<mc&&Math.abs(O)<mc)return;if(O>0&&O>Math.abs(W))L.isLocked=!0,T.currentTarget.setPointerCapture(T.pointerId);else{L.isLocked=!1,g();return}}if(!L.isLocked)return;T.preventDefault();const C=Math.max(0,O);u.current=C,r(C)},[e,g]),w=s.useCallback(T=>{const L=c.current;if(!e||!L||T.pointerType!=="touch"||L.pointerId!==T.pointerId)return;const W=L.isLocked===!0;if(T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),!W){g();return}T.clientY-L.startY>=p?v():f()},[p,v,e,g,f]),V=s.useCallback(T=>{w(T)},[w]),z=s.useCallback(T=>{w(T)},[w]),Y=o>0,M=l?`transform ${n}ms ease`:"none",F=l?`opacity ${n}ms ease`:"none",K=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:x(o),transition:F},mediaAreaStyle:{transform:m(o),transition:M,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:K?{opacity:b(o),transition:F}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:y,onPointerUp:V,onPointerCancel:z}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Zv="[data-lightbox-scrollable]",uu=()=>{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(Zv)||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"})}},[])},Jv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Qv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},e0=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},t0=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(g,f)=>{Qv(t),e.scrollLeft=g,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,x=0;const b=()=>{t.removeEventListener("transitionend",m),clearTimeout(x)},m=g=>{g.target!==t||g.propertyName!=="transform"||p||(p=!0,b(),u(n,!0))};return t.addEventListener("transitionend",m),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,x=window.setTimeout(()=>{p||(p=!0,b(),u(n,!0))},i+64),()=>{p||(p=!0,b(),u(l-e0(t),!1))}},Ao=300,n0=900,i0=1500,o0="cubic-bezier(0.16, 1, 0.3, 1)",r0=3e3,a0=2,s0=16,l0=.05,c0=1,fr=.3,d0=50,u0=20,Fi=.004,lo=["title1","title2","title3"],p0={title1:"1",title2:"2",title3:"3"},m0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},g0={title1:.02,title2:.02,title3:.02},yr=e=>`max(${e}, ${u0}px)`,h0=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]}},f0=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=h0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Ut=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,y0=e=>[Ut(e,"fontFamily"),Ut(e,"fontSettings"),{type:"row",items:[Ut(e,"fontSize"),Ut(e,"lineHeight"),Ut(e,"letterSpacing"),Ut(e,"wordSpacing")]},Ut(e,"textAlign"),Ut(e,"textAppearance")],v0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(lo.map(e=>[p0[e],y0(e)]))}),rl=(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},pu=(e,t)=>rl(e,t),vr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},gc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:rl(e.length,n),effective:pu(e.length,n)}},x0=(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},Fa=(e,t)=>{const n=i=>{const o=Ut(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[m0[t]]}},b0=(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),Wa=(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??g0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Zt(i,n)},w0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:x,closeIcon:b,closeIconMaxWidth:m,closeIconColor:g,closeIconHoverColor:f,thumbnailTrigger:v,thumbnailVisibility:I,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:V,title1Width:z,title2Width:Y,title3Width:M,title1MarginLeft:F=0,title2MarginLeft:K=0,title3MarginLeft:T=0,titleRowMarginBottom:L=0,titleHeaderLayout:W="desktop",contentMarginTop:O,iconMarginLeft:C}=n,E=P=>j.scalingValue(P,i??!1),_=c??n.thumnailSize??.03,S=E(_),Z=E(u),$=E(p??.02),H=E(x??0),B=E(O??0),le=yr(B),ie=E(C??0),[k,de]=s.useState(0),G=s.useRef(k);G.current=k;const ce=t[k],{title1:oe,title2:fe,title3:Ie}=f0(ce),xe=Wa("title1",Fa(n,"title1"),i),ue=Wa("title2",Fa(n,"title2"),i),U=Wa("title3",Fa(n,"title3"),i),se=W==="mobile",re=!o&&(!i||r),Re=re,Se=re,ke=re,ye=zn(y),be=ye?{"--image-aspect-ratio":ca(y)}:void 0,Ce=!!(oe||fe||Ie),h=s.useMemo(()=>x0(e,oe,fe,Ie,xe,ue,U),[e,k,oe,fe,Ie,xe,ue,U]),q=s.useMemo(()=>({title1Width:z,title2Width:Y,title3Width:M}),[z,Y,M]),X=s.useMemo(()=>h.map(P=>q[P.widthKey]),[h,q]),ee=s.useMemo(()=>rl(h.length,X),[h.length,X]),ve=s.useMemo(()=>pu(h.length,X),[h.length,X]),D=s.useMemo(()=>h.filter(P=>P.prefix==="title1"),[h]),R=s.useMemo(()=>h.filter(P=>P.prefix==="title2"||P.prefix==="title3"),[h]),Q=s.useMemo(()=>gc(D,q),[D,q]),ne=s.useMemo(()=>gc(R,q),[R,q]),N=s.useCallback((P,ae)=>{const pe=h.indexOf(P);if(!se||ae==="single-row")return{effectiveWidth:ve[pe]??0,resolvedWidth:ee[pe]??0,maxWidth:vr(pe,ee)};if(ae==="two-row-top"){const Ue=D.indexOf(P);return{effectiveWidth:Q.effective[Ue]??0,resolvedWidth:Q.resolved[Ue]??0,maxWidth:vr(Ue,Q.resolved)}}const Me=R.indexOf(P);return{effectiveWidth:ne.effective[Me]??0,resolvedWidth:ne.resolved[Me]??0,maxWidth:vr(Me,ne.resolved)}},[R,ne,ve,ee,h,D,Q,se]),te=s.useCallback(P=>j.scalingValue(P,i??!1),[i]),Ee=te(L??0),ge=s.useMemo(()=>({title1MarginLeft:F,title2MarginLeft:K,title3MarginLeft:T}),[F,K,T]),J=s.useCallback(P=>h.slice(0,P+1).reduce((ae,pe,Me)=>ae+(pe!=null&&pe.marginLeftKey?ge[pe.marginLeftKey]??0:0)+(ee[Me]??0),0)+(se?0:F??0),[h,ge,ee,se,F]),Ye=s.useCallback(()=>se?0:F??0,[se,F]),Be=s.useCallback(P=>R.slice(0,P).reduce((ae,pe,Me)=>ae+(pe.marginLeftKey?ge[pe.marginLeftKey]??0:0)+(ne.resolved[Me]??0),0),[R,ne.resolved,ge]),it=s.useCallback(P=>{const ae=R[P];return Be(P)+(ae.marginLeftKey?ge[ae.marginLeftKey]??0:0)+(ne.resolved[P]??0)},[R,ne.resolved,Be,ge]),Xe=(P,ae)=>{const pe=P.marginLeftKey?ge[P.marginLeftKey]??0:0,{effectiveWidth:Me,resolvedWidth:Ue,maxWidth:ct}=N(P,ae),Rt=o&&ae==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":P.prefix,style:{...ae==="single-row"?{gridArea:P.prefix}:{},width:te(Me),...pe>0?{marginLeft:te(pe)}:{}},children:[a.jsx("p",{className:P.className,style:P.style,children:P.text}),Rt&&P.marginLeftKey&&a.jsx("div",{"data-controls":P.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:te(-pe),width:`max(${te(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),Rt&&a.jsx("div",{"data-controls":P.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ct),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:te(-Fi/2),width:te(Fi),height:"100%",pointerEvents:"auto"}})]},P.className)},et=()=>{const P=se?-1:h.findIndex(Me=>Me.prefix==="title1"),ae=!se&&(o||(F??0)>0)?(()=>{const Me=F??0,Ue=P>=0?ee[P]:z??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:0,width:`max(${te(Me)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,pe=h.flatMap((Me,Ue)=>{if(!Me.marginLeftKey)return[];const ct=ge[Me.marginLeftKey]??0,Rt=b0(h,ee,ge,Ue)+Ye();return a.jsx("div",{"data-controls":Me.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ee[Ue]),style:{position:"absolute",top:0,left:te(Rt),width:`max(${te(ct)}, 10px)`,height:"100%",pointerEvents:"auto"}},Me.marginLeftKey)});return ae?[ae,...pe]:pe},Je=()=>h.map((P,ae)=>{const pe=vr(ae,ee),Ue=J(ae)-Fi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":P.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(Fi),height:"100%",pointerEvents:"auto"}})},`${P.widthKey}-junction`)}),Ge=()=>R.flatMap((P,ae)=>{if(!P.marginLeftKey)return[];const pe=ge[P.marginLeftKey]??0,Me=Be(ae),{resolvedWidth:Ue}=N(P,"two-row-bottom");return a.jsx("div",{"data-controls":P.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:te(Me),width:`max(${te(pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},P.marginLeftKey)}),$e=()=>R.map((P,ae)=>{const{maxWidth:pe}=N(P,"two-row-bottom"),Ue=it(ae)-Fi/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":P.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(pe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:te(Ue),width:te(Fi),height:"100%",pointerEvents:"auto"}})},`${P.widthKey}-junction`)}),He=s.useRef(null),De=s.useRef(null),Qe=s.useRef(null),he=s.useRef(null),_e=s.useRef([]),Ve=s.useRef([]),tt=s.useRef(0),ht=s.useRef(null),at=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Oe=s.useRef(null),Ae=s.useRef(null),Pe=s.useRef(0),Ze=s.useRef("forward"),Ne=s.useRef(0),rt=s.useRef(null),ot=s.useRef(!1),me=t.length>1&&(!o||!!r),Fe=me?3:1,st=s.useMemo(()=>Array.from({length:Fe},()=>t).flat(),[t,Fe]),[dt,ze]=s.useState(!1),[ut,Ct]=s.useState(!1),[Tt,xt]=s.useState(!0),Pt=s.useRef(null),zt=s.useRef(null),Xt=s.useRef(!1),Yt=s.useRef(!1),It=s.useRef(null),Ot=s.useRef(null),tn=Re&&!Tt,yt=s.useCallback(()=>{Re&&(xt(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{at.current.isActive||xt(!1)},r0))},[Re]),Le=s.useCallback(()=>{o||Yt.current||(Yt.current=!0,Ct(!1),It.current=setTimeout(()=>{l()},Ao))},[o,l]),qe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":tn?"true":"false",style:{width:j.scalingValue(m??0,i),height:j.scalingValue(m??0,i),marginRight:ie,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:a.jsx(ln,{url:b,fill:g,hoverFill:i&&!r?g:f,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),lt=(P="two-row")=>a.jsx("div",{...P==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:te(F??0),flexShrink:0,...P==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...P==="two-row"&&o?{pointerEvents:"auto"}:{}}}),vt=()=>{const P=h.find(Me=>Me.prefix==="title1"),ae=h.filter(Me=>Me.prefix==="title2"||Me.prefix==="title3"),pe=ae.length>0||o||(L??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(F??0)>0||o?lt():null,P&&Xe(P,"two-row-top"),b&&qe()]}),pe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[ae.map(Me=>Xe(Me,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[Ge(),$e()]})]}):null,a.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Ee,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},wt=()=>a.jsxs(a.Fragment,{children:[(F??0)>0||o?lt("single-row"):null,h.map(P=>Xe(P,"single-row")),o?a.jsxs(a.Fragment,{children:[et(),Je()]}):null,b?qe():null]}),Et=s.useCallback(P=>!!(P.closest("[data-controls]")||P.closest(`.${e}-thumbnails`)||P.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:Bt,mediaAreaStyle:Nt,overlayContentStyle:Ft,swipeHandlers:Vt,dismissAreaStyle:Gt}=du({enabled:re??!1,onClose:Le,animMs:Ao,isBlockedTarget:Et}),Dt=()=>{if(!me||t.length===0)return tt.current=0,0;const P=Ve.current[0],ae=Ve.current[t.length];if(!P||!ae)return tt.current;const pe=ae.offsetLeft-P.offsetLeft;return pe>0&&(tt.current=pe),tt.current},jt=(P=!1)=>{if(!me)return;const ae=De.current,pe=Dt();!ae||pe<=0||pe<ae.clientWidth*.25||(ae.scrollLeft<=0?(ae.scrollLeft+=pe,P&&(at.current.scrollLeft+=pe),ot.current&&(Ne.current+=pe)):ae.scrollLeft>=pe*2&&(ae.scrollLeft-=pe,P&&(at.current.scrollLeft-=pe),ot.current&&(Ne.current-=pe)))},Ht=(P,ae=(pe=>(pe=De.current)==null?void 0:pe.scrollLeft)()??0)=>{if(!me)return P;let Me=t.length+P,Ue=1/0;for(let ct=0;ct<Fe;ct++){const Rt=ct*t.length+P,At=Ve.current[Rt];if(!At)continue;const nn=Math.abs(At.offsetLeft-ae);nn<Ue&&(Ue=nn,Me=Rt)}return Me},bt=P=>{const ae=De.current;return!P||!ae?!1:P.offsetWidth>ae.clientWidth+1},A=P=>{const ae=De.current;if(!P||!ae||!bt(P))return!1;const pe=P.offsetLeft,Me=pe+P.offsetWidth;return ae.scrollLeft>=pe-1&&ae.scrollLeft+ae.clientWidth<=Me+1},Te=(P=(ae=>(ae=De.current)==null?void 0:ae.scrollLeft)()??0)=>{for(let Me=0;Me<Ve.current.length;Me+=1){const Ue=Ve.current[Me];if(Ue&&A(Ue))return Me}let pe={flatIndex:0,distance:1/0};return Ve.current.forEach((Me,Ue)=>{if(!Me)return;const ct=Math.abs(Me.offsetLeft-P);ct<pe.distance&&(pe={flatIndex:Ue,distance:ct})}),pe.flatIndex},We=P=>{De.current&&Ve.current.forEach(ae=>{ae&&(ae.style.scrollSnapAlign=bt(ae)&&P==="backward"?"end":"start")})},je=(P,ae,pe)=>{const Me=P-ae,Ue=Te(ae),ct=Ve.current[Ue];if(A(ct))return Te(P)%t.length;const Rt=Ve.current[Ue+1],At=ct?Rt?Rt.offsetLeft-ct.offsetLeft:ct.offsetWidth:0,nn=At>0?Me>At*fr?1:Me<-At*fr?-1:0:0;return nn===0?pe:me?(pe+nn+t.length)%t.length:Math.max(0,Math.min(t.length-1,pe+nn))},pt=s.useCallback((P=!1)=>{if(I!=="on"||o)return;const ae=he.current,pe=G.current,Me=_e.current[pe];if(!ae||!Me||ae.scrollWidth<=ae.clientWidth)return;const Ue=ae.scrollLeft,ct=Ue+ae.clientWidth,Rt=Me.offsetLeft,At=Rt+Me.offsetWidth;if(Rt>=Ue&&At<=ct)return;const nn=ae.scrollWidth-ae.clientWidth;let Qt=Ue;if(!P&&Pt.current===null){const Pi=_e.current[pe-1],bo=_e.current[pe+1],ar=Pi?Me.offsetLeft-Pi.offsetLeft:bo?bo.offsetLeft-Me.offsetLeft:Me.offsetWidth;At>ct?Qt+=ar:Rt<Ue&&(Qt-=ar)}else At>ct?Qt=At-ae.clientWidth:Qt=Rt;ae.scrollLeft=Math.max(0,Math.min(nn,Qt))},[o,I]),_t=s.useCallback((P=!1)=>{P&&(Xt.current=!0),zt.current===null&&(zt.current=requestAnimationFrame(()=>{zt.current=null;const ae=Xt.current;Xt.current=!1,pt(ae)}))},[pt]),mt=s.useCallback(P=>{if(P===G.current)return;const ae=G.current;G.current=P;const pe=Math.abs(P-ae)>1,Me=me&&t.length>1&&(ae===t.length-1&&P===0||ae===0&&P===t.length-1);de(P),_t(pe||Me)},[t.length,me,_t]),Lt=()=>{if(!De.current||t.length===0||Pt.current!==null||at.current.isActive&&at.current.hasMoved)return;const P=De.current.scrollLeft,ae=Te(P)%t.length;ae!==G.current&&mt(ae)},qt=()=>{Pt.current=null},kt=P=>{const ae=De.current;ae&&(ae.style.scrollSnapType=P?"":"none")},rn=()=>{var P;(P=Ae.current)==null||P.call(Ae),Ae.current=null},pn=()=>{rt.current!==null&&(cancelAnimationFrame(rt.current),rt.current=null),ot.current=!1},di=()=>{const P=De.current;if(!P){rt.current=null,ot.current=!1;return}const ae=Ne.current-P.scrollLeft;if(Math.abs(ae)<.5){P.scrollLeft=Ne.current,jt(),Lt(),rt.current=null,ot.current=!1;return}P.scrollLeft+=ae*l0,jt(),Lt(),yt(),rt.current=requestAnimationFrame(di)},ui=()=>{const P=Qe.current;P&&(P.style.transition="",P.style.transform="",P.style.willChange="")},nr=(P,ae,pe,Me)=>{ui(),P.scrollLeft=ae,Pe.current=P.scrollLeft,jt(),pe!==void 0?(G.current=pe,de(pe)):Lt(),kt(!0),Me==null||Me()},ir=(P,{behavior:ae="smooth",activeIndex:pe,onComplete:Me}={})=>{const Ue=De.current,ct=Qe.current;if(!Ue||!ct)return;if(pn(),rn(),kt(!1),ae==="auto"){nr(Ue,P,pe,Me);return}const Rt=Math.abs(P-Ue.scrollLeft),At=Jv(Rt,n0,i0,Ue.clientWidth*.55);Ae.current=t0(Ue,ct,P,{duration:At,easing:o0,onComplete:()=>{Ae.current=null,nr(Ue,P,pe,Me)}})},ua=(P="smooth")=>{const ae=De.current;if(!ae||t.length===0)return;const pe=Te()%t.length,Me=Ht(pe,ae.scrollLeft),Ue=Ve.current[Me];Ue&&ir(Ue.offsetLeft,{behavior:P,activeIndex:pe})},pa=(P,ae="smooth",pe,Me)=>{const Ue=De.current;if(!Ue||t.length===0)return;const ct=(Me??Ue.scrollLeft)-P,Rt=Te(P),At=Ve.current[Rt];if(A(At)){kt(!0),Lt();return}const nn=Ve.current[Rt+1],Qt=At?nn?nn.offsetLeft-At.offsetLeft:At.offsetWidth:0;if((Qt>0?ct>Qt*fr?1:ct<-Qt*fr?-1:0:0)!==0){const Du=pe??Rt%t.length,ju=je(Me??Ue.scrollLeft,P,Du);Tn(ju,ae);return}const bo=Me??Ue.scrollLeft,ar=Te(bo),cl=Ve.current[ar];if(cl&&Math.abs(cl.offsetLeft-bo)<1){kt(!0),Lt();return}ua("auto")},Tn=(P,ae="smooth")=>{const pe=De.current;if(!pe||t.length===0)return;const Me=Ht(P,pe.scrollLeft),Ue=Ve.current[Me];Ue&&(ae==="smooth"?Pt.current=P:Pt.current=null,G.current=P,de(P),_t(!0),ir(Ue.offsetLeft,{behavior:ae,activeIndex:P,onComplete:ae==="smooth"?qt:void 0}))},Mi=()=>{Oe.current&&(window.removeEventListener("pointerup",Oe.current),window.removeEventListener("pointercancel",Oe.current),Oe.current=null)},or=(P,ae,pe,Me,Ue)=>{const ct=pe-P,Rt=Me-ae,At=Math.abs(ct),nn=Math.abs(Rt);if(At<d0||At<=nn)return!1;const Qt=ct<0?1:-1,Pi=me?(Ue+Qt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+Qt));return Pi===Ue?!1:(Tn(Pi),!0)},pi=P=>{if(!at.current.isActive)return;Mi();const ae=De.current;if(!ae)return;const{scrollLeft:pe,startActiveIndex:Me,hasMoved:Ue}=at.current,ct=ae.scrollLeft;jt(!0),at.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ze(!1),P!==void 0&&ae.hasPointerCapture(P)&&ae.releasePointerCapture(P),Ue?pa(pe,"smooth",Me,ct):(kt(!0),Lt()),yt()},rr=(P,ae)=>{const pe=ht.current;ht.current=null,pe&&(or(pe.startX,pe.startY,P,ae,pe.startActiveIndex),yt())},ma=P=>{if(!Se)return;if(P.pointerType==="touch"){if(pn(),kt(!0),Et(P.target))return;ht.current={startX:P.clientX,startY:P.clientY,startActiveIndex:G.current};return}if(P.pointerType!=="mouse"||P.button!==0||Et(P.target))return;const ae=De.current;if(!ae)return;pn(),rn(),ui(),Pt.current=null,at.current={isActive:!0,startX:P.clientX,scrollLeft:ae.scrollLeft,startActiveIndex:G.current,hasMoved:!1},kt(!1),yt(),ae.setPointerCapture(P.pointerId),Mi();const pe=Me=>{Me.pointerType==="mouse"&&pi(Me.pointerId)};Oe.current=pe,window.addEventListener("pointerup",pe),window.addEventListener("pointercancel",pe)},ga=P=>{if(!Se||P.pointerType!=="mouse")return;const ae=De.current;if(!ae||!at.current.isActive)return;if(P.buttons===0){pi(P.pointerId);return}const pe=P.clientX-at.current.startX;Math.abs(pe)>c0&&(at.current.hasMoved=!0,ze(!0)),at.current.hasMoved&&(P.preventDefault(),ae.scrollLeft=at.current.scrollLeft-pe,jt(!0),Lt(),yt())},we=P=>{if(Se){if(P.pointerType==="touch"){P.type==="pointerup"?rr(P.clientX,P.clientY):ht.current=null;return}P.pointerType==="mouse"&&pi(P.pointerId)}},Ke=P=>{!Se||P.pointerType!=="mouse"||pi(P.pointerId)};return uu(),s.useEffect(()=>{const P=requestAnimationFrame(()=>Ct(!0));return()=>{cancelAnimationFrame(P),rn(),Mi(),zt.current!==null&&(cancelAnimationFrame(zt.current),zt.current=null),It.current&&clearTimeout(It.current),Ot.current&&clearTimeout(Ot.current)}},[]),s.useEffect(()=>{if(!Re){xt(!0);return}yt();const P=()=>yt();return document.addEventListener("pointermove",P,{passive:!0}),document.addEventListener("pointerdown",P,{passive:!0}),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerdown",P),Ot.current&&clearTimeout(Ot.current)}},[Re,yt]),s.useEffect(()=>{const P=ae=>{ae.key==="Escape"&&Le()};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[Le]),s.useLayoutEffect(()=>{Dt()},[H,t.length,me]),s.useLayoutEffect(()=>{o||Tn(G.current,"auto")},[H,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,me]),s.useEffect(()=>{const P=De.current;if(!P||o||!re)return;const ae=pe=>{if(pe.preventDefault(),Math.abs(pe.deltaY)<=Math.abs(pe.deltaX))return;const Me=pe.deltaMode===1?s0:pe.deltaMode===2?P.clientHeight:1,Ue=pe.deltaY*Me*a0;if(Ue!==0){if(rn(),ot.current||(ot.current=!0,Ne.current=P.scrollLeft,Pt.current=null,kt(!1)),Ne.current+=Ue,!me){const ct=P.scrollWidth-P.clientWidth;Ne.current=Math.max(0,Math.min(ct,Ne.current))}yt(),rt.current===null&&(rt.current=requestAnimationFrame(di))}};return P.addEventListener("wheel",ae,{passive:!1}),()=>{P.removeEventListener("wheel",ae),pn()}},[o,re,me]),s.useEffect(()=>{const P=De.current;if(!P)return;const ae=()=>{jt(at.current.isActive);const Me=P.scrollLeft,Ue=Me-Pe.current;Pe.current=Me;const ct=tt.current>0?tt.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ct){const Rt=Ue>0?"forward":"backward";Rt!==Ze.current&&(Ze.current=Rt,We(Rt))}at.current.isActive&&at.current.hasMoved||Lt()};P.addEventListener("scroll",ae,{passive:!0});const pe=new ResizeObserver(()=>{Dt(),jt(at.current.isActive),We(Ze.current),Lt()});return pe.observe(P),()=>{rn(),P.removeEventListener("scroll",ae),pe.disconnect()}},[t.length,me]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ut?1:0,transition:`opacity ${Ao}ms ease`,pointerEvents:ut?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Bt}}),a.jsxs("div",{ref:He,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Nt,onClick:P=>P.stopPropagation(),children:a.jsx("div",{ref:De,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Se&&t.length>0?"true":"false","data-mouse-dragging":dt?"true":"false",onPointerDown:ma,onPointerMove:ga,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ke,children:a.jsx("div",{ref:Qe,className:`${e}-lightbox-strip-track`,style:{gap:H},children:st.map((P,ae)=>{const pe=P.image.objectFit??"contain",Me=ae%t.length,Ue=Math.floor(ae/t.length),ct=yr(H),Rt=`calc(-0.5 * (${ct} + ${H}))`;return a.jsxs("div",{ref:At=>Ve.current[ae]=At,className:`${e}-strip-item`,style:{height:W==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:P.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:pe}}),o&&Me<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Rt,width:ct,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${P.image.url}-${Me}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":tn?"true":"false",style:Ft,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:B,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:le,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${se?` ${e}-lightbox-content-area-stacked`:""}`,children:(Ce||b)&&a.jsx("div",{className:`${e}-header ${se?`${e}-header-two-row`:`${e}-header-single-row`}`,children:se?vt():Ce||b?wt():null})})})]}),t.length>1&&I==="on"&&(()=>{const P=yr($),ae=`calc(-0.5 * (${$} + ${P}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:$},children:a.jsx("div",{ref:he,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:pe=>pe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:Z,"--thumbnail-active-color":V},children:[t.map((pe,Me)=>{const Ue=yr(Z),ct=`calc(-0.5 * (${Ue} + ${Z}))`;return a.jsxs("div",{ref:Rt=>{_e.current[Me]=Rt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":k===Me?"true":"false",onClick:()=>re&&v==="click"&&Tn(Me),onMouseEnter:()=>ke&&v==="hover"&&Tn(Me),"aria-label":pe.image.name?`View ${pe.image.name}`:`View image ${Me+1}`,"aria-current":k===Me?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${ye?` ${e}-thumb-image-cover`:""}`,src:pe.image.url,alt:"",draggable:!1,style:{...be,maxWidth:S,maxHeight:S,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&Me<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ct,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${pe.image.url}-${Me}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:ae,height:P,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function S0(e){return`
|
|
14319
14319
|
.${e}-wrapper {
|
|
14320
14320
|
position: relative;
|
|
14321
14321
|
width: 100%;
|
|
@@ -14700,7 +14700,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14700
14700
|
pointer-events: auto;
|
|
14701
14701
|
z-index: 10;
|
|
14702
14702
|
}
|
|
14703
|
-
`}const $0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=j.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),b=t??[],m=p&&b.length>0,g=()=>{b.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:S0(l)}}),d&&a.jsx("div",{className:`${l}-cover ${zn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...zn(c)?{"--image-aspect-ratio":
|
|
14703
|
+
`}const $0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=j.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,x]=s.useState(!1),b=t??[],m=p&&b.length>0,g=()=>{b.length!==0&&x(!0)};return s.useEffect(()=>{!n||i||o||x(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:S0(l)}}),d&&a.jsx("div",{className:`${l}-cover ${zn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>g(),style:{...zn(c)?{"--image-aspect-ratio":ca(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${zn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),m&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(w0,{prefix:l,images:b,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>x(!1)}),f)})()]})},C0=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14704
14704
|
import { createPortal } from 'react-dom';
|
|
14705
14705
|
import { CommonComponentProps } from '../props';
|
|
14706
14706
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15246,7 +15246,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15246
15246
|
</>
|
|
15247
15247
|
);
|
|
15248
15248
|
};
|
|
15249
|
-
`,T0="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>'),vi={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 L0(e){const t={};return t[Xt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Xt(e,"fontSettings")]={...vi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Xt(e,"fontSize")]={...vi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Xt(e,"lineHeight")]={...vi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Xt(e,"letterSpacing")]={...vi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Xt(e,"wordSpacing")]={...vi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Xt(e,"textAlign")]={...vi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Xt(e,"textAppearance")]={...vi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const R0=lo.reduce((e,t)=>({...e,...L0(t)}),{}),I0=lo.reduce((e,t)=>({...e,[Xt(t,"fontFamily")]:"Goudy Bookletter 1911",[Xt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Xt(t,"letterSpacing")]:0,[Xt(t,"wordSpacing")]:0,[Xt(t,"textAlign")]:"left",[Xt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Na(e){return lo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Xt(n,"fontSize")]=i),o!==void 0&&(t[Xt(n,"lineHeight")]=o),t},{})}const E0=v0(),M0={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"}},...R0,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:T0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...I0},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,...Na({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,...Na({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,...Na({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:[E0]}],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"}]}},P0={element:$0,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:M0,sourceCode:C0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...lo.map(e=>({path:`${Xt(e,"fontFamily")}`}))]},fontRelations:{...lo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Xt(t,"fontFamily")}`}),{})}},k0=({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:x,coverFit:b,backgroundColor:m,imageGap:g,maxWidth:f,maxHeight:v,textTransition:I,title1Width:y,title2Width:w,title3Width:V,title1MarginLeft:z=0,title2MarginLeft:Y=0,title3MarginLeft:M=0,titleRowMarginBottom:F=0,titleHeaderLayout:K="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:W,closeIconColor:O,closeIconHoverColor:C,contentMarginTop:E=0,iconMarginRight:_=0}=n,S=s.useCallback(be=>j.scalingValue(be,i??!1),[i]),Z=S(g??0),$=`${f}%`,H=`${v}%`,B=S(T),ce=S(E),ie=S(_),A=$i("title1",Si(n,"title1"),i),de=$i("title2",Si(n,"title2"),i),G=$i("title3",Si(n,"title3"),i),se=$i("count",Si(n,"count"),i),oe=K==="mobile",he=!i||!!r,Ie=!o&&(!i||!!r),ve=s.useMemo(()=>Ar(t,x),[t,x]),[ue,U]=s.useState(l),le=ve[ue],re=le==null?void 0:le.entry,[Re,we]=s.useState(!1),[ke,fe]=s.useState(null),[xe,Ce]=s.useState(!1),[h,q]=s.useState(null),[X,ee]=s.useState(!1),[ye,D]=s.useState(0),[R,Q]=s.useState(),[ne,N]=s.useState(),[te,Ee]=s.useState(null),me=s.useRef(null),J=s.useRef(0),Ke=s.useRef(0),Be=s.useRef(0),rt=s.useRef(!1),Xe=s.useRef(null),nt=s.useRef(null),Qe=s.useRef(null),Ge=s.useRef(null),Se=s.useRef(null),_e=s.useRef(null),Oe=s.useRef(null),et=s.useCallback(()=>{const be=nt.current;if(!be)return;const Ze=be.closest(`.${e}-lightbox-content-area`);if(!Ze)return be.getBoundingClientRect().width;const k=Array.from(Ze.children).reduce((ae,pe)=>!(pe instanceof HTMLElement)||pe.contains(be)?ae:ae+pe.getBoundingClientRect().width,0);return Ze.getBoundingClientRect().width-k},[e]),ge=s.useCallback(()=>{me.current&&(clearTimeout(me.current),me.current=null)},[]),We=s.useCallback(be=>{be===J.current&&(q(null),ee(!1))},[]),Ve=s.useCallback(()=>{o||rt.current||(rt.current=!0,u==null||u(),we(!1),Xe.current=setTimeout(()=>{p()},300))},[o,u,p]),it=s.useCallback(be=>!!(be.closest("[data-controls]")||be.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ht,backdropStyle:ct,mediaAreaStyle:Ne,overlayContentStyle:Ae,swipeHandlers:Pe,dismissAreaStyle:Je}=du({enabled:Ie,onClose:Ve,animMs:300,isBlockedTarget:it}),He=s.useCallback(be=>{d&&qd(be+1,c,!0)},[d,c]),tt=s.useCallback(be=>{if(be)return be.getBoundingClientRect().height},[]),at=s.useCallback(be=>{if(ve.length===0)return;const Ze=(be%ve.length+ve.length)%ve.length;if(Ze===ue)return;const k=ve[ue],ae=ve[Ze];J.current+=1;const pe=J.current,Me=I==="fade"&&Bl(k==null?void 0:k.entry)!==Bl(ae==null?void 0:ae.entry),Ye=tt(Qe.current),dt=Me?(()=>{const Ft=et();Gn.flushSync(()=>{Ee(ae.entry)}),Qe.current&&Ft&&(Qe.current.style.width=`${Ft}px`);const nn=tt(Qe.current);return Qe.current&&(Qe.current.style.width=""),{measuredIncomingTitlesHeight:nn,incomingTitlesMeasureWidth:Ft}})():void 0,Rt=Math.max(Ye??0,(dt==null?void 0:dt.measuredIncomingTitlesHeight)??0)||void 0;D(pe),q(ue),ee(!0),U(Ze),He(Ze),Be.current=Ze,Me?(ge(),Rt&&Q(Rt),dt!=null&&dt.incomingTitlesMeasureWidth&&N(dt.incomingTitlesMeasureWidth),fe((k==null?void 0:k.entryIndex)??null),Ce(!0),Ke.current=ae.entryIndex,me.current=setTimeout(()=>{fe(null),Ce(!1),Q(void 0),N(void 0),Ee(null),me.current=null},400)):(ge(),fe(null),Ce(!1),Q(void 0),N(void 0),Ee(null),Ke.current=ae.entryIndex)},[ue,ge,et,tt,ve,He,I]),st=s.useCallback(()=>{Oe.current=null},[]),$e=s.useCallback(be=>{!he||ve.length<=1||be.pointerType==="mouse"&&be.button!==0||be.target.closest("[data-controls]")||(Oe.current={startX:be.clientX,startY:be.clientY,pointerId:be.pointerId})},[he,ve.length]),De=s.useCallback(be=>{var Ft;if(!he||ve.length<=1||be.pointerType==="mouse"&&be.button!==0)return;if(ht){st();return}const Ze=Oe.current;if(!Ze||Ze.pointerId!==be.pointerId||(st(),be.target.closest("[data-controls]")))return;const ae=be.clientX-Ze.startX,pe=be.clientY-Ze.startY,Me=Math.abs(ae),Ye=Math.abs(pe);if(Me>=Vf&&Me>Ye){at(ae>0?ue-1:ue+1);return}if(Me>Ol||Ye>Ol)return;const dt=(Ft=Ge.current)==null?void 0:Ft.getBoundingClientRect(),Rt=dt?dt.left+dt.width/2:window.innerWidth/2;at(be.clientX<Rt?ue-1:ue+1)},[ue,he,at,ht,st,ve.length]),lt=s.useCallback(be=>{const Ze=Oe.current;(Ze==null?void 0:Ze.pointerId)===be.pointerId&&st()},[st]);uu(),s.useEffect(()=>{_e.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const be=requestAnimationFrame(()=>{we(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(be),Xe.current&&clearTimeout(Xe.current),me.current&&clearTimeout(me.current);const Ze=_e.current;Ze&&document.contains(Ze)&&Ze.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var be;I!=="fade"&&(Ke.current=((be=ve[ue])==null?void 0:be.entryIndex)??0,ge(),fe(null),Ce(!1),Q(void 0),N(void 0))},[ue,ge,ve,I]),s.useEffect(()=>{const be=Ze=>{if(Ze.key==="Escape"){Ve();return}if(Ze.key==="ArrowLeft"&&ve.length>1){at(ue-1);return}if(Ze.key==="ArrowRight"&&ve.length>1){at(ue+1);return}if(Ze.key==="Tab"&&Ge.current){const k=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(k).filter(dt=>!dt.closest('[aria-hidden="true"]'));if(ae.length===0)return;const pe=ae[0],Me=ae[ae.length-1],Ye=document.activeElement;Ze.shiftKey?(Ye===pe||!Ge.current.contains(Ye))&&(Ze.preventDefault(),Me.focus()):(Ye===Me||!Ge.current.contains(Ye))&&(Ze.preventDefault(),pe.focus())}};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[at,Ve,ue,ve.length]),s.useLayoutEffect(()=>{ge(),J.current=0,D(0),q(null),ee(!1),fe(null),Ce(!1),Q(void 0),N(void 0),Ee(null),U(be=>{const Ze=Math.max(0,ve.length-1);return Math.min(be,Ze)})},[ge,t.length,x,ve.length]),s.useLayoutEffect(()=>{var k;const be=Math.max(0,ve.length-1),Ze=Math.min(Math.max(0,l),be);Be.current=Ze,Ke.current=((k=ve[Ze])==null?void 0:k.entryIndex)??0,U(Ze)},[l]);const Ue=ke!==null?t[ke]:null,qe=h!==null?ve[h]:null,$t=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(Ue==null?void 0:Ue.title1)||(Ue==null?void 0:Ue.title2)||(Ue==null?void 0:Ue.title3),Ct=Jf(x,ve,t),vt=L!==null,Pt=$t||Ct||vt,Ht=Ct&&vt?{gap:B}:void 0,Yt=`${e}-titles-stack${oe?` ${e}-titles-stack-stacked`:""}`,Kt=`${e}-titles-layer-out${oe?` ${e}-titles-layer-out-stacked`:""}`,Lt=`${e}-titles-layer-out`,Ot=(z??0)>0||o,tn=S(F),xt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:w??Yi.title2Width,title3Width:V??Yi.title3Width}),[y,w,V]),Le=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:M}),[Y,M]),je=s.useMemo(()=>re?Qn(e,re,A,de,G):[],[e,re,A,de,G]),ut=s.useMemo(()=>je.map(be=>xt[be.widthKey]),[je,xt]),ft=s.useMemo(()=>no(je.length,ut),[je.length,ut]),bt=s.useMemo(()=>jo(je.length,ut),[je.length,ut]),Mt=s.useMemo(()=>je.filter(be=>be.prefix==="title1"),[je]),yt=s.useMemo(()=>je.filter(be=>be.prefix==="title2"||be.prefix==="title3"),[je]),Dt=s.useMemo(()=>ei(Mt,xt),[Mt,xt]),_t=s.useMemo(()=>ei(yt,xt),[yt,xt]),Nt=s.useCallback((be,Ze)=>{const k=je.findIndex(pe=>pe.prefix===be.prefix);if(!oe||Ze==="single-row")return{effectiveWidth:bt[k]??0,resolvedWidth:ft[k]??0,maxWidth:dn(k,ft)};if(Ze==="two-row-top"){const pe=Mt.findIndex(Me=>Me.prefix===be.prefix);return{effectiveWidth:Dt.effective[pe]??0,resolvedWidth:Dt.resolved[pe]??0,maxWidth:dn(pe,Dt.resolved)}}const ae=yt.findIndex(pe=>pe.prefix===be.prefix);return{effectiveWidth:_t.effective[ae]??0,resolvedWidth:_t.resolved[ae]??0,maxWidth:dn(ae,_t.resolved)}},[je,yt,_t,bt,ft,Mt,Dt,oe]),Vt=s.useCallback(be=>Kd(je,ft,Le,be)+(oe?0:z??0),[je,ft,Le,oe,z]),Gt=s.useCallback(()=>oe?0:z??0,[oe,z]),zt=s.useCallback(be=>yt.slice(0,be).reduce((Ze,k,ae)=>Ze+(k.marginLeftKey?Le[k.marginLeftKey]??0:0)+(_t.resolved[ae]??0),0),[yt,_t.resolved,Le]),Bt=s.useCallback(be=>{const Ze=yt[be];return zt(be)+(Ze.marginLeftKey?Le[Ze.marginLeftKey]??0:0)+(_t.resolved[be]??0)},[yt,_t.resolved,zt,Le]),jt=s.useCallback((be,Ze,k)=>{if(!oe||k==="single-row"){const dt=be.findIndex(Qt=>Qt.prefix===Ze.prefix),Rt=be.map(Qt=>xt[Qt.widthKey]),Ft=no(be.length,Rt);return{effectiveWidth:jo(be.length,Rt)[dt]??0,resolvedWidth:Ft[dt]??0,maxWidth:dn(dt,Ft)}}if(k==="two-row-top"){const dt=be.filter(Qt=>Qt.prefix==="title1"),Rt=dt.findIndex(Qt=>Qt.prefix===Ze.prefix),{resolved:Ft,effective:nn}=ei(dt,xt);return{effectiveWidth:nn[Rt]??0,resolvedWidth:Ft[Rt]??0,maxWidth:dn(Rt,Ft)}}const ae=be.filter(dt=>dt.prefix==="title2"||dt.prefix==="title3"),pe=ae.findIndex(dt=>dt.prefix===Ze.prefix),{resolved:Me,effective:Ye}=ei(ae,xt);return{effectiveWidth:Ye[pe]??0,resolvedWidth:Me[pe]??0,maxWidth:dn(pe,Me)}},[xt,oe]),It=(be,Ze,k)=>{const ae=be.marginLeftKey?Le[be.marginLeftKey]??0:0,{effectiveWidth:pe,resolvedWidth:Me,maxWidth:Ye}=k??Nt(be,Ze),dt=Math.max(ae,Jn),Rt=o&&Ze==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":be.prefix,style:{width:S(pe),...ae>0?{marginLeft:S(ae)}:{}},children:[a.jsx("p",{className:be.className,style:be.style,children:be.text}),Rt&&be.marginLeftKey?a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:S(-ae),width:S(dt),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ye),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S(-yn/2),width:S(yn),height:"100%",pointerEvents:"auto"}}):null]},be.className)},P=(be="two-row")=>{const Ze=je.findIndex(pe=>pe.prefix==="title1"),k=Ze>=0?ft[Ze]:xt.title1Width,ae=be==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(k)}:{},style:{width:S(z??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Fe=()=>a.jsx("span",{className:`${e}-entry-counter`,style:se,"aria-live":"polite","aria-atomic":"true",children:Zf(ve,ue,x,t)}),ze=()=>Ct?o&&vt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Fe(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Ra(B)} + ${B}))`,width:Ra(B),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Fe():null,pt=()=>!Ct&&!vt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ht,children:[ze(),vt?Tt():null]}),kt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ct||$t?Te():null,Ot?P("single-row"):null,At(re),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),pt(),Tn()]}),mt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Ct||$t?Te():null,Ot?P("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:xe&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:Qe,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:pi(te||re)}),a.jsxs("div",{ref:nt,className:Yt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%",...xe&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Ue&&xe?a.jsx("div",{className:`${Kt} ${e}-titles-fade-out`,children:pi(Ue)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:pi(re)})]})]}),pt(),Tn()]}),Tt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:j.scalingValue(W??0,i),height:j.scalingValue(W??0,i),marginRight:ie,"--close-icon-hover-color":C},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:a.jsx(ln,{url:L??"",fill:O,hoverFill:i&&!r?O:C,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(be,Ze)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Ct||$t?Te():null,Ot?P("two-row"):null,Ze!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ze},children:be}):a.jsxs(a.Fragment,{children:[be,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),pt()]}),At=be=>{if(!be)return null;const Ze=Qn(e,be,A,de,G);return a.jsx(a.Fragment,{children:Ze.map(k=>It(k,"single-row",jt(Ze,k,"single-row")))})},rn=be=>{if(!be)return null;const Ze=Qn(e,be,A,de,G),k=Ze.find(ae=>ae.prefix==="title1");return k?It(k,"two-row-top",jt(Ze,k,"two-row-top")):null},pn=(be,Ze=!1)=>{const k=be?Qn(e,be,A,de,G):[],ae=k.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),pe=o&&Ze;return ae.length>0||pe||(F??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(Ye=>It(Ye,"two-row-bottom",jt(k,Ye,"two-row-bottom"))),Ze&&o?a.jsxs(a.Fragment,{children:[pa(),ma()]}):null]}):null,(F??0)>0||pe?a.jsx("div",{"data-controls":pe?"titleRowMarginBottom":void 0,"data-controls-axis":pe?"y":void 0,"data-controls-reverse":pe?"":void 0,className:pe?`${e}-control`:void 0,style:{height:tn,width:"100%",flexShrink:0,pointerEvents:pe?"auto":"none"}}):null]}):null},ui=(be,Ze=!1)=>a.jsxs(a.Fragment,{children:[qt(rn(be)),pn(be,Ze)]}),pi=be=>oe?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ui(be)}):be?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:At(be)}):null,nr=()=>{const be=oe?-1:je.findIndex(ae=>ae.prefix==="title1"),Ze=!oe&&(o||(z??0)>0)?(()=>{const ae=z??0,pe=be>=0?ft[be]:xt.title1Width,Me=Math.max(ae,Jn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pe),style:{position:"absolute",top:0,left:0,width:S(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,k=je.flatMap((ae,pe)=>{if(!ae.marginLeftKey)return[];const Me=Le[ae.marginLeftKey]??0,Ye=Yd(je,ft,Le,pe)+Gt(),dt=Math.max(Me,Jn);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ft[pe]),style:{position:"absolute",top:0,left:S(Ye),width:S(dt),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return Ze?[Ze,...k]:k},ir=()=>je.map((be,Ze)=>{const k=dn(Ze,ft),pe=Vt(Ze)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(yn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),pa=()=>yt.flatMap((be,Ze)=>{if(!be.marginLeftKey)return[];const k=Le[be.marginLeftKey]??0,ae=zt(Ze),pe=Math.max(k,Jn),{resolvedWidth:Me}=Nt(be,"two-row-bottom");return a.jsx("div",{"data-controls":be.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:S(ae),width:S(pe),height:"100%",pointerEvents:"auto"}},be.marginLeftKey)}),ma=()=>yt.map((be,Ze)=>{const{maxWidth:k}=Nt(be,"two-row-bottom"),pe=Bt(Ze)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":be.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(k),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(yn),height:"100%",pointerEvents:"auto"}})},`${be.widthKey}-junction`)}),Tn=()=>!o||oe?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Mi=be=>{const Ze=!be.objectFit&&zn(b);return{className:`${e}-slide-image-cell${Ze?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:H,...Ze?{"--image-aspect-ratio":da(b)}:{}}}},or=be=>be.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":be.objectFit}}:zn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},mi=be=>{if(be.length===0)return null;const Ze=be.length>1,k=Ra(Z),ae=`calc(-0.5 * (${k} + ${Z}))`;if(be.length===1){const pe=be[0];return a.jsx("div",{...Mi(pe),children:a.jsx("img",{...or(pe),src:pe.url,alt:pe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ze?{gap:Z}:void 0,children:be.map((pe,Me)=>a.jsxs("div",{...Mi(pe),children:[a.jsx("img",{...or(pe),src:pe.url,alt:pe.name??"",draggable:!1}),o&&Ze&&Me<be.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:k,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${pe.url}-${Me}`))})},rr=!!(re!=null&&re.title2||re!=null&&re.title3||Ue!=null&&Ue.title2||Ue!=null&&Ue.title3||(F??0)>0||o),ga=()=>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:Qe,className:Yt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ui(te||re)}),a.jsxs("div",{ref:nt,className:`${e}-titles-row-two-row`,style:{...xe&&R?{minHeight:R}:void 0,...xe&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Yt,style:{position:xe?"absolute":"relative",inset:xe?0:void 0,width:"100%"},children:[Ue&&xe?a.jsx("div",{className:`${Lt} ${e}-titles-fade-out`,children:rn(Ue)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:rn(re)})]}),xe&&R?R:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[Ue&&xe?a.jsx("div",{className:`${Kt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(Ue)}):null,a.jsx("div",{className:`${e}-titles-layer-in${xe?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${oe?` ${e}-titles-layer-in-stacked`:""}`,children:pn(re,!0)})]}):null]})]}),ha=()=>{const be=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...be?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:be?void 0:{flex:"0 0 auto",height:"auto"},children:ui(re,!0)}),Tn()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ht||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Re?1:0,transition:"opacity 300ms ease",pointerEvents:Re?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...ct}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Je,...Pe,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Ne,onClick:be=>be.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":he&&ve.length>1?"true":"false",onPointerDown:he?$e:void 0,onPointerUp:he?De:void 0,onPointerCancel:he?lt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[qe&&X?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:be=>{be.target===be.currentTarget&&We(ye)},children:a.jsx("div",{className:`${e}-slide-area`,children:mi(qe.images)})},`slide-out-${ye}`):null,a.jsx("div",{className:`${e}-slide-layer-in${X?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:le?mi(le.images):null})},`slide-in-${ye}-${ue}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ae,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ce,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...oe?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:Pt&&a.jsx("div",{className:`${e}-text-bar-cell${oe?` ${e}-text-bar-cell-stacked`:""}`,style:oe?void 0:{flex:1,minWidth:0,width:"100%"},children:oe?I==="fade"?ga():ha():I==="fade"?mt():kt()})})})]})]})]})};function A0(e){return`
|
|
15249
|
+
`,T0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),yi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function L0(e){const t={};return t[Ut(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Ut(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Ut(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Ut(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Ut(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Ut(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Ut(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Ut(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const R0=lo.reduce((e,t)=>({...e,...L0(t)}),{}),I0=lo.reduce((e,t)=>({...e,[Ut(t,"fontFamily")]:"Goudy Bookletter 1911",[Ut(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Ut(t,"letterSpacing")]:0,[Ut(t,"wordSpacing")]:0,[Ut(t,"textAlign")]:"left",[Ut(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function _a(e){return lo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Ut(n,"fontSize")]=i),o!==void 0&&(t[Ut(n,"lineHeight")]=o),t},{})}const E0=v0(),M0={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"}},...R0,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:T0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...I0},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,..._a({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,..._a({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,..._a({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:[E0]}],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"}]}},P0={element:$0,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:M0,sourceCode:C0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...lo.map(e=>({path:`${Ut(e,"fontFamily")}`}))]},fontRelations:{...lo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Ut(t,"fontFamily")}`}),{})}},k0=({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:x,coverFit:b,backgroundColor:m,imageGap:g,maxWidth:f,maxHeight:v,textTransition:I,title1Width:y,title2Width:w,title3Width:V,title1MarginLeft:z=0,title2MarginLeft:Y=0,title3MarginLeft:M=0,titleRowMarginBottom:F=0,titleHeaderLayout:K="single-row",countCloseGap:T=0,closeIcon:L,closeIconMaxWidth:W,closeIconColor:O,closeIconHoverColor:C,contentMarginTop:E=0,iconMarginRight:_=0}=n,S=s.useCallback(we=>j.scalingValue(we,i??!1),[i]),Z=S(g??0),$=`${f}%`,H=`${v}%`,B=S(T),le=S(E),ie=S(_),k=Si("title1",wi(n,"title1"),i),de=Si("title2",wi(n,"title2"),i),G=Si("title3",wi(n,"title3"),i),ce=Si("count",wi(n,"count"),i),oe=K==="mobile",fe=!i||!!r,Ie=!o&&(!i||!!r),xe=s.useMemo(()=>Ar(t,x),[t,x]),[ue,U]=s.useState(l),se=xe[ue],re=se==null?void 0:se.entry,[Re,Se]=s.useState(!1),[ke,ye]=s.useState(null),[be,Ce]=s.useState(!1),[h,q]=s.useState(null),[X,ee]=s.useState(!1),[ve,D]=s.useState(0),[R,Q]=s.useState(),[ne,N]=s.useState(),[te,Ee]=s.useState(null),ge=s.useRef(null),J=s.useRef(0),Ye=s.useRef(0),Be=s.useRef(0),it=s.useRef(!1),Xe=s.useRef(null),et=s.useRef(null),Je=s.useRef(null),Ge=s.useRef(null),$e=s.useRef(null),He=s.useRef(null),De=s.useRef(null),Qe=s.useCallback(()=>{const we=et.current;if(!we)return;const Ke=we.closest(`.${e}-lightbox-content-area`);if(!Ke)return we.getBoundingClientRect().width;const P=Array.from(Ke.children).reduce((ae,pe)=>!(pe instanceof HTMLElement)||pe.contains(we)?ae:ae+pe.getBoundingClientRect().width,0);return Ke.getBoundingClientRect().width-P},[e]),he=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),_e=s.useCallback(we=>{we===J.current&&(q(null),ee(!1))},[]),Ve=s.useCallback(()=>{o||it.current||(it.current=!0,u==null||u(),Se(!1),Xe.current=setTimeout(()=>{p()},300))},[o,u,p]),tt=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ht,backdropStyle:at,mediaAreaStyle:Oe,overlayContentStyle:Ae,swipeHandlers:Pe,dismissAreaStyle:Ze}=du({enabled:Ie,onClose:Ve,animMs:300,isBlockedTarget:tt}),Ne=s.useCallback(we=>{d&&qd(we+1,c,!0)},[d,c]),rt=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),ot=s.useCallback(we=>{if(xe.length===0)return;const Ke=(we%xe.length+xe.length)%xe.length;if(Ke===ue)return;const P=xe[ue],ae=xe[Ke];J.current+=1;const pe=J.current,Me=I==="fade"&&Bl(P==null?void 0:P.entry)!==Bl(ae==null?void 0:ae.entry),Ue=rt(Je.current),ct=Me?(()=>{const At=Qe();Gn.flushSync(()=>{Ee(ae.entry)}),Je.current&&At&&(Je.current.style.width=`${At}px`);const nn=rt(Je.current);return Je.current&&(Je.current.style.width=""),{measuredIncomingTitlesHeight:nn,incomingTitlesMeasureWidth:At}})():void 0,Rt=Math.max(Ue??0,(ct==null?void 0:ct.measuredIncomingTitlesHeight)??0)||void 0;D(pe),q(ue),ee(!0),U(Ke),Ne(Ke),Be.current=Ke,Me?(he(),Rt&&Q(Rt),ct!=null&&ct.incomingTitlesMeasureWidth&&N(ct.incomingTitlesMeasureWidth),ye((P==null?void 0:P.entryIndex)??null),Ce(!0),Ye.current=ae.entryIndex,ge.current=setTimeout(()=>{ye(null),Ce(!1),Q(void 0),N(void 0),Ee(null),ge.current=null},400)):(he(),ye(null),Ce(!1),Q(void 0),N(void 0),Ee(null),Ye.current=ae.entryIndex)},[ue,he,Qe,rt,xe,Ne,I]),me=s.useCallback(()=>{De.current=null},[]),Fe=s.useCallback(we=>{!fe||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(De.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[fe,xe.length]),st=s.useCallback(we=>{var At;if(!fe||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(ht){me();return}const Ke=De.current;if(!Ke||Ke.pointerId!==we.pointerId||(me(),we.target.closest("[data-controls]")))return;const ae=we.clientX-Ke.startX,pe=we.clientY-Ke.startY,Me=Math.abs(ae),Ue=Math.abs(pe);if(Me>=Vf&&Me>Ue){ot(ae>0?ue-1:ue+1);return}if(Me>Ol||Ue>Ol)return;const ct=(At=Ge.current)==null?void 0:At.getBoundingClientRect(),Rt=ct?ct.left+ct.width/2:window.innerWidth/2;ot(we.clientX<Rt?ue-1:ue+1)},[ue,fe,ot,ht,me,xe.length]),dt=s.useCallback(we=>{const Ke=De.current;(Ke==null?void 0:Ke.pointerId)===we.pointerId&&me()},[me]);uu(),s.useEffect(()=>{He.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Se(!0),requestAnimationFrame(()=>{$e.current?$e.current.focus():Ge.current&&Ge.current.focus()})});return()=>{cancelAnimationFrame(we),Xe.current&&clearTimeout(Xe.current),ge.current&&clearTimeout(ge.current);const Ke=He.current;Ke&&document.contains(Ke)&&Ke.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;I!=="fade"&&(Ye.current=((we=xe[ue])==null?void 0:we.entryIndex)??0,he(),ye(null),Ce(!1),Q(void 0),N(void 0))},[ue,he,xe,I]),s.useEffect(()=>{const we=Ke=>{if(Ke.key==="Escape"){Ve();return}if(Ke.key==="ArrowLeft"&&xe.length>1){ot(ue-1);return}if(Ke.key==="ArrowRight"&&xe.length>1){ot(ue+1);return}if(Ke.key==="Tab"&&Ge.current){const P=Ge.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),ae=Array.from(P).filter(ct=>!ct.closest('[aria-hidden="true"]'));if(ae.length===0)return;const pe=ae[0],Me=ae[ae.length-1],Ue=document.activeElement;Ke.shiftKey?(Ue===pe||!Ge.current.contains(Ue))&&(Ke.preventDefault(),Me.focus()):(Ue===Me||!Ge.current.contains(Ue))&&(Ke.preventDefault(),pe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[ot,Ve,ue,xe.length]),s.useLayoutEffect(()=>{he(),J.current=0,D(0),q(null),ee(!1),ye(null),Ce(!1),Q(void 0),N(void 0),Ee(null),U(we=>{const Ke=Math.max(0,xe.length-1);return Math.min(we,Ke)})},[he,t.length,x,xe.length]),s.useLayoutEffect(()=>{var P;const we=Math.max(0,xe.length-1),Ke=Math.min(Math.max(0,l),we);Be.current=Ke,Ye.current=((P=xe[Ke])==null?void 0:P.entryIndex)??0,U(Ke)},[l]);const ze=ke!==null?t[ke]:null,ut=h!==null?xe[h]:null,Ct=(re==null?void 0:re.title1)||(re==null?void 0:re.title2)||(re==null?void 0:re.title3)||(ze==null?void 0:ze.title1)||(ze==null?void 0:ze.title2)||(ze==null?void 0:ze.title3),Tt=Jf(x,xe,t),xt=L!==null,Pt=Ct||Tt||xt,zt=Tt&&xt?{gap:B}:void 0,Xt=`${e}-titles-stack${oe?` ${e}-titles-stack-stacked`:""}`,Yt=`${e}-titles-layer-out${oe?` ${e}-titles-layer-out-stacked`:""}`,It=`${e}-titles-layer-out`,Ot=(z??0)>0||o,tn=S(F),yt=s.useMemo(()=>({title1Width:y??Yi.title1Width,title2Width:w??Yi.title2Width,title3Width:V??Yi.title3Width}),[y,w,V]),Le=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:M}),[Y,M]),qe=s.useMemo(()=>re?Qn(e,re,k,de,G):[],[e,re,k,de,G]),lt=s.useMemo(()=>qe.map(we=>yt[we.widthKey]),[qe,yt]),vt=s.useMemo(()=>no(qe.length,lt),[qe.length,lt]),wt=s.useMemo(()=>jo(qe.length,lt),[qe.length,lt]),Et=s.useMemo(()=>qe.filter(we=>we.prefix==="title1"),[qe]),ft=s.useMemo(()=>qe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[qe]),Bt=s.useMemo(()=>ei(Et,yt),[Et,yt]),Nt=s.useMemo(()=>ei(ft,yt),[ft,yt]),Ft=s.useCallback((we,Ke)=>{const P=qe.findIndex(pe=>pe.prefix===we.prefix);if(!oe||Ke==="single-row")return{effectiveWidth:wt[P]??0,resolvedWidth:vt[P]??0,maxWidth:dn(P,vt)};if(Ke==="two-row-top"){const pe=Et.findIndex(Me=>Me.prefix===we.prefix);return{effectiveWidth:Bt.effective[pe]??0,resolvedWidth:Bt.resolved[pe]??0,maxWidth:dn(pe,Bt.resolved)}}const ae=ft.findIndex(pe=>pe.prefix===we.prefix);return{effectiveWidth:Nt.effective[ae]??0,resolvedWidth:Nt.resolved[ae]??0,maxWidth:dn(ae,Nt.resolved)}},[qe,ft,Nt,wt,vt,Et,Bt,oe]),Vt=s.useCallback(we=>Kd(qe,vt,Le,we)+(oe?0:z??0),[qe,vt,Le,oe,z]),Gt=s.useCallback(()=>oe?0:z??0,[oe,z]),Dt=s.useCallback(we=>ft.slice(0,we).reduce((Ke,P,ae)=>Ke+(P.marginLeftKey?Le[P.marginLeftKey]??0:0)+(Nt.resolved[ae]??0),0),[ft,Nt.resolved,Le]),jt=s.useCallback(we=>{const Ke=ft[we];return Dt(we)+(Ke.marginLeftKey?Le[Ke.marginLeftKey]??0:0)+(Nt.resolved[we]??0)},[ft,Nt.resolved,Dt,Le]),Ht=s.useCallback((we,Ke,P)=>{if(!oe||P==="single-row"){const ct=we.findIndex(Qt=>Qt.prefix===Ke.prefix),Rt=we.map(Qt=>yt[Qt.widthKey]),At=no(we.length,Rt);return{effectiveWidth:jo(we.length,Rt)[ct]??0,resolvedWidth:At[ct]??0,maxWidth:dn(ct,At)}}if(P==="two-row-top"){const ct=we.filter(Qt=>Qt.prefix==="title1"),Rt=ct.findIndex(Qt=>Qt.prefix===Ke.prefix),{resolved:At,effective:nn}=ei(ct,yt);return{effectiveWidth:nn[Rt]??0,resolvedWidth:At[Rt]??0,maxWidth:dn(Rt,At)}}const ae=we.filter(ct=>ct.prefix==="title2"||ct.prefix==="title3"),pe=ae.findIndex(ct=>ct.prefix===Ke.prefix),{resolved:Me,effective:Ue}=ei(ae,yt);return{effectiveWidth:Ue[pe]??0,resolvedWidth:Me[pe]??0,maxWidth:dn(pe,Me)}},[yt,oe]),bt=(we,Ke,P)=>{const ae=we.marginLeftKey?Le[we.marginLeftKey]??0:0,{effectiveWidth:pe,resolvedWidth:Me,maxWidth:Ue}=P??Ft(we,Ke),ct=Math.max(ae,Jn),Rt=o&&Ke==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:S(pe),...ae>0?{marginLeft:S(ae)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),Rt&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:S(-ae),width:S(ct),height:"100%",pointerEvents:"auto"}}):null,Rt?a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ue),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:S(-yn/2),width:S(yn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},A=(we="two-row")=>{const Ke=qe.findIndex(pe=>pe.prefix==="title1"),P=Ke>=0?vt[Ke]:yt.title1Width,ae=we==="two-row"&&o;return a.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(P)}:{},style:{width:S(z??0),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Te=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:k,"aria-hidden":"true",children:" "}),We=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Zf(xe,ue,x,t)}),je=()=>Tt?o&&xt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[We(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${La(B)} + ${B}))`,width:La(B),height:"100%",pointerEvents:"auto",zIndex:3}})]}):We():null,pt=()=>!Tt&&!xt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:zt,children:[je(),xt?Lt():null]}),_t=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Tt||Ct?Te():null,Ot?A("single-row"):null,kt(re),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),pt(),Tn()]}),mt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Tt||Ct?Te():null,Ot?A("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:be&&R?{minHeight:R}:void 0,children:[a.jsx("div",{ref:Je,className:Xt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ui(te||re)}),a.jsxs("div",{ref:et,className:Xt,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%",...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[ze&&be?a.jsx("div",{className:`${Yt} ${e}-titles-fade-out`,children:ui(ze)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ui(re)})]})]}),pt(),Tn()]}),Lt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:j.scalingValue(W??0,i),height:j.scalingValue(W??0,i),marginRight:ie,"--close-icon-hover-color":C},children:[a.jsx("button",{ref:$e,type:"button",className:`${e}-close-icon-inner`,onClick:Ve,"aria-label":"Close",children:a.jsx(ln,{url:L??"",fill:O,hoverFill:i&&!r?O:C,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ie,height:"100%",pointerEvents:"auto"}})]}),qt=(we,Ke)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Tt||Ct?Te():null,Ot?A("two-row"):null,Ke!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ke},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),pt()]}),kt=we=>{if(!we)return null;const Ke=Qn(e,we,k,de,G);return a.jsx(a.Fragment,{children:Ke.map(P=>bt(P,"single-row",Ht(Ke,P,"single-row")))})},rn=we=>{if(!we)return null;const Ke=Qn(e,we,k,de,G),P=Ke.find(ae=>ae.prefix==="title1");return P?bt(P,"two-row-top",Ht(Ke,P,"two-row-top")):null},pn=(we,Ke=!1)=>{const P=we?Qn(e,we,k,de,G):[],ae=P.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),pe=o&&Ke;return ae.length>0||pe||(F??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[ae.map(Ue=>bt(Ue,"two-row-bottom",Ht(P,Ue,"two-row-bottom"))),Ke&&o?a.jsxs(a.Fragment,{children:[ua(),pa()]}):null]}):null,(F??0)>0||pe?a.jsx("div",{"data-controls":pe?"titleRowMarginBottom":void 0,"data-controls-axis":pe?"y":void 0,"data-controls-reverse":pe?"":void 0,className:pe?`${e}-control`:void 0,style:{height:tn,width:"100%",flexShrink:0,pointerEvents:pe?"auto":"none"}}):null]}):null},di=(we,Ke=!1)=>a.jsxs(a.Fragment,{children:[qt(rn(we)),pn(we,Ke)]}),ui=we=>oe?a.jsx("div",{className:`${e}-titles-row-two-row`,children:di(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:kt(we)}):null,nr=()=>{const we=oe?-1:qe.findIndex(ae=>ae.prefix==="title1"),Ke=!oe&&(o||(z??0)>0)?(()=>{const ae=z??0,pe=we>=0?vt[we]:yt.title1Width,Me=Math.max(ae,Jn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(pe),style:{position:"absolute",top:0,left:0,width:S(Me),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,P=qe.flatMap((ae,pe)=>{if(!ae.marginLeftKey)return[];const Me=Le[ae.marginLeftKey]??0,Ue=Yd(qe,vt,Le,pe)+Gt(),ct=Math.max(Me,Jn);return a.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(vt[pe]),style:{position:"absolute",top:0,left:S(Ue),width:S(ct),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return Ke?[Ke,...P]:P},ir=()=>qe.map((we,Ke)=>{const P=dn(Ke,vt),pe=Vt(Ke)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(P),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),ua=()=>ft.flatMap((we,Ke)=>{if(!we.marginLeftKey)return[];const P=Le[we.marginLeftKey]??0,ae=Dt(Ke),pe=Math.max(P,Jn),{resolvedWidth:Me}=Ft(we,"two-row-bottom");return a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:S(ae),width:S(pe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),pa=()=>ft.map((we,Ke)=>{const{maxWidth:P}=Ft(we,"two-row-bottom"),pe=jt(Ke)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":we.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(P),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:S(pe),width:S(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),Tn=()=>!o||oe?null:a.jsxs(a.Fragment,{children:[nr(),ir()]}),Mi=we=>{const Ke=!we.objectFit&&zn(b);return{className:`${e}-slide-image-cell${Ke?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:$,maxHeight:H,...Ke?{"--image-aspect-ratio":ca(b)}:{}}}},or=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:zn(b)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},pi=we=>{if(we.length===0)return null;const Ke=we.length>1,P=La(Z),ae=`calc(-0.5 * (${P} + ${Z}))`;if(we.length===1){const pe=we[0];return a.jsx("div",{...Mi(pe),children:a.jsx("img",{...or(pe),src:pe.url,alt:pe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ke?{gap:Z}:void 0,children:we.map((pe,Me)=>a.jsxs("div",{...Mi(pe),children:[a.jsx("img",{...or(pe),src:pe.url,alt:pe.name??"",draggable:!1}),o&&Ke&&Me<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ae,width:P,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${pe.url}-${Me}`))})},rr=!!(re!=null&&re.title2||re!=null&&re.title3||ze!=null&&ze.title2||ze!=null&&ze.title3||(F??0)>0||o),ma=()=>a.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[a.jsx("div",{ref:Je,className:Xt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(te||re)}),a.jsxs("div",{ref:et,className:`${e}-titles-row-two-row`,style:{...be&&R?{minHeight:R}:void 0,...be&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[qt(a.jsxs("div",{className:Xt,style:{position:be?"absolute":"relative",inset:be?0:void 0,width:"100%"},children:[ze&&be?a.jsx("div",{className:`${It} ${e}-titles-fade-out`,children:rn(ze)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:rn(re)})]}),be&&R?R:void 0),rr?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ze&&be?a.jsx("div",{className:`${Yt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(ze)}):null,a.jsx("div",{className:`${e}-titles-layer-in${be?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${oe?` ${e}-titles-layer-in-stacked`:""}`,children:pn(re,!0)})]}):null]})]}),ga=()=>{const we=rr;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...we?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:we?void 0:{flex:"0 0 auto",height:"auto"},children:di(re,!0)}),Tn()]})};return a.jsxs("div",{ref:Ge,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ht||Ve()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:xt?void 0:-1,style:{opacity:Re?1:0,transition:"opacity 300ms ease",pointerEvents:Re?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:m,...at}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ze,...Pe,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Oe,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":fe&&xe.length>1?"true":"false",onPointerDown:fe?Fe:void 0,onPointerUp:fe?st:void 0,onPointerCancel:fe?dt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[ut&&X?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&_e(ve)},children:a.jsx("div",{className:`${e}-slide-area`,children:pi(ut.images)})},`slide-out-${ve}`):null,a.jsx("div",{className:`${e}-slide-layer-in${X?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:se?pi(se.images):null})},`slide-in-${ve}-${ue}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ae,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:le,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...oe?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${oe?` ${e}-lightbox-content-area-stacked`:""}`,children:Pt&&a.jsx("div",{className:`${e}-text-bar-cell${oe?` ${e}-text-bar-cell-stacked`:""}`,style:oe?void 0:{flex:1,minWidth:0,width:"100%"},children:oe?I==="fade"?ma():ga():I==="fade"?mt():_t()})})})]})]})]})};function A0(e){return`
|
|
15250
15250
|
.${e}-wrapper {
|
|
15251
15251
|
position: relative;
|
|
15252
15252
|
width: 100%;
|
|
@@ -15768,7 +15768,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15768
15768
|
pointer-events: auto;
|
|
15769
15769
|
z-index: 10;
|
|
15770
15770
|
}
|
|
15771
|
-
`}const F0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=j.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,b=s.useRef(null),[m,g]=s.useState(!1),[f,v]=s.useState(0),I=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),V=s.useMemo(()=>(t??[]).filter(T=>to(T).length>0),[t]),z=m&&V.length>0,Y=!n,M=s.useCallback(()=>{Y&&(w.current=!0,qf(y.current,c),y.current=!1)},[Y,c]),F=(T=0)=>{if(V.length===0||n&&!i&&!o)return;const L=Ar(V,x),W=Math.max(0,Math.min(T,L.length-1));if(v(W),Y){const O=Xd();qd(W+1,c,O),y.current=!O}g(!0)},K=s.useCallback(()=>{g(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!Y||typeof window>"u")return;const T=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=T}},[Y]),s.useEffect(()=>{if(!Y||I.current)return;I.current=!0;const T=jl(c);if(!T)return;const L=zl(T,Ar(V,x).length);L<0||(v(L),g(!0))},[V,c,Y,x]),s.useEffect(()=>{if(!Y)return;const T=()=>{if(w.current){w.current=!1,g(!1);return}const L=jl(c);if(!L){g(!1);return}const W=zl(L,Ar(V,x).length);if(W<0){g(!1);return}y.current=!1,v(W),g(!0)};return window.addEventListener("popstate",T),()=>window.removeEventListener("popstate",T)},[V,c,Y,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:A0(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${zn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>F(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...zn(p)?{"--image-aspect-ratio":
|
|
15771
|
+
`}const F0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=j.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:x}=e,b=s.useRef(null),[m,g]=s.useState(!1),[f,v]=s.useState(0),I=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),V=s.useMemo(()=>(t??[]).filter(T=>to(T).length>0),[t]),z=m&&V.length>0,Y=!n,M=s.useCallback(()=>{Y&&(w.current=!0,qf(y.current,c),y.current=!1)},[Y,c]),F=(T=0)=>{if(V.length===0||n&&!i&&!o)return;const L=Ar(V,x),W=Math.max(0,Math.min(T,L.length-1));if(v(W),Y){const O=Xd();qd(W+1,c,O),y.current=!O}g(!0)},K=s.useCallback(()=>{g(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||g(!1)},[n,i,o]),s.useEffect(()=>{if(!Y||typeof window>"u")return;const T=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=T}},[Y]),s.useEffect(()=>{if(!Y||I.current)return;I.current=!0;const T=jl(c);if(!T)return;const L=zl(T,Ar(V,x).length);L<0||(v(L),g(!0))},[V,c,Y,x]),s.useEffect(()=>{if(!Y)return;const T=()=>{if(w.current){w.current=!1,g(!1);return}const L=jl(c);if(!L){g(!1);return}const W=zl(L,Ar(V,x).length);if(W<0){g(!1);return}y.current=!1,v(W),g(!0)};return window.addEventListener("popstate",T),()=>window.removeEventListener("popstate",T)},[V,c,Y,x]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:b,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:A0(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${zn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>F(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...zn(p)?{"--image-aspect-ratio":ca(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${zn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),z&&typeof document<"u"&&(()=>{const T=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx(k0,{prefix:d,entries:V,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:Y,journalItemId:c,onBeforeClose:M,onClose:K}),T)})()]})},W0=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15772
15772
|
import { createPortal } from 'react-dom';
|
|
15773
15773
|
import { CommonComponentProps } from '../props';
|
|
15774
15774
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16533,7 +16533,7 @@ export type LightboxJournalSettings = {
|
|
|
16533
16533
|
closeIconColor: string;
|
|
16534
16534
|
closeIconHoverColor: string;
|
|
16535
16535
|
};
|
|
16536
|
-
`,_0="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>'),xi={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 N0(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...xi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...xi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...xi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...xi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...xi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...xi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...xi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const H0=ri.reduce((e,t)=>({...e,...N0(t)}),{}),O0=ri.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Goudy Bookletter 1911",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ha(e){return ri.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const D0=Qf(),j0={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"}},...H0,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:_0,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...O0,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,...Ha({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,...Ha({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,...Ha({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:[D0]}],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"}]}]}},z0={element:F0,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:j0,sourceCode:W0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ri.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{...ri.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})}},B0={sizeType:"custom",value:700,min:400,max:700};function Vr(e,t){return{widthPx:e,heightPx:e*t}}function ms(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 hc(e,t,n,i){const{heightPx:o}=Vr(n,i);return ms(e/2,t/2,e,t,n,o)}function mu(e,t,n){for(const i of n){const{heightPx:o}=Vr(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 V0(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":mu(e,t,n)||r==="area"?l??"none":d??"none"}function fc(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 G0(e){return`
|
|
16536
|
+
`,_0="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>'),vi={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 N0(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...vi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...vi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...vi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...vi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...vi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...vi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...vi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const H0=oi.reduce((e,t)=>({...e,...N0(t)}),{}),O0=oi.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Goudy Bookletter 1911",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Na(e){return oi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const D0=Qf(),j0={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"}},...H0,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:_0,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...O0,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,...Na({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,...Na({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,...Na({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:[D0]}],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"}]}]}},z0={element:F0,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:j0,sourceCode:W0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...oi.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{...oi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})}},B0={sizeType:"custom",value:700,min:400,max:700};function Vr(e,t){return{widthPx:e,heightPx:e*t}}function ps(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 hc(e,t,n,i){const{heightPx:o}=Vr(n,i);return ps(e/2,t/2,e,t,n,o)}function mu(e,t,n){for(const i of n){const{heightPx:o}=Vr(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 V0(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":mu(e,t,n)||r==="area"?l??"none":d??"none"}function fc(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 G0(e){return`
|
|
16537
16537
|
.${e}-root {
|
|
16538
16538
|
position: absolute;
|
|
16539
16539
|
top: 0;
|
|
@@ -16568,7 +16568,7 @@ export type LightboxJournalSettings = {
|
|
|
16568
16568
|
width: 32px;
|
|
16569
16569
|
height: 32px;
|
|
16570
16570
|
}
|
|
16571
|
-
`}function q0(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 X0(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await q0(i)]));return new Map(n)}function U0({settings:e,content:t=[],isEditor:n}){const{prefix:i}=j.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,b]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,I]=s.useState(!1),[y,w]=s.useState(!1),V=s.useRef(new Map),{imageSize:z=B0,cursor:Y="system",target:M="area",position:F="random",visible:K="all",defaultCursor:T=null,hoverCursor:L=null}=e,W=t.filter($=>{var H;return!!((H=$==null?void 0:$.image)!=null&&H.url)}),O=s.useMemo(()=>G0(i),[i]),C=s.useCallback(($,H,B=l)=>{if(!o)return;const
|
|
16571
|
+
`}function q0(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 X0(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await q0(i)]));return new Map(n)}function U0({settings:e,content:t=[],isEditor:n}){const{prefix:i}=j.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[x,b]=s.useState({x:0,y:0}),[m,g]=s.useState("none"),f=s.useRef({x:0,y:0}),[v,I]=s.useState(!1),[y,w]=s.useState(!1),V=s.useRef(new Map),{imageSize:z=B0,cursor:Y="system",target:M="area",position:F="random",visible:K="all",defaultCursor:T=null,hoverCursor:L=null}=e,W=t.filter($=>{var H;return!!((H=$==null?void 0:$.image)!=null&&H.url)}),O=s.useMemo(()=>G0(i),[i]),C=s.useCallback(($,H,B=l)=>{if(!o)return;const le=o.getBoundingClientRect(),ie=$-le.left,k=H-le.top;b({x:ie,y:k}),g(V0(ie,k,B,o,Y,M,L,T))},[o,l,Y,M,L,T]);s.useEffect(()=>{const $=[...W.map(B=>B.image.url),T,L].filter(B=>!!B);if($.length===0){V.current=new Map,w(!0);return}let H=!1;return w(!1),X0($).then(B=>{H||(V.current=B,w(!0))}),()=>{H=!0}},[t,T,L]),s.useEffect(()=>{if(!o)return;const $=B=>{B.stopPropagation(),f.current={x:B.clientX,y:B.clientY},C(B.clientX,B.clientY)},H=()=>{v&&C(f.current.x,f.current.y)};return o.addEventListener("mousemove",$),window.addEventListener("scroll",H,!0),()=>{o.removeEventListener("mousemove",$),window.removeEventListener("scroll",H,!0)}},[o,v,C]),s.useEffect(()=>{!o||!v||C(f.current.x,f.current.y)},[l,o,v,C]),s.useEffect(()=>{v||g("none")},[v]);const E=($,H,B,le={})=>{var oe,fe;if(!((oe=$==null?void 0:$.image)!=null&&oe.url))return null;const ie=((fe=V.current.get($.image.url))==null?void 0:fe.aspectRatio)??1,k=fc($.image.url,z,V.current),{heightPx:de}=Vr(k,ie);let G=0,ce=0;return F==="same"?{x:G,y:ce}=hc(H,B,k,ie):(G=le.x??Math.random()*H,ce=le.y??Math.random()*B,{x:G,y:ce}=ps(G,ce,H,B,k,de)),{id:p.current++,url:$.image.url,link:$.link,name:$.image.name,x:G,y:ce,xRatio:G/H,yRatio:ce/B,aspectRatio:ie,widthPx:k}},_=()=>{if(!o)return;const $=o.getBoundingClientRect(),H=$.width,B=$.height;H===0||B===0||d(le=>le.length===0?le:le.map(ie=>{const k=z.sizeType==="random"?ie.widthPx:fc(ie.url,z,V.current),{heightPx:de}=Vr(k,ie.aspectRatio);if(F==="same"){const{x:oe,y:fe}=hc(H,B,k,ie.aspectRatio);return{...ie,x:oe,y:fe,widthPx:k}}const{x:G,y:ce}=ps(ie.xRatio*H,ie.yRatio*B,H,B,k,de);return{...ie,x:G,y:ce,widthPx:k}}))};s.useEffect(()=>{if(!o||W.length===0||!y)return;const $=o.getBoundingClientRect(),H=$.width,B=$.height,le=E(W[0],H,B);le&&(d([le]),u(W.length>1?1:0))},[z,F,o,t,y]),s.useEffect(()=>{if(!o)return;_();const $=new ResizeObserver(_);return $.observe(o),window.addEventListener("resize",_),()=>{$.disconnect(),window.removeEventListener("resize",_)}},[o,F,z,l.length]),s.useEffect(()=>{K==="last One"&&d($=>$.length>0?[$[$.length-1]]:[])},[K]);const S=$=>{if(!o||W.length===0||!y)return;const H=o.getBoundingClientRect(),B=$.clientX-H.left,le=$.clientY-H.top;if(M==="image"&&!mu(B,le,l))return;let ie=0,k=0;F==="on Click"?(ie=B,k=le):F==="same"?(ie=H.width/2,k=H.height/2):(ie=Math.random()*H.width,k=Math.random()*H.height);const de=W[c%W.length],G=E(de,H.width,H.height,{x:ie,y:k});if(!G)return;const ce=K==="all"?[...l,G]:[G];d(ce),u(oe=>(oe+1)%W.length),C($.clientX,$.clientY,ce)},Z=Y==="custom"&&m!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsxs("div",{ref:r,onClick:S,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:`${i}-root`,style:{cursor:Z?"none":"default"},children:[l.map($=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${$.y}px`,left:`${$.x}px`,width:`${$.widthPx}px`,cursor:Z?"none":"default"},children:M==="area"&&$.link?a.jsx("a",{href:$.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})}):a.jsx("img",{src:$.url,alt:$.name,className:`${i}-image`})},$.id)),v&&Z&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${x.x}px`,top:`${x.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${m}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const Y0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16572
16572
|
import { CommonComponentProps } from '../props';
|
|
16573
16573
|
import { useScopedStyles } from '../utils/index';
|
|
16574
16574
|
|
|
@@ -17208,7 +17208,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17208
17208
|
display: block;
|
|
17209
17209
|
pointer-events: none;
|
|
17210
17210
|
}
|
|
17211
|
-
`}function tx(e){return e==="blur"?Q0:e==="greyscale"?J0:0}function $o(e,t=1,n=1){const i=tx(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 yc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function nx(e,t){return t<=1?0:(e-1+t)%t}function ix(e,t=1){return!e||e.height===0?t:e.width/e.height}function ox(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 vc(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 gu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function xc(e,t,n){return{...gu(e),[`--${n}-stage-scale`]:t}}function rx(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 ax({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,q,X,ee,
|
|
17211
|
+
`}function tx(e){return e==="blur"?Q0:e==="greyscale"?J0:0}function $o(e,t=1,n=1){const i=tx(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 yc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function nx(e,t){return t<=1?0:(e-1+t)%t}function ix(e,t=1){return!e||e.height===0?t:e.width/e.height}function ox(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 vc(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 gu(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function xc(e,t,n){return{...gu(e),[`--${n}-stage-scale`]:t}}function rx(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 ax({settings:e,content:t,isEditor:n,isPreviewMode:i}){var Ce,h,q,X,ee,ve,D;const{prefix:o}=j.useScopedStyles(),r=s.useMemo(()=>ex(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,x=t??[],b=yc(x.length),[m,g]=s.useState(b.activeIndex),[f,v]=s.useState(b.backgroundIndex),[I,y]=s.useState(!1),[w,V]=s.useState(!1),[z,Y]=s.useState(null),[M,F]=s.useState(null),[K,T]=s.useState(0),[L,W]=s.useState(1),[O,C]=s.useState("none"),[E,_]=s.useState("next"),[S,Z]=s.useState({}),[$,H]=s.useState({width:0,height:0}),B=s.useRef(null),le=s.useRef(null),ie=!n||!!i,k=l??60,de=Math.max(10,Math.min(100,d??k)),G=Math.max(10,Math.min(100,c??k)),ce=Math.max(100,u),oe=$o(p),fe=s.useCallback(R=>{const Q=ix(R?S[R]:void 0);return ox($.width,$.height,Q,de,G)},[$.height,$.width,S,G,de]);s.useEffect(()=>{const R=le.current;if(!R)return;const Q=new ResizeObserver(([ne])=>{const{width:N,height:te}=ne.contentRect;H({width:N,height:te})});return Q.observe(R),()=>Q.disconnect()},[]),s.useEffect(()=>{const R=(t??[]).map(Q=>{var ne;return(ne=Q.image)==null?void 0:ne.url}).filter(Q=>!!Q);rx(R,(Q,ne)=>{Z(N=>{var te,Ee;return((te=N[Q])==null?void 0:te.width)===ne.width&&((Ee=N[Q])==null?void 0:Ee.height)===ne.height?N:{...N,[Q]:ne}})})},[t]),s.useEffect(()=>{const{backgroundIndex:R,activeIndex:Q}=yc(x.length);g(Q),v(R),y(!1),V(!1),Y(null),F(null),T(0),W(1),C("none"),_("next")},[x.length,t]),s.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const Ie=s.useCallback(R=>{var ge,J,Ye,Be;if(!ie||I||x.length<=1)return;const Q=R==="next"?(m+1)%x.length:(m-1+x.length)%x.length,ne=fe((J=(ge=x[m])==null?void 0:ge.image)==null?void 0:J.url),N=fe((Be=(Ye=x[Q])==null?void 0:Ye.image)==null?void 0:Be.url),te=vc($.width,$.height,ne),Ee=vc($.width,$.height,N);B.current&&clearTimeout(B.current),_(R),V(!0),y(!0),R==="next"?(Y(m),F(Q),T(0),W(1),C($o(p,0,1))):(v(nx(Q,x.length)),Y(Q),F(m),T(1),W(Ee),C($o(p,1,Ee))),requestAnimationFrame(()=>{V(!1),requestAnimationFrame(()=>{R==="next"?(T(1),W(te),C($o(p,1,te))):(T(0),W(1),C($o(p,0,1)))})}),B.current=setTimeout(()=>{R==="next"&&v(m),g(Q),Y(null),F(null),y(!1)},ce)},[m,p,$.height,$.width,fe,I,ie,x,ce]),xe=x[m],ue=f!==null?x[f]:null,U=z!==null?x[z]:null,se=M!==null?x[M]:null,re=x.length<=1?0:(m-1+x.length)%x.length,Re=x.length<=1?0:(m+1)%x.length,Se=fe((Ce=xe==null?void 0:xe.image)==null?void 0:Ce.url),ke=fe((h=U==null?void 0:U.image)==null?void 0:h.url),ye=fe((q=se==null?void 0:se.image)==null?void 0:q.url),be={[`--${o}-transition-ms`]:`${ce}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:le,className:$t(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:be,"aria-label":"Zoom gallery",children:[((X=ue==null?void 0:ue.image)==null?void 0:X.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ue.image.url,alt:"",style:{filter:oe}})}),I&&((ee=U==null?void 0:U.image)==null?void 0:ee.url)&&a.jsx("div",{className:$t(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${E}`),style:xc(ke,L,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:U.image.url,alt:"",style:{filter:O}})}),I&&((ve=se==null?void 0:se.image)==null?void 0:ve.url)&&a.jsx("div",{className:$t(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${E}`),style:xc(ye,K,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:se.image.url,alt:""})}),!I&&((D=xe==null?void 0:xe.image)==null?void 0:D.url)&&a.jsx("div",{className:$t(`${o}-stage`,`${o}-foreground`),style:gu(Se),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),ie&&x.length>1&&!I&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:$t(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ie("prev"),"aria-label":`Show previous image (${re+1} of ${x.length})`}),a.jsx("button",{type:"button",className:$t(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ie("next"),"aria-label":`Show next image (${Re+1} of ${x.length})`})]})]})]})}const sx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17212
17212
|
import cn from 'classnames';
|
|
17213
17213
|
import { CommonComponentProps } from '../props';
|
|
17214
17214
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17727,7 +17727,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17727
17727
|
</>
|
|
17728
17728
|
);
|
|
17729
17729
|
}
|
|
17730
|
-
`,lx={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},cx={element:ax,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:lx,sourceCode:sx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},dx={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},ux=["hover","active"],
|
|
17730
|
+
`,lx={type:"object",version:1,settings:{sizing:"manual",properties:{maxWidth:{type:"number",scope:"common",title:"Max width (%)",display:{type:"percentage-input"},min:10,max:100},maxHeight:{type:"number",scope:"common",title:"Max height (%)",display:{type:"percentage-input"},min:10,max:100},transition:{type:"number",scope:"common",title:"Transition (ms)",display:{type:"common-numeric-input"},min:100,max:9999},bgImage:{type:"string",scope:"common",title:"BG image",display:{type:"toggle-cycle",enum:["greyscale","blur","as is"]}}},defaults:{maxWidth:60,maxHeight:60,transition:700,bgImage:"greyscale"},layout:["__componentName__","maxWidth","maxHeight","transition","bgImage"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["maxWidth","maxHeight"]},{type:"row",title:"",items:["transition","bgImage"]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",isObjectFitEditable:!1}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""}},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""}}]}},cx={element:ax,id:"scale",name:"Scale",category:"galleries",version:1,defaultSize:{d:{width:920,height:540},m:{width:"100%",height:300}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Scale.mp4"},schema:lx,sourceCode:sx,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},dx={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},ux=["hover","active"],Ha={left:"flex-start",center:"center",right:"flex-end"};function px(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 mx(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 gx(e){const t=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-box-shadow-color, transparent)`,n=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-inner-box-shadow-color, transparent)`,i=`${t}, ${n}`,o=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-hover-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,r=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-hover-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,l=`${o}, ${r}`,d=`var(--${e}-box-shadow-x, 0) var(--${e}-box-shadow-y, 0) var(--${e}-box-shadow-blur, 0) var(--${e}-box-shadow-spread, 0) var(--${e}-active-box-shadow-color, var(--${e}-box-shadow-color, transparent))`,c=`inset var(--${e}-inner-box-shadow-x, 0) var(--${e}-inner-box-shadow-y, 0) var(--${e}-inner-box-shadow-blur, 0) var(--${e}-inner-box-shadow-spread, 0) var(--${e}-active-inner-box-shadow-color, var(--${e}-inner-box-shadow-color, transparent))`,u=`${d}, ${c}`,p=`0 4px 12px rgba(0, 0, 0, 0.15), ${n}`,x=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,b=`.${e}-button:hover, ${x}`,m=g=>`.${e}-hover-effect-${g}:hover, .${e}-hover-effect-${g}:focus-visible, a:focus-visible .${e}-hover-effect-${g}`;return`
|
|
17731
17731
|
.${e}-root {
|
|
17732
17732
|
line-height: 0;
|
|
17733
17733
|
}
|
|
@@ -17969,7 +17969,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17969
17969
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17970
17970
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17971
17971
|
}
|
|
17972
|
-
`}function
|
|
17972
|
+
`}function Oa(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 bc(e,t,n="fill",i=100,o=0,r){if(!t)return null;const l=a.jsx(ln,{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=j.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 hx({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=j.useScopedStyles(),l=s.useMemo(()=>gx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:x,order:b="text-icon",gap:m=0,iconSize:g=0,iconWidthC:f=0,dimensions:v=!1,padding:I={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:V="rgba(0, 0, 0, 0)",innerBoxShadow:z={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:Y="rgba(0, 0, 0, 0)",stroke:M=0,blur:F=0,backgroundColor:K="#000000",textColor:T="#ffffff",borderColor:L="#ffffff",iconColor:W="#ffffff",hoverEffect:O="none",fontFamily:C,fontSettings:E,fontSize:_,lineHeight:S,letterSpacing:Z=0,wordSpacing:$=0,textAppearance:H,stateOverrides:B,minWidth:le=0,minHeight:ie=0,width:k=0,height:de=0}=e,G=j.buildColorVars(r,{backgroundColor:K,textColor:T,borderColor:L,iconColor:W,boxShadowColor:V,innerBoxShadowColor:Y},dx,ux,B),ce=i&&i!=="default"?`${r}-state-${i}`:"",oe=t&&!n?`${r}-editing`:"",fe=O!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${O}`:"",Ie=O==="reveal"||O==="swipe",xe=O==="content-roll",ue=O==="reveal"&&(!t||n),U=v===!0,re=d==="a"?x??p:p,Re=d==="c",Se=d!=="b",ke={fontSettings:{fontFamily:C,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:_??.01,lineHeight:S,letterSpacing:Z,wordSpacing:$,textAppearance:H,color:T},be={...Se?sn(Zt(ke,t)):{},[`--${r}-box-shadow-x`]:j.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:j.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:j.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:j.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:j.scalingValue(z.left,t),[`--${r}-inner-box-shadow-y`]:j.scalingValue(z.top,t),[`--${r}-inner-box-shadow-blur`]:j.scalingValue(z.right,t),[`--${r}-inner-box-shadow-spread`]:j.scalingValue(z.bottom,t),[`--${r}-backdrop-blur`]:F>0?`blur(${j.scalingValue(F,t)})`:void 0,paddingTop:j.scalingValue(I.top,t),paddingRight:j.scalingValue(I.right,t),paddingBottom:j.scalingValue(I.bottom,t),paddingLeft:j.scalingValue(I.left,t),borderRadius:j.scalingValue(y,t),borderWidth:j.scalingValue(M,t),...Re?{}:{justifyContent:Ha[re],textAlign:re},...Re&&!xe?{gap:j.scalingValue(m,t)}:{},...U?{width:j.scalingValue(k,t),height:j.scalingValue(de,t)}:{minWidth:j.scalingValue(le,t),minHeight:j.scalingValue(ie,t),...Re?{width:"100%"}:{}}};let Ce;const h={display:"inline-flex",alignItems:"center",justifyContent:Re?Ha[re]:Ha[d==="a"?re:"center"],gap:Re?j.scalingValue(m,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:re}:{}};if(d==="b"){const ee=()=>bc(r,u,g>0?"fixed":"fill",100,g,t);Ce=xe?Oa(r,ee,`${r}-icon-roll`,void 0,h):ee()}else if(d==="c"){const ee=()=>{const ve=a.jsx("span",{className:`${r}-text`,style:{textAlign:re},children:c}),D=bc(r,u,f>0?"fixed":"fill",100,f,t);return b==="icon-text"?a.jsxs(a.Fragment,{children:[D,ve]}):a.jsxs(a.Fragment,{children:[ve,D]})};Ce=xe?Oa(r,ee,`${r}-icon-text-roll`,void 0,h):ee()}else Ce=xe?Oa(r,()=>c,`${r}-label-roll`,void 0,h):Ie?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const q=ue?ee=>px(ee,r):void 0,X=ue?ee=>mx(ee,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:G,children:a.jsx("div",{className:`${r}-wrapper ${ce} ${oe}`.trim(),children:a.jsx("div",{className:`${r}-button ${fe}`.trim(),style:be,onMouseEnter:q,onMouseLeave:X,role:"button",tabIndex:o||t&&!n?void 0:0,children:Ce})})})]})}const fx=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17973
17973
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17974
17974
|
import { CommonComponentProps } from '../props';
|
|
17975
17975
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18799,7 +18799,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18799
18799
|
pointer-events: auto;
|
|
18800
18800
|
flex-shrink: 0;
|
|
18801
18801
|
}
|
|
18802
|
-
`}const Rn=500,Co=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",Sx=72,$x=50,Cx=1e4,Tx=650,Lx=500;function Rx(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 hu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 Ix(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?hu(i,n):null}function Ex(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 Io(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 wc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Io(e,i,n)}const Mx=.03;function fu(e){return e.width*Mx}const ja={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function xr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Px(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function gs(e,t,n){const i=e.getBoundingClientRect(),o=i.width,r=i.height,l=t/n,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 kx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:gs(e,t.width,t.height)}function Ax(e,t){if(ua(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 Fx(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 Wx({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=>ua(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 co(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=fu(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 Gr(e,t,n){const i=co(e,t,n);return{...i,left:2*i.left-e.left}}function _x(e,t,n){const{left:i,width:o}=n,r=fu(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 yu(e,t,n,i){const o=co(e,"left",i),r=co(e,"right",i),l=Gr(e,"left",i),d=Gr(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 Nx(e,t,n,i){const{start:o,end:r}=yu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Hx(e,t,n){const i=co(e,t,n),o=Gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function ua(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Ox({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ua(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 Dx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:b,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:v}){const I=s.useRef(null),y=s.useRef(null),w=s.useRef(null),V=s.useRef(new Map),[z,Y]=s.useState(0),M=s.useRef(null),F=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),W=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(()=>{}),Z=s.useRef(null),$=s.useRef(null),H=s.useRef(null),B=s.useRef(!1),[ce,ie]=s.useState(null),[A,de]=s.useState(ja),[G,se]=s.useState(0),[oe,he]=s.useState("opening"),[Ie,ve]=s.useState(0),[ue,U]=s.useState(0),[le,re]=s.useState(!1),[Re,we]=s.useState(null),[ke,fe]=s.useState(null),[xe,Ce]=s.useState(null),[h,q]=s.useState(!1),[X,ee]=s.useState(null),[ye,D]=s.useState(!1),R=s.useRef(!1),[Q,ne]=s.useState(!1),[N,te]=s.useState(!1),Ee=s.useRef(n),me=s.useRef(void 0),J=t[n],Ke=J?ua(J):!1,Be=ue!==0||le,rt=!l&&(!r||!!d),Xe=c&&!l,nt=u.length>1,Qe=s.useCallback((P,Te)=>t.length<=1?null:t[(P+Te+t.length)%t.length]??null,[t]),Ge=nt?Io(u,p,-1):Qe(n,-1),Se=nt?Io(u,p,1):Qe(n,1),_e=Re===-1&&Be?nt&&ke!==null?Io(u,ke,-1):xe!==null?Qe(xe,-1):null:null,Oe=Re===1&&Be?nt&&ke!==null?Io(u,ke,1):xe!==null?Qe(xe,1):null:null,et=_e&&_e.url!==(Ge==null?void 0:Ge.url)?_e:null,ge=Oe&&Oe.url!==(Se==null?void 0:Se.url)?Oe:null,We=Ge&&Xe?(()=>{const P=nt?wc(u,p,-1):t.length>2?Qe((n-1+t.length)%t.length,-1):null;return P&&P.url!==Ge.url?P:null})():null,Ve=Se&&Xe?(()=>{const P=nt?wc(u,p,1):t.length>2?Qe((n+1)%t.length,1):null;return P&&P.url!==Se.url?P:null})():null,it=et??We,ht=ge??Ve,ct=s.useCallback((P,Te,Fe)=>{if(!P||!Te||!Fe)return;const ze=V.current,pt=ze.get(P);(pt==null?void 0:pt.width)===Te&&(pt==null?void 0:pt.height)===Fe||(ze.set(P,{width:Te,height:Fe}),Y(kt=>kt+1))},[]),Ne=s.useCallback(P=>{if(!(P!=null&&P.url))return null;const Te=V.current.get(P.url);return kx(y.current,Te)},[z,G]),Ae=s.useCallback(()=>{if(!J)return;const P=Ne(J);if(P){ie(P);return}const Te=y.current;Te&&ie(Sc(Te))},[J,Ne]),Pe=s.useCallback(P=>{if(nt){const Te=u.length;fe((p+P+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+P+t.length)%t.length),fe(null))},[nt,u.length,p,t.length,n]),Je=s.useCallback(P=>{O.current=P,re(P)},[]),He=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),tt=s.useCallback(()=>{He(),C.current=window.setTimeout(()=>{He(),Je(!1)},Co+32)},[He,Je]),at=s.useCallback(()=>{const P=I.current;if(!P){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:ja.width,height:typeof window<"u"?window.innerHeight:ja.height});return}const Te=P.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),st=s.useCallback((P,Te)=>{if(Be){if(Q&&!le)return`translate(${ue}px, 0px)`;if(le&&Re!==null){const Fe=Ne(P);if(!Fe)return;const{x:ze,y:pt}=Nx(Fe,Te,Re,A);return`translate(${ze}px, ${pt}px)`}if(le)return"translate(0px, 0px)"}},[Be,Q,le,ue,Re,A,Ne]),$e=s.useCallback(()=>{const P=E.current;E.current=null,He(),Je(!1),we(null),fe(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none",P===-1?f():P===1&&v()},[He,Je,f,v]),De=s.useCallback(()=>{He(),C.current=window.setTimeout(()=>{E.current!==null&&$e()},Co+32)},[He,$e]),lt=s.useCallback(()=>{He(),E.current=null,Je(!1),we(null),fe(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[He,Je]),Ue=s.useCallback(P=>{if(!(!Xe||!ce)){if(O.current){if(E.current===P){_.current=P,$e();return}lt()}He(),Pe(P),E.current=P,we(P),Je(!0),De()}},[Xe,ce,$e,lt,He,Pe,Je,De]);S.current=Ue;const qe=s.useCallback(()=>{Z.current=null,B.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),$t=s.useCallback(P=>{$.current!==null&&window.clearInterval($.current);const Te=B.current?Lx:Tx;$.current=window.setInterval(()=>{S.current(P)},Te)},[]),Ct=s.useCallback(P=>{Z.current!==P&&(qe(),Z.current=P,B.current=!1,S.current(P),$t(P),H.current=window.setTimeout(()=>{H.current=null,Z.current===P&&(B.current=!0,$t(P))},Cx))},[qe,$t]),vt=s.useCallback(()=>{const P=y.current;if(!P)return;const Te=J==null?void 0:J.url,Fe=Te?V.current.get(Te):void 0;if(Fe!=null&&Fe.width&&(Fe!=null&&Fe.height)){ie(gs(P,Fe.width,Fe.height));return}const ze=w.current;if(ze&&Te&&(ze.src===Te||ze.currentSrc===Te)){const{width:kt,height:mt}=Px(ze);if(kt&&mt){ct(Te,kt,mt),ie(gs(P,kt,mt));return}}const pt=Sc(P);!pt.width||!pt.height||ie(pt)},[J==null?void 0:J.url,ct]),Pt=s.useCallback(P=>{if(w.current=P,!!P){if(P instanceof HTMLVideoElement){P.readyState>=1&&P.videoWidth>0&&vt();return}P.complete&&P.naturalWidth>0&&vt()}},[vt]),Ht=s.useCallback(()=>{at(),vt(),se(P=>P+1)},[at,vt]);s.useEffect(()=>{Ht();const P=y.current,Te=I.current,Fe=new ResizeObserver(()=>Ht());return P&&Fe.observe(P),Te&&Fe.observe(Te),window.addEventListener("resize",Ht),()=>{Fe.disconnect(),window.removeEventListener("resize",Ht)}},[Ht,n,x]),s.useLayoutEffect(()=>{if(!J)return;const P=w.current;if(P){if(P instanceof HTMLImageElement&&P.complete&&P.naturalWidth>0){vt();return}P instanceof HTMLVideoElement&&P.readyState>=1&&P.videoWidth>0&&vt()}},[J==null?void 0:J.url,n,vt]),s.useEffect(()=>{Ae()},[Ae,z]),s.useEffect(()=>{const P=new Set,Te=[],Fe=ze=>{!(ze!=null&&ze.url)||P.has(ze.url)||(P.add(ze.url),Te.push(ze))};t.forEach(Fe),u.forEach(ze=>ze.items.forEach(Fe)),Te.forEach(ze=>{V.current.has(ze.url)||Ax(ze,ct)})},[t,u,ct]),s.useEffect(()=>{if(oe!=="opening"||!ce)return;if(!b){he("open");return}q(!1);const P=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),he("open")})});return()=>cancelAnimationFrame(P)},[oe,ce,b]),s.useEffect(()=>{if(oe!=="closing")return;const P=setTimeout(()=>g(),Rn);return()=>clearTimeout(P)},[oe,g]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{Ee.current===n&&me.current===(J==null?void 0:J.url)||(He(),E.current=null,we(null),fe(null),Ce(null),ve(0),U(0),Je(!1),te(!1),ne(!1),F.current=0,K.current=0,T.current="none",L.current=!1,M.current=null,W.current=!1,w.current=null,Ae(),Ee.current=n,me.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Je,He,Ae]),s.useLayoutEffect(()=>{const P=_.current;P!==null&&(_.current=null,requestAnimationFrame(()=>{S.current(P)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){R.current=!1,D(!1);return}if(oe!=="open"||R.current)return;if(!Ge&&!Se){R.current=!0;return}D(!1);const P=requestAnimationFrame(()=>{requestAnimationFrame(()=>{D(!0),R.current=!0})});return()=>cancelAnimationFrame(P)},[oe,Ge==null?void 0:Ge.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(oe!=="open")return;const P=()=>{const mt=Tt=>{Tt.stopPropagation(),Tt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Te=mt=>{const Tt=mt<0?1:-1;He(),Pe(Tt),E.current=Tt,we(Tt),Je(!0),De()},Fe=mt=>{if(Math.abs(mt)>$x&&Xe){Te(mt);return}E.current=null,we(null),fe(null),Ce(null),Je(!0),U(0),tt()},ze=mt=>{if(mt.touches.length!==1||O.current)return;const Tt=mt.touches[0];W.current=!0,M.current={x:Tt.clientX,y:Tt.clientY},T.current="none",K.current=0,L.current=!1},pt=mt=>{if(!M.current||mt.touches.length!==1||O.current)return;const Tt=mt.touches[0],qt=Tt.clientX-M.current.x,At=Tt.clientY-M.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(At)<10)return;if(Math.abs(qt)>Math.abs(At)){if(!Xe)return;T.current="horizontal"}else if(At>0){if(!rt)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,U(qt),mt.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),F.current=At,ve(At),mt.preventDefault())},kt=()=>{if(!M.current)return;const mt=T.current,Tt=L.current;if(Tt&&mt==="horizontal")Fe(K.current),P();else if(Tt&&mt==="vertical"){const qt=F.current;if(rt&&qt>Sx){const At=window.innerHeight;F.current=At,te(!0),ve(At),he("closing")}else F.current=0,ve(0);P()}else mt==="horizontal"&&Math.abs(K.current)>0&&(Fe(K.current),P());M.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",ze,{passive:!0}),document.addEventListener("touchmove",pt,{passive:!1}),document.addEventListener("touchend",kt),document.addEventListener("touchcancel",kt),()=>{document.removeEventListener("touchstart",ze),document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",kt),document.removeEventListener("touchcancel",kt)}},[oe,Xe,Je,tt,He,rt,De,Pe]);const Yt=s.useCallback(()=>{const P=(m==null?void 0:m())??b??null;P&&ce&&(ee(P),q(!0)),he("closing")},[m,b,ce]);s.useEffect(()=>{const P=ze=>{if(ze.key==="Escape"){if(r&&d||oe==="closing")return;qe(),Yt();return}if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight"||oe!=="open"||!Xe)return;ze.preventDefault();const pt=ze.key==="ArrowLeft"?-1:1;ze.repeat&&Z.current===pt||Ct(pt)},Te=ze=>{if(ze.key!=="ArrowLeft"&&ze.key!=="ArrowRight")return;const pt=ze.key==="ArrowLeft"?-1:1;Z.current===pt&&qe()},Fe=()=>{qe()};return window.addEventListener("keydown",P),window.addEventListener("keyup",Te),window.addEventListener("blur",Fe),()=>{window.removeEventListener("keydown",P),window.removeEventListener("keyup",Te),window.removeEventListener("blur",Fe),qe()}},[oe,r,d,Yt,Xe,Ct,qe]),s.useEffect(()=>{oe!=="open"&&qe()},[oe,qe]);const Kt=()=>{oe==="closing"||l||Yt()},Lt=oe==="open",Ot=oe==="closing",tn=Ie>0?Math.max(0,1-Ie/500):1,xt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(P=>{if(!(P.propertyName!=="transform"||!O.current)){if(E.current!==null){$e();return}He(),Je(!1)}},[He,Je,$e]),je=oe==="closing"?X??b:b,ut=je&&ce&&(oe==="opening"||Ot)?Rx(je,ce):void 0,ft=Be&&J?st(J,"center"):Ie>0?`translateY(${Ie}px)`:ut,bt=ce?xr(ce,A):null,Mt=!!(je&&ce),yt=Mt&&(oe==="closing"||oe==="open"&&h),Dt={position:"absolute",top:bt==null?void 0:bt.top,left:bt==null?void 0:bt.left,width:bt==null?void 0:bt.width,height:bt==null?void 0:bt.height,objectFit:"contain",transformOrigin:"top left",transform:ft,opacity:Ie>0?xt:Mt?1:oe==="opening"||Ot?0:1,transition:Q&&!le?"none":le?`transform ${Co}ms ${gn}`:N?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:yt?`transform ${Rn}ms ${gn}`:oe==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:Ke&&Lt&&!Be?"auto":"none",touchAction:Ke&&Lt?"none":void 0,zIndex:1,overflow:Ke?"hidden":void 0},_t={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Lt&&!Be?"auto":"none"},Nt=(P,Te,Fe="adjacent")=>{const ze=Ne(P);if(!ze)return{display:"none"};const pt=Fe==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:kt}=Re!==null?yu(ze,pt,Re,A):{start:Fe==="far"?Gr(ze,Te,A):co(ze,Te,A)},mt=xr(kt,A),Tt=st(P,pt),qt=!Be&&Fe==="adjacent"&&Lt&&!ye?Hx(ze,Te,A):null,At=Fe==="far"&&Be&&Re===(Te==="left"?-1:1),rn=Q&&!le?!1:le,pn=Fe==="adjacent"&&Lt&&ye&&!Be;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Tt??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:Fe==="far"?Lt&&At?1:0:Lt?1:0,transition:rn?Fe==="far"?`transform ${Co}ms ${gn}`:`transform ${Co}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:oe==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(P,Te)=>{const Fe=Ne(P);return Fe?_x(co(Fe,Te,A),Te,A):null},Gt=P=>Te=>{if(!l){if(W.current){W.current=!1;return}Te.stopPropagation(),Ue(P)}},zt=Ge?Vt(Ge,"left"):null,Bt=Se?Vt(Se,"right"):null,jt=zt?xr(zt,A):null,It=Bt?xr(Bt,A):null;return a.jsxs("div",{ref:I,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Kt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Lt?tn:0,transition:Q?"none":`opacity ${Rn}ms ${gn}`,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:Lt?1:0,transition:Q?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Zd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Kt})})]}),Lt&&it&&a.jsx(br,{media:it,style:Nt(it,"left","far"),onMeasure:ct,onTransitionEnd:Le},`far-prev-${it.url}`),Lt&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ge,style:Nt(Ge,"left"),onMeasure:ct,onTransitionEnd:Le},`prev-${Ge.url}`),jt&&a.jsx("div",{style:{position:"absolute",top:jt.top,left:jt.left,width:jt.width,height:jt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Lt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Se,style:Nt(Se,"right"),onMeasure:ct,onTransitionEnd:Le},`next-${Se.url}`),It&&a.jsx("div",{style:{position:"absolute",top:It.top,left:It.left,width:It.width,height:It.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Lt&&ht&&a.jsx(br,{media:ht,style:Nt(ht,"right","far"),onMeasure:ct,onTransitionEnd:Le},`far-next-${ht.url}`),ce&&J&&(Ke?a.jsx(Ox,{src:J.url,phase:oe,onMediaElement:Pt,wrapperStyle:Dt,videoStyle:_t,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Pt,src:J.url,alt:J.name,onLoad:vt,onTransitionEnd:Le,style:Dt},`${n}-${J.url}`))]})}const jx=20,zx=.18;function Bx(e){return`
|
|
18802
|
+
`}const Rn=500,Co=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",Sx=72,$x=50,Cx=1e4,Tx=650,Lx=500;function Rx(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 hu(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=jr(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 Ix(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?hu(i,n):null}function Ex(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 Io(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 wc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Io(e,i,n)}const Mx=.03;function fu(e){return e.width*Mx}const Da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function xr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Px(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ms(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 kx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ms(e,t.width,t.height)}function Ax(e,t){if(da(e)){const i=document.createElement("video"),o=()=>{i.videoWidth>0&&i.videoHeight>0&&t(e.url,i.videoWidth,i.videoHeight),i.removeEventListener("loadedmetadata",o)};i.addEventListener("loadedmetadata",o),i.preload="auto",i.src=e.url,i.load();return}const n=new Image;n.onload=()=>{n.naturalWidth>0&&n.naturalHeight>0&&t(e.url,n.naturalWidth,n.naturalHeight)},n.src=e.url}function Fx(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 Wx({mediaList:e}){return e.length===0?null:a.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>da(t)?a.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):a.jsx("img",{src:t.url,alt:""},t.url))})}function co(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=fu(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 Gr(e,t,n){const i=co(e,t,n);return{...i,left:2*i.left-e.left}}function _x(e,t,n){const{left:i,width:o}=n,r=fu(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 yu(e,t,n,i){const o=co(e,"left",i),r=co(e,"right",i),l=Gr(e,"left",i),d=Gr(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 Nx(e,t,n,i){const{start:o,end:r}=yu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Hx(e,t,n){const i=co(e,t,n),o=Gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function da(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Ox({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 br({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Dx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:x,sourceRect:b,resolveCloseSourceRect:m,onClose:g,onPrev:f,onNext:v}){const I=s.useRef(null),y=s.useRef(null),w=s.useRef(null),V=s.useRef(new Map),[z,Y]=s.useState(0),M=s.useRef(null),F=s.useRef(0),K=s.useRef(0),T=s.useRef("none"),L=s.useRef(!1),W=s.useRef(!1),O=s.useRef(!1),C=s.useRef(null),E=s.useRef(null),_=s.useRef(null),S=s.useRef(()=>{}),Z=s.useRef(null),$=s.useRef(null),H=s.useRef(null),B=s.useRef(!1),[le,ie]=s.useState(null),[k,de]=s.useState(Da),[G,ce]=s.useState(0),[oe,fe]=s.useState("opening"),[Ie,xe]=s.useState(0),[ue,U]=s.useState(0),[se,re]=s.useState(!1),[Re,Se]=s.useState(null),[ke,ye]=s.useState(null),[be,Ce]=s.useState(null),[h,q]=s.useState(!1),[X,ee]=s.useState(null),[ve,D]=s.useState(!1),R=s.useRef(!1),[Q,ne]=s.useState(!1),[N,te]=s.useState(!1),Ee=s.useRef(n),ge=s.useRef(void 0),J=t[n],Ye=J?da(J):!1,Be=ue!==0||se,it=!l&&(!r||!!d),Xe=c&&!l,et=u.length>1,Je=s.useCallback((A,Te)=>t.length<=1?null:t[(A+Te+t.length)%t.length]??null,[t]),Ge=et?Io(u,p,-1):Je(n,-1),$e=et?Io(u,p,1):Je(n,1),He=Re===-1&&Be?et&&ke!==null?Io(u,ke,-1):be!==null?Je(be,-1):null:null,De=Re===1&&Be?et&&ke!==null?Io(u,ke,1):be!==null?Je(be,1):null:null,Qe=He&&He.url!==(Ge==null?void 0:Ge.url)?He:null,he=De&&De.url!==($e==null?void 0:$e.url)?De:null,_e=Ge&&Xe?(()=>{const A=et?wc(u,p,-1):t.length>2?Je((n-1+t.length)%t.length,-1):null;return A&&A.url!==Ge.url?A:null})():null,Ve=$e&&Xe?(()=>{const A=et?wc(u,p,1):t.length>2?Je((n+1)%t.length,1):null;return A&&A.url!==$e.url?A:null})():null,tt=Qe??_e,ht=he??Ve,at=s.useCallback((A,Te,We)=>{if(!A||!Te||!We)return;const je=V.current,pt=je.get(A);(pt==null?void 0:pt.width)===Te&&(pt==null?void 0:pt.height)===We||(je.set(A,{width:Te,height:We}),Y(_t=>_t+1))},[]),Oe=s.useCallback(A=>{if(!(A!=null&&A.url))return null;const Te=V.current.get(A.url);return kx(y.current,Te)},[z,G]),Ae=s.useCallback(()=>{if(!J)return;const A=Oe(J);if(A){ie(A);return}const Te=y.current;Te&&ie(Sc(Te))},[J,Oe]),Pe=s.useCallback(A=>{if(et){const Te=u.length;ye((p+A+Te)%Te),Ce(null);return}t.length>1&&(Ce((n+A+t.length)%t.length),ye(null))},[et,u.length,p,t.length,n]),Ze=s.useCallback(A=>{O.current=A,re(A)},[]),Ne=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),rt=s.useCallback(()=>{Ne(),C.current=window.setTimeout(()=>{Ne(),Ze(!1)},Co+32)},[Ne,Ze]),ot=s.useCallback(()=>{const A=I.current;if(!A){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Da.width,height:typeof window<"u"?window.innerHeight:Da.height});return}const Te=A.getBoundingClientRect();de({left:Te.left,top:Te.top,width:Te.width,height:Te.height})},[]),me=s.useCallback((A,Te)=>{if(Be){if(Q&&!se)return`translate(${ue}px, 0px)`;if(se&&Re!==null){const We=Oe(A);if(!We)return;const{x:je,y:pt}=Nx(We,Te,Re,k);return`translate(${je}px, ${pt}px)`}if(se)return"translate(0px, 0px)"}},[Be,Q,se,ue,Re,k,Oe]),Fe=s.useCallback(()=>{const A=E.current;E.current=null,Ne(),Ze(!1),Se(null),ye(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none",A===-1?f():A===1&&v()},[Ne,Ze,f,v]),st=s.useCallback(()=>{Ne(),C.current=window.setTimeout(()=>{E.current!==null&&Fe()},Co+32)},[Ne,Fe]),dt=s.useCallback(()=>{Ne(),E.current=null,Ze(!1),Se(null),ye(null),Ce(null),U(0),ne(!1),L.current=!1,K.current=0,T.current="none"},[Ne,Ze]),ze=s.useCallback(A=>{if(!(!Xe||!le)){if(O.current){if(E.current===A){_.current=A,Fe();return}dt()}Ne(),Pe(A),E.current=A,Se(A),Ze(!0),st()}},[Xe,le,Fe,dt,Ne,Pe,Ze,st]);S.current=ze;const ut=s.useCallback(()=>{Z.current=null,B.current=!1,$.current!==null&&(window.clearInterval($.current),$.current=null),H.current!==null&&(window.clearTimeout(H.current),H.current=null)},[]),Ct=s.useCallback(A=>{$.current!==null&&window.clearInterval($.current);const Te=B.current?Lx:Tx;$.current=window.setInterval(()=>{S.current(A)},Te)},[]),Tt=s.useCallback(A=>{Z.current!==A&&(ut(),Z.current=A,B.current=!1,S.current(A),Ct(A),H.current=window.setTimeout(()=>{H.current=null,Z.current===A&&(B.current=!0,Ct(A))},Cx))},[ut,Ct]),xt=s.useCallback(()=>{const A=y.current;if(!A)return;const Te=J==null?void 0:J.url,We=Te?V.current.get(Te):void 0;if(We!=null&&We.width&&(We!=null&&We.height)){ie(ms(A,We.width,We.height));return}const je=w.current;if(je&&Te&&(je.src===Te||je.currentSrc===Te)){const{width:_t,height:mt}=Px(je);if(_t&&mt){at(Te,_t,mt),ie(ms(A,_t,mt));return}}const pt=Sc(A);!pt.width||!pt.height||ie(pt)},[J==null?void 0:J.url,at]),Pt=s.useCallback(A=>{if(w.current=A,!!A){if(A instanceof HTMLVideoElement){A.readyState>=1&&A.videoWidth>0&&xt();return}A.complete&&A.naturalWidth>0&&xt()}},[xt]),zt=s.useCallback(()=>{ot(),xt(),ce(A=>A+1)},[ot,xt]);s.useEffect(()=>{zt();const A=y.current,Te=I.current,We=new ResizeObserver(()=>zt());return A&&We.observe(A),Te&&We.observe(Te),window.addEventListener("resize",zt),()=>{We.disconnect(),window.removeEventListener("resize",zt)}},[zt,n,x]),s.useLayoutEffect(()=>{if(!J)return;const A=w.current;if(A){if(A instanceof HTMLImageElement&&A.complete&&A.naturalWidth>0){xt();return}A instanceof HTMLVideoElement&&A.readyState>=1&&A.videoWidth>0&&xt()}},[J==null?void 0:J.url,n,xt]),s.useEffect(()=>{Ae()},[Ae,z]),s.useEffect(()=>{const A=new Set,Te=[],We=je=>{!(je!=null&&je.url)||A.has(je.url)||(A.add(je.url),Te.push(je))};t.forEach(We),u.forEach(je=>je.items.forEach(We)),Te.forEach(je=>{V.current.has(je.url)||Ax(je,at)})},[t,u,at]),s.useEffect(()=>{if(oe!=="opening"||!le)return;if(!b){fe("open");return}q(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{q(!0),fe("open")})});return()=>cancelAnimationFrame(A)},[oe,le,b]),s.useEffect(()=>{if(oe!=="closing")return;const A=setTimeout(()=>g(),Rn);return()=>clearTimeout(A)},[oe,g]),s.useEffect(()=>()=>{Ne()},[Ne]),s.useLayoutEffect(()=>{Ee.current===n&&ge.current===(J==null?void 0:J.url)||(Ne(),E.current=null,Se(null),ye(null),Ce(null),xe(0),U(0),Ze(!1),te(!1),ne(!1),F.current=0,K.current=0,T.current="none",L.current=!1,M.current=null,W.current=!1,w.current=null,Ae(),Ee.current=n,ge.current=J==null?void 0:J.url)},[n,J==null?void 0:J.url,Ze,Ne,Ae]),s.useLayoutEffect(()=>{const A=_.current;A!==null&&(_.current=null,requestAnimationFrame(()=>{S.current(A)}))},[n,p,J==null?void 0:J.url]),s.useLayoutEffect(()=>{if(oe==="opening"){R.current=!1,D(!1);return}if(oe!=="open"||R.current)return;if(!Ge&&!$e){R.current=!0;return}D(!1);const A=requestAnimationFrame(()=>{requestAnimationFrame(()=>{D(!0),R.current=!0})});return()=>cancelAnimationFrame(A)},[oe,Ge==null?void 0:Ge.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(oe!=="open")return;const A=()=>{const mt=Lt=>{Lt.stopPropagation(),Lt.preventDefault(),document.removeEventListener("click",mt,!0)};document.addEventListener("click",mt,!0)},Te=mt=>{const Lt=mt<0?1:-1;Ne(),Pe(Lt),E.current=Lt,Se(Lt),Ze(!0),st()},We=mt=>{if(Math.abs(mt)>$x&&Xe){Te(mt);return}E.current=null,Se(null),ye(null),Ce(null),Ze(!0),U(0),rt()},je=mt=>{if(mt.touches.length!==1||O.current)return;const Lt=mt.touches[0];W.current=!0,M.current={x:Lt.clientX,y:Lt.clientY},T.current="none",K.current=0,L.current=!1},pt=mt=>{if(!M.current||mt.touches.length!==1||O.current)return;const Lt=mt.touches[0],qt=Lt.clientX-M.current.x,kt=Lt.clientY-M.current.y;if(T.current==="none"){if(Math.abs(qt)<10&&Math.abs(kt)<10)return;if(Math.abs(qt)>Math.abs(kt)){if(!Xe)return;T.current="horizontal"}else if(kt>0){if(!it)return;T.current="vertical"}else return}if(T.current==="horizontal"){L.current=!0,ne(!0),K.current=qt,U(qt),mt.preventDefault();return}T.current==="vertical"&&(L.current=!0,ne(!0),F.current=kt,xe(kt),mt.preventDefault())},_t=()=>{if(!M.current)return;const mt=T.current,Lt=L.current;if(Lt&&mt==="horizontal")We(K.current),A();else if(Lt&&mt==="vertical"){const qt=F.current;if(it&&qt>Sx){const kt=window.innerHeight;F.current=kt,te(!0),xe(kt),fe("closing")}else F.current=0,xe(0);A()}else mt==="horizontal"&&Math.abs(K.current)>0&&(We(K.current),A());M.current=null,T.current="none",K.current=0,L.current=!1,ne(!1)};return document.addEventListener("touchstart",je,{passive:!0}),document.addEventListener("touchmove",pt,{passive:!1}),document.addEventListener("touchend",_t),document.addEventListener("touchcancel",_t),()=>{document.removeEventListener("touchstart",je),document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",_t),document.removeEventListener("touchcancel",_t)}},[oe,Xe,Ze,rt,Ne,it,st,Pe]);const Xt=s.useCallback(()=>{const A=(m==null?void 0:m())??b??null;A&&le&&(ee(A),q(!0)),fe("closing")},[m,b,le]);s.useEffect(()=>{const A=je=>{if(je.key==="Escape"){if(r&&d||oe==="closing")return;ut(),Xt();return}if(je.key!=="ArrowLeft"&&je.key!=="ArrowRight"||oe!=="open"||!Xe)return;je.preventDefault();const pt=je.key==="ArrowLeft"?-1:1;je.repeat&&Z.current===pt||Tt(pt)},Te=je=>{if(je.key!=="ArrowLeft"&&je.key!=="ArrowRight")return;const pt=je.key==="ArrowLeft"?-1:1;Z.current===pt&&ut()},We=()=>{ut()};return window.addEventListener("keydown",A),window.addEventListener("keyup",Te),window.addEventListener("blur",We),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Te),window.removeEventListener("blur",We),ut()}},[oe,r,d,Xt,Xe,Tt,ut]),s.useEffect(()=>{oe!=="open"&&ut()},[oe,ut]);const Yt=()=>{oe==="closing"||l||Xt()},It=oe==="open",Ot=oe==="closing",tn=Ie>0?Math.max(0,1-Ie/500):1,yt=Ie>0?Math.max(.35,1-Ie/500):1,Le=s.useCallback(A=>{if(!(A.propertyName!=="transform"||!O.current)){if(E.current!==null){Fe();return}Ne(),Ze(!1)}},[Ne,Ze,Fe]),qe=oe==="closing"?X??b:b,lt=qe&&le&&(oe==="opening"||Ot)?Rx(qe,le):void 0,vt=Be&&J?me(J,"center"):Ie>0?`translateY(${Ie}px)`:lt,wt=le?xr(le,k):null,Et=!!(qe&&le),ft=Et&&(oe==="closing"||oe==="open"&&h),Bt={position:"absolute",top:wt==null?void 0:wt.top,left:wt==null?void 0:wt.left,width:wt==null?void 0:wt.width,height:wt==null?void 0:wt.height,objectFit:"contain",transformOrigin:"top left",transform:vt,opacity:Ie>0?yt:Et?1:oe==="opening"||Ot?0:1,transition:Q&&!se?"none":se?`transform ${Co}ms ${gn}`:N?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:ft?`transform ${Rn}ms ${gn}`:oe==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:Ye&&It&&!Be?"auto":"none",touchAction:Ye&&It?"none":void 0,zIndex:1,overflow:Ye?"hidden":void 0},Nt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:It&&!Be?"auto":"none"},Ft=(A,Te,We="adjacent")=>{const je=Oe(A);if(!je)return{display:"none"};const pt=We==="far"?Te==="left"?"far-left":"far-right":Te==="left"?"left-adjacent":"right-adjacent",{start:_t}=Re!==null?yu(je,pt,Re,k):{start:We==="far"?Gr(je,Te,k):co(je,Te,k)},mt=xr(_t,k),Lt=me(A,pt),qt=!Be&&We==="adjacent"&&It&&!ve?Hx(je,Te,k):null,kt=We==="far"&&Be&&Re===(Te==="left"?-1:1),rn=Q&&!se?!1:se,pn=We==="adjacent"&&It&&ve&&!Be;return{position:"absolute",top:mt.top,left:mt.left,width:mt.width,height:mt.height,objectFit:"contain",transform:Lt??(qt?`translate(${qt.x}px, ${qt.y}px)`:void 0),opacity:We==="far"?It&&kt?1:0:It?1:0,transition:rn?We==="far"?`transform ${Co}ms ${gn}`:`transform ${Co}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:oe==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(A,Te)=>{const We=Oe(A);return We?_x(co(We,Te,k),Te,k):null},Gt=A=>Te=>{if(!l){if(W.current){W.current=!1;return}Te.stopPropagation(),ze(A)}},Dt=Ge?Vt(Ge,"left"):null,jt=$e?Vt($e,"right"):null,Ht=Dt?xr(Dt,k):null,bt=jt?xr(jt,k):null;return a.jsxs("div",{ref:I,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:oe==="open"?"none":void 0},onClick:Yt,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:It?tn:0,transition:Q?"none":`opacity ${Rn}ms ${gn}`,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:It?1:0,transition:Q?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Zd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:Yt})})]}),It&&tt&&a.jsx(br,{media:tt,style:Ft(tt,"left","far"),onMeasure:at,onTransitionEnd:Le},`far-prev-${tt.url}`),It&&Ge&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:Ge,style:Ft(Ge,"left"),onMeasure:at,onTransitionEnd:Le},`prev-${Ge.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),It&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(br,{media:$e,style:Ft($e,"right"),onMeasure:at,onTransitionEnd:Le},`next-${$e.url}`),bt&&a.jsx("div",{style:{position:"absolute",top:bt.top,left:bt.left,width:bt.width,height:bt.height,cursor:l||Q?"default":"pointer",pointerEvents:l||Q?"none":"auto",zIndex:3},onClick:Gt(1)})]}),It&&ht&&a.jsx(br,{media:ht,style:Ft(ht,"right","far"),onMeasure:at,onTransitionEnd:Le},`far-next-${ht.url}`),le&&J&&(Ye?a.jsx(Ox,{src:J.url,phase:oe,onMediaElement:Pt,wrapperStyle:Bt,videoStyle:Nt,onLoadedMetadata:xt,onTransitionEnd:Le},`${n}-${J.url}`):a.jsx("img",{ref:Pt,src:J.url,alt:J.name,onLoad:xt,onTransitionEnd:Le,style:Bt},`${n}-${J.url}`))]})}const jx=20,zx=.18;function Bx(e){return`
|
|
18803
18803
|
.${e}-wrapper {
|
|
18804
18804
|
box-sizing: border-box;
|
|
18805
18805
|
max-width: 100%;
|
|
@@ -18887,7 +18887,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18887
18887
|
pointer-events: auto;
|
|
18888
18888
|
}
|
|
18889
18889
|
${wx(e)}
|
|
18890
|
-
`}function Vx(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 Gx(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 qx(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:j.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:j.scalingValue(i*zx,n??!1),[`--${t}-image-aspect`]:Vx(e)}}function Xx(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 Zt(n,t)}function Ux(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 Yx(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?hu(d,o):void 0)}}function Kx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=j.useScopedStyles(),c=s.useMemo(()=>Bx(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=j.scalingValue(b,n??!1),g=`max(${m}, ${jx}px)`,{objectFitMode:f,imageStyle:v}=Ux(e),I=Xx(e,n),y=s.useRef(null),[w,V]=s.useState(!1),[z,Y]=s.useState([]),[M,F]=s.useState(0),[K,T]=s.useState(0),[L,W]=s.useState(null),[O,C]=s.useState({title1:"",title2:"",title3:""}),E=(!n||i)&&!w,_=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},S=_.sizeType??"none",Z=E&&S!=="none"?`${d}-item-image-hover-${S}`:void 0,$=(_.value??120)/100,H=s.useCallback(ue=>{!ue||S!=="scale"||(ue.style.transformOrigin=qg(ue))},[S]),B=s.useCallback(ue=>{if(ue){if(f==="contain"){const U=Gx(ue);if(U){const
|
|
18890
|
+
`}function Vx(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 Gx(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 qx(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:j.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:j.scalingValue(i*zx,n??!1),[`--${t}-image-aspect`]:Vx(e)}}function Xx(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 Zt(n,t)}function Ux(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 Yx(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?hu(d,o):void 0)}}function Kx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=j.useScopedStyles(),c=s.useMemo(()=>Bx(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",x=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,b=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,m=j.scalingValue(b,n??!1),g=`max(${m}, ${jx}px)`,{objectFitMode:f,imageStyle:v}=Ux(e),I=Xx(e,n),y=s.useRef(null),[w,V]=s.useState(!1),[z,Y]=s.useState([]),[M,F]=s.useState(0),[K,T]=s.useState(0),[L,W]=s.useState(null),[O,C]=s.useState({title1:"",title2:"",title3:""}),E=(!n||i)&&!w,_=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},S=_.sizeType??"none",Z=E&&S!=="none"?`${d}-item-image-hover-${S}`:void 0,$=(_.value??120)/100,H=s.useCallback(ue=>{!ue||S!=="scale"||(ue.style.transformOrigin=qg(ue))},[S]),B=s.useCallback(ue=>{if(ue){if(f==="contain"){const U=Gx(ue);if(U){const se=ue.closest(`.${d}-item-image`);se instanceof HTMLElement&&se.style.setProperty(`--${d}-item-media-aspect`,String(U))}}H(ue)}},[d,H,f]),le={width:j.scalingValue(x,n??!1),...I,...qx(e,d,n),[`--${d}-image-hover-scale`]:String($)},ie=(()=>{const ue={},U=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return U&&(ue["--cntrl-article-width"]=U),ue})(),k=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),de=s.useMemo(()=>Ex(u),[u]),G=s.useMemo(()=>Fx(u),[u]),ce=(ue,U)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const se=de.findIndex(Re=>Re.gridIndex===ue);if(se<0)return;const re=de[se];T(se),Y(re.items),F(0),C(re.entry),W(U??null),V(!0)},oe=s.useCallback(()=>{V(!1),W(null)},[]),fe=s.useCallback(()=>{const ue=de[K];return!ue||!y.current?L:Ix(y.current,ue.gridIndex,f)??L},[de,K,L,f]),Ie=s.useCallback(ue=>{if(de.length>1){const U=de.length,se=(K+ue+U)%U,re=de[se];T(se),Y(re.items),F(0),C(re.entry);return}F(U=>(U+ue+z.length)%z.length)},[de,K,z.length]),xe=de.length>1||z.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const ue=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ue}},[w]),s.useEffect(()=>{!n||o||i||V(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&V(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Wx,{mediaList:G}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:le,children:u.map((ue,U)=>{var Re,Se;const se=!!((Re=ue.image)!=null&&Re.url),re=Yx(!!k,se,U,d,f,ce);return a.jsxs("div",{className:`${d}-item`,children:[ue.title?a.jsx("span",{className:`${d}-item-title`,onClick:re,style:re?{cursor:"pointer"}:void 0,children:ue.title}):null,(Se=ue.image)!=null&&Se.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,Z].filter(Boolean).join(" "),children:ue.image.type==="video"?a.jsx("video",{ref:B,src:ue.image.url,"data-waterfall-index":U,style:v,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:re,onLoadedData:ke=>B(ke.currentTarget)}):a.jsx("img",{ref:B,src:ue.image.url,alt:ue.image.name??"","data-waterfall-index":U,style:v,onClick:re,onLoad:ke=>B(ke.currentTarget)})}):null,U<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:m},children:o&&!w&&a.jsx("div",{"data-controls":"horizontalGap","data-controls-axis":"x","data-controls-min":"0",className:`${d}-item-gap-control`,style:{left:"50%",transform:"translateX(-50%)",width:g,height:"100%"}})})]},U)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const ue=(l?document.getElementById(l):null)??document.body;return Gn.createPortal(a.jsx("div",{style:ie,"data-selection":"none",children:a.jsx(Dx,{prefix:d,items:z,index:M,entry:O,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:de,entryIdx:K,layoutId:r,sourceRect:L,resolveCloseSourceRect:fe,onClose:oe,onPrev:()=>Ie(-1),onNext:()=>Ie(1)})}),ue)})()]})}const Zx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18891
18891
|
import type React from 'react';
|
|
18892
18892
|
import { createPortal } from 'react-dom';
|
|
18893
18893
|
import { CommonComponentProps } from '../props';
|
|
@@ -19401,7 +19401,7 @@ export function Waterfall({
|
|
|
19401
19401
|
</>
|
|
19402
19402
|
);
|
|
19403
19403
|
}
|
|
19404
|
-
`,Jx="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>'),Kn={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 Qx(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...Kn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...Kn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...Kn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...Kn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...Kn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...Kn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...Kn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const uo=ri.filter(e=>e!=="count"),eb=uo.reduce((e,t)=>({...e,...Qx(t)}),{}),tb=uo.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Arial",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function za(e){return uo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const nb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(uo.map(e=>[Zs[e],Js(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},ib=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],ob={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:ib},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:{...Kn.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"]}}},...eb},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:Jx,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...tb},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,...za({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,...za({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,...za({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:[nb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},rb={element:Kx,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"},...uo.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...uo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})},schema:ob,sourceCode:Zx},Ki=500,vu="cubic-bezier(0.25, 1, 0.5, 1)",ab=300,sb=5,lb=.15,cb=.4,db=100,Wi=100,$c={color:"#000000",hover:"#cccccc"},To={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},ub={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}},Ba={offset:{x:0,y:0},linkColor:"#cccccc"},Cc={sizeType:"drag",value:3},pb="left";function mb(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:pb,color:(e==null?void 0:e.titleColor)??"#000000"};return Zt(n,t)}function _i(e,t,n){return`${e}: ${j.scalingValue(t/1440,n)};`}function Eo(e,t){return t<=0?0:(e%t+t)%t}function gb(e,t,n,i){if(!i)return{position:Eo(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 hb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function fb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const b=n.getBoundingClientRect();return{x:b.left,y:b.top}},o=i(0,0),r=i(Wi,0),l=i(0,Wi);e.removeChild(n);const d={x:(r.x-o.x)/Wi,y:(r.y-o.y)/Wi},c={x:(l.x-o.x)/Wi,y:(l.y-o.y)/Wi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function yb(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 vb(e,t){return`
|
|
19404
|
+
`,Jx="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>'),Kn={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 Qx(e){const t={};return t[gt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSettings")]={...Kn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[gt(e,"fontSize")]={...Kn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[gt(e,"lineHeight")]={...Kn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[gt(e,"letterSpacing")]={...Kn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[gt(e,"wordSpacing")]={...Kn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[gt(e,"textAlign")]={...Kn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[gt(e,"textAppearance")]={...Kn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const uo=oi.filter(e=>e!=="count"),eb=uo.reduce((e,t)=>({...e,...Qx(t)}),{}),tb=uo.reduce((e,t)=>({...e,[gt(t,"fontFamily")]:"Arial",[gt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[gt(t,"letterSpacing")]:0,[gt(t,"wordSpacing")]:0,[gt(t,"textAlign")]:"left",[gt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ja(e){return uo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[gt(n,"fontSize")]=i),o!==void 0&&(t[gt(n,"lineHeight")]=o),t},{})}const nb={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(uo.map(e=>[Zs[e],Js(e)]))},wr={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},ib=[{title:"Salton Sea from Above",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...wr,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],ob={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:ib},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:{...Kn.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"]}}},...eb},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:Jx,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...tb},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,...ja({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,...ja({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,...ja({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:[nb]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},rb={element:Kx,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"},...uo.map(e=>({path:`${gt(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...uo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${gt(t,"fontFamily")}`}),{})},schema:ob,sourceCode:Zx},Ki=500,vu="cubic-bezier(0.25, 1, 0.5, 1)",ab=300,sb=5,lb=.15,cb=.4,db=100,Wi=100,$c={color:"#000000",hover:"#cccccc"},To={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},ub={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}},za={offset:{x:0,y:0},linkColor:"#cccccc"},Cc={sizeType:"drag",value:3},pb="left";function mb(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:pb,color:(e==null?void 0:e.titleColor)??"#000000"};return Zt(n,t)}function _i(e,t,n){return`${e}: ${j.scalingValue(t/1440,n)};`}function Eo(e,t){return t<=0?0:(e%t+t)%t}function gb(e,t,n,i){if(!i)return{position:Eo(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 hb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function fb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,x)=>{n.style.transform=`translate(${p}px, ${x}px)`;const b=n.getBoundingClientRect();return{x:b.left,y:b.top}},o=i(0,0),r=i(Wi,0),l=i(0,Wi);e.removeChild(n);const d={x:(r.x-o.x)/Wi,y:(r.y-o.y)/Wi},c={x:(l.x-o.x)/Wi,y:(l.y-o.y)/Wi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function yb(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 vb(e,t){return`
|
|
19405
19405
|
.${e}-wrapper {
|
|
19406
19406
|
position: relative;
|
|
19407
19407
|
width: 100%;
|
|
@@ -19671,7 +19671,7 @@ export function Waterfall({
|
|
|
19671
19671
|
from { clip-path: inset(100% 0 0 0); }
|
|
19672
19672
|
to { clip-path: inset(0 0 0 0); }
|
|
19673
19673
|
}
|
|
19674
|
-
`}function xb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=j.useScopedStyles(),l=mb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Cc,p=u.sizeType??"drag",x=u.value??Cc.value,b=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=ub[f],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>j.scalingValue(Se*I,n),w=(e==null?void 0:e.show)??"always",V=(e==null?void 0:e.controls)??null,z=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,M=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,F=(e==null?void 0:e.controlsColor)??$c.color,K=(e==null?void 0:e.controlsHoverColor)??$c.hover,T=(e==null?void 0:e.navColor)??To.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??To.colors.pagination,W=(e==null?void 0:e.navBackgroundColor)??To.colors.background,O=(e==null?void 0:e.linkColor)??Ba.linkColor,C=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,E=b==="horizontal",_=p==="click",S=p==="drag",Z=p==="auto"&&(!n||!!i),$=!n,H=m==="slide",B=g==="classic",ce=w!=="never"&&z>0,ie=w==="on hover",A=j.scalingValue(z,n),de={width:A,height:A,maxWidth:A},G=H&&c>1,[se,oe]=s.useState(0),[he,Ie]=s.useState(G?1:0),[ve,ue]=s.useState(!1),[U,le]=s.useState(!1),[re,Re]=s.useState(!1),[we,ke]=s.useState(0),[fe,xe]=s.useState(!1),[Ce,h]=s.useState(!1),q=s.useRef(!1),X=s.useRef(he);X.current=he;const ee=s.useRef(null),ye=s.useRef(0),D=s.useRef(null),R=s.useRef(null),Q=s.useRef(null),ne=s.useRef(null),N=s.useCallback(Se=>{q.current=Se,ue(Se)},[]),te=s.useCallback(Se=>{if(c<2||Se===0)return;const _e=Se>0?1:-1,Oe=Math.abs(Se);if(xe(!0),N(!0),!H){oe(ht=>Eo(ht+Se,c));return}let et=X.current;const ge=G&&(et===0||et===c+1),We=ge?se+1:null;ge&&(et=se+1);let Ve=Oe;for(;Ve>0;){const ht=gb(et,_e,c,G);if(et=ht.position,Ve-=1,ht.hitBoundary){ye.current=Ve*_e;break}}const it=Oe-Ve;if(it>0&&oe(ht=>Eo(ht+it*_e,c)),X.current=et,We!==null){if(X.current=We,et===We){le(!0),Ie(et);return}ee.current=et,le(!0),Ie(We);return}le(!1),Ie(et)},[se,c,G,H,N]),Ee=s.useCallback(Se=>{te(Se)},[te]),me=s.useCallback(Se=>{if(c<2)return;const _e=Eo(Se,c);if(!(_e===se&&!q.current)&&(xe(!0),N(!0),oe(_e),H)){const Oe=_e+(G?1:0);ee.current=null,ye.current=0,X.current=Oe,le(!1),Ie(Oe)}},[se,c,G,H,N]);s.useEffect(()=>{if(!ve)return;const Se=window.setTimeout(()=>{if(G&&(he===0||he===c+1)){ee.current=null,le(!0),Ie(se+1);return}N(!1)},Ki);return()=>window.clearTimeout(Se)},[se,c,G,ve,N,he]),s.useEffect(()=>{if(!U)return;let Se=0;const _e=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Oe=ee.current;ee.current=null;const et=ye.current;if(ye.current=0,le(!1),Oe!==null){X.current=Oe,Ie(Oe);return}if(et!==0){te(et);return}N(!1)})});return()=>{cancelAnimationFrame(_e),cancelAnimationFrame(Se)}},[te,N,U]);const J=`${G}:${c}`,Ke=s.useRef(J);s.useEffect(()=>{if(Ke.current===J)return;Ke.current=J;const Se=c>0?Math.min(se,c-1):0;Q.current=null,ne.current=null,Re(!1),ke(0),oe(Se),le(!0),Ie(Se+(G?1:0))},[se,c,G,J]),s.useEffect(()=>{if(!fe)return;const Se=window.setTimeout(()=>xe(!1),ab);return()=>window.clearTimeout(Se)},[fe,se]),s.useEffect(()=>{if(!Z||c<2)return;const Se=Math.max(x,.1)*1e3,_e=window.setInterval(()=>{$&&Ce||Ee(1)},Se);return()=>window.clearInterval(_e)},[x,c,Ee,Z,Ce,$]);const Be=s.useCallback(Se=>{const _e=Q.current;if(!_e||_e.pointerId!==Se.pointerId)return;Q.current=null,ne.current=null;const Oe=D.current;if(Oe!=null&&Oe.hasPointerCapture(Se.pointerId)&&Oe.releasePointerCapture(Se.pointerId),!_e.isActive){H&&ke(0);return}const ge=!(Se.timeStamp-_e.lastTime>db)&&Math.abs(_e.velocity)>cb,We=_e.size>0&&Math.abs(_e.offset-_e.baseOffset)>_e.size*lb;if(Re(!1),!ge&&!We){ke(0);return}const Ve=We?_e.offset-_e.baseOffset:_e.velocity;let it=1;We&&_e.size>0&&(it=Math.max(1,Math.round(Math.abs(Ve)/_e.size))),ke(0),te(Ve<0?it:-it)},[te,H]);s.useEffect(()=>{const Se=_e=>{ne.current===null||_e.pointerId!==ne.current||Be(_e)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[Be]);const rt=Se=>{const _e=D.current;if(!S||c<2||!_e||Se.pointerType==="mouse"&&Se.button!==0)return;ee.current=null,ye.current=0,q.current&&N(!1);let Oe=0;const et=R.current;if(H&&et){const ge=E?et.offsetWidth:et.offsetHeight;if(ge>0){const We=hb(et,E);let Ve=X.current;G&&(Ve===0||Ve===c+1)?(Ve=se+1,X.current=Ve,le(!0),Ie(Ve),Oe=0):Oe=We+Ve*ge,ke(Oe)}}_e.setPointerCapture(Se.pointerId),ne.current=Se.pointerId,Q.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:fb(_e,`${r}-axis-probe`),size:E?_e.offsetWidth:_e.offsetHeight,isActive:!1,baseOffset:Oe,offset:Oe,lastTime:Se.timeStamp,velocity:0}},Xe=Se=>{const _e=Q.current;if(!_e||_e.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){Be(Se);return}const Oe=Se.clientX-_e.startClientX,et=Se.clientY-_e.startClientY,ge=_e.axes?yb(_e.axes,Oe,et):{x:Oe,y:et},We=E?ge.x:ge.y,Ve=E?ge.y:ge.x,it=_e.baseOffset+We;if(!_e.isActive){if(Math.max(Math.abs(We),Math.abs(Ve))<sb)return;if(Math.abs(Ve)>Math.abs(We)){const ct=D.current;ct!=null&&ct.hasPointerCapture(_e.pointerId)&&ct.releasePointerCapture(_e.pointerId),Q.current=null,ne.current=null,H&&ke(0);return}_e.isActive=!0,Re(!0)}const ht=Se.timeStamp-_e.lastTime;ht>0&&(_e.velocity=(it-_e.offset)/ht,_e.lastTime=Se.timeStamp),_e.offset=it,H&&ke(it)},nt=Se=>{Be(Se)},Qe=E?`translate3d(calc(${-he*100}% + ${we}px), 0, 0)`:`translate3d(0, calc(${-he*100}% + ${we}px), 0)`,Ge=G?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vb(r,n)}}),a.jsxs("div",{className:St(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!E}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:D,className:St(`${r}-track`,{[`${r}-track-draggable`]:S,[`${r}-track-draggable-vertical`]:S&&!E}),onPointerDown:rt,onPointerMove:Xe,onPointerUp:nt,onPointerCancel:nt,onLostPointerCapture:Se=>{ne.current===Se.pointerId&&Be(Se)},children:a.jsx("div",{ref:R,className:St(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!E,[`${r}-list-fade`]:!H}),style:H?{transform:Qe,transition:re||U?"none":`transform ${Ki}ms ${vu}`}:void 0,children:Ge.map((Se,_e)=>{const Oe=G?Eo(_e-1,c):_e,ge=G&&(_e===0||_e===c+1)?`clone-${_e===0?"start":"end"}`:`slide-${Oe}`;return a.jsx("div",{className:St(`${r}-slide`,{[`${r}-is-active`]:!H&&Oe===se}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:St(`${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})})})},ge)})})}),ce&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:St(`${r}-arrow`,{[`${r}-arrow-prev`]:E,[`${r}-arrow-prev-vertical`]:!E,[`${r}-hover-arrow`]:ie}),style:{color:F,"--arrow-hover-color":K,...de},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${j.scalingValue(Y,n)}, ${j.scalingValue(M*(E?1:-1),n)}) rotate(${E?"0deg":"90deg"})`},children:[V&&a.jsx(ln,{url:V,fill:F,hoverFill:K,className:St(`${r}-arrow-img`,`${r}-mirror`),style:de}),!V&&a.jsx(Tc,{color:F,className:St(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:St(`${r}-arrow`,{[`${r}-arrow-next`]:E,[`${r}-arrow-next-vertical`]:!E,[`${r}-hover-arrow`]:ie}),style:{color:F,"--arrow-hover-color":K,...de},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),Ee(1)},style:{transform:`translate(${j.scalingValue(Y*(E?-1:1),n)}, ${j.scalingValue(M,n)}) rotate(${E?"0deg":"90deg"})`},children:[V&&a.jsx(ln,{url:V,fill:F,hoverFill:K,className:`${r}-arrow-img`,style:de}),!V&&a.jsx(Tc,{color:F,className:St(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),_&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),B&&a.jsx("div",{className:St(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:E,[`${r}-pagination-inside-left`]:!E}),style:E?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:St(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!E,[`${r}-animate-dots`]:fe}),style:{backgroundColor:W,gap:y(v.gapInactive-v.activeDot+v.dot),...E?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${j.scalingValue(To.offset.x,n)}, ${j.scalingValue(To.offset.y,n)})`},children:d.map((Se,_e)=>{const Oe=_e===se,et=Oe?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>me(_e),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Oe?L:T,width:y(et)}})},_e)})},`${f}-${b}`)})]}),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:j.scalingValue(C,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,_e)=>a.jsx("div",{className:St(`${r}-caption-text`,{[`${r}-with-pointer-events`]:_e===se&&n,[`${r}-active`]:_e===se}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ki/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":O,"--link-hover-color":O,position:"relative",top:j.scalingValue(Ba.offset.y,n),left:j.scalingValue(Ba.offset.x,n)},children:a.jsx(Ii,{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 bb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19674
|
+
`}function xb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=j.useScopedStyles(),l=mb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Cc,p=u.sizeType??"drag",x=u.value??Cc.value,b=(e==null?void 0:e.direction)??"horizontal",m=(e==null?void 0:e.transition)??"slide",g=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",v=ub[f],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=$e=>j.scalingValue($e*I,n),w=(e==null?void 0:e.show)??"always",V=(e==null?void 0:e.controls)??null,z=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,M=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,F=(e==null?void 0:e.controlsColor)??$c.color,K=(e==null?void 0:e.controlsHoverColor)??$c.hover,T=(e==null?void 0:e.navColor)??To.colors.inactive,L=(e==null?void 0:e.navPaginationColor)??To.colors.pagination,W=(e==null?void 0:e.navBackgroundColor)??To.colors.background,O=(e==null?void 0:e.linkColor)??za.linkColor,C=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,E=b==="horizontal",_=p==="click",S=p==="drag",Z=p==="auto"&&(!n||!!i),$=!n,H=m==="slide",B=g==="classic",le=w!=="never"&&z>0,ie=w==="on hover",k=j.scalingValue(z,n),de={width:k,height:k,maxWidth:k},G=H&&c>1,[ce,oe]=s.useState(0),[fe,Ie]=s.useState(G?1:0),[xe,ue]=s.useState(!1),[U,se]=s.useState(!1),[re,Re]=s.useState(!1),[Se,ke]=s.useState(0),[ye,be]=s.useState(!1),[Ce,h]=s.useState(!1),q=s.useRef(!1),X=s.useRef(fe);X.current=fe;const ee=s.useRef(null),ve=s.useRef(0),D=s.useRef(null),R=s.useRef(null),Q=s.useRef(null),ne=s.useRef(null),N=s.useCallback($e=>{q.current=$e,ue($e)},[]),te=s.useCallback($e=>{if(c<2||$e===0)return;const He=$e>0?1:-1,De=Math.abs($e);if(be(!0),N(!0),!H){oe(ht=>Eo(ht+$e,c));return}let Qe=X.current;const he=G&&(Qe===0||Qe===c+1),_e=he?ce+1:null;he&&(Qe=ce+1);let Ve=De;for(;Ve>0;){const ht=gb(Qe,He,c,G);if(Qe=ht.position,Ve-=1,ht.hitBoundary){ve.current=Ve*He;break}}const tt=De-Ve;if(tt>0&&oe(ht=>Eo(ht+tt*He,c)),X.current=Qe,_e!==null){if(X.current=_e,Qe===_e){se(!0),Ie(Qe);return}ee.current=Qe,se(!0),Ie(_e);return}se(!1),Ie(Qe)},[ce,c,G,H,N]),Ee=s.useCallback($e=>{te($e)},[te]),ge=s.useCallback($e=>{if(c<2)return;const He=Eo($e,c);if(!(He===ce&&!q.current)&&(be(!0),N(!0),oe(He),H)){const De=He+(G?1:0);ee.current=null,ve.current=0,X.current=De,se(!1),Ie(De)}},[ce,c,G,H,N]);s.useEffect(()=>{if(!xe)return;const $e=window.setTimeout(()=>{if(G&&(fe===0||fe===c+1)){ee.current=null,se(!0),Ie(ce+1);return}N(!1)},Ki);return()=>window.clearTimeout($e)},[ce,c,G,xe,N,fe]),s.useEffect(()=>{if(!U)return;let $e=0;const He=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{const De=ee.current;ee.current=null;const Qe=ve.current;if(ve.current=0,se(!1),De!==null){X.current=De,Ie(De);return}if(Qe!==0){te(Qe);return}N(!1)})});return()=>{cancelAnimationFrame(He),cancelAnimationFrame($e)}},[te,N,U]);const J=`${G}:${c}`,Ye=s.useRef(J);s.useEffect(()=>{if(Ye.current===J)return;Ye.current=J;const $e=c>0?Math.min(ce,c-1):0;Q.current=null,ne.current=null,Re(!1),ke(0),oe($e),se(!0),Ie($e+(G?1:0))},[ce,c,G,J]),s.useEffect(()=>{if(!ye)return;const $e=window.setTimeout(()=>be(!1),ab);return()=>window.clearTimeout($e)},[ye,ce]),s.useEffect(()=>{if(!Z||c<2)return;const $e=Math.max(x,.1)*1e3,He=window.setInterval(()=>{$&&Ce||Ee(1)},$e);return()=>window.clearInterval(He)},[x,c,Ee,Z,Ce,$]);const Be=s.useCallback($e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;Q.current=null,ne.current=null;const De=D.current;if(De!=null&&De.hasPointerCapture($e.pointerId)&&De.releasePointerCapture($e.pointerId),!He.isActive){H&&ke(0);return}const he=!($e.timeStamp-He.lastTime>db)&&Math.abs(He.velocity)>cb,_e=He.size>0&&Math.abs(He.offset-He.baseOffset)>He.size*lb;if(Re(!1),!he&&!_e){ke(0);return}const Ve=_e?He.offset-He.baseOffset:He.velocity;let tt=1;_e&&He.size>0&&(tt=Math.max(1,Math.round(Math.abs(Ve)/He.size))),ke(0),te(Ve<0?tt:-tt)},[te,H]);s.useEffect(()=>{const $e=He=>{ne.current===null||He.pointerId!==ne.current||Be(He)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[Be]);const it=$e=>{const He=D.current;if(!S||c<2||!He||$e.pointerType==="mouse"&&$e.button!==0)return;ee.current=null,ve.current=0,q.current&&N(!1);let De=0;const Qe=R.current;if(H&&Qe){const he=E?Qe.offsetWidth:Qe.offsetHeight;if(he>0){const _e=hb(Qe,E);let Ve=X.current;G&&(Ve===0||Ve===c+1)?(Ve=ce+1,X.current=Ve,se(!0),Ie(Ve),De=0):De=_e+Ve*he,ke(De)}}He.setPointerCapture($e.pointerId),ne.current=$e.pointerId,Q.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:fb(He,`${r}-axis-probe`),size:E?He.offsetWidth:He.offsetHeight,isActive:!1,baseOffset:De,offset:De,lastTime:$e.timeStamp,velocity:0}},Xe=$e=>{const He=Q.current;if(!He||He.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){Be($e);return}const De=$e.clientX-He.startClientX,Qe=$e.clientY-He.startClientY,he=He.axes?yb(He.axes,De,Qe):{x:De,y:Qe},_e=E?he.x:he.y,Ve=E?he.y:he.x,tt=He.baseOffset+_e;if(!He.isActive){if(Math.max(Math.abs(_e),Math.abs(Ve))<sb)return;if(Math.abs(Ve)>Math.abs(_e)){const at=D.current;at!=null&&at.hasPointerCapture(He.pointerId)&&at.releasePointerCapture(He.pointerId),Q.current=null,ne.current=null,H&&ke(0);return}He.isActive=!0,Re(!0)}const ht=$e.timeStamp-He.lastTime;ht>0&&(He.velocity=(tt-He.offset)/ht,He.lastTime=$e.timeStamp),He.offset=tt,H&&ke(tt)},et=$e=>{Be($e)},Je=E?`translate3d(calc(${-fe*100}% + ${Se}px), 0, 0)`:`translate3d(0, calc(${-fe*100}% + ${Se}px), 0)`,Ge=G?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:vb(r,n)}}),a.jsxs("div",{className:$t(`${r}-wrapper`,{[`${r}-transition-reveal`]:m==="reveal",[`${r}-transition-reveal-vertical`]:m==="reveal"&&!E}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:D,className:$t(`${r}-track`,{[`${r}-track-draggable`]:S,[`${r}-track-draggable-vertical`]:S&&!E}),onPointerDown:it,onPointerMove:Xe,onPointerUp:et,onPointerCancel:et,onLostPointerCapture:$e=>{ne.current===$e.pointerId&&Be($e)},children:a.jsx("div",{ref:R,className:$t(`${r}-list`,{[`${r}-list-slide`]:H,[`${r}-list-slide-vertical`]:H&&!E,[`${r}-list-fade`]:!H}),style:H?{transform:Je,transition:re||U?"none":`transform ${Ki}ms ${vu}`}:void 0,children:Ge.map(($e,He)=>{const De=G?Eo(He-1,c):He,he=G&&(He===0||He===c+1)?`clone-${He===0?"start":"end"}`:`slide-${De}`;return a.jsx("div",{className:$t(`${r}-slide`,{[`${r}-is-active`]:!H&&De===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:$t(`${r}-slider-image`,{[`${r}-contain`]:$e.image.objectFit==="contain",[`${r}-cover`]:$e.image.objectFit==="cover"}),src:$e.image.url,alt:$e.image.name??"",draggable:!1})})})},he)})})}),le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:$t(`${r}-arrow`,{[`${r}-arrow-prev`]:E,[`${r}-arrow-prev-vertical`]:!E,[`${r}-hover-arrow`]:ie}),style:{color:F,"--arrow-hover-color":K,...de},children:a.jsxs("button",{onClick:$e=>{$e.stopPropagation(),Ee(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${j.scalingValue(Y,n)}, ${j.scalingValue(M*(E?1:-1),n)}) rotate(${E?"0deg":"90deg"})`},children:[V&&a.jsx(ln,{url:V,fill:F,hoverFill:K,className:$t(`${r}-arrow-img`,`${r}-mirror`),style:de}),!V&&a.jsx(Tc,{color:F,className:$t(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:$t(`${r}-arrow`,{[`${r}-arrow-next`]:E,[`${r}-arrow-next-vertical`]:!E,[`${r}-hover-arrow`]:ie}),style:{color:F,"--arrow-hover-color":K,...de},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),Ee(1)},style:{transform:`translate(${j.scalingValue(Y*(E?-1:1),n)}, ${j.scalingValue(M,n)}) rotate(${E?"0deg":"90deg"})`},children:[V&&a.jsx(ln,{url:V,fill:F,hoverFill:K,className:`${r}-arrow-img`,style:de}),!V&&a.jsx(Tc,{color:F,className:$t(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),_&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>Ee(1)}),B&&a.jsx("div",{className:$t(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:E,[`${r}-pagination-inside-left`]:!E}),style:E?{bottom:y(v.inset)}:{left:y(v.inset)},children:a.jsx("div",{className:$t(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!E,[`${r}-animate-dots`]:ye}),style:{backgroundColor:W,gap:y(v.gapInactive-v.activeDot+v.dot),...E?{height:y(v.activeDot+v.paddingY*2),paddingTop:y(v.paddingY),paddingBottom:y(v.paddingY),paddingLeft:y(v.paddingActive),paddingRight:y(v.paddingActive)}:{width:y(v.activeDot+v.paddingY*2),paddingLeft:y(v.paddingY),paddingRight:y(v.paddingY),paddingTop:y(v.paddingActive),paddingBottom:y(v.paddingActive)},borderRadius:y(v.borderRadius),transform:`translate(${j.scalingValue(To.offset.x,n)}, ${j.scalingValue(To.offset.y,n)})`},children:d.map(($e,He)=>{const De=He===ce,Qe=De?v.activeDot:v.dot;return a.jsx("button",{onClick:()=>ge(He),className:`${r}-pagination-item`,style:{width:y(v.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:De?L:T,width:y(Qe)}})},He)})},`${f}-${b}`)})]}),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:j.scalingValue(C,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map(($e,He)=>a.jsx("div",{className:$t(`${r}-caption-text`,{[`${r}-with-pointer-events`]:He===ce&&n,[`${r}-active`]:He===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ki/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":O,"--link-hover-color":O,position:"relative",top:j.scalingValue(za.offset.y,n),left:j.scalingValue(za.offset.x,n)},children:a.jsx(Ii,{content:$e.imageCaption})})},He))})]})]})]})}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 bb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19675
19675
|
import cn from 'classnames';
|
|
19676
19676
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19677
19677
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20852,7 +20852,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20852
20852
|
</svg>
|
|
20853
20853
|
);
|
|
20854
20854
|
}
|
|
20855
|
-
`,wb={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"}]}]}]}},Sb={element:xb,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:wb,sourceCode:bb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},zi=300/1440,$b=8/1440,
|
|
20855
|
+
`,wb={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"}]}]}]}},Sb={element:xb,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:wb,sourceCode:bb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},zi=300/1440,$b=8/1440,bi=.004;function Cb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Lc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Rc(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:j.scalingValue((o-t)/2,i)}}function Tb(e){return`
|
|
20856
20856
|
.${e}-wrapper {
|
|
20857
20857
|
box-sizing: border-box;
|
|
20858
20858
|
display: flex;
|
|
@@ -21069,7 +21069,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21069
21069
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21070
21070
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21071
21071
|
}
|
|
21072
|
-
`}const Lb="rgba(28,31,34,0.9)",_n=500,bi="cubic-bezier(0.22, 1, 0.36, 1)",Rb=72,Ib=50,Eb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Mb=[];function Pb(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 kb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Ab(e){const[t]=e.media;return t!=null&&t.url?t:null}function Fb(e){if(!Array.isArray(e)||e.length===0)return[];if(Pb(e)){const t=[];for(const n of e){const i=kb(n);if(!i)continue;const o=Ab(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 hs(e){return e.type==="video"}function Wb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function _b(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Nb=1140/1440;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=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Db(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function jb({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()=>{Wb(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 zb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",b=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),v=s.useRef(0),I=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),V=s.useRef(!1),z=s.useRef(null),[Y,M]=s.useState(null),[F,K]=s.useState("opening"),[T,L]=s.useState(0),[W,O]=s.useState(0),[C,E]=s.useState(!1),[_,S]=s.useState(!1),[Z,$]=s.useState(!1),H=s.useRef(n),B=t[n],ce=B?hs(B):!1,ie=W!==0||C,A=s.useCallback(fe=>{V.current=fe,E(fe)},[]),de=s.useCallback(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=s.useCallback(()=>{de(),z.current=window.setTimeout(()=>{de(),A(!1)},_n+32)},[de,A]),se=s.useCallback(()=>{const fe=b.current,xe=m.current;if(!fe)return;const Ce=fe.getBoundingClientRect(),h=Ce.width,q=Ce.height;if(!h||!q)return;if(i==="cover"){M({width:h,height:q,left:Ce.left,top:Ce.top});return}if(!xe){M(Sr(fe));return}const{width:X,height:ee}=_b(xe);if(!X||!ee){M(Sr(fe));return}const ye=X/ee,D=h/q;if(ye>D){const R=h/ye;M({width:h,height:R,left:Ce.left,top:Ce.top+(q-R)/2})}else{const R=q*ye;M({width:R,height:q,left:Ce.left+(h-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{se();const fe=b.current;if(!fe)return;const xe=new ResizeObserver(()=>se());return xe.observe(fe),()=>xe.disconnect()},[se,n]),s.useEffect(()=>{F==="opening"&&Y&&K("open")},[F,Y]),s.useEffect(()=>{if(F!=="closing")return;const fe=setTimeout(()=>r(),_n);return()=>clearTimeout(fe)},[F,r]),s.useEffect(()=>()=>{de()},[de]),s.useLayoutEffect(()=>{if(H.current===n)return;de(),L(0),O(0),A(!1),$(!1),S(!1),f.current=0,v.current=0,I.current="none",y.current=!1,g.current=null,w.current=!1;const fe=b.current;fe&&M(Sr(fe)),H.current=n},[n,A,de]),s.useEffect(()=>{if(F!=="open")return;let fe=null;const xe=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},Ce=()=>{xe(),fe=D=>{D.stopPropagation(),D.preventDefault(),xe()},document.addEventListener("click",fe,!0)},h=D=>{de(),V.current=!1,E(!1),O(0),S(!1),y.current=!1,v.current=0,I.current="none";const R=b.current;R&&M(Sr(R)),D<0?d():l()},q=D=>{if(Math.abs(D)>Ib&&t.length>1){h(D);return}A(!0),O(0),G()},X=D=>{if(D.touches.length!==1||V.current)return;const R=D.touches[0];w.current=!0,g.current={x:R.clientX,y:R.clientY},I.current="none",v.current=0,y.current=!1},ee=D=>{if(!g.current||D.touches.length!==1||V.current)return;const R=D.touches[0],Q=R.clientX-g.current.x,ne=R.clientY-g.current.y;if(I.current==="none"){if(Math.abs(Q)<10&&Math.abs(ne)<10)return;if(Math.abs(Q)>Math.abs(ne)){if(t.length<=1)return;I.current="horizontal"}else if(ne>0)I.current="vertical";else return}if(I.current==="horizontal"){y.current=!0,S(!0),v.current=Q,O(Q),D.preventDefault();return}I.current==="vertical"&&(y.current=!0,S(!0),f.current=ne,L(ne),D.preventDefault())},ye=()=>{if(!g.current)return;const D=I.current,R=y.current;if(R&&D==="horizontal")q(v.current),Ce();else if(R&&D==="vertical")if(f.current>Rb){const ne=window.innerHeight;f.current=ne,$(!0),L(ne),K("closing")}else f.current=0,L(0),Ce();else D==="horizontal"&&Math.abs(v.current)>0&&(q(v.current),Ce());g.current=null,I.current="none",v.current=0,y.current=!1,S(!1)};return document.addEventListener("touchstart",X,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",ye),document.addEventListener("touchcancel",ye),()=>{document.removeEventListener("touchstart",X),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",ye),document.removeEventListener("touchcancel",ye),xe()}},[F,t.length,d,l,A,G,de]),s.useEffect(()=>{const fe=xe=>{xe.key==="Escape"&&(xe.preventDefault(),xe.stopPropagation(),F!=="closing"&&K("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[F]);const oe=()=>{F!=="closing"&&K("closing")},he=F==="open",Ie=F==="closing",ve=T>0?Math.max(0,1-T/500):1,ue=T>0?Math.max(.35,1-T/500):1,U=fe=>{if(fe.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const xe=fe.currentTarget.getBoundingClientRect(),Ce=fe.clientY-xe.top,h=Math.min(52,xe.height*.2);if(!(Ce>xe.height-h)){if(fe.clientX-xe.left<xe.width/2){l();return}d()}},le=fe=>{if(t.length<=1)return;const xe=fe.currentTarget.getBoundingClientRect(),Ce=fe.clientX-xe.left,h=fe.clientY-xe.top,q=Math.min(52,xe.height*.2);if(h>xe.height-q){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=Ce<xe.width/2?"w-resize":"e-resize"},re=s.useCallback(fe=>{fe.propertyName!=="transform"||!V.current||(de(),A(!1))},[de,A]),Re=ie?`translateX(${W}px)`:T>0?`translateY(${T}px)`:void 0,we={position:"fixed",top:Y==null?void 0:Y.top,left:Y==null?void 0:Y.left,width:Y==null?void 0:Y.width,height:Y==null?void 0:Y.height,objectFit:i==="cover"?"cover":"contain",transform:Re,opacity:T>0?ue:F==="opening"||Ie?0:1,transition:_&&!C?"none":C?`transform ${_n}ms ${bi}`:Z?`transform ${_n}ms ${bi}, opacity ${_n}ms ${bi}`:F==="opening"||Ie?`opacity ${_n}ms ${bi}`:"none",pointerEvents:ce&&he&&!ie?"auto":"none",touchAction:ce&&he?"none":void 0,zIndex:9998},ke=Y?{position:"fixed",top:Y.top,height:Y.height,width:Y.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:F==="open"?"none":void 0},onClick:oe,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:he?ve:0,transition:_?"none":`opacity ${_n}ms ${bi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:he?1:0,transition:`opacity ${_n}ms ${bi}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:he?1:0,transition:`opacity ${_n}ms ${bi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&B&&(ce?a.jsx(jb,{src:B.url,phase:F,mediaRef:m,mediaStyle:we,onLoadedMetadata:se,onClick:U,onMouseMove:le,onTransitionEnd:re},`${n}-${B.url}`):a.jsx("img",{ref:m,src:B.url,alt:B.name,onLoad:se,onTransitionEnd:re,style:we},`${n}-${B.url}`)),he&&ke&&t.length>1&&!ce&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:Y.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:fe=>{if(w.current){w.current=!1;return}fe.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:fe=>{if(w.current){w.current=!1;return}fe.stopPropagation(),d()}})]})]})}function Ic({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 x=`${e}-gallery-${hs(t)?"video":"image"}`,b=r.display==="cover",m=Ob(r),g=F=>j.scalingValue(F,l??!1),f=n??zi,v=o?{width:"100%",maxWidth:"100%"}:{width:g(f),maxWidth:"100%"},I=i?{borderRadius:g(i)}:{},y={...v,...b?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...I},w={...b?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...b?{}:I},z={className:x,style:w,onClick:p?F=>{F.stopPropagation(),p()}:void 0},Y=Math.max(d,wi),M=hs(t)?a.jsx("video",{...z,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...z,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[b?a.jsx("div",{style:y,children:M}):M,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(Y)}})]})}function Bb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,b=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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 Vb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Ec({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 Mc({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 Va({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),[x,b]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>b(f.offsetHeight);v();const I=new ResizeObserver(v);return I.observe(f),()=>I.disconnect()},[m,g]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${x}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const Pc=45;function kc(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 Gb(e){const t=kc(e,"--cntrl-viewport-height",window.innerHeight),n=kc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function qb(e,t,n){const{top:i,centerY:o}=Gb(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 Xb(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=qb(u,n,c);return Math.exp(-(p*p)/(2*Pc*Pc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ub(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(Xb(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 Yb(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 Kb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var tt;const{prefix:l}=j.useScopedStyles(),d=s.useMemo(()=>Tb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??zi,b=(e==null?void 0:e.titleWidth)??Nb,m=Hb(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??$b,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,I=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=Vb(e==null?void 0:e.transition),V=(e==null?void 0:e.lightbox)??"on",z=p==="b",Y=w==="fade"||w==="retype",{setTitleRef:M,dominantIndex:F}=Ub(c.length,Y,f),K=((tt=c[F])==null?void 0:tt.title)??"",T=Yb(K,w==="retype"),L=w==="fade"||w==="retype",W=w==="retype"?T:K,O=z?void 0:{width:j.scalingValue(x,n??!1)},C=V==="on"&&(!n||i||o),E=o??!1,_=(e==null?void 0:e.galleryPaddingRight)??0,S=(e==null?void 0:e.galleryPaddingLeft)??0,Z=(e==null?void 0:e.galleryPaddingBetween)??0,$=at=>j.scalingValue(at,n??!1),B={width:$(b)},ce=p==="a"?_:S,ie=z?{width:"100%"}:{width:`calc(100% - ${$(x)} - ${$(ce)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(_,wi),de=Math.max(S,wi),G=Math.max(Z,wi),se=Math.max(v,wi),oe=Math.max(I,wi),he=Math.max(y,wi),Ie=Math.max(0,(u??1)-(x??zi)),ve=p==="a"?Math.max(0,(u??1)-(x??zi)-_):p==="c"?Math.max(0,(u??1)-(x??zi)-S):p==="b"?u??1:1,ue=E&&(p==="a"||p==="b"||p==="c")&&f==="top",U=E&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),le=E&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),re=c.length>1,Re=z?void 0:$((p==="c"?S:_)+(x??zi)),we=p==="c"&&Re?{left:Re}:void 0,ke=p==="a"&&Re?{right:Re}:void 0,fe=z?{left:0,width:"100%"}:p==="a"?{right:$(_),width:$(x)}:{left:$(S),width:$(x)},{titleColor:xe,titleFontFamily:Ce,titleFontSettings:h,titleFontSize:q,titleLineHeight:X,titleLetterSpacing:ee,titleWordSpacing:ye,titleAlign:D,titleTextAppearance:R,lightboxCounterColor:Q,lightboxCounterFontFamily:ne,lightboxCounterFontSettings:N,lightboxCounterFontSize:te,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:me,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ke}=e??{},Be={fontSettings:{fontFamily:Ce,fontWeight:(h==null?void 0:h.fontWeight)??400,fontStyle:(h==null?void 0:h.fontStyle)??"normal"},fontSize:q??.01,lineHeight:X,letterSpacing:ee??0,wordSpacing:ye??0,textAlign:D??"left",textAppearance:R,color:xe??"#000000"},Xe=sn(Zt(Be,n)),nt=B,Qe=Rc(q,X,l,n),Ge=Lc(q,X,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:ne,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:te??.01,lineHeight:Ee,letterSpacing:me??0,wordSpacing:J??0,textAppearance:Ke,color:Q??"#DEDDDD"},Oe={...sn(Zt(Se,n)),...Rc(te,Ee,l,n)},et=Lc(te,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ge=j.buildColorVars(l,{titleColor:xe??"#000000",lightboxCounterColor:Q??"#DEDDDD"},Eb,Mb),We=s.useRef(null),[Ve,it]=s.useState(!1),[ht,ct]=s.useState([]),[Ne,Ae]=s.useState(0),Pe=s.useCallback((at,st)=>{C&&(ct(at),Ae(st),it(!0))},[C]),Je=s.useCallback(()=>{it(!1)},[]),He=s.useMemo(()=>{const at={...ge},st=We.current?getComputedStyle(We.current).getPropertyValue("--cntrl-article-width").trim():"";return st&&(at["--cntrl-article-width"]=st),at},[ge,Ve]);return s.useEffect(()=>{if(!Ve||V!=="on"||typeof document>"u")return;const at=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=at}},[Ve,V]),s.useEffect(()=>{!n||o||i||it(!1)},[n,o,i]),s.useEffect(()=>{V==="off"&&it(!1)},[V]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:ge,children:a.jsxs("div",{ref:We,className:`${l}-wrapper`,style:{width:j.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?$(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?$(I):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?$(y):void 0},children:[L&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Va,{P:l,title:W,position:f,titleRef:()=>{},titleClassName:`${Ge} ${l}-single-title`,titleContainerStyle:{...Qe,...ie},titleTextBoxStyle:nt,titleStyle:Xe,showTextBoxOutline:E,topPaddingControl:ue?Ec({P:l,scaled:$,height:se,paired:!1}):void 0})}),c.map((at,st)=>{const $e=Fb(at.gallery),De=st<c.length-1,lt=$e.filter(qe=>qe.lightboxMedia).map(qe=>qe.lightboxMedia),Ue={P:l,position:f,titleRef:M(st),titleClassName:Ge,titleContainerStyle:Qe,titleTextBoxStyle:L?{maxWidth:"100%"}:nt,titleStyle:Xe,showTextBoxOutline:E&&!L,topPaddingControl:ue&&!L?Ec({P:l,scaled:$,height:se,paired:re}):void 0};return a.jsxs("div",{"data-item-index":st,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:De?$(Z):void 0},children:[U&&Mc({P:l,controlKey:"titleLeftPadding",scaled:$,width:oe,maxFraction:ve,side:"left",paired:re,anchorStyle:we}),le&&Mc({P:l,controlKey:"titleRightPadding",scaled:$,width:he,maxFraction:ve,side:"right",paired:re,anchorStyle:ke}),E&&De&&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:$(G),...fe}}),z?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:$e.map(({displayMedia:qe,lightboxMedia:$t},Ct)=>{const vt=$t?lt.findIndex(Pt=>Pt.url===$t.url):-1;return a.jsx(Ic,{P:l,media:qe,imgWidth:x||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:Z,showPaddingAfter:Ct<$e.length-1,showControls:E,onMediaClick:C&&vt>=0?()=>Pe(lt,vt):void 0},`${qe.url}-${Ct}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Va,{...Ue,title:L?"":at.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Va,{...Ue,title:L?"":at.title}),$e.length>0&&a.jsx(Bb,{P:l,layoutType:p,galleryWidthStyle:O,galleryPaddingRight:_,galleryPaddingLeft:S,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Ie,showControls:E,scaled:$,children:$e.map(({displayMedia:qe,lightboxMedia:$t},Ct)=>{const vt=$t?lt.findIndex(Pt=>Pt.url===$t.url):-1;return a.jsx(Ic,{P:l,media:qe,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:Z,showPaddingAfter:Ct<$e.length-1,showControls:E,onMediaClick:C&&vt>=0?()=>Pe(lt,vt):void 0},`${qe.url}-${Ct}`)})})]})]},st)})]})}),Ve&&V==="on"&&typeof document<"u"&&e&&(()=>{const at=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx("div",{style:He,"data-selection":"none",children:a.jsx(zb,{prefix:l,items:ht,index:Ne,imageDisplay:Db(e.lightboxImageDisplay),isEditor:n,onClose:Je,onPrev:()=>Ae(st=>(st-1+ht.length)%ht.length),onNext:()=>Ae(st=>(st+1)%ht.length),counterClassName:et,counterStyle:Oe,backgroundColor:e.backgroundColor??Lb})}),at)})()]})}const Zb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21072
|
+
`}const Lb="rgba(28,31,34,0.9)",_n=500,xi="cubic-bezier(0.22, 1, 0.36, 1)",Rb=72,Ib=50,Eb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Mb=[];function Pb(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 kb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Ab(e){const[t]=e.media;return t!=null&&t.url?t:null}function Fb(e){if(!Array.isArray(e)||e.length===0)return[];if(Pb(e)){const t=[];for(const n of e){const i=kb(n);if(!i)continue;const o=Ab(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 gs(e){return e.type==="video"}function Wb(e){e.pause(),e.removeAttribute("src"),e.load()}function Sr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function _b(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Nb=1140/1440;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=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Db(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function jb({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()=>{Wb(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 zb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const x=i==="cover",b=s.useRef(null),m=s.useRef(null),g=s.useRef(null),f=s.useRef(0),v=s.useRef(0),I=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),V=s.useRef(!1),z=s.useRef(null),[Y,M]=s.useState(null),[F,K]=s.useState("opening"),[T,L]=s.useState(0),[W,O]=s.useState(0),[C,E]=s.useState(!1),[_,S]=s.useState(!1),[Z,$]=s.useState(!1),H=s.useRef(n),B=t[n],le=B?gs(B):!1,ie=W!==0||C,k=s.useCallback(ye=>{V.current=ye,E(ye)},[]),de=s.useCallback(()=>{z.current!==null&&(window.clearTimeout(z.current),z.current=null)},[]),G=s.useCallback(()=>{de(),z.current=window.setTimeout(()=>{de(),k(!1)},_n+32)},[de,k]),ce=s.useCallback(()=>{const ye=b.current,be=m.current;if(!ye)return;const Ce=ye.getBoundingClientRect(),h=Ce.width,q=Ce.height;if(!h||!q)return;if(i==="cover"){M({width:h,height:q,left:Ce.left,top:Ce.top});return}if(!be){M(Sr(ye));return}const{width:X,height:ee}=_b(be);if(!X||!ee){M(Sr(ye));return}const ve=X/ee,D=h/q;if(ve>D){const R=h/ve;M({width:h,height:R,left:Ce.left,top:Ce.top+(q-R)/2})}else{const R=q*ve;M({width:R,height:q,left:Ce.left+(h-R)/2,top:Ce.top})}},[i]);s.useEffect(()=>{ce();const ye=b.current;if(!ye)return;const be=new ResizeObserver(()=>ce());return be.observe(ye),()=>be.disconnect()},[ce,n]),s.useEffect(()=>{F==="opening"&&Y&&K("open")},[F,Y]),s.useEffect(()=>{if(F!=="closing")return;const ye=setTimeout(()=>r(),_n);return()=>clearTimeout(ye)},[F,r]),s.useEffect(()=>()=>{de()},[de]),s.useLayoutEffect(()=>{if(H.current===n)return;de(),L(0),O(0),k(!1),$(!1),S(!1),f.current=0,v.current=0,I.current="none",y.current=!1,g.current=null,w.current=!1;const ye=b.current;ye&&M(Sr(ye)),H.current=n},[n,k,de]),s.useEffect(()=>{if(F!=="open")return;let ye=null;const be=()=>{ye&&(document.removeEventListener("click",ye,!0),ye=null)},Ce=()=>{be(),ye=D=>{D.stopPropagation(),D.preventDefault(),be()},document.addEventListener("click",ye,!0)},h=D=>{de(),V.current=!1,E(!1),O(0),S(!1),y.current=!1,v.current=0,I.current="none";const R=b.current;R&&M(Sr(R)),D<0?d():l()},q=D=>{if(Math.abs(D)>Ib&&t.length>1){h(D);return}k(!0),O(0),G()},X=D=>{if(D.touches.length!==1||V.current)return;const R=D.touches[0];w.current=!0,g.current={x:R.clientX,y:R.clientY},I.current="none",v.current=0,y.current=!1},ee=D=>{if(!g.current||D.touches.length!==1||V.current)return;const R=D.touches[0],Q=R.clientX-g.current.x,ne=R.clientY-g.current.y;if(I.current==="none"){if(Math.abs(Q)<10&&Math.abs(ne)<10)return;if(Math.abs(Q)>Math.abs(ne)){if(t.length<=1)return;I.current="horizontal"}else if(ne>0)I.current="vertical";else return}if(I.current==="horizontal"){y.current=!0,S(!0),v.current=Q,O(Q),D.preventDefault();return}I.current==="vertical"&&(y.current=!0,S(!0),f.current=ne,L(ne),D.preventDefault())},ve=()=>{if(!g.current)return;const D=I.current,R=y.current;if(R&&D==="horizontal")q(v.current),Ce();else if(R&&D==="vertical")if(f.current>Rb){const ne=window.innerHeight;f.current=ne,$(!0),L(ne),K("closing")}else f.current=0,L(0),Ce();else D==="horizontal"&&Math.abs(v.current)>0&&(q(v.current),Ce());g.current=null,I.current="none",v.current=0,y.current=!1,S(!1)};return document.addEventListener("touchstart",X,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve),()=>{document.removeEventListener("touchstart",X),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),be()}},[F,t.length,d,l,k,G,de]),s.useEffect(()=>{const ye=be=>{be.key==="Escape"&&(be.preventDefault(),be.stopPropagation(),F!=="closing"&&K("closing"))};return window.addEventListener("keydown",ye,!0),()=>window.removeEventListener("keydown",ye,!0)},[F]);const oe=()=>{F!=="closing"&&K("closing")},fe=F==="open",Ie=F==="closing",xe=T>0?Math.max(0,1-T/500):1,ue=T>0?Math.max(.35,1-T/500):1,U=ye=>{if(ye.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientY-be.top,h=Math.min(52,be.height*.2);if(!(Ce>be.height-h)){if(ye.clientX-be.left<be.width/2){l();return}d()}},se=ye=>{if(t.length<=1)return;const be=ye.currentTarget.getBoundingClientRect(),Ce=ye.clientX-be.left,h=ye.clientY-be.top,q=Math.min(52,be.height*.2);if(h>be.height-q){ye.currentTarget.style.cursor="default";return}ye.currentTarget.style.cursor=Ce<be.width/2?"w-resize":"e-resize"},re=s.useCallback(ye=>{ye.propertyName!=="transform"||!V.current||(de(),k(!1))},[de,k]),Re=ie?`translateX(${W}px)`:T>0?`translateY(${T}px)`:void 0,Se={position:"fixed",top:Y==null?void 0:Y.top,left:Y==null?void 0:Y.left,width:Y==null?void 0:Y.width,height:Y==null?void 0:Y.height,objectFit:i==="cover"?"cover":"contain",transform:Re,opacity:T>0?ue:F==="opening"||Ie?0:1,transition:_&&!C?"none":C?`transform ${_n}ms ${xi}`:Z?`transform ${_n}ms ${xi}, opacity ${_n}ms ${xi}`:F==="opening"||Ie?`opacity ${_n}ms ${xi}`:"none",pointerEvents:le&&fe&&!ie?"auto":"none",touchAction:le&&fe?"none":void 0,zIndex:9998},ke=Y?{position:"fixed",top:Y.top,height:Y.height,width:Y.width/2,zIndex:9999}:null;return a.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:F==="open"?"none":void 0},onClick:oe,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:fe?xe:0,transition:_?"none":`opacity ${_n}ms ${xi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:x?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:b,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:fe?1:0,transition:`opacity ${_n}ms ${xi}`,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:b,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:fe?1:0,transition:`opacity ${_n}ms ${xi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&B&&(le?a.jsx(jb,{src:B.url,phase:F,mediaRef:m,mediaStyle:Se,onLoadedMetadata:ce,onClick:U,onMouseMove:se,onTransitionEnd:re},`${n}-${B.url}`):a.jsx("img",{ref:m,src:B.url,alt:B.name,onLoad:ce,onTransitionEnd:re,style:Se},`${n}-${B.url}`)),fe&&ke&&t.length>1&&!le&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...ke,left:Y.left,cursor:"w-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(w.current){w.current=!1;return}ye.stopPropagation(),l()}}),a.jsx("div",{style:{...ke,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:ie?"none":"auto"},onClick:ye=>{if(w.current){w.current=!1;return}ye.stopPropagation(),d()}})]})]})}function Ic({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 x=`${e}-gallery-${gs(t)?"video":"image"}`,b=r.display==="cover",m=Ob(r),g=F=>j.scalingValue(F,l??!1),f=n??zi,v=o?{width:"100%",maxWidth:"100%"}:{width:g(f),maxWidth:"100%"},I=i?{borderRadius:g(i)}:{},y={...v,...b?{aspectRatio:m,height:"auto",overflow:"hidden"}:{},...I},w={...b?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":g(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...b?{}:I},z={className:x,style:w,onClick:p?F=>{F.stopPropagation(),p()}:void 0},Y=Math.max(d,bi),M=gs(t)?a.jsx("video",{...z,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...z,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[b?a.jsx("div",{style:y,children:M}):M,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:g(d)},"aria-hidden":"true"}),u&&c&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${e}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:g(Y)}})]})}function Bb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const x=t==="a"?i:t==="c"?o:0,b=x>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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"&&b&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(x)},"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 Vb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Ec({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 Mc({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 Ba({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),[x,b]=s.useState(0),m=t??"",g=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!g)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const v=()=>b(f.offsetHeight);v();const I=new ResizeObserver(v);return I.observe(f),()=>I.disconnect()},[m,g]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...g?{[`--${e}-title-height`]:`${x}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:m})})]})})}const Pc=45;function kc(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 Gb(e){const t=kc(e,"--cntrl-viewport-height",window.innerHeight),n=kc(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function qb(e,t,n){const{top:i,centerY:o}=Gb(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 Xb(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=qb(u,n,c);return Math.exp(-(p*p)/(2*Pc*Pc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Ub(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(Xb(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 Yb(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 Kb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var rt;const{prefix:l}=j.useScopedStyles(),d=s.useMemo(()=>Tb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",x=(e==null?void 0:e.imgWidth)??zi,b=(e==null?void 0:e.titleWidth)??Nb,m=Hb(e==null?void 0:e.imageDisplay),g=(e==null?void 0:e.cornerRadius)??$b,f=(e==null?void 0:e.position)??"center",v=(e==null?void 0:e.titleTopPadding)??0,I=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=Vb(e==null?void 0:e.transition),V=(e==null?void 0:e.lightbox)??"on",z=p==="b",Y=w==="fade"||w==="retype",{setTitleRef:M,dominantIndex:F}=Ub(c.length,Y,f),K=((rt=c[F])==null?void 0:rt.title)??"",T=Yb(K,w==="retype"),L=w==="fade"||w==="retype",W=w==="retype"?T:K,O=z?void 0:{width:j.scalingValue(x,n??!1)},C=V==="on"&&(!n||i||o),E=o??!1,_=(e==null?void 0:e.galleryPaddingRight)??0,S=(e==null?void 0:e.galleryPaddingLeft)??0,Z=(e==null?void 0:e.galleryPaddingBetween)??0,$=ot=>j.scalingValue(ot,n??!1),B={width:$(b)},le=p==="a"?_:S,ie=z?{width:"100%"}:{width:`calc(100% - ${$(x)} - ${$(le)})`,...p==="c"?{marginLeft:"auto"}:{}},k=Math.max(_,bi),de=Math.max(S,bi),G=Math.max(Z,bi),ce=Math.max(v,bi),oe=Math.max(I,bi),fe=Math.max(y,bi),Ie=Math.max(0,(u??1)-(x??zi)),xe=p==="a"?Math.max(0,(u??1)-(x??zi)-_):p==="c"?Math.max(0,(u??1)-(x??zi)-S):p==="b"?u??1:1,ue=E&&(p==="a"||p==="b"||p==="c")&&f==="top",U=E&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),se=E&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),re=c.length>1,Re=z?void 0:$((p==="c"?S:_)+(x??zi)),Se=p==="c"&&Re?{left:Re}:void 0,ke=p==="a"&&Re?{right:Re}:void 0,ye=z?{left:0,width:"100%"}:p==="a"?{right:$(_),width:$(x)}:{left:$(S),width:$(x)},{titleColor:be,titleFontFamily:Ce,titleFontSettings:h,titleFontSize:q,titleLineHeight:X,titleLetterSpacing:ee,titleWordSpacing:ve,titleAlign:D,titleTextAppearance:R,lightboxCounterColor:Q,lightboxCounterFontFamily:ne,lightboxCounterFontSettings:N,lightboxCounterFontSize:te,lightboxCounterLineHeight:Ee,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:J,lightboxCounterTextAppearance:Ye}=e??{},Be={fontSettings:{fontFamily:Ce,fontWeight:(h==null?void 0:h.fontWeight)??400,fontStyle:(h==null?void 0:h.fontStyle)??"normal"},fontSize:q??.01,lineHeight:X,letterSpacing:ee??0,wordSpacing:ve??0,textAlign:D??"left",textAppearance:R,color:be??"#000000"},Xe=sn(Zt(Be,n)),et=B,Je=Rc(q,X,l,n),Ge=Lc(q,X,`${l}-title`,`${l}-text-tight-leading`),$e={fontSettings:{fontFamily:ne,fontWeight:(N==null?void 0:N.fontWeight)??400,fontStyle:(N==null?void 0:N.fontStyle)??"normal"},fontSize:te??.01,lineHeight:Ee,letterSpacing:ge??0,wordSpacing:J??0,textAppearance:Ye,color:Q??"#DEDDDD"},De={...sn(Zt($e,n)),...Rc(te,Ee,l,n)},Qe=Lc(te,Ee,`${l}-lightbox-counter`,`${l}-text-tight-leading`),he=j.buildColorVars(l,{titleColor:be??"#000000",lightboxCounterColor:Q??"#DEDDDD"},Eb,Mb),_e=s.useRef(null),[Ve,tt]=s.useState(!1),[ht,at]=s.useState([]),[Oe,Ae]=s.useState(0),Pe=s.useCallback((ot,me)=>{C&&(at(ot),Ae(me),tt(!0))},[C]),Ze=s.useCallback(()=>{tt(!1)},[]),Ne=s.useMemo(()=>{const ot={...he},me=_e.current?getComputedStyle(_e.current).getPropertyValue("--cntrl-article-width").trim():"";return me&&(ot["--cntrl-article-width"]=me),ot},[he,Ve]);return s.useEffect(()=>{if(!Ve||V!=="on"||typeof document>"u")return;const ot=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ot}},[Ve,V]),s.useEffect(()=>{!n||o||i||tt(!1)},[n,o,i]),s.useEffect(()=>{V==="off"&&tt(!1)},[V]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:he,children:a.jsxs("div",{ref:_e,className:`${l}-wrapper`,style:{width:j.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?$(v):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?$(I):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?$(y):void 0},children:[L&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ba,{P:l,title:W,position:f,titleRef:()=>{},titleClassName:`${Ge} ${l}-single-title`,titleContainerStyle:{...Je,...ie},titleTextBoxStyle:et,titleStyle:Xe,showTextBoxOutline:E,topPaddingControl:ue?Ec({P:l,scaled:$,height:ce,paired:!1}):void 0})}),c.map((ot,me)=>{const Fe=Fb(ot.gallery),st=me<c.length-1,dt=Fe.filter(ut=>ut.lightboxMedia).map(ut=>ut.lightboxMedia),ze={P:l,position:f,titleRef:M(me),titleClassName:Ge,titleContainerStyle:Je,titleTextBoxStyle:L?{maxWidth:"100%"}:et,titleStyle:Xe,showTextBoxOutline:E&&!L,topPaddingControl:ue&&!L?Ec({P:l,scaled:$,height:ce,paired:re}):void 0};return a.jsxs("div",{"data-item-index":me,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:st?$(Z):void 0},children:[U&&Mc({P:l,controlKey:"titleLeftPadding",scaled:$,width:oe,maxFraction:xe,side:"left",paired:re,anchorStyle:Se}),se&&Mc({P:l,controlKey:"titleRightPadding",scaled:$,width:fe,maxFraction:xe,side:"right",paired:re,anchorStyle:ke}),E&&st&&a.jsx("div",{"data-controls":"galleryPaddingBetween","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0",className:`${l}-control-anchor`,style:{bottom:0,height:$(G),...ye}}),z?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:Fe.map(({displayMedia:ut,lightboxMedia:Ct},Tt)=>{const xt=Ct?dt.findIndex(Pt=>Pt.url===Ct.url):-1;return a.jsx(Ic,{P:l,media:ut,imgWidth:x||void 0,cornerRadius:g||void 0,imageDisplay:m,isEditor:n,galleryPaddingBetween:Z,showPaddingAfter:Tt<Fe.length-1,showControls:E,onMediaClick:C&&xt>=0?()=>Pe(dt,xt):void 0},`${ut.url}-${Tt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ba,{...ze,title:L?"":ot.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ba,{...ze,title:L?"":ot.title}),Fe.length>0&&a.jsx(Bb,{P:l,layoutType:p,galleryWidthStyle:O,galleryPaddingRight:_,galleryPaddingLeft:S,galleryPaddingRightWidth:k,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Ie,showControls:E,scaled:$,children:Fe.map(({displayMedia:ut,lightboxMedia:Ct},Tt)=>{const xt=Ct?dt.findIndex(Pt=>Pt.url===Ct.url):-1;return a.jsx(Ic,{P:l,media:ut,cornerRadius:g||void 0,fillGalleryWidth:!0,imageDisplay:m,isEditor:n,galleryPaddingBetween:Z,showPaddingAfter:Tt<Fe.length-1,showControls:E,onMediaClick:C&&xt>=0?()=>Pe(dt,xt):void 0},`${ut.url}-${Tt}`)})})]})]},me)})]})}),Ve&&V==="on"&&typeof document<"u"&&e&&(()=>{const ot=(r?document.getElementById(r):null)??document.body;return Gn.createPortal(a.jsx("div",{style:Ne,"data-selection":"none",children:a.jsx(zb,{prefix:l,items:ht,index:Oe,imageDisplay:Db(e.lightboxImageDisplay),isEditor:n,onClose:Ze,onPrev:()=>Ae(me=>(me-1+ht.length)%ht.length),onNext:()=>Ae(me=>(me+1)%ht.length),counterClassName:Qe,counterStyle:De,backgroundColor:e.backgroundColor??Lb})}),ot)})()]})}const Zb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21073
21073
|
import { createPortal } from 'react-dom';
|
|
21074
21074
|
import type React from 'react';
|
|
21075
21075
|
import { CommonComponentProps } from '../props';
|
|
@@ -23119,7 +23119,7 @@ export function Mercury({
|
|
|
23119
23119
|
</>
|
|
23120
23120
|
);
|
|
23121
23121
|
}
|
|
23122
|
-
`;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Ga={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"}}},Jb={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:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("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:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("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:{...Ga.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:{...Ga.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:{...Ga.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"]}},Qb={element:Kb,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:Jb,sourceCode:Zb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Ac=48,ew=10,tw=400,nw=1,iw=1120/1440,ow=140/1440,rw=550/1440,aw=13,sw=4,lw=38/100,cw=28/100,xu=2.8,dw=.9,bu=.22,uw=.5,pw=1,mw=1.5,gw=0,hw=.85;function fw(e,t){return`
|
|
23122
|
+
`;function Ni(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const Va={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"}}},Jb={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:Ni("Gallery Padding Right"),galleryPaddingLeft:Ni("Gallery Padding Left"),galleryPaddingBetween:Ni("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:Ni("Title Top Padding"),titleLeftPadding:Ni("Title Left Padding"),titleRightPadding:Ni("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:{...Va.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:{...Va.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:{...Va.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"]}},Qb={element:Kb,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:Jb,sourceCode:Zb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Ac=48,ew=10,tw=400,nw=1,iw=1120/1440,ow=140/1440,rw=550/1440,aw=13,sw=4,lw=38/100,cw=28/100,xu=2.8,dw=.9,bu=.22,uw=.5,pw=1,mw=1.5,gw=0,hw=.85;function fw(e,t){return`
|
|
23123
23123
|
.${e}-wrapper {
|
|
23124
23124
|
position: relative;
|
|
23125
23125
|
box-sizing: border-box;
|
|
@@ -23164,10 +23164,10 @@ export function Mercury({
|
|
|
23164
23164
|
object-position: center;
|
|
23165
23165
|
}
|
|
23166
23166
|
${t}
|
|
23167
|
-
`}function tr(e){return Number(e.toFixed(4))}function Fc(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
|
|
23167
|
+
`}function tr(e){return Number(e.toFixed(4))}function Fc(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 Ga(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 yw(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 vw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function xw(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 wu(e,t){return(1-e)/(1-e*Math.cos(t))}function bw(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)*wu(e,i)))}return t||1}function ww(e,t){return e?1:1+bu*(.35+t)}function Sw(e,t,n,i){const o=t*ww(n,i);return Math.max(0,(e-o)/2)}function Su(e,t,n){const i=wu(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function $u(e,t,n){return e/2+t*n}function $w(e,t,n){return e(t-n/2)}function Cw(e,t){return e*t}function Cu(e){return Math.round(e*1e3)}function Tu(e,t,n){const i=Math.cos(e),o=Math.cos(hw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return tr(t+(n-t)*r)}function Lu(e){return Tu(e,uw,pw)}function Tw(e){return Tu(e,mw,gw)}function Ru(e,t){if(!t)return"none";const n=Tw(e);return n<=0?"none":`blur(${n}px)`}function Lw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=Su(i,o,r*Math.PI*2),p=r*Math.PI*2,x=$u(t,n,c),b=tr(u),m=`calc(${e(x)} - var(--helix-base-w) * ${b} / 2)`,g=`calc(var(--helix-base-w) * ${b})`,f=l?`height: calc(var(--helix-base-h) * ${b});`:"";return`left: ${m}; width: ${g}; ${f} z-index: ${Cu(u)}; transform: translateY(-50%); opacity: ${Lu(p)}; filter: ${Ru(p,d)};`}function Rw(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Ac;u+=1){const p=u/Ac;c.push(` ${tr(p*100)}% { ${Lw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23168
23168
|
${c.join(`
|
|
23169
23169
|
`)}
|
|
23170
|
-
}`}function Iu(e,t){return(e%t+t)%t}function Iw(e,t){return al(e,t)/t}function al(e,t){return Iu(e,t)}function Ew(e,t){return Math.floor(e/t)}function Mw(e,t,n,i){return Ew(e,t)*n+al(e,t)*i}function Pw(e,t,n){const i=n==="left"?1-e:e;return`${tr(-i*t)}s`}function Wc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Eu(e){const t=e%1;return t<0?t+1:t}function kw(e,t,n){const i=t/xu,o=n==="left"?-e*i:e*i;return Eu(o)}function Aw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=j.useScopedStyles(),r=s.useRef(null),l=
|
|
23170
|
+
}`}function Iu(e,t){return(e%t+t)%t}function Iw(e,t){return al(e,t)/t}function al(e,t){return Iu(e,t)}function Ew(e,t){return Math.floor(e/t)}function Mw(e,t,n,i){return Ew(e,t)*n+al(e,t)*i}function Pw(e,t,n){const i=n==="left"?1-e:e;return`${tr(-i*t)}s`}function Wc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Eu(e){const t=e%1;return t<0?t+1:t}function kw(e,t,n){const i=t/xu,o=n==="left"?-e*i:e*i;return Eu(o)}function Aw({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=j.useScopedStyles(),r=s.useRef(null),l=Ga((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),iw),d=Ga(e==null?void 0:e.imageWidth,ow),c=Ga(e==null?void 0:e.turnHeight,rw),u=Fc(e==null?void 0:e.itemsPerTurn,aw,3,40),p=Fc(e==null?void 0:e.turns,sw,1,30),x=Math.min(dw,Math.max(0,lw)),b=Math.min(1,Math.max(0,cw)),m=Math.max(0,(e==null?void 0:e.speed)??xu),g=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",v=(e==null?void 0:e.cornerRadius)??0,I=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>yw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=y.display==="cover",V=ie=>j.scalingValue(ie,n??!1),z=s.useMemo(()=>bw(x),[x]),Y=s.useMemo(()=>Sw(l,d,w,b),[l,d,w,b]),M=s.useMemo(()=>fw(o,Rw(o,V,l,Y,x,z,w,I)),[o,l,Y,x,z,w,I,n]),F=s.useMemo(()=>(t??[]).filter(ie=>{var k;return!!((k=ie.image)!=null&&k.url)}),[t]),K=c/u,T=d*vw(y),L=Math.min(tw,p*u),W=nw*u,O=L+W*2,E=Math.max(0,p-1)*c+(u-1)*K,_=m>0,S=f==="scroll"&&_,Z=f==="autoplay"&&_&&(n?!!i:!0),[$,H]=s.useState(0);s.useEffect(()=>{if(!S)return;const ie=r.current;if(!ie)return;const k=()=>{const G=ie.getBoundingClientRect(),ce=window.innerHeight||document.documentElement.clientHeight,oe=ce+G.height;oe<=0||H(Math.min(1,Math.max(0,(ce-G.top)/oe)))};k(),window.addEventListener("scroll",k,{passive:!0}),window.addEventListener("resize",k);const de=new ResizeObserver(k);return de.observe(ie),()=>{window.removeEventListener("scroll",k),window.removeEventListener("resize",k),de.disconnect()}},[S]);const B=S?kw($,m,g):0,le=_&&f==="autoplay"?360/(m*ew):0;return F.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:M}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:V(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:M}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:V(l),height:V(E),marginInline:"auto"},children:Array.from({length:O},(ie,k)=>{const de=k-W,ce=F[Iu(de,F.length)].image,oe=al(de,u),fe=Iw(de,u),Ie=S?Eu(fe+B):fe,xe=Mw(de,u,c,K),ue=b===0?0:(Wc(oe+7.3)-.5)*b*K,U=w?1:1+(Wc(oe+3.1)-.5)*2*bu*(.35+b),se=Ie*Math.PI*2,{offset:re,scale:Re}=Su(x,z,se),Se=d*U,ke=Cw(Se,Re),ye=$u(l,Y,re),be={"--helix-base-w":V(Se),...w?{"--helix-base-h":V(T)}:{}},Ce={top:V(xe+ue),transform:"translateY(-50%)",...be,...Z?{animationDuration:`${tr(le)}s`,animationDelay:Pw(fe,le,g),animationDirection:g==="left"?"reverse":"normal"}:{left:$w(V,ye,ke),width:V(ke),...w?{height:V(T*Re)}:{},zIndex:Cu(Re),opacity:Lu(se),filter:Ru(se,I)}},h=v>0?{borderRadius:V(v)}:{},q=w?{...h,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:h,X=xw(ce)?a.jsx("video",{className:`${o}-media`,style:q,src:ce.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:q,src:ce.url,alt:ce.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:Z?`${o}-item`:`${o}-item ${o}-item-static`,style:Ce,children:w?a.jsx("div",{className:`${o}-cover`,style:h,children:X}):X},`${p}-${u}-${de}`)})})]})}const Fw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23171
23171
|
import { CommonComponentProps } from '../props';
|
|
23172
23172
|
import { scalingValue } from '../utils/scalingValue';
|
|
23173
23173
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23705,7 +23705,7 @@ export function Helix({
|
|
|
23705
23705
|
</>
|
|
23706
23706
|
);
|
|
23707
23707
|
}
|
|
23708
|
-
`,Ww=["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"],_w={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:Ww.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"]}]}]},Nw={element:Aw,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:_w,sourceCode:Fw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},_c=120,Nc=3,Hw=.12,sl={x:0,y:0,width:100,height:100};function Zi(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function qr(e){return e<0?0:e>1?1:e}function Hc(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 Ow(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,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}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 Dw(e){return e.map(([t,n])=>({x:t,y:n}))}function Xa(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 jw(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=qr(n[o]),l=qr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return zw(i)}function zw(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 Bw(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 Vw(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 Gw(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 qw(e,t,n,i){let o=null;for(let r=0;r<Nc;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Nc-1)),d=jw(e,l),c=i==="avoid"?Vw(d):d;if(o=o===null?c:Bw(o,c),o.length===0)return[]}return o??[]}function Oc(e,t="stretch",n=sl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=si(i),d=qo(l);if(d.length)return t==="viewbox"?Zi(d,n):Xa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d",x),u.appendChild(b);let m=0;try{m=b.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let f=0;f<_c;f+=1){const v=b.getPointAtLength(f/_c*m);g.push({x:v.x,y:v.y})}p.push(g)}return p.length?t==="viewbox"?Zi(p,n):Xa(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"?Zi([r],n):Xa([r])}const ll={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},fs="0 0 100 100",Xr=100,ys=16,Xw=12,Uw=16,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Yw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Dc=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,Vi=24,Gi=[];function Qw(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Ya(e,t){return on(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function eS(e){const t=ti(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:on(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function tS(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return on(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function jc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ya(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=si(d);c.length&&(l=n==="viewbox"?Ya(c,i):eS(c))}if(!l.length){const c=o!=="custom"?ll[o]:void 0;c?l=Ya(si(c),sl):l=Qw()}}return o==="circle"?tS(l,r):l}function zc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":po(on(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function vs(e){const t=e==="rectangle"||e==="custom"?void 0:ll[e];return t?Zi(qo(si(t)),sl):[Dw([[0,0],[1,0],[1,1],[0,1]])]}function nS(e){const t=e.match(Yw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function xs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function an(e){return{x:e.x,y:e.y}}function iS(e){return{p:an(e.p),in:e.in?an(e.in):null,out:e.out?an(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(iS)}))}function on(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 Bc(e,t,n,i=n){return on(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function oS(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:an(e),c2:an(l),p:an(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),b=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*b+x*m,f=-x*b+p*m,v=g*g/(d*d)+f*f/(c*c);if(v>1){const Z=Math.sqrt(v);d*=Z,c*=Z}const I=o===r?-1:1,y=d*d*f*f+c*c*g*g,w=Math.max(0,d*d*c*c-y),V=y===0?0:I*Math.sqrt(w/y),z=V*d*f/c,Y=-V*c*g/d,M=p*z-x*Y+(e.x+l.x)/2,F=x*z+p*Y+(e.y+l.y)/2,K=Math.atan2((f-Y)/c,(g-z)/d);let L=Math.atan2((-f-Y)/c,(-g-z)/d)-K;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const W=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),O=L/W,C=4/3*Math.tan(O/4),E=(Z,$)=>({x:M+p*d*Z-x*c*$,y:F+x*d*Z+p*c*$}),_=[];let S=K;for(let Z=0;Z<W;Z+=1){const $=S+O,H=Math.cos(S),B=Math.sin(S),ce=Math.cos($),ie=Math.sin($);_.push({c1:E(H-C*B,B+C*H),c2:E(ce+C*ie,ie-C*ce),p:Z===W-1?an(l):E(ce,ie)}),S=$}return _}function si(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Fn(g??null,m),out:null}),r=m},x=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Fn(m,g.p)};Ua.lastIndex=0;let b=Ua.exec(t);for(;b!==null;){const m=b[1],g=m.toUpperCase(),f=m!==g,v=nS(b[2]),I=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(g==="Z")o=!0,u(),r=an(l),d=null,c=null;else if(g==="M"){for(let y=0;y+1<v.length;y+=2){const w=I(y);y===0&&(u(),l=an(w)),p(w)}d=null,c=null}else if(g==="L"){for(let y=0;y+1<v.length;y+=2)p(I(y));d=null,c=null}else if(g==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(g==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(g==="C"){for(let y=0;y+5<v.length;y+=6){const w=I(y),V=I(y+2),z=I(y+4);x(w),p(z,V),d=V}c=null}else if(g==="S"){for(let y=0;y+3<v.length;y+=4){const w=d?xs(d,r):an(r),V=I(y),z=I(y+2);x(w),p(z,V),d=V}c=null}else if(g==="Q")for(let y=0;y+3<v.length;y+=4){const w=I(y),V=I(y+2);x(hn(r,w,2/3)),p(V,hn(V,w,2/3)),c=w,d=null}else if(g==="T")for(let y=0;y+1<v.length;y+=2){const w=c?xs(c,r):an(r),V=I(y);x(hn(r,w,2/3)),p(V,hn(V,w,2/3)),c=w,d=null}else if(g==="A")for(let y=0;y+6<v.length;y+=7){const w=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const V of oS(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,w))x(V.c1),p(V.p,V.c2);d=null,c=null}b=Ua.exec(t)}return u(),n}function En(e){return`${Number(e.toFixed(2))}`}function Fn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Mu(e){return!!(Fn(e.in,e.p)||Fn(e.out,e.p))}function xo(e,t){return!Fn(e.out,e.p)&&!Fn(t.in,t.p)}function Vc(e,t){if(xo(e,t))return`L${En(t.p.x)},${En(t.p.y)}`;const n=Fn(e.out,e.p)??e.p,i=Fn(t.in,t.p)??t.p;return`C${En(n.x)},${En(n.y)} ${En(i.x)},${En(i.y)} ${En(t.p.x)},${En(t.p.y)}`}function po(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${En(i.p.x)},${En(i.p.y)}`);let r=i;for(const l of o)t.push(Vc(r,l)),r=l;if(n.closed){const l=Vc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Pu(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 bs(e,t,n){if(xo(e,t))return hn(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 qo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Pu(n)){if(xo(o.from,o.to)){i.push(an(o.from.p));continue}for(let r=0;r<ys;r+=1)i.push(bs(o.from,o.to,r/ys))}n.closed||i.push(an(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ti(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of qo(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 rS(e){const t=ti(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function ku(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 Au(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Xw)return{closed:!0,nodes:t.map(r=>({p:an(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Uw)),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:an(r),...ku(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Fu(e,t,n=1){if(!e.length)return!1;const i=ti(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function aS(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:on(e,u=>{const p=i+(u.x-t.x)*r,x=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+x/c}})}function sS(e,t){if(!e.length)return e;const n=ti(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 on(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Wu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?ll[e]:void 0,i=n?on(si(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):on(Au(vs("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=sS(i,t);return{shape:e,customPath:po(o),pathFit:"viewbox",pathViewBox:fs}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function lS(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=Pn(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 Gc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function cS(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=_u(i,r,d)}),i}function dS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=an(o),r){const p=i==="in"?"out":"in";c[p]=xs(o,c.p)}return d}function uS(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=Pn(e);return r[t].nodes[n][i]=null,r}function pS(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=Pn(e),c=d[t].nodes,u=n+1;if(xo(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,b=hn(r.p,p,i),m=hn(p,x,i),g=hn(x,l.p,i),f=hn(b,m,i),v=hn(m,g,i),I=hn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=b,c[y].in=g,c.splice(u,0,{p:I,in:f,out:v}),{contours:d,nodeIndex:u}}function _u(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function qc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,x=!!Fn(l[u].out,l[u].p),b=!!Fn(l[p].in,l[p].p);if(Mu(d)||x||b)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=ku(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function mS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Xc(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Pu(i)){const l=xo(r.from,r.to)?1:ys;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=mS(t,bs(r.from,r.to,c),bs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function gS(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Uc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Yc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function hS(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function fS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ws(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function yS(e,t){const n=ws(e,t);return n?{kind:"align",a:{x:e.x-n.x*Vi,y:e.y-n.y*Vi},b:{x:t.x+n.x*Vi,y:t.y+n.y*Vi}}:{kind:"align",a:e,b:t}}function Ss(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Kc(e,t,n,i,o){if(e.axis===null)return yS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return Ss(o(r)[t],t,i)}function vS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Kc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Kc(n,"y",l,i,o)),r}function xS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ws(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ws(i(p),r)}function bS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:Gi};const b=Math.atan2(p,u),m=Math.round(b/Dc)*Dc;let g=o?m:null,f=!1;if(!o){const Y=[];n&&Y.push({angle:Math.atan2(n.y,n.x),smooth:!0}),Y.push({angle:m,smooth:!1});for(const M of Y){const F=fS(M.angle-b);if(!(Math.abs(F)>Zw)&&!(Math.abs(Math.sin(F))*x>Kw)){g=M.angle,f=M.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(g===null&&!v)return{point:e,guides:Gi};const I=g??b,y=v?i:x,w={x:Math.cos(I),y:Math.sin(I)},V=y+(g===null?0:Vi),z=v?y:f?Vi:0;return{point:l({x:d.x+w.x*y,y:d.y+w.y*y}),guides:[{kind:"angle",a:{x:d.x-w.x*z,y:d.y-w.y*z},b:{x:d.x+w.x*V,y:d.y+w.y*V}}]}}const Ur=.1,$s=8,wS=4,Zc=10,Yr=(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}}},Nu=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Cs=(e,t)=>{const n=Yr(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Zc,y:n.y+o*Zc}},Ts=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),ni=(e,t,n)=>{const i=Ts(e,t)*n;return{width:t.width*i,height:t.height*i}},Mn=(e,t,n)=>(e-t)*n,qi=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<wS?.5:qr(r)},SS=(e,t,n,i)=>{if(!(i.width>0)||!(i.height>0))return n;const o=ni(e,t,n);if(!(o.width>i.width)&&!(o.height>i.height))return n;const r=Math.min(i.width/o.width,i.height/o.height);return Math.max(Ur,n*r)},$S=(e,t,n,i,o,r)=>{const l=ni(e,n,r),d=e.x+Mn(e.width,l.width,i),c=e.y+Mn(e.height,l.height,o),u=Ts(e,n),p=Ts(t,n),x=Math.min($s,Math.max(Ur,p>0?r*(u/p):r)),b=ni(t,n,x);return{focalX:qi(t.width,b.width,d-t.x,{clamp:!1}),focalY:qi(t.height,b.height,c-t.y,{clamp:!1}),scale:x}},Jc=1.08,Cr=14,Tr=8;function CS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:b}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),I=s.useRef({focalX:c,focalY:u,scale:p});I.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var O;y&&((O=m.current)==null||O.focus({preventScroll:!0}))},[y]);const w=s.useCallback((O,C)=>{var _;const E=(_=m.current)==null?void 0:_.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(O-E.left)/E.width*t.width,y:(C-E.top)/E.height*t.height}},[t.width,t.height]),V=O=>{var E,_;if(!i)return;O.stopPropagation(),O.preventDefault(),(E=m.current)==null||E.focus({preventScroll:!0});const C=ni(n,i,p);f.current={pointerId:O.pointerId,origin:w(O.clientX,O.clientY),startX:Mn(n.width,C.width,c),startY:Mn(n.height,C.height,u),width:C.width,height:C.height,moved:!1},(_=m.current)==null||_.setPointerCapture(O.pointerId)},z=(O,C)=>{var ce,ie;if(!i)return;O.stopPropagation(),O.preventDefault(),(ce=m.current)==null||ce.focus({preventScroll:!0});const E=ni(n,i,p),_=Mn(n.width,E.width,c),S=Mn(n.height,E.height,u),Z={minX:_,minY:S,maxX:_+E.width,maxY:S+E.height},$=Yr(Z,Nu(C)),H=Yr(Z,C),B=Math.hypot(H.x-$.x,H.y-$.y);!isFinite(B)||B<=0||(v.current={pointerId:O.pointerId,anchor:$,startDistance:B,startScale:p,startX:_,startY:S,moved:!1},(ie=m.current)==null||ie.setPointerCapture(O.pointerId))},Y=O=>{if(!i)return;const C=v.current;if(C&&O.pointerId===C.pointerId){O.stopPropagation(),O.preventDefault();const _=w(O.clientX,O.clientY),S={x:_.x-n.x,y:_.y-n.y},Z=Math.hypot(S.x-C.anchor.x,S.y-C.anchor.y),$=Math.min($s,Math.max(Ur,C.startScale*(Z/C.startDistance)));if(!C.moved&&Math.abs($-C.startScale)<1e-4)return;C.moved=!0;const H=$/C.startScale,B=C.anchor.x+(C.startX-C.anchor.x)*H,ce=C.anchor.y+(C.startY-C.anchor.y)*H,ie=ni(n,i,$);x({focalX:qi(n.width,ie.width,B),focalY:qi(n.height,ie.height,ce),scale:$});return}const E=f.current;if(E&&O.pointerId===E.pointerId){O.stopPropagation(),O.preventDefault();const _=w(O.clientX,O.clientY),S=_.x-E.origin.x,Z=_.y-E.origin.y;if(!E.moved&&S===0&&Z===0)return;E.moved=!0,x({focalX:qi(n.width,E.width,E.startX+S),focalY:qi(n.height,E.height,E.startY+Z),scale:p})}},M=O=>{var _,S;const C=f.current;if(C&&O.pointerId===C.pointerId){f.current=null,O.stopPropagation(),(_=m.current)!=null&&_.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&b(I.current);return}const E=v.current;E&&O.pointerId===E.pointerId&&(v.current=null,O.stopPropagation(),(S=m.current)!=null&&S.hasPointerCapture(E.pointerId)&&m.current.releasePointerCapture(E.pointerId),E.moved&&b(I.current))},F=O=>{if(O.key==="Escape"){O.stopPropagation(),d("none");return}if(O.key==="="||O.key==="+"||O.key==="-"||O.key==="_"){O.preventDefault(),O.stopPropagation();const C=O.key==="="||O.key==="+",E=Math.min($s,Math.max(Ur,p*(C?Jc:1/Jc))),_={focalX:c,focalY:u,scale:E};x(_),b(_)}},K=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const O=i??{width:n.width,height:n.height},C=ni(n,O,p);return!(C.width>0)||!(C.height>0)?null:{x:n.x+Mn(n.width,C.width,c),y:n.y+Mn(n.height,C.height,u),width:C.width,height:C.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),W=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerMove:Y,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:M,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:V}),K.map(O=>{const C=Cs(W,O),E=O==="ne"||O==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:C.x-Tr/2,y:C.y-Tr/2,width:Tr,height:Tr}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:C.x-Cr/2,y:C.y-Cr/2,width:Cr,height:Cr,onPointerDown:_=>z(_,O)})]},O)})]})]})}const Ls=10,TS=Ls*2,In=7,LS=4,Hi=9,RS=3.5,Qc=1.08,IS=.05,Lr=14,ES=1,Rr=14,Ir=8;function MS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:x}){const b=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const f=s.useRef(null),v=s.useRef(null),I=s.useRef(null),y=s.useRef(null),[w,V]=s.useState([]),[z,Y]=s.useState(Gi),[M,F]=s.useState(null),K=s.useCallback(h=>{Y(q=>hS(q,h)?q:h)},[]),T=d==="shape";s.useEffect(()=>{var h;T&&((h=b.current)==null||h.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||V(h=>h.length?[]:h)},[T]);const L=w.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const W=n.width>0?t.width/n.width:1,O=n.height>0?t.height/n.height:1,C=Math.min(W,O),E=r&&l?C:W,_=r&&l?C:O,S=r&&l?(t.width-n.width*C)/2:0,Z=r&&l?(t.height-n.height*C)/2:0,$=s.useCallback(h=>r?{x:S+(h.x-n.x)*E,y:Z+(h.y-n.y)*_}:{x:h.x-n.x,y:h.y-n.y},[r,n,E,_,S,Z]),H=s.useCallback(h=>r?{x:n.x+(E>0?(h.x-S)/E:0),y:n.y+(_>0?(h.y-Z)/_:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,E,_,S,Z]),B=s.useMemo(()=>H({x:t.width/2,y:t.height/2}),[H,t.width,t.height]),ce=s.useCallback((h,q)=>{var ee;const X=(ee=b.current)==null?void 0:ee.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const ye=(h-X.left)/X.width*t.width,D=(q-X.top)/X.height*t.height;return{x:n.x+(E>0?(ye-S)/E:0),y:n.y+(_>0?(D-Z)/_:0)}}return{x:n.x+(h-X.left),y:n.y+(q-X.top)}},[r,n,t.width,t.height,E,_,S,Z]),ie=s.useCallback((h,q)=>{var ee;const X=(ee=b.current)==null?void 0:ee.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(h-X.left)/X.width*t.width,y:(q-X.top)/X.height*t.height}},[t.width,t.height]),A=s.useCallback((h,q)=>{const X=l&&!(q!=null&&q.preserveShape)?aS(h,n,t,S,Z,E,_):h;x(X,q)},[x,l,n,t,S,Z,E,_]),de=s.useCallback(()=>{F(null)},[]),G=s.useCallback((h,q,X)=>{if(!X||f.current||v.current||I.current||y.current){de();return}const ee=ie(h,q),ye=on(g.current,$);for(const te of ye)for(const Ee of te.nodes)if(Math.hypot(Ee.p.x-ee.x,Ee.p.y-ee.y)<=Hi){de();return}const D=Xc(ye,ee);if(!D||D.distance>Ls){de();return}const R=ye[D.contour],Q=R==null?void 0:R.nodes[D.segment],ne=R==null?void 0:R.nodes[(D.segment+1)%((R==null?void 0:R.nodes.length)??1)],N=!!(Q&&ne&&!xo(Q,ne));F(te=>te&&te.curved===N&&Math.hypot(te.point.x-D.point.x,te.point.y-D.point.y)<.25?te:{point:D.point,curved:N})},[ie,$,de]),se=h=>{var Be;const q=h.metaKey||h.ctrlKey,X=I.current;if(X&&h.pointerId===X.pointerId){if(h.stopPropagation(),h.preventDefault(),X.startDistance<=0)return;const rt=ce(h.clientX,h.clientY),Xe=Math.hypot(rt.x-X.origin.x,rt.y-X.origin.y),nt=Math.max(IS,Xe/X.startDistance);if(!X.moved&&Math.abs(nt-1)<1e-4)return;X.moved=!0,p(Bc(X.startContours,X.origin,nt));return}const ee=v.current;if(ee&&h.pointerId===ee.pointerId){h.stopPropagation(),h.preventDefault();const rt=ce(h.clientX,h.clientY),{bbox:Xe}=ee,nt=Xe.maxX-Xe.minX,Qe=Xe.maxY-Xe.minY,Ge=rt.x-ee.origin.x,Se=rt.y-ee.origin.y;let _e=Ge,Oe=Se;if(isFinite(nt)&&isFinite(Qe))if(r){let ge=n.x,We=n.x+n.width,Ve=n.y,it=n.y+n.height;l&&(E>0&&(ge=n.x+(0-S)/E,We=n.x+(t.width-S)/E),_>0&&(Ve=n.y+(0-Z)/_,it=n.y+(t.height-Z)/_));const ht=Math.min(ge,We-nt),ct=Math.max(ge,We-nt),Ne=Math.min(Ve,it-Qe),Ae=Math.max(Ve,it-Qe),Pe=Math.min(ct,Math.max(ht,Xe.minX+Ge)),Je=Math.min(Ae,Math.max(Ne,Xe.minY+Se));_e=Pe-Xe.minX,Oe=Je-Xe.minY}else{const ge=Xe.minX-n.x,We=Xe.minY-n.y,Ve=Math.min(0,t.width-nt),it=Math.max(0,t.width-nt),ht=Math.min(0,t.height-Qe),ct=Math.max(0,t.height-Qe),Ne=Math.min(it,Math.max(Ve,ge+Ge)),Ae=Math.min(ct,Math.max(ht,We+Se));_e=Ne-ge,Oe=Ae-We}const et=[];if(!q&&isFinite(nt)&&isFinite(Qe)){const ge=$({x:Xe.minX+nt/2+_e,y:Xe.minY+Qe/2+Oe}),We={x:t.width/2,y:t.height/2};Math.abs(ge.x-We.x)<=Lr&&(_e=B.x-Xe.minX-nt/2,et.push(Ss(We.x,"x",t))),Math.abs(ge.y-We.y)<=Lr&&(Oe=B.y-Xe.minY-Qe/2,et.push(Ss(We.y,"y",t)))}if(!ee.moved&&_e===0&&Oe===0)return;ee.moved=!0,K(et.length?et:Gi),p(on(ee.startContours,ge=>({x:ge.x+_e,y:ge.y+Oe})),{carryImage:!0});return}const ye=y.current;if(ye&&h.pointerId===ye.pointerId){h.stopPropagation(),h.preventDefault();const rt=ce(h.clientX,h.clientY);let Xe=rt.x-ye.origin.x,nt=rt.y-ye.origin.y;if(h.shiftKey&&(Math.abs(Xe)>Math.abs(nt)?nt=0:Xe=0),!ye.moved&&Xe===0&&nt===0)return;ye.moved=!0,p(Gc(ye.startContours,ye.selection,Xe,nt));return}const D=f.current;if(!D||h.pointerId!==D.pointerId){G(h.clientX,h.clientY,w.length>0||T);return}de(),h.stopPropagation(),h.preventDefault();const R=ce(h.clientX,h.clientY);if(D.kind==="anchor"){const rt={x:D.anchor.x+(R.x-D.origin.x),y:D.anchor.y+(R.y-D.origin.y)},Xe=q?[]:gS(g.current,{contour:D.contour,node:D.node}),nt=q||!D.center?[]:[D.center],Qe=Yc(Uc(Xe,nt.map(_e=>_e.x),"x"),rt,"x",$,Lr),Ge=Yc(Uc(Xe,nt.map(_e=>_e.y),"y"),rt,"y",$,Lr),Se=q?rt:{x:(Qe==null?void 0:Qe.value)??$r(rt.x,o),y:(Ge==null?void 0:Ge.value)??$r(rt.y,o)};if(h.shiftKey&&(Math.abs(Se.x-D.anchor.x)>Math.abs(Se.y-D.anchor.y)?Se.y=D.anchor.y:Se.x=D.anchor.x),!D.moved&&Se.x===D.anchor.x&&Se.y===D.anchor.y)return;D.moved=!0,K(vS(Se,Qe,Ge,t,$)),p(lS(g.current,D.contour,D.node,Se));return}const Q=(Be=g.current[D.contour])==null?void 0:Be.nodes[D.node],ne=D.mirror&&!h.altKey,N=ne||q?null:D.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,te=Q?$(Q.p):null,Ee=N?$(N):null,me=Q&&(!q||h.shiftKey)?bS(R,Q.p,ne||q?null:xS(g.current[D.contour],D.node,D.kind,$),te&&Ee?Math.hypot(Ee.x-te.x,Ee.y-te.y):null,h.shiftKey,$,H):{point:R,guides:Gi},J=me.guides.length?me.point:q?R:{x:$r(R.x,o),y:$r(R.y,o)},Ke=D.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!D.moved&&Ke&&J.x===Ke.x&&J.y===Ke.y||(D.moved=!0,K(me.guides),p(dS(g.current,D.contour,D.node,D.kind,J,ne)))},oe=h=>{K(Gi);const q=I.current;if(q&&h.pointerId===q.pointerId){I.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(q.pointerId)&&N.releasePointerCapture(q.pointerId),q.moved&&A(g.current,{preserveShape:!0});return}const X=v.current;if(X&&h.pointerId===X.pointerId){v.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(X.pointerId)&&N.releasePointerCapture(X.pointerId),X.moved?A(g.current,{preserveShape:!0}):V([]);return}const ee=y.current;if(ee&&h.pointerId===ee.pointerId){y.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(ee.pointerId)&&N.releasePointerCapture(ee.pointerId),ee.moved&&A(g.current);return}const ye=f.current;if(!ye||h.pointerId!==ye.pointerId)return;f.current=null,h.stopPropagation();const D=b.current;D!=null&&D.hasPointerCapture(ye.pointerId)&&D.releasePointerCapture(ye.pointerId);const R=Math.hypot(h.clientX-ye.clientOrigin.x,h.clientY-ye.clientOrigin.y);if(ye.moved||R>LS){ye.moved&&A(g.current);return}if(!ye.toggleOnRelease||h.type!=="pointerup")return;const ne=qc(g.current,ye.contour,ye.node);ne!==g.current&&(p(ne),A(ne))},he=h=>{h.stopPropagation()},Ie=h=>{var q,X;h.stopPropagation(),h.preventDefault(),de(),(q=b.current)==null||q.focus({preventScroll:!0}),v.current={pointerId:h.pointerId,origin:ce(h.clientX,h.clientY),startContours:Pn(i),bbox:ti(i),moved:!1},(X=b.current)==null||X.setPointerCapture(h.pointerId)},ve=(h,q)=>{var R,Q;h.stopPropagation(),h.preventDefault(),de(),(R=b.current)==null||R.focus({preventScroll:!0}),V([]),c("shape");const X=ti(i),ee=Yr(X,Nu(q)),ye=Cs(X,q),D=Math.hypot(ye.x-ee.x,ye.y-ee.y);!isFinite(D)||D<=0||(I.current={pointerId:h.pointerId,corner:q,origin:ee,startDistance:D,startContours:Pn(i),moved:!1},(Q=b.current)==null||Q.setPointerCapture(h.pointerId))},ue=(h,q,X,ee)=>{var R,Q,ne,N;h.stopPropagation(),h.preventDefault(),de(),(R=b.current)==null||R.focus({preventScroll:!0});const ye=(Q=i[X])==null?void 0:Q.nodes[ee];if(!ye)return;if(h.altKey){const te=q==="anchor"?_u(i,X,ee):uS(i,X,ee,q);if(te===i)return;V(q==="anchor"?[]:[{contour:X,node:ee}]),p(te),A(te);return}const D=h.metaKey||h.ctrlKey;if(q==="anchor"&&h.shiftKey&&!D){V(te=>te.some(Ee=>Ee.contour===X&&Ee.node===ee)?te.filter(Ee=>!(Ee.contour===X&&Ee.node===ee)):[...te,{contour:X,node:ee}]);return}if(q==="anchor"&&!D&&w.length>1&&w.some(te=>te.contour===X&&te.node===ee)){y.current={pointerId:h.pointerId,origin:ce(h.clientX,h.clientY),startContours:Pn(i),selection:w,moved:!1},(ne=b.current)==null||ne.setPointerCapture(h.pointerId);return}V([{contour:X,node:ee}]),f.current={kind:q,contour:X,node:ee,pointerId:h.pointerId,origin:ce(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:ye.p,center:rS(i),mirror:q!=="anchor"&&!!(ye.in&&ye.out),toggleOnRelease:D,moved:!1},(N=b.current)==null||N.setPointerCapture(h.pointerId)},U=h=>{h.stopPropagation(),h.preventDefault(),de();const q=on(i,$),X=Xc(q,ie(h.clientX,h.clientY));if(!X||X.distance>Ls)return;const{contours:ee,nodeIndex:ye}=pS(i,X.contour,X.segment,X.t);ye<0||(V([{contour:X.contour,node:ye}]),p(ee),A(ee))},le=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const D=ti(i);if(!isFinite(D.minX)||!isFinite(D.maxX))return;const R={x:(D.minX+D.maxX)/2,y:(D.minY+D.maxY)/2},ne=h.key==="="||h.key==="+"?Qc:1/Qc,N=Bc(i,R,ne);p(N),A(N,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),V([]),c("none");return}if(!w.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const D=cS(i,w);if(D===i)return;V([]),p(D),A(D);return}const q=o>0?o:ES,X=h.shiftKey?q*10:q,ee={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[h.key];if(!ee)return;h.preventDefault(),h.stopPropagation();const ye=Gc(i,w,ee[0],ee[1]);p(ye),A(ye)},re=s.useMemo(()=>po(on(i,$)),[i,$]),Re=s.useMemo(()=>ti(i),[i]),we=$({x:Re.minX,y:Re.minY}),ke={width:$({x:Re.maxX,y:Re.minY}).x-we.x,height:$({x:Re.minX,y:Re.maxY}).y-we.y},fe=T&&w.length===0&&isFinite(Re.minX)&&isFinite(Re.maxX)&&Re.maxX>Re.minX&&Re.maxY>Re.minY,xe=w.length>0||T,Ce=xe;return a.jsxs("svg",{ref:b,className:`${e}-editor${xe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:le,onPointerDown:()=>{var h;return(h=b.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:se,onPointerLeave:de,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onContextMenu:h=>{h.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{V([]),c("none")},onClick:U}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:re}),Ce&&z.map((h,q)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${h.kind}`,x1:h.a.x,y1:h.a.y,x2:h.b.x,y2:h.b.y},`${h.kind}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:re,fillRule:"evenodd",onPointerDown:Ie,onClick:U}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:re,style:{strokeWidth:TS},onClick:U}),Ce&&M&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:M.point.x-In/2,y:M.point.y-In/2,width:In,height:In,rx:M.curved?In/2:0}),Ce&&i.map((h,q)=>h.nodes.map((X,ee)=>{const ye=w.some(R=>R.contour===q&&R.node===ee),D=$(X.p);return a.jsxs("g",{children:[ye&&w.length===1&&["in","out"].map(R=>{const Q=X[R];if(!Q)return null;const ne=$(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:D.x,y1:D.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:RS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:Hi,onPointerDown:N=>ue(N,R,q,ee),onClick:he})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${ye?` ${e}-editor-anchor-selected`:""}`,x:D.x-In/2,y:D.y-In/2,width:In,height:In,rx:Mu(X)?In/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:D.x-Hi,y:D.y-Hi,width:Hi*2,height:Hi*2,onPointerDown:R=>ue(R,"anchor",q,ee),onClick:he,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const Q=qc(i,q,ee);p(Q),A(Q)}})]},`${q}-${ee}`)})),fe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:we.x,y:we.y,width:ke.width,height:ke.height}),["nw","ne","se","sw"].map(h=>{const q=$(Cs(Re,h)),X=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Ir/2,y:q.y-Ir/2,width:Ir,height:Ir}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Rr/2,y:q.y-Rr/2,width:Rr,height:Rr,onPointerDown:ee=>ve(ee,h),onClick:he})]},h)})]})]})}const PS=4e3,kS=/^(?:https?:|mailto:|tel:)/i;function Hu(e){return!!e&&typeof e=="object"&&e.type==="link"}function AS(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!kS.test(t)))return t}function FS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Hu(c)){o(c.children??[],AS(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function ed(e){return{...e.fontFamily&&{fontFamily:fo(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 WS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Hu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function _S(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,f=m.y*i;g<d&&(d=g),g>c&&(c=g),f<u&&(u=f),f>p&&(p=f)}const x=(d+c)/2,b=(u+p)/2;return l.map(m=>{const g=m.x*n,f=m.y*i,v=g-x,I=f-b,y=Math.sqrt(v*v+I*I);if(y<1e-6)return m;const V=Math.max(0,y+r*t)/y;return{x:(x+v*V)/n,y:(b+I*V)/i}})})}const Ka=2,Za=2;function NS(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<Ka+Za)return null;const d=Math.min(r.length-Za,l.length-Za);let c=-1;for(let u=d;u>=Ka;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<Ka?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function td(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,b=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,f=e.lineHeight*l,v=e.spaceWidth*l,I=Math.max(0,e.shapeMargin??0),y=[],w=t.map((E,_)=>({token:E,originalIndex:_,width:n[_],kind:"whole"}));if(!w.length||d<=0||f<=0)return{segments:y,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const V=Math.max(1,v*.5),z=f*Hw,Y=_S(i,I,d,c,o);let M=0,F=0,K=0,T=w[0].token.para,L=0,W=0,O=null;for(;M<w.length&&K<PS;){const E=F+f>c;if(E&&!u)break;const _=w[M].token.para;if(_>T+1){F+=f*(_-T-1),T=_-1,K+=1;continue}let S=E?[{x0:0,x1:d}]:qw(Y,(F+z)/c,(F+f-z)/c,o).map($=>({x0:$.x0*d,x1:$.x1*d}));p>0&&x>0&&!E&&S.length&&(O===null&&(O=K,L=S[0].x0,W=F),K-O<x&&(S=Gw(S,{x0:L,x1:L+p})));const Z=S.reduce(($,H)=>Math.max($,H.x1-H.x0),0);for(const $ of S){const H=$.x1-$.x0;if(H<V)continue;if(M>=w.length||w[M].token.para!==_)break;const B=M;let ce=0;for(;M<w.length&&w[M].token.para===_;){const ie=w[M],A=M===B,de=ie.width*l,G=A?de:v+de;if(ce+G<=H){ce+=G,M+=1;continue}if(A&&H>=Z-.5&&de>d-.5){ce+=G,M+=1;continue}if(b){const oe=H-ce-(A?0:v),he=NS(ie,m,oe,l,g);if(he){const Ie={token:{...ie.token,text:he.fragmentText},originalIndex:ie.originalIndex,width:he.fragmentWidth,kind:"fragment"},ve={token:{...ie.token,text:he.remainderText},originalIndex:ie.originalIndex,width:he.remainderWidth,kind:"remainder"};w.splice(M,1,Ie,ve),ce+=(A?0:v)+he.fragmentWidth*l,M+=1}}break}if(M>B){const ie=M>=w.length||w[M].token.para!==_;y.push({top:F,left:$.x0,width:H,from:B,to:M,justify:r==="justify"&&!ie})}if(M>=w.length||w[M].token.para!==_)break}T=_,F+=f,K+=1}let C=0;if(M>0){const E=w[M-1];C=E.kind==="fragment"?E.originalIndex:E.originalIndex+1}return{segments:y,placed:C,height:y.length?F:0,capLeft:L,capTop:W,renderTokens:w.map(E=>E.token)}}const HS=.12,OS=2,DS=10,Ja=.25,jS=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},zS=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,BS=(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=jS(e);(!r||!zS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Qa=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},Lo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function VS(){return typeof document>"u"?null:document.body}function GS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,padding:b,hyphenate:m,showOverflowIndicator:g,dropCapLines:f,dropCapSize:v,showGuides:I,typography:y,imageUrl:w,imageFocalX:V,imageFocalY:z,imageScale:Y,imageCustomPath:M,pathDragActive:F,pathCarryImage:K,onCarryImageConsumed:T,pathEditor:L,imageEditor:W}){var at,st;const O=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[C,E]=s.useState(null),_=s.useRef(null),[S,Z]=s.useState({width:0,height:0}),[$,H]=s.useState(0),[B,ce]=s.useState(null),[ie,A]=s.useState(0),[de,G]=s.useState("none");s.useEffect(()=>{!L&&!W&&G("none")},[L,W]);const[se,oe]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){oe(null);return}let $e=!1;const De=new Image;return De.onload=()=>{$e||oe({width:De.naturalWidth,height:De.naturalHeight})},De.src=w,()=>{$e=!0}},[w]);const he=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Ie=s.useMemo(()=>FS(he),[he]),ve=s.useMemo(()=>WS(he),[he]),ue=f>0&&v>1?((st=(at=Ie[0])==null?void 0:at.text)==null?void 0:st.charAt(0))??"":"",U=(L==null?void 0:L.contours)??null,le=s.useMemo(()=>{let $e=[];if(U){const De=qo(U);De.length&&($e=Zi(De,r))}if(!$e.length){const De=i.trim(),lt=De?Oc(De,o,r):null;lt&<.length?$e=lt:$e=vs(n==="custom"?"rectangle":n)}return n==="circle"?Qa($e,S):$e},[U,n,i,o,r,S.width,S.height]),re=L==null?void 0:L.onConvert,Re=(L==null?void 0:L.needsConversion)??!1,we=s.useMemo(()=>{if(n==="circle")return!1;const $e=U??(i.trim()?si(i):null);return!!($e&&Fu($e,r))},[U,i,r,n]),[ke,fe]=s.useState(null);Lo(()=>{if(!we){ke&&fe(null);return}!ke&&S.width>0&&S.height>0&&fe({width:S.width,height:S.height})},[we,S.width,S.height,ke]);const xe=s.useMemo(()=>{if(!we||S.width<=0||S.height<=0)return le;const $e=ke??S,De=r.width/$e.width,lt=r.height/$e.height;return le.map(Ue=>Ue.map(qe=>({x:qe.x*De,y:qe.y*lt})))},[le,we,ke,r.width,r.height,S.width,S.height]),Ce=s.useMemo(()=>{if(U){const Ue=qo(U);if(Ue.length){const qe=Zi(Ue,r);return n==="circle"?Qa(qe,S):qe}}const $e=M.trim(),De=$e?Oc($e,o,r):null,lt=De&&De.length?De:vs(n==="custom"?"rectangle":n);return n==="circle"?Qa(lt,S):lt},[U,n,M,o,r,S.width,S.height]),h=s.useMemo(()=>{if(!we||S.width<=0||S.height<=0)return Ce;const $e=ke??S,De=r.width/$e.width,lt=r.height/$e.height;return Ce.map(Ue=>Ue.map(qe=>({x:qe.x*De,y:qe.y*lt})))},[Ce,we,ke,r.width,r.height,S.width,S.height]),q=s.useRef(null),X=s.useRef(!1);s.useEffect(()=>{if(!(!re||S.width<=0||S.height<=0)){if(we){if(q.current===i)return;const $e=U??(i.trim()?si(i):null);if(!($e!=null&&$e.length))return;const De=on($e,lt=>({x:r.x+(lt.x-r.x)/S.width*r.width,y:r.y+(lt.y-r.y)/S.height*r.height}));q.current=po(De),re(De);return}!Re||!le.length||X.current||(X.current=!0,re(on(Au(le),$e=>({x:$e.x*Xr,y:$e.y*Xr}))))}},[Re,we,re,le,U,i,r,S.width,S.height]);const ee=s.useCallback(()=>{const $e=C;if(!$e)return;const De=$e.getBoundingClientRect(),lt=parseFloat(window.getComputedStyle($e).paddingTop)||0;H(qe=>Math.abs(qe-lt)<.5?qe:lt);const Ue={width:De.width,height:De.height};Z(qe=>Math.abs(qe.width-Ue.width)<.5&&Math.abs(qe.height-Ue.height)<.5?qe:Ue)},[C]);Lo(()=>{const $e=C;if(!$e||typeof ResizeObserver>"u")return;ee();const De=new ResizeObserver(ee);return De.observe($e),()=>De.disconnect()},[C,ee]),Lo(()=>{ee()},[b,ee]),s.useEffect(()=>{const $e=typeof document<"u"?document.fonts:void 0;$e!=null&&$e.ready&&$e.ready.then(()=>{A(De=>De+1)})},[]),Lo(()=>{const $e=_.current;if(!$e)return;if(!Ie.length){ce(null);return}const De=[],lt=document.createDocumentFragment();for(const P of Ie){const Te=document.createElement("span");Object.assign(Te.style,ed(P.leaf)),Te.textContent=P.text,lt.appendChild(Te),De.push(Te)}const Ue=document.createElement("span");Ue.textContent=" ",lt.appendChild(Ue);const qe=document.createElement("span");qe.textContent="-",lt.appendChild(qe);const $t=ue||"H",Ct=document.createElement("span");Ct.textContent=$t,Ct.style.lineHeight="1",lt.appendChild(Ct),$e.replaceChildren(lt);const vt=window.getComputedStyle($e),Pt=parseFloat(vt.fontSize)||16,Ht=parseFloat(vt.lineHeight),Yt=Number.isNaN(Ht)?Pt*1.2:Ht,Kt=Math.max(Yt,Pt),Lt=document.createElement("span");Lt.textContent=$t,Lt.style.lineHeight=`${Kt}px`;const Ot=document.createElement("span");Ot.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Lt.appendChild(Ot),$e.appendChild(Lt);const tn=Lt.getBoundingClientRect().top,xt=Ot.getBoundingClientRect().top,Le=Math.max(1,xt-tn);Lt.remove();let je=Le*.8;const ft=document.createElement("canvas").getContext("2d"),bt=P=>`${vt.fontStyle} ${vt.fontWeight} ${P}px ${vt.fontFamily}`;if(ft){ft.font=bt(Pt);const P=ft.measureText($t).actualBoundingBoxAscent;P>0&&(je=P)}const Mt=v>1?(v-1)*Kt+je:je;let yt=Pt*(Mt/je);if(ft){ft.font=bt(yt);const P=ft.measureText($t).actualBoundingBoxAscent;P>0&&(yt=yt*(Mt/P))}Ct.style.fontSize=`${yt}px`,Ct.style.lineHeight=`${yt}px`;const Dt=document.createElement("span");Dt.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ct.appendChild(Dt);const _t=Math.max(1,Dt.getBoundingClientRect().top-Ct.getBoundingClientRect().top);Dt.remove();const Vt=(v-1)*Kt+Le-_t,Gt=De.map(P=>P.getBoundingClientRect().width),zt=Ue.getBoundingClientRect().width,Bt=qe.getBoundingClientRect().width,jt=ue?Ct.getBoundingClientRect().width:0,It=m?De.map(P=>{const Te=P.firstChild;if(!(Te instanceof Text)||Te.data.length<4)return;const Fe=document.createRange(),ze=P.getBoundingClientRect().left,pt=[];for(let kt=1;kt<=Te.data.length;kt+=1)Fe.setStart(Te,0),Fe.setEnd(Te,kt),pt.push(Fe.getBoundingClientRect().right-ze);return pt}):[];$e.replaceChildren(),ce({widths:Gt,spaceWidth:zt,dashWidth:Bt,charWidths:It,lineHeight:Kt,capWidth:jt,dropCapFontSize:yt,dropCapTopAdjust:Vt})},[Ie,y,ue,f,v,ie,S.width,m]);const ye=B&&ue?B.capWidth+B.lineHeight*HS:0,D=Math.max(f,Math.ceil(v)),R=s.useMemo(()=>{if(!B||!Ie.length||S.width<=0||S.height<=0||!u)return 1;const $e=Ue=>td({tokens:Ie,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:xe,mode:l,align:d,scale:Ue,allowOverflow:!1,capInset:ye*Ue,capLines:ue?D:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:$});if($e(1).placed>=Ie.length)return 1;if($e(Ja).placed<Ie.length)return Ja;let De=Ja,lt=1;for(let Ue=0;Ue<DS;Ue+=1){const qe=(De+lt)/2;$e(qe).placed>=Ie.length?De=qe:lt=qe}return De},[B,Ie,S.width,S.height,xe,l,d,u,ye,ue,D,m,$]);s.useEffect(()=>{x(R)},[R,x]);const Q=u?Math.min(p,R):1,ne=s.useMemo(()=>!B||!Ie.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Ie}:td({tokens:Ie,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:xe,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ye*Q,capLines:ue?D:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:$}),[B,Ie,S.width,S.height,xe,l,d,Q,c,ye,ue,D,m,$]),N=g&&Ie.length>0&&ne.placed<Ie.length,te=B?B.dropCapFontSize*Q:0,Ee=B?B.dropCapTopAdjust*Q:0,me=d==="justify"?"left":d,J=B?B.lineHeight*Q:0,Ke=ne.segments.length?ne.segments[ne.segments.length-1]:null,Be=Ke?{top:Ke.top+J,left:Ke.left+Ke.width/2}:{top:S.height,left:S.width/2},rt=!!(L&&U&&S.width>0&&S.height>0),Xe=!!W,nt=(rt||Xe)&&S.width>0&&S.height>0,Qe=BS(C,nt),Ge=nt&&Qe?VS():null,Se=s.useRef(!1),_e=s.useCallback($e=>{Se.current=$e},[]);s.useEffect(()=>{if(!rt&&!Xe)return;const $e=De=>{const lt=C;if(!lt)return;const Ue=lt.getBoundingClientRect();De.clientX>=Ue.left&&De.clientX<=Ue.right&&De.clientY>=Ue.top&&De.clientY<=Ue.bottom&&(De.preventDefault(),De.stopPropagation(),G($t=>$t==="shape"&&Se.current?$t:$t==="shape"&&Xe?"image":rt?"shape":"image"))};return document.addEventListener("dblclick",$e,!0),()=>document.removeEventListener("dblclick",$e,!0)},[rt,Xe,C]);const Oe=s.useMemo(()=>w&&S.width>0&&S.height>0?Ow(h,S):null,[w,h,S.width,S.height]),et=s.useRef(null),ge=(()=>{const $e=et.current;return K||!W||!se||!Oe||!$e||M===$e.customPath||$e.shape!==n&&n!=="custom"?null:$S($e.bounds,Oe,se,$e.focalX,$e.focalY,$e.scale)})();Lo(()=>{if(F||!W||!se||!Oe)return;const $e=et.current,De=!!($e&&M!==$e.customPath);De&&ge&&W.onCommit(ge),De&&K&&(T==null||T()),et.current={rings:h,bounds:Oe,focalX:(ge==null?void 0:ge.focalX)??V,focalY:(ge==null?void 0:ge.focalY)??z,scale:(ge==null?void 0:ge.scale)??Y,customPath:M,shape:n}},[F,K,M,n,h,Oe,W,se,V,z,Y,ge,T]);const We=et.current,Ve=!!(F&&!K&&We&&!ge),it=Ve&&We?We.focalX:(ge==null?void 0:ge.focalX)??V,ht=Ve&&We?We.focalY:(ge==null?void 0:ge.focalY)??z,ct=Ve&&We?We.scale:(ge==null?void 0:ge.scale)??Y,Ne=Ve&&We?We.bounds:Oe,Ae=Ne?SS(Ne,se??{width:Ne.width,height:Ne.height},ct,S):ct,Pe=s.useMemo(()=>{if(!(S.width>0)||!(S.height>0))return"";let $e=jc(i,U,o,r,n,S);if(we){const De=ke??S,lt=r.width/De.width,Ue=r.height/De.height;$e=on($e,qe=>({x:qe.x*lt,y:qe.y*Ue}))}return zc($e,S)||Hc(xe,S)},[i,U,o,r,n,S.width,S.height,we,ke,xe]),Je=s.useMemo(()=>{if(!w||!(S.width>0)||!(S.height>0))return"";let $e=jc(M,U,o,r,n,S);if(we){const De=ke??S,lt=r.width/De.width,Ue=r.height/De.height;$e=on($e,qe=>({x:qe.x*lt,y:qe.y*Ue}))}return zc($e,S)||Hc(h,S)},[w,M,U,o,r,n,S.width,S.height,we,ke,h]),He=`${O}-clip`,tt=s.useMemo(()=>{if(!Ne)return null;const $e=se??{width:Ne.width,height:Ne.height},De=ni(Ne,$e,Ae);return{x:Mn(Ne.width,De.width,it),y:Mn(Ne.height,De.height,ht),width:De.width,height:De.height}},[Ne,se,it,ht,Ae]);return a.jsxs("div",{className:`${e}-column`,style:{padding:b},ref:E,children:[Pe?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:S.width,height:S.height},viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Pe,fillRule:"evenodd"}),w&&Je&&Ne&&tt?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:He,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Je,fillRule:"evenodd"})})}),a.jsx("image",{href:w,x:Ne.x+tt.x,y:Ne.y+tt.y,width:tt.width,height:tt.height,preserveAspectRatio:"none",clipPath:`url(#${He})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...y,["--"+e+"-fit"]:Q,top:0,left:0,width:S.width,height:S.height},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:y,"aria-hidden":!0}),ne.segments.map(($e,De)=>{const lt=ne.renderTokens.slice($e.from,$e.to),Ue=De===0;return a.jsx("div",{className:`${e}-line${$e.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${$e.top}px`,left:`${$e.left}px`,width:`${$e.width}px`,textAlign:$e.justify?void 0:me},children:lt.map((qe,$t)=>{const vt=ue&&Ue&&$e.from===0&&$t===0?qe.text.slice(1):qe.text,Pt=ed(qe.leaf),Ht=qe.href?a.jsx("a",{className:`${e}-link`,href:qe.href,target:qe.target,rel:qe.target?"noopener noreferrer":void 0,style:Pt,children:vt}):a.jsx("span",{style:Pt,children:vt});return a.jsxs("span",{children:[!$e.justify&&$t>0?" ":null,Ht]},$t)})},`${$e.from}-${$e.to}-${De}`)}),I&&!U&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:xe.map(($e,De)=>a.jsx("polygon",{points:$e.map(lt=>`${lt.x},${lt.y}`).join(" ")},De))})]}),ue&&B&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...y,top:`${ne.capTop+Ee}px`,left:`${ne.capLeft}px`,fontSize:`${te}px`,lineHeight:`${te}px`},children:ue}),Ge&&Qe&&(U&&L||W)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Qe.top,left:Qe.left,width:Qe.width,height:Qe.height,zIndex:OS,pointerEvents:"none"},children:[U&&L&&a.jsx(MS,{P:e,box:{width:Qe.width,height:Qe.height},viewBox:r,contours:U,snap:L.snap,stretchToBox:!we,uniformStretch:n==="circle",stage:de,onStageChange:G,onSelectionChange:_e,onChange:L.onChange,onCommit:L.onCommit}),W&&Ne&&a.jsx(CS,{P:e,box:{width:Qe.width,height:Qe.height},bounds:Ne,natural:se,imageUrl:w,maskPath:Je,stage:de,onStageChange:G,focalX:it,focalY:ht,scale:Ae,onChange:W.onChange,onCommit:W.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:ve.map(($e,De)=>a.jsx("p",{children:$e},De))}),N&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Be.top,left:Be.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Ou=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],qS={x:0,y:0,width:100,height:100},XS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?qS:{x:t[0],y:t[1],width:t[2],height:t[3]}},US=e=>`
|
|
23708
|
+
`,Ww=["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"],_w={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:Ww.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"]}]}]},Nw={element:Aw,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:_w,sourceCode:Fw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},_c=120,Nc=3,Hw=.12,sl={x:0,y:0,width:100,height:100};function Zi(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function qr(e){return e<0?0:e>1?1:e}function Hc(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 Ow(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,x=u.y*t.height;p<n&&(n=p),p>o&&(o=p),x<i&&(i=x),x>r&&(r=x)}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 Dw(e){return e.map(([t,n])=>({x:t,y:n}))}function qa(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 jw(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=qr(n[o]),l=qr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return zw(i)}function zw(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 Bw(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 Vw(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 Gw(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 qw(e,t,n,i){let o=null;for(let r=0;r<Nc;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Nc-1)),d=jw(e,l),c=i==="avoid"?Vw(d):d;if(o=o===null?c:Bw(o,c),o.length===0)return[]}return o??[]}function Oc(e,t="stretch",n=sl){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ai(i),d=qo(l);if(d.length)return t==="viewbox"?Zi(d,n):qa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(x=>x.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const x of c){const b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("d",x),u.appendChild(b);let m=0;try{m=b.getTotalLength()}catch{m=0}if(!m)continue;const g=[];for(let f=0;f<_c;f+=1){const v=b.getPointAtLength(f/_c*m);g.push({x:v.x,y:v.y})}p.push(g)}return p.length?t==="viewbox"?Zi(p,n):qa(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"?Zi([r],n):qa([r])}const ll={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"},hs="0 0 100 100",Xr=100,fs=16,Xw=12,Uw=16,Xa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Yw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Dc=Math.PI/4,Kw=8,Zw=Math.PI/18,Jw=8,Vi=24,Gi=[];function Qw(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function Ua(e,t){return on(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function eS(e){const t=ti(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:on(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function tS(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return on(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function jc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=Ua(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=ai(d);c.length&&(l=n==="viewbox"?Ua(c,i):eS(c))}if(!l.length){const c=o!=="custom"?ll[o]:void 0;c?l=Ua(ai(c),sl):l=Qw()}}return o==="circle"?tS(l,r):l}function zc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":po(on(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function ys(e){const t=e==="rectangle"||e==="custom"?void 0:ll[e];return t?Zi(qo(ai(t)),sl):[Dw([[0,0],[1,0],[1,1],[0,1]])]}function nS(e){const t=e.match(Yw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function vs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function an(e){return{x:e.x,y:e.y}}function iS(e){return{p:an(e.p),in:e.in?an(e.in):null,out:e.out?an(e.out):null}}function Pn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(iS)}))}function on(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 Bc(e,t,n,i=n){return on(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function oS(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:an(e),c2:an(l),p:an(l)}];const u=i*Math.PI/180,p=Math.cos(u),x=Math.sin(u),b=(e.x-l.x)/2,m=(e.y-l.y)/2,g=p*b+x*m,f=-x*b+p*m,v=g*g/(d*d)+f*f/(c*c);if(v>1){const Z=Math.sqrt(v);d*=Z,c*=Z}const I=o===r?-1:1,y=d*d*f*f+c*c*g*g,w=Math.max(0,d*d*c*c-y),V=y===0?0:I*Math.sqrt(w/y),z=V*d*f/c,Y=-V*c*g/d,M=p*z-x*Y+(e.x+l.x)/2,F=x*z+p*Y+(e.y+l.y)/2,K=Math.atan2((f-Y)/c,(g-z)/d);let L=Math.atan2((-f-Y)/c,(-g-z)/d)-K;!r&&L>0&&(L-=Math.PI*2),r&&L<0&&(L+=Math.PI*2);const W=Math.max(1,Math.ceil(Math.abs(L)/(Math.PI/2))),O=L/W,C=4/3*Math.tan(O/4),E=(Z,$)=>({x:M+p*d*Z-x*c*$,y:F+x*d*Z+p*c*$}),_=[];let S=K;for(let Z=0;Z<W;Z+=1){const $=S+O,H=Math.cos(S),B=Math.sin(S),le=Math.cos($),ie=Math.sin($);_.push({c1:E(H-C*B,B+C*H),c2:E(le+C*ie,ie-C*le),p:Z===W-1?an(l):E(le,ie)}),S=$}return _}function ai(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const m=i[0],g=i[i.length-1];Math.abs(m.p.x-g.p.x)<1e-6&&Math.abs(m.p.y-g.p.y)<1e-6&&(m.in=g.in??m.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(m,g)=>{i.push({p:m,in:Fn(g??null,m),out:null}),r=m},x=m=>{if(!i.length)return;const g=i[i.length-1];g.out=Fn(m,g.p)};Xa.lastIndex=0;let b=Xa.exec(t);for(;b!==null;){const m=b[1],g=m.toUpperCase(),f=m!==g,v=nS(b[2]),I=y=>f?{x:r.x+v[y],y:r.y+v[y+1]}:{x:v[y],y:v[y+1]};if(g==="Z")o=!0,u(),r=an(l),d=null,c=null;else if(g==="M"){for(let y=0;y+1<v.length;y+=2){const w=I(y);y===0&&(u(),l=an(w)),p(w)}d=null,c=null}else if(g==="L"){for(let y=0;y+1<v.length;y+=2)p(I(y));d=null,c=null}else if(g==="H"){for(const y of v)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(g==="V"){for(const y of v)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(g==="C"){for(let y=0;y+5<v.length;y+=6){const w=I(y),V=I(y+2),z=I(y+4);x(w),p(z,V),d=V}c=null}else if(g==="S"){for(let y=0;y+3<v.length;y+=4){const w=d?vs(d,r):an(r),V=I(y),z=I(y+2);x(w),p(z,V),d=V}c=null}else if(g==="Q")for(let y=0;y+3<v.length;y+=4){const w=I(y),V=I(y+2);x(hn(r,w,2/3)),p(V,hn(V,w,2/3)),c=w,d=null}else if(g==="T")for(let y=0;y+1<v.length;y+=2){const w=c?vs(c,r):an(r),V=I(y);x(hn(r,w,2/3)),p(V,hn(V,w,2/3)),c=w,d=null}else if(g==="A")for(let y=0;y+6<v.length;y+=7){const w=f?{x:r.x+v[y+5],y:r.y+v[y+6]}:{x:v[y+5],y:v[y+6]};for(const V of oS(r,v[y],v[y+1],v[y+2],v[y+3]!==0,v[y+4]!==0,w))x(V.c1),p(V.p,V.c2);d=null,c=null}b=Xa.exec(t)}return u(),n}function En(e){return`${Number(e.toFixed(2))}`}function Fn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Mu(e){return!!(Fn(e.in,e.p)||Fn(e.out,e.p))}function xo(e,t){return!Fn(e.out,e.p)&&!Fn(t.in,t.p)}function Vc(e,t){if(xo(e,t))return`L${En(t.p.x)},${En(t.p.y)}`;const n=Fn(e.out,e.p)??e.p,i=Fn(t.in,t.p)??t.p;return`C${En(n.x)},${En(n.y)} ${En(i.x)},${En(i.y)} ${En(t.p.x)},${En(t.p.y)}`}function po(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${En(i.p.x)},${En(i.p.y)}`);let r=i;for(const l of o)t.push(Vc(r,l)),r=l;if(n.closed){const l=Vc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Pu(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 xs(e,t,n){if(xo(e,t))return hn(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 qo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Pu(n)){if(xo(o.from,o.to)){i.push(an(o.from.p));continue}for(let r=0;r<fs;r+=1)i.push(xs(o.from,o.to,r/fs))}n.closed||i.push(an(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ti(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of qo(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 rS(e){const t=ti(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function ku(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 Au(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Xw)return{closed:!0,nodes:t.map(r=>({p:an(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Uw)),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:an(r),...ku(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Fu(e,t,n=1){if(!e.length)return!1;const i=ti(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function aS(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:on(e,u=>{const p=i+(u.x-t.x)*r,x=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+x/c}})}function sS(e,t){if(!e.length)return e;const n=ti(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 on(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Wu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?ll[e]:void 0,i=n?on(ai(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):on(Au(ys("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=sS(i,t);return{shape:e,customPath:po(o),pathFit:"viewbox",pathViewBox:hs}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function lS(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=Pn(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 Gc(e,t,n,i){var r;if(!t.length)return e;const o=Pn(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function cS(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=_u(i,r,d)}),i}function dS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Pn(e),c=d[t].nodes[n];if(c[i]=an(o),r){const p=i==="in"?"out":"in";c[p]=vs(o,c.p)}return d}function uS(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=Pn(e);return r[t].nodes[n][i]=null,r}function pS(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=Pn(e),c=d[t].nodes,u=n+1;if(xo(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,x=l.in??l.p,b=hn(r.p,p,i),m=hn(p,x,i),g=hn(x,l.p,i),f=hn(b,m,i),v=hn(m,g,i),I=hn(f,v,i),y=(n+1)%o.nodes.length;return c[n].out=b,c[y].in=g,c.splice(u,0,{p:I,in:f,out:v}),{contours:d,nodeIndex:u}}function _u(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Pn(e);return o[t].nodes.splice(n,1),o}function qc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Pn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,x=!!Fn(l[u].out,l[u].p),b=!!Fn(l[p].in,l[p].p);if(Mu(d)||x||b)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const m=ku(l[u].p,d.p,l[p].p);return d.in=m.in,d.out=m.out,r}function mS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y),point:d}}function Xc(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Pu(i)){const l=xo(r.from,r.to)?1:fs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=mS(t,xs(r.from,r.to,c),xs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance,point:p.point})}}}),n}function gS(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Uc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Yc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}function hS(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function fS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function bs(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function yS(e,t){const n=bs(e,t);return n?{kind:"align",a:{x:e.x-n.x*Vi,y:e.y-n.y*Vi},b:{x:t.x+n.x*Vi,y:t.y+n.y*Vi}}:{kind:"align",a:e,b:t}}function ws(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function Kc(e,t,n,i,o){if(e.axis===null)return yS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return ws(o(r)[t],t,i)}function vS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Kc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Kc(n,"y",l,i,o)),r}function xS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return bs(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return bs(i(p),r)}function bS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,x=Math.hypot(u,p);if(x<1e-6)return{point:e,guides:Gi};const b=Math.atan2(p,u),m=Math.round(b/Dc)*Dc;let g=o?m:null,f=!1;if(!o){const Y=[];n&&Y.push({angle:Math.atan2(n.y,n.x),smooth:!0}),Y.push({angle:m,smooth:!1});for(const M of Y){const F=fS(M.angle-b);if(!(Math.abs(F)>Zw)&&!(Math.abs(Math.sin(F))*x>Kw)){g=M.angle,f=M.smooth;break}}}const v=i!==null&&i>0&&Math.abs(x-i)<=Jw;if(g===null&&!v)return{point:e,guides:Gi};const I=g??b,y=v?i:x,w={x:Math.cos(I),y:Math.sin(I)},V=y+(g===null?0:Vi),z=v?y:f?Vi:0;return{point:l({x:d.x+w.x*y,y:d.y+w.y*y}),guides:[{kind:"angle",a:{x:d.x-w.x*z,y:d.y-w.y*z},b:{x:d.x+w.x*V,y:d.y+w.y*V}}]}}const Ss=.1,$s=8,wS=4,Zc=10,Ur=(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}}},Nu=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Cs=(e,t)=>{const n=Ur(e,t),i=t==="nw"||t==="sw"?-1:1,o=t==="nw"||t==="ne"?-1:1;return{x:n.x+i*Zc,y:n.y+o*Zc}},Ts=(e,t)=>!(t.width>0)||!(t.height>0)||!(e.width>0)||!(e.height>0)?1:Math.max(e.width/t.width,e.height/t.height),$i=(e,t,n)=>{const i=Ts(e,t)*n;return{width:t.width*i,height:t.height*i}},Mn=(e,t,n)=>(e-t)*n,qi=(e,t,n,i)=>{const o=e-t;if(Math.abs(o)<1e-6)return .5;const r=n/o;return(i==null?void 0:i.clamp)===!1?r:Math.abs(o)<wS?.5:qr(r)},SS=(e,t,n,i,o,r)=>{const l=$i(e,n,r),d=e.x+Mn(e.width,l.width,i),c=e.y+Mn(e.height,l.height,o),u=Ts(e,n),p=Ts(t,n),x=Math.min($s,Math.max(Ss,p>0?r*(u/p):r)),b=$i(t,n,x);return{focalX:qi(t.width,b.width,d-t.x,{clamp:!1}),focalY:qi(t.height,b.height,c-t.y,{clamp:!1}),scale:x}},Jc=1.08,Cr=14,Tr=8;function $S({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:x,onCommit:b}){const m=s.useRef(null),g=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),v=s.useRef(null),I=s.useRef({focalX:c,focalY:u,scale:p});I.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var O;y&&((O=m.current)==null||O.focus({preventScroll:!0}))},[y]);const w=s.useCallback((O,C)=>{var _;const E=(_=m.current)==null?void 0:_.getBoundingClientRect();return!E||E.width<=0||E.height<=0?{x:0,y:0}:{x:(O-E.left)/E.width*t.width,y:(C-E.top)/E.height*t.height}},[t.width,t.height]),V=O=>{var E,_;if(!i)return;O.stopPropagation(),O.preventDefault(),(E=m.current)==null||E.focus({preventScroll:!0});const C=$i(n,i,p);f.current={pointerId:O.pointerId,origin:w(O.clientX,O.clientY),startX:Mn(n.width,C.width,c),startY:Mn(n.height,C.height,u),width:C.width,height:C.height,moved:!1},(_=m.current)==null||_.setPointerCapture(O.pointerId)},z=(O,C)=>{var le,ie;if(!i)return;O.stopPropagation(),O.preventDefault(),(le=m.current)==null||le.focus({preventScroll:!0});const E=$i(n,i,p),_=Mn(n.width,E.width,c),S=Mn(n.height,E.height,u),Z={minX:_,minY:S,maxX:_+E.width,maxY:S+E.height},$=Ur(Z,Nu(C)),H=Ur(Z,C),B=Math.hypot(H.x-$.x,H.y-$.y);!isFinite(B)||B<=0||(v.current={pointerId:O.pointerId,anchor:$,startDistance:B,startScale:p,startX:_,startY:S,moved:!1},(ie=m.current)==null||ie.setPointerCapture(O.pointerId))},Y=O=>{if(!i)return;const C=v.current;if(C&&O.pointerId===C.pointerId){O.stopPropagation(),O.preventDefault();const _=w(O.clientX,O.clientY),S={x:_.x-n.x,y:_.y-n.y},Z=Math.hypot(S.x-C.anchor.x,S.y-C.anchor.y),$=Math.min($s,Math.max(Ss,C.startScale*(Z/C.startDistance)));if(!C.moved&&Math.abs($-C.startScale)<1e-4)return;C.moved=!0;const H=$/C.startScale,B=C.anchor.x+(C.startX-C.anchor.x)*H,le=C.anchor.y+(C.startY-C.anchor.y)*H,ie=$i(n,i,$);x({focalX:qi(n.width,ie.width,B),focalY:qi(n.height,ie.height,le),scale:$});return}const E=f.current;if(E&&O.pointerId===E.pointerId){O.stopPropagation(),O.preventDefault();const _=w(O.clientX,O.clientY),S=_.x-E.origin.x,Z=_.y-E.origin.y;if(!E.moved&&S===0&&Z===0)return;E.moved=!0,x({focalX:qi(n.width,E.width,E.startX+S),focalY:qi(n.height,E.height,E.startY+Z),scale:p})}},M=O=>{var _,S;const C=f.current;if(C&&O.pointerId===C.pointerId){f.current=null,O.stopPropagation(),(_=m.current)!=null&&_.hasPointerCapture(C.pointerId)&&m.current.releasePointerCapture(C.pointerId),C.moved&&b(I.current);return}const E=v.current;E&&O.pointerId===E.pointerId&&(v.current=null,O.stopPropagation(),(S=m.current)!=null&&S.hasPointerCapture(E.pointerId)&&m.current.releasePointerCapture(E.pointerId),E.moved&&b(I.current))},F=O=>{if(O.key==="Escape"){O.stopPropagation(),d("none");return}if(O.key==="="||O.key==="+"||O.key==="-"||O.key==="_"){O.preventDefault(),O.stopPropagation();const C=O.key==="="||O.key==="+",E=Math.min($s,Math.max(Ss,p*(C?Jc:1/Jc))),_={focalX:c,focalY:u,scale:E};x(_),b(_)}},K=["nw","ne","se","sw"],T={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},L=s.useMemo(()=>{const O=i??{width:n.width,height:n.height},C=$i(n,O,p);return!(C.width>0)||!(C.height>0)?null:{x:n.x+Mn(n.width,C.width,c),y:n.y+Mn(n.height,C.height,u),width:C.width,height:C.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),W=L?{minX:L.x,minY:L.y,maxX:L.x+L.width,maxY:L.y+L.height}:T;return a.jsxs("svg",{ref:m,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:F,onPointerMove:Y,onPointerUp:M,onPointerCancel:M,onLostPointerCapture:M,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&L&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:g,maskUnits:"userSpaceOnUse",x:L.x,y:L.y,width:L.width,height:L.height,children:[a.jsx("rect",{x:L.x,y:L.y,width:L.width,height:L.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:L.x,y:L.y,width:L.width,height:L.height,preserveAspectRatio:"none",mask:`url(#${g})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:L.x,y:L.y,width:L.width,height:L.height})]}),y&&a.jsxs(a.Fragment,{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:n.x,y:n.y,width:n.width,height:n.height}),a.jsx("rect",{className:`${e}-editor-body`,x:n.x,y:n.y,width:n.width,height:n.height,onPointerDown:V}),K.map(O=>{const C=Cs(W,O),E=O==="ne"||O==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:C.x-Tr/2,y:C.y-Tr/2,width:Tr,height:Tr}),a.jsx("rect",{className:`${e}-editor-scale-grab${E?` ${e}-editor-scale-grab-nesw`:""}`,x:C.x-Cr/2,y:C.y-Cr/2,width:Cr,height:Cr,onPointerDown:_=>z(_,O)})]},O)})]})]})}const Ls=10,CS=Ls*2,In=7,TS=4,Hi=9,LS=3.5,Qc=1.08,RS=.05,Lr=14,IS=1,Rr=14,Ir=8;function ES({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:x}){const b=s.useRef(null),m=s.useRef(null),g=s.useRef(i);g.current=i;const f=s.useRef(null),v=s.useRef(null),I=s.useRef(null),y=s.useRef(null),[w,V]=s.useState([]),[z,Y]=s.useState(Gi),[M,F]=s.useState(null),K=s.useCallback(h=>{Y(q=>hS(q,h)?q:h)},[]),T=d==="shape";s.useEffect(()=>{var h;T&&((h=b.current)==null||h.focus({preventScroll:!0}))},[T]),s.useEffect(()=>{T||V(h=>h.length?[]:h)},[T]);const L=w.length>0;s.useEffect(()=>{u==null||u(L)},[L,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const W=n.width>0?t.width/n.width:1,O=n.height>0?t.height/n.height:1,C=Math.min(W,O),E=r&&l?C:W,_=r&&l?C:O,S=r&&l?(t.width-n.width*C)/2:0,Z=r&&l?(t.height-n.height*C)/2:0,$=s.useCallback(h=>r?{x:S+(h.x-n.x)*E,y:Z+(h.y-n.y)*_}:{x:h.x-n.x,y:h.y-n.y},[r,n,E,_,S,Z]),H=s.useCallback(h=>r?{x:n.x+(E>0?(h.x-S)/E:0),y:n.y+(_>0?(h.y-Z)/_:0)}:{x:n.x+h.x,y:n.y+h.y},[r,n,E,_,S,Z]),B=s.useMemo(()=>H({x:t.width/2,y:t.height/2}),[H,t.width,t.height]),le=s.useCallback((h,q)=>{var ee;const X=(ee=b.current)==null?void 0:ee.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const ve=(h-X.left)/X.width*t.width,D=(q-X.top)/X.height*t.height;return{x:n.x+(E>0?(ve-S)/E:0),y:n.y+(_>0?(D-Z)/_:0)}}return{x:n.x+(h-X.left),y:n.y+(q-X.top)}},[r,n,t.width,t.height,E,_,S,Z]),ie=s.useCallback((h,q)=>{var ee;const X=(ee=b.current)==null?void 0:ee.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(h-X.left)/X.width*t.width,y:(q-X.top)/X.height*t.height}},[t.width,t.height]),k=s.useCallback((h,q)=>{const X=l&&!(q!=null&&q.preserveShape)?aS(h,n,t,S,Z,E,_):h;x(X,q)},[x,l,n,t,S,Z,E,_]),de=s.useCallback(()=>{F(null)},[]),G=s.useCallback((h,q,X)=>{if(!X||f.current||v.current||I.current||y.current){de();return}const ee=ie(h,q),ve=on(g.current,$);for(const te of ve)for(const Ee of te.nodes)if(Math.hypot(Ee.p.x-ee.x,Ee.p.y-ee.y)<=Hi){de();return}const D=Xc(ve,ee);if(!D||D.distance>Ls){de();return}const R=ve[D.contour],Q=R==null?void 0:R.nodes[D.segment],ne=R==null?void 0:R.nodes[(D.segment+1)%((R==null?void 0:R.nodes.length)??1)],N=!!(Q&&ne&&!xo(Q,ne));F(te=>te&&te.curved===N&&Math.hypot(te.point.x-D.point.x,te.point.y-D.point.y)<.25?te:{point:D.point,curved:N})},[ie,$,de]),ce=h=>{var Be;const q=h.metaKey||h.ctrlKey,X=I.current;if(X&&h.pointerId===X.pointerId){if(h.stopPropagation(),h.preventDefault(),X.startDistance<=0)return;const it=le(h.clientX,h.clientY),Xe=Math.hypot(it.x-X.origin.x,it.y-X.origin.y),et=Math.max(RS,Xe/X.startDistance);if(!X.moved&&Math.abs(et-1)<1e-4)return;X.moved=!0,p(Bc(X.startContours,X.origin,et));return}const ee=v.current;if(ee&&h.pointerId===ee.pointerId){h.stopPropagation(),h.preventDefault();const it=le(h.clientX,h.clientY),{bbox:Xe}=ee,et=Xe.maxX-Xe.minX,Je=Xe.maxY-Xe.minY,Ge=it.x-ee.origin.x,$e=it.y-ee.origin.y;let He=Ge,De=$e;if(isFinite(et)&&isFinite(Je))if(r){let he=n.x,_e=n.x+n.width,Ve=n.y,tt=n.y+n.height;l&&(E>0&&(he=n.x+(0-S)/E,_e=n.x+(t.width-S)/E),_>0&&(Ve=n.y+(0-Z)/_,tt=n.y+(t.height-Z)/_));const ht=Math.min(he,_e-et),at=Math.max(he,_e-et),Oe=Math.min(Ve,tt-Je),Ae=Math.max(Ve,tt-Je),Pe=Math.min(at,Math.max(ht,Xe.minX+Ge)),Ze=Math.min(Ae,Math.max(Oe,Xe.minY+$e));He=Pe-Xe.minX,De=Ze-Xe.minY}else{const he=Xe.minX-n.x,_e=Xe.minY-n.y,Ve=Math.min(0,t.width-et),tt=Math.max(0,t.width-et),ht=Math.min(0,t.height-Je),at=Math.max(0,t.height-Je),Oe=Math.min(tt,Math.max(Ve,he+Ge)),Ae=Math.min(at,Math.max(ht,_e+$e));He=Oe-he,De=Ae-_e}const Qe=[];if(!q&&isFinite(et)&&isFinite(Je)){const he=$({x:Xe.minX+et/2+He,y:Xe.minY+Je/2+De}),_e={x:t.width/2,y:t.height/2};Math.abs(he.x-_e.x)<=Lr&&(He=B.x-Xe.minX-et/2,Qe.push(ws(_e.x,"x",t))),Math.abs(he.y-_e.y)<=Lr&&(De=B.y-Xe.minY-Je/2,Qe.push(ws(_e.y,"y",t)))}if(!ee.moved&&He===0&&De===0)return;ee.moved=!0,K(Qe.length?Qe:Gi),p(on(ee.startContours,he=>({x:he.x+He,y:he.y+De})),{carryImage:!0});return}const ve=y.current;if(ve&&h.pointerId===ve.pointerId){h.stopPropagation(),h.preventDefault();const it=le(h.clientX,h.clientY);let Xe=it.x-ve.origin.x,et=it.y-ve.origin.y;if(h.shiftKey&&(Math.abs(Xe)>Math.abs(et)?et=0:Xe=0),!ve.moved&&Xe===0&&et===0)return;ve.moved=!0,p(Gc(ve.startContours,ve.selection,Xe,et));return}const D=f.current;if(!D||h.pointerId!==D.pointerId){G(h.clientX,h.clientY,w.length>0||T);return}de(),h.stopPropagation(),h.preventDefault();const R=le(h.clientX,h.clientY);if(D.kind==="anchor"){const it={x:D.anchor.x+(R.x-D.origin.x),y:D.anchor.y+(R.y-D.origin.y)},Xe=q?[]:gS(g.current,{contour:D.contour,node:D.node}),et=q||!D.center?[]:[D.center],Je=Yc(Uc(Xe,et.map(He=>He.x),"x"),it,"x",$,Lr),Ge=Yc(Uc(Xe,et.map(He=>He.y),"y"),it,"y",$,Lr),$e=q?it:{x:(Je==null?void 0:Je.value)??$r(it.x,o),y:(Ge==null?void 0:Ge.value)??$r(it.y,o)};if(h.shiftKey&&(Math.abs($e.x-D.anchor.x)>Math.abs($e.y-D.anchor.y)?$e.y=D.anchor.y:$e.x=D.anchor.x),!D.moved&&$e.x===D.anchor.x&&$e.y===D.anchor.y)return;D.moved=!0,K(vS($e,Je,Ge,t,$)),p(lS(g.current,D.contour,D.node,$e));return}const Q=(Be=g.current[D.contour])==null?void 0:Be.nodes[D.node],ne=D.mirror&&!h.altKey,N=ne||q?null:D.kind==="in"?Q==null?void 0:Q.out:Q==null?void 0:Q.in,te=Q?$(Q.p):null,Ee=N?$(N):null,ge=Q&&(!q||h.shiftKey)?bS(R,Q.p,ne||q?null:xS(g.current[D.contour],D.node,D.kind,$),te&&Ee?Math.hypot(Ee.x-te.x,Ee.y-te.y):null,h.shiftKey,$,H):{point:R,guides:Gi},J=ge.guides.length?ge.point:q?R:{x:$r(R.x,o),y:$r(R.y,o)},Ye=D.kind==="in"?Q==null?void 0:Q.in:Q==null?void 0:Q.out;!D.moved&&Ye&&J.x===Ye.x&&J.y===Ye.y||(D.moved=!0,K(ge.guides),p(dS(g.current,D.contour,D.node,D.kind,J,ne)))},oe=h=>{K(Gi);const q=I.current;if(q&&h.pointerId===q.pointerId){I.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(q.pointerId)&&N.releasePointerCapture(q.pointerId),q.moved&&k(g.current,{preserveShape:!0});return}const X=v.current;if(X&&h.pointerId===X.pointerId){v.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(X.pointerId)&&N.releasePointerCapture(X.pointerId),X.moved?k(g.current,{preserveShape:!0}):V([]);return}const ee=y.current;if(ee&&h.pointerId===ee.pointerId){y.current=null,h.stopPropagation();const N=b.current;N!=null&&N.hasPointerCapture(ee.pointerId)&&N.releasePointerCapture(ee.pointerId),ee.moved&&k(g.current);return}const ve=f.current;if(!ve||h.pointerId!==ve.pointerId)return;f.current=null,h.stopPropagation();const D=b.current;D!=null&&D.hasPointerCapture(ve.pointerId)&&D.releasePointerCapture(ve.pointerId);const R=Math.hypot(h.clientX-ve.clientOrigin.x,h.clientY-ve.clientOrigin.y);if(ve.moved||R>TS){ve.moved&&k(g.current);return}if(!ve.toggleOnRelease||h.type!=="pointerup")return;const ne=qc(g.current,ve.contour,ve.node);ne!==g.current&&(p(ne),k(ne))},fe=h=>{h.stopPropagation()},Ie=h=>{var q,X;h.stopPropagation(),h.preventDefault(),de(),(q=b.current)==null||q.focus({preventScroll:!0}),v.current={pointerId:h.pointerId,origin:le(h.clientX,h.clientY),startContours:Pn(i),bbox:ti(i),moved:!1},(X=b.current)==null||X.setPointerCapture(h.pointerId)},xe=(h,q)=>{var R,Q;h.stopPropagation(),h.preventDefault(),de(),(R=b.current)==null||R.focus({preventScroll:!0}),V([]),c("shape");const X=ti(i),ee=Ur(X,Nu(q)),ve=Cs(X,q),D=Math.hypot(ve.x-ee.x,ve.y-ee.y);!isFinite(D)||D<=0||(I.current={pointerId:h.pointerId,corner:q,origin:ee,startDistance:D,startContours:Pn(i),moved:!1},(Q=b.current)==null||Q.setPointerCapture(h.pointerId))},ue=(h,q,X,ee)=>{var R,Q,ne,N;h.stopPropagation(),h.preventDefault(),de(),(R=b.current)==null||R.focus({preventScroll:!0});const ve=(Q=i[X])==null?void 0:Q.nodes[ee];if(!ve)return;if(h.altKey){const te=q==="anchor"?_u(i,X,ee):uS(i,X,ee,q);if(te===i)return;V(q==="anchor"?[]:[{contour:X,node:ee}]),p(te),k(te);return}const D=h.metaKey||h.ctrlKey;if(q==="anchor"&&h.shiftKey&&!D){V(te=>te.some(Ee=>Ee.contour===X&&Ee.node===ee)?te.filter(Ee=>!(Ee.contour===X&&Ee.node===ee)):[...te,{contour:X,node:ee}]);return}if(q==="anchor"&&!D&&w.length>1&&w.some(te=>te.contour===X&&te.node===ee)){y.current={pointerId:h.pointerId,origin:le(h.clientX,h.clientY),startContours:Pn(i),selection:w,moved:!1},(ne=b.current)==null||ne.setPointerCapture(h.pointerId);return}V([{contour:X,node:ee}]),f.current={kind:q,contour:X,node:ee,pointerId:h.pointerId,origin:le(h.clientX,h.clientY),clientOrigin:{x:h.clientX,y:h.clientY},anchor:ve.p,center:rS(i),mirror:q!=="anchor"&&!!(ve.in&&ve.out),toggleOnRelease:D,moved:!1},(N=b.current)==null||N.setPointerCapture(h.pointerId)},U=h=>{h.stopPropagation(),h.preventDefault(),de();const q=on(i,$),X=Xc(q,ie(h.clientX,h.clientY));if(!X||X.distance>Ls)return;const{contours:ee,nodeIndex:ve}=pS(i,X.contour,X.segment,X.t);ve<0||(V([{contour:X.contour,node:ve}]),p(ee),k(ee))},se=h=>{if(h.key==="="||h.key==="+"||h.key==="-"||h.key==="_"){h.preventDefault(),h.stopPropagation();const D=ti(i);if(!isFinite(D.minX)||!isFinite(D.maxX))return;const R={x:(D.minX+D.maxX)/2,y:(D.minY+D.maxY)/2},ne=h.key==="="||h.key==="+"?Qc:1/Qc,N=Bc(i,R,ne);p(N),k(N,{preserveShape:!0});return}if(h.key==="Escape"){h.stopPropagation(),V([]),c("none");return}if(!w.length)return;if(h.key==="Backspace"||h.key==="Delete"){h.preventDefault(),h.stopPropagation();const D=cS(i,w);if(D===i)return;V([]),p(D),k(D);return}const q=o>0?o:IS,X=h.shiftKey?q*10:q,ee={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[h.key];if(!ee)return;h.preventDefault(),h.stopPropagation();const ve=Gc(i,w,ee[0],ee[1]);p(ve),k(ve)},re=s.useMemo(()=>po(on(i,$)),[i,$]),Re=s.useMemo(()=>ti(i),[i]),Se=$({x:Re.minX,y:Re.minY}),ke={width:$({x:Re.maxX,y:Re.minY}).x-Se.x,height:$({x:Re.minX,y:Re.maxY}).y-Se.y},ye=T&&w.length===0&&isFinite(Re.minX)&&isFinite(Re.maxX)&&Re.maxX>Re.minX&&Re.maxY>Re.minY,be=w.length>0||T,Ce=be;return a.jsxs("svg",{ref:b,className:`${e}-editor${be?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:se,onPointerDown:()=>{var h;return(h=b.current)==null?void 0:h.focus({preventScroll:!0})},onPointerMove:ce,onPointerLeave:de,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onContextMenu:h=>{h.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{V([]),c("none")},onClick:U}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:re}),Ce&&z.map((h,q)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${h.kind}`,x1:h.a.x,y1:h.a.y,x2:h.b.x,y2:h.b.y},`${h.kind}-${q}`)),a.jsx("path",{ref:m,className:`${e}-editor-body`,d:re,fillRule:"evenodd",onPointerDown:Ie,onClick:U}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:re,style:{strokeWidth:CS},onClick:U}),Ce&&M&&a.jsx("rect",{className:`${e}-editor-add-preview`,x:M.point.x-In/2,y:M.point.y-In/2,width:In,height:In,rx:M.curved?In/2:0}),Ce&&i.map((h,q)=>h.nodes.map((X,ee)=>{const ve=w.some(R=>R.contour===q&&R.node===ee),D=$(X.p);return a.jsxs("g",{children:[ve&&w.length===1&&["in","out"].map(R=>{const Q=X[R];if(!Q)return null;const ne=$(Q);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:D.x,y1:D.y,x2:ne.x,y2:ne.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:ne.x,cy:ne.y,r:LS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:ne.x,cy:ne.y,r:Hi,onPointerDown:N=>ue(N,R,q,ee),onClick:fe})]},R)}),a.jsx("rect",{className:`${e}-editor-anchor${ve?` ${e}-editor-anchor-selected`:""}`,x:D.x-In/2,y:D.y-In/2,width:In,height:In,rx:Mu(X)?In/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:D.x-Hi,y:D.y-Hi,width:Hi*2,height:Hi*2,onPointerDown:R=>ue(R,"anchor",q,ee),onClick:fe,onDoubleClick:R=>{R.stopPropagation(),R.preventDefault();const Q=qc(i,q,ee);p(Q),k(Q)}})]},`${q}-${ee}`)})),ye&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:Se.x,y:Se.y,width:ke.width,height:ke.height}),["nw","ne","se","sw"].map(h=>{const q=$(Cs(Re,h)),X=h==="ne"||h==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:q.x-Ir/2,y:q.y-Ir/2,width:Ir,height:Ir}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:q.x-Rr/2,y:q.y-Rr/2,width:Rr,height:Rr,onPointerDown:ee=>xe(ee,h),onClick:fe})]},h)})]})]})}const MS=4e3,PS=/^(?:https?:|mailto:|tel:)/i;function Hu(e){return!!e&&typeof e=="object"&&e.type==="link"}function kS(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!PS.test(t)))return t}function AS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Hu(c)){o(c.children??[],kS(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const x of p.split(/\s+/))x&&t.push({text:x,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function ed(e){return{...e.fontFamily&&{fontFamily:fo(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 FS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Hu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function WS(e,t,n,i,o){if(t<=0||!e.length||n<=0||i<=0)return e;const r=o==="avoid"?1:-1;return e.map(l=>{if(!l.length)return l;let d=1/0,c=-1/0,u=1/0,p=-1/0;for(const m of l){const g=m.x*n,f=m.y*i;g<d&&(d=g),g>c&&(c=g),f<u&&(u=f),f>p&&(p=f)}const x=(d+c)/2,b=(u+p)/2;return l.map(m=>{const g=m.x*n,f=m.y*i,v=g-x,I=f-b,y=Math.sqrt(v*v+I*I);if(y<1e-6)return m;const V=Math.max(0,y+r*t)/y;return{x:(x+v*V)/n,y:(b+I*V)/i}})})}const Ya=2,Ka=2;function _S(e,t,n,i,o){if(e.kind!=="whole")return null;const r=t[e.originalIndex],l=e.token.text;if(!r||l.length<Ya+Ka)return null;const d=Math.min(r.length-Ka,l.length-Ka);let c=-1;for(let u=d;u>=Ya;u-=1)if(r[u-1]*i+o*i<=n){c=u;break}return c<Ya?null:{fragmentText:`${l.slice(0,c)}-`,remainderText:l.slice(c),fragmentWidth:r[c-1]+o,remainderWidth:Math.max(0,e.width-r[c-1])}}function td(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:x}=e,b=!!e.hyphenate,m=e.charWidths??[],g=e.hyphenWidth??0,f=e.lineHeight*l,v=e.spaceWidth*l,I=Math.max(0,e.shapeMargin??0),y=[],w=t.map((E,_)=>({token:E,originalIndex:_,width:n[_],kind:"whole"}));if(!w.length||d<=0||f<=0)return{segments:y,placed:0,height:0,capLeft:0,capTop:0,renderTokens:t};const V=Math.max(1,v*.5),z=f*Hw,Y=WS(i,I,d,c,o);let M=0,F=0,K=0,T=w[0].token.para,L=0,W=0,O=null;for(;M<w.length&&K<MS;){const E=F+f>c;if(E&&!u)break;const _=w[M].token.para;if(_>T+1){F+=f*(_-T-1),T=_-1,K+=1;continue}let S=E?[{x0:0,x1:d}]:qw(Y,(F+z)/c,(F+f-z)/c,o).map($=>({x0:$.x0*d,x1:$.x1*d}));p>0&&x>0&&!E&&S.length&&(O===null&&(O=K,L=S[0].x0,W=F),K-O<x&&(S=Gw(S,{x0:L,x1:L+p})));const Z=S.reduce(($,H)=>Math.max($,H.x1-H.x0),0);for(const $ of S){const H=$.x1-$.x0;if(H<V)continue;if(M>=w.length||w[M].token.para!==_)break;const B=M;let le=0;for(;M<w.length&&w[M].token.para===_;){const ie=w[M],k=M===B,de=ie.width*l,G=k?de:v+de;if(le+G<=H){le+=G,M+=1;continue}if(k&&H>=Z-.5&&de>d-.5){le+=G,M+=1;continue}if(b){const oe=H-le-(k?0:v),fe=_S(ie,m,oe,l,g);if(fe){const Ie={token:{...ie.token,text:fe.fragmentText},originalIndex:ie.originalIndex,width:fe.fragmentWidth,kind:"fragment"},xe={token:{...ie.token,text:fe.remainderText},originalIndex:ie.originalIndex,width:fe.remainderWidth,kind:"remainder"};w.splice(M,1,Ie,xe),le+=(k?0:v)+fe.fragmentWidth*l,M+=1}}break}if(M>B){const ie=M>=w.length||w[M].token.para!==_;y.push({top:F,left:$.x0,width:H,from:B,to:M,justify:r==="justify"&&!ie})}if(M>=w.length||w[M].token.para!==_)break}T=_,F+=f,K+=1}let C=0;if(M>0){const E=w[M-1];C=E.kind==="fragment"?E.originalIndex:E.originalIndex+1}return{segments:y,placed:C,height:y.length?F:0,capLeft:L,capTop:W,renderTokens:w.map(E=>E.token)}}const NS=.12,HS=2,OS=10,Za=.25,DS=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},jS=(e,t)=>Math.abs(e.top-t.top)<.5&&Math.abs(e.left-t.left)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,zS=(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=DS(e);(!r||!jS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ja=(e,t)=>{if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))},Lo=typeof window>"u"?s.useEffect:s.useLayoutEffect;function BS(){return typeof document>"u"?null:document.body}function VS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:x,padding:b,hyphenate:m,showOverflowIndicator:g,dropCapLines:f,dropCapSize:v,showGuides:I,typography:y,imageUrl:w,imageFocalX:V,imageFocalY:z,imageScale:Y,imageCustomPath:M,pathDragActive:F,pathCarryImage:K,onCarryImageConsumed:T,pathEditor:L,imageEditor:W}){var rt,ot;const O=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[C,E]=s.useState(null),_=s.useRef(null),[S,Z]=s.useState({width:0,height:0}),[$,H]=s.useState(0),[B,le]=s.useState(null),[ie,k]=s.useState(0),[de,G]=s.useState("none");s.useEffect(()=>{!L&&!W&&G("none")},[L,W]);const[ce,oe]=s.useState(null);s.useEffect(()=>{if(!w||typeof Image>"u"){oe(null);return}let me=!1;const Fe=new Image;return Fe.onload=()=>{me||oe({width:Fe.naturalWidth,height:Fe.naturalHeight})},Fe.src=w,()=>{me=!0}},[w]);const fe=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),Ie=s.useMemo(()=>AS(fe),[fe]),xe=s.useMemo(()=>FS(fe),[fe]),ue=f>0&&v>1?((ot=(rt=Ie[0])==null?void 0:rt.text)==null?void 0:ot.charAt(0))??"":"",U=(L==null?void 0:L.contours)??null,se=s.useMemo(()=>{let me=[];if(U){const Fe=qo(U);Fe.length&&(me=Zi(Fe,r))}if(!me.length){const Fe=i.trim(),st=Fe?Oc(Fe,o,r):null;st&&st.length?me=st:me=ys(n==="custom"?"rectangle":n)}return n==="circle"?Ja(me,S):me},[U,n,i,o,r,S.width,S.height]),re=L==null?void 0:L.onConvert,Re=(L==null?void 0:L.needsConversion)??!1,Se=s.useMemo(()=>{if(n==="circle")return!1;const me=U??(i.trim()?ai(i):null);return!!(me&&Fu(me,r))},[U,i,r,n]),[ke,ye]=s.useState(null);Lo(()=>{if(!Se){ke&&ye(null);return}!ke&&S.width>0&&S.height>0&&ye({width:S.width,height:S.height})},[Se,S.width,S.height,ke]);const be=s.useMemo(()=>{if(!Se||S.width<=0||S.height<=0)return se;const me=ke??S,Fe=r.width/me.width,st=r.height/me.height;return se.map(dt=>dt.map(ze=>({x:ze.x*Fe,y:ze.y*st})))},[se,Se,ke,r.width,r.height,S.width,S.height]),Ce=s.useMemo(()=>{if(U){const dt=qo(U);if(dt.length){const ze=Zi(dt,r);return n==="circle"?Ja(ze,S):ze}}const me=M.trim(),Fe=me?Oc(me,o,r):null,st=Fe&&Fe.length?Fe:ys(n==="custom"?"rectangle":n);return n==="circle"?Ja(st,S):st},[U,n,M,o,r,S.width,S.height]),h=s.useMemo(()=>{if(!Se||S.width<=0||S.height<=0)return Ce;const me=ke??S,Fe=r.width/me.width,st=r.height/me.height;return Ce.map(dt=>dt.map(ze=>({x:ze.x*Fe,y:ze.y*st})))},[Ce,Se,ke,r.width,r.height,S.width,S.height]),q=s.useRef(null),X=s.useRef(!1);s.useEffect(()=>{if(!(!re||S.width<=0||S.height<=0)){if(Se){if(q.current===i)return;const me=U??(i.trim()?ai(i):null);if(!(me!=null&&me.length))return;const Fe=on(me,st=>({x:r.x+(st.x-r.x)/S.width*r.width,y:r.y+(st.y-r.y)/S.height*r.height}));q.current=po(Fe),re(Fe);return}!Re||!se.length||X.current||(X.current=!0,re(on(Au(se),me=>({x:me.x*Xr,y:me.y*Xr}))))}},[Re,Se,re,se,U,i,r,S.width,S.height]);const ee=s.useCallback(()=>{const me=C;if(!me)return;const Fe=me.getBoundingClientRect(),st=parseFloat(window.getComputedStyle(me).paddingTop)||0;H(ze=>Math.abs(ze-st)<.5?ze:st);const dt={width:Fe.width,height:Fe.height};Z(ze=>Math.abs(ze.width-dt.width)<.5&&Math.abs(ze.height-dt.height)<.5?ze:dt)},[C]);Lo(()=>{const me=C;if(!me||typeof ResizeObserver>"u")return;ee();const Fe=new ResizeObserver(ee);return Fe.observe(me),()=>Fe.disconnect()},[C,ee]),Lo(()=>{ee()},[b,ee]),s.useEffect(()=>{const me=typeof document<"u"?document.fonts:void 0;me!=null&&me.ready&&me.ready.then(()=>{k(Fe=>Fe+1)})},[]),Lo(()=>{const me=_.current;if(!me)return;if(!Ie.length){le(null);return}const Fe=[],st=document.createDocumentFragment();for(const bt of Ie){const A=document.createElement("span");Object.assign(A.style,ed(bt.leaf)),A.textContent=bt.text,st.appendChild(A),Fe.push(A)}const dt=document.createElement("span");dt.textContent=" ",st.appendChild(dt);const ze=document.createElement("span");ze.textContent="-",st.appendChild(ze);const ut=ue||"H",Ct=document.createElement("span");Ct.textContent=ut,Ct.style.lineHeight="1",st.appendChild(Ct),me.replaceChildren(st);const Tt=window.getComputedStyle(me),xt=parseFloat(Tt.fontSize)||16,Pt=parseFloat(Tt.lineHeight),zt=Number.isNaN(Pt)?xt*1.2:Pt,Xt=Math.max(zt,xt),Yt=document.createElement("span");Yt.textContent=ut,Yt.style.lineHeight=`${Xt}px`;const It=document.createElement("span");It.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Yt.appendChild(It),me.appendChild(Yt);const Ot=Yt.getBoundingClientRect().top,tn=It.getBoundingClientRect().top,yt=Math.max(1,tn-Ot);Yt.remove();let Le=yt*.8;const lt=document.createElement("canvas").getContext("2d"),vt=bt=>`${Tt.fontStyle} ${Tt.fontWeight} ${bt}px ${Tt.fontFamily}`;if(lt){lt.font=vt(xt);const bt=lt.measureText(ut).actualBoundingBoxAscent;bt>0&&(Le=bt)}const wt=v>1?(v-1)*Xt+Le:Le;let Et=xt*(wt/Le);if(lt){lt.font=vt(Et);const bt=lt.measureText(ut).actualBoundingBoxAscent;bt>0&&(Et=Et*(wt/bt))}Ct.style.fontSize=`${Et}px`,Ct.style.lineHeight=`${Et}px`;const ft=document.createElement("span");ft.style.cssText="display:inline-block;width:0;height:0;vertical-align:baseline",Ct.appendChild(ft);const Bt=Math.max(1,ft.getBoundingClientRect().top-Ct.getBoundingClientRect().top);ft.remove();const Ft=(v-1)*Xt+yt-Bt,Vt=Fe.map(bt=>bt.getBoundingClientRect().width),Gt=dt.getBoundingClientRect().width,Dt=ze.getBoundingClientRect().width,jt=ue?Ct.getBoundingClientRect().width:0,Ht=m?Fe.map(bt=>{const A=bt.firstChild;if(!(A instanceof Text)||A.data.length<4)return;const Te=document.createRange(),We=bt.getBoundingClientRect().left,je=[];for(let pt=1;pt<=A.data.length;pt+=1)Te.setStart(A,0),Te.setEnd(A,pt),je.push(Te.getBoundingClientRect().right-We);return je}):[];me.replaceChildren(),le({widths:Vt,spaceWidth:Gt,dashWidth:Dt,charWidths:Ht,lineHeight:Xt,capWidth:jt,dropCapFontSize:Et,dropCapTopAdjust:Ft})},[Ie,y,ue,f,v,ie,S.width,m]);const ve=B&&ue?B.capWidth+B.lineHeight*NS:0,D=Math.max(f,Math.ceil(v)),R=s.useMemo(()=>{if(!B||!Ie.length||S.width<=0||S.height<=0||!u)return 1;const me=dt=>td({tokens:Ie,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:be,mode:l,align:d,scale:dt,allowOverflow:!1,capInset:ve*dt,capLines:ue?D:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:$});if(me(1).placed>=Ie.length)return 1;if(me(Za).placed<Ie.length)return Za;let Fe=Za,st=1;for(let dt=0;dt<OS;dt+=1){const ze=(Fe+st)/2;me(ze).placed>=Ie.length?Fe=ze:st=ze}return Fe},[B,Ie,S.width,S.height,be,l,d,u,ve,ue,D,m,$]);s.useEffect(()=>{x(R)},[R,x]);const Q=u?Math.min(p,R):1,ne=s.useMemo(()=>!B||!Ie.length||S.width<=0||S.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0,renderTokens:Ie}:td({tokens:Ie,widths:B.widths,spaceWidth:B.spaceWidth,lineHeight:B.lineHeight,width:S.width,height:S.height,rings:be,mode:l,align:d,scale:Q,allowOverflow:c,capInset:ve*Q,capLines:ue?D:0,hyphenate:m,charWidths:B.charWidths,hyphenWidth:B.dashWidth,shapeMargin:$}),[B,Ie,S.width,S.height,be,l,d,Q,c,ve,ue,D,m,$]),N=g&&Ie.length>0&&ne.placed<Ie.length,te=B?B.dropCapFontSize*Q:0,Ee=B?B.dropCapTopAdjust*Q:0,ge=d==="justify"?"left":d,J=B?B.lineHeight*Q:0,Ye=ne.segments.length?ne.segments[ne.segments.length-1]:null,Be=Ye?{top:Ye.top+J,left:Ye.left+Ye.width/2}:{top:S.height,left:S.width/2},it=!!(L&&U&&S.width>0&&S.height>0),Xe=!!W,et=(it||Xe)&&S.width>0&&S.height>0,Je=zS(C,et),Ge=et&&Je?BS():null,$e=s.useRef(!1),He=s.useCallback(me=>{$e.current=me},[]);s.useEffect(()=>{if(!it&&!Xe)return;const me=Fe=>{const st=C;if(!st)return;const dt=st.getBoundingClientRect();Fe.clientX>=dt.left&&Fe.clientX<=dt.right&&Fe.clientY>=dt.top&&Fe.clientY<=dt.bottom&&(Fe.preventDefault(),Fe.stopPropagation(),G(ut=>ut==="shape"&&$e.current?ut:ut==="shape"&&Xe?"image":it?"shape":"image"))};return document.addEventListener("dblclick",me,!0),()=>document.removeEventListener("dblclick",me,!0)},[it,Xe,C]);const De=s.useMemo(()=>w&&S.width>0&&S.height>0?Ow(h,S):null,[w,h,S.width,S.height]),Qe=s.useRef(null),he=(()=>{const me=Qe.current;return K||!W||!ce||!De||!me||M===me.customPath||me.shape!==n&&n!=="custom"?null:SS(me.bounds,De,ce,me.focalX,me.focalY,me.scale)})();Lo(()=>{if(F||!W||!ce||!De)return;const me=Qe.current,Fe=!!(me&&M!==me.customPath);Fe&&he&&W.onCommit(he),Fe&&K&&(T==null||T()),Qe.current={rings:h,bounds:De,focalX:(he==null?void 0:he.focalX)??V,focalY:(he==null?void 0:he.focalY)??z,scale:(he==null?void 0:he.scale)??Y,customPath:M,shape:n}},[F,K,M,n,h,De,W,ce,V,z,Y,he,T]);const _e=Qe.current,Ve=!!(F&&!K&&_e&&!he),tt=Ve&&_e?_e.focalX:(he==null?void 0:he.focalX)??V,ht=Ve&&_e?_e.focalY:(he==null?void 0:he.focalY)??z,at=Ve&&_e?_e.scale:(he==null?void 0:he.scale)??Y,Oe=Ve&&_e?_e.bounds:De,Ae=s.useMemo(()=>{if(!(S.width>0)||!(S.height>0))return"";let me=jc(i,U,o,r,n,S);if(Se){const Fe=ke??S,st=r.width/Fe.width,dt=r.height/Fe.height;me=on(me,ze=>({x:ze.x*st,y:ze.y*dt}))}return zc(me,S)||Hc(be,S)},[i,U,o,r,n,S.width,S.height,Se,ke,be]),Pe=s.useMemo(()=>{if(!w||!(S.width>0)||!(S.height>0))return"";let me=jc(M,U,o,r,n,S);if(Se){const Fe=ke??S,st=r.width/Fe.width,dt=r.height/Fe.height;me=on(me,ze=>({x:ze.x*st,y:ze.y*dt}))}return zc(me,S)||Hc(h,S)},[w,M,U,o,r,n,S.width,S.height,Se,ke,h]),Ze=`${O}-clip`,Ne=s.useMemo(()=>{if(!Oe)return null;const me=ce??{width:Oe.width,height:Oe.height},Fe=$i(Oe,me,at);return{x:Mn(Oe.width,Fe.width,tt),y:Mn(Oe.height,Fe.height,ht),width:Fe.width,height:Fe.height}},[Oe,ce,tt,ht,at]);return a.jsxs("div",{className:`${e}-column`,style:{padding:b},ref:E,children:[Ae?a.jsxs("svg",{className:`${e}-shape-fill`,style:{top:0,left:0,width:S.width,height:S.height},viewBox:`0 0 ${S.width} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Ae,fillRule:"evenodd"}),w&&Pe&&Oe&&Ne?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Ze,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Pe,fillRule:"evenodd"})})}),a.jsx("image",{href:w,x:Oe.x+Ne.x,y:Oe.y+Ne.y,width:Ne.width,height:Ne.height,preserveAspectRatio:"none",clipPath:`url(#${Ze})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...y,["--"+e+"-fit"]:Q,top:0,left:0,width:S.width,height:S.height},children:[a.jsx("div",{className:`${e}-measure`,ref:_,style:y,"aria-hidden":!0}),ne.segments.map((me,Fe)=>{const st=ne.renderTokens.slice(me.from,me.to),dt=Fe===0;return a.jsx("div",{className:`${e}-line${me.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${me.top}px`,left:`${me.left}px`,width:`${me.width}px`,textAlign:me.justify?void 0:ge},children:st.map((ze,ut)=>{const Tt=ue&&dt&&me.from===0&&ut===0?ze.text.slice(1):ze.text,xt=ed(ze.leaf),Pt=ze.href?a.jsx("a",{className:`${e}-link`,href:ze.href,target:ze.target,rel:ze.target?"noopener noreferrer":void 0,style:xt,children:Tt}):a.jsx("span",{style:xt,children:Tt});return a.jsxs("span",{children:[!me.justify&&ut>0?" ":null,Pt]},ut)})},`${me.from}-${me.to}-${Fe}`)}),I&&!U&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:be.map((me,Fe)=>a.jsx("polygon",{points:me.map(st=>`${st.x},${st.y}`).join(" ")},Fe))})]}),ue&&B&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...y,top:`${ne.capTop+Ee}px`,left:`${ne.capLeft}px`,fontSize:`${te}px`,lineHeight:`${te}px`},children:ue}),Ge&&Je&&(U&&L||W)&&Gn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:Je.top,left:Je.left,width:Je.width,height:Je.height,zIndex:HS,pointerEvents:"none"},children:[U&&L&&a.jsx(ES,{P:e,box:{width:Je.width,height:Je.height},viewBox:r,contours:U,snap:L.snap,stretchToBox:!Se,uniformStretch:n==="circle",stage:de,onStageChange:G,onSelectionChange:He,onChange:L.onChange,onCommit:L.onCommit}),W&&Oe&&a.jsx($S,{P:e,box:{width:Je.width,height:Je.height},bounds:Oe,natural:ce,imageUrl:w,maskPath:Pe,stage:de,onStageChange:G,focalX:tt,focalY:ht,scale:at,onChange:W.onChange,onCommit:W.onCommit})]}),Ge),a.jsx("div",{className:`${e}-a11y`,children:xe.map((me,Fe)=>a.jsx("p",{children:me},Fe))}),N&&a.jsxs("svg",{className:`${e}-overflow-icon`,width:"33",height:"24",viewBox:"0 0 33 24",style:{top:Be.top,left:Be.left},"aria-hidden":!0,children:[a.jsx("path",{d:"M12.8,4 L20.2,4 C24.68042,4 26.9206301,4 28.631924,4.87194781 C31.3123488,6.23769248 33,8.99168887 33,12 C33,15.0083111 31.3123488,17.7623075 28.631924,19.1280522 C26.9206301,20 24.68042,20 20.2,20 L12.8,20 C8.31957995,20 6.07936993,20 4.368076,19.1280522 C1.68765116,17.7623075 0,15.0083111 0,12 C0,8.99168887 1.68765116,6.23769248 4.368076,4.87194781 C6.07936993,4 8.31957995,4 12.8,4 Z",fill:"#FF4400"}),a.jsx("path",{transform:"translate(5, 0)",fill:"#FFFFFF",d:"M12,5.625 C12.3846269,5.625 12.7016304,5.91453014 12.7449542,6.28753416 L12.75,6.375 L12.75,11.25 L17.625,11.25 C18.0392136,11.25 18.375,11.5857864 18.375,12 C18.375,12.3846269 18.0854699,12.7016304 17.7124658,12.7449542 L17.625,12.75 L12.75,12.75 L12.75,17.625 C12.75,18.0392136 12.4142136,18.375 12,18.375 C11.6153731,18.375 11.2983696,18.0854699 11.2550458,17.7124658 L11.25,17.625 L11.25,12.75 L6.375,12.75 C5.96078644,12.75 5.625,12.4142136 5.625,12 C5.625,11.6153731 5.91453014,11.2983696 6.28753416,11.2550458 L6.375,11.25 L11.25,11.25 L11.25,6.375 C11.25,5.96078644 11.5857864,5.625 12,5.625 Z"})]})]})}const Ou=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],GS={x:0,y:0,width:100,height:100},qS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?GS:{x:t[0],y:t[1],width:t[2],height:t[3]}},XS=e=>`
|
|
23709
23709
|
.${e}-wrapper {
|
|
23710
23710
|
box-sizing: border-box;
|
|
23711
23711
|
display: flex;
|
|
@@ -23934,7 +23934,7 @@ export function Helix({
|
|
|
23934
23934
|
clip-path: inset(50%);
|
|
23935
23935
|
white-space: nowrap;
|
|
23936
23936
|
}
|
|
23937
|
-
`,
|
|
23937
|
+
`,US=1;function YS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=j.useScopedStyles(),c=s.useMemo(()=>XS(d),[d]),u=n??!1,p=!!r||!!o,x=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),b=(e==null?void 0:e.shape)??"custom",m=(e==null?void 0:e.customPath)??"",g=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>qS(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),v=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",I=(e==null?void 0:e.textAlign)??"left",y=((e==null?void 0:e.overflowMode)??"clip")==="visible",w=((e==null?void 0:e.fitText)??"off")==="on",V=((e==null?void 0:e.hyphenate)??"off")==="on",z=j.scalingValue((e==null?void 0:e.padding)??0,u),Y=(e==null?void 0:e.dropCapSize)??US,M=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??Y)),F=u&&p&&!i,K=u&&!i,[T,L]=s.useState(!1);s.useEffect(()=>{if(!u||!p){L(!1);return}const D=()=>L(!0),R=()=>L(!1),Q=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ne=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const N of Q)window.addEventListener(N,D);for(const N of ne)window.addEventListener(N,R);return()=>{for(const N of Q)window.removeEventListener(N,D);for(const N of ne)window.removeEventListener(N,R)}},[u,p]);const W=u&&p&&!i&&typeof l=="function",O=!T,C=Math.max(0,(e==null?void 0:e.pathSnap)??0),E=s.useRef(e??{}),_=s.useRef(""),S=[e==null?void 0:e.customPath,e==null?void 0:e.shape,e==null?void 0:e.pathFit,e==null?void 0:e.pathViewBox,e==null?void 0:e.imageScale,e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.image].join("\0");if(S!==_.current)_.current=S,E.current=e??{};else if(e){const{customPath:D,shape:R,pathFit:Q,pathViewBox:ne,imageScale:N,imageFocalX:te,imageFocalY:Ee,image:ge,...J}=e,Ye=E.current;for(const Be of Object.keys(J))if(Ye[Be]!==J[Be]){E.current={...Ye,...J};break}}const[Z,$]=s.useState(null),[H,B]=s.useState(!1),[le,ie]=s.useState(!1),k=s.useCallback(()=>ie(!1),[]),de=E.current.shape??b,G=s.useMemo(()=>!Z||Z.serialized===m?m:Z.serialized,[Z,m]);s.useEffect(()=>{W||(B(!1),ie(!1))},[W]),s.useEffect(()=>{!Z||H||Z.serialized===m&&$(null)},[Z,m,H]);const ce=s.useMemo(()=>{if(!W)return null;if(Z&&(Z.base===m||Z.serialized===m))return Z.contours;const D=ai(m);return D.length?D:null},[W,Z,m]),oe=!!(g==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===hs&&ce&&(b==="circle"||!Fu(ce,f))),fe=s.useCallback((D,R,Q)=>{const ne=po(D);if($(N=>({base:N&&(N.base===m||N.serialized===m)?N.base:m,serialized:ne,contours:D})),R){const N=E.current,te=Q!=null&&Q.preserveShape?N.shape:"custom",Ee={...N,shape:te,customPath:ne};E.current=Ee,l==null||l(Ee)}},[m,l]),Ie=s.useMemo(()=>W?{contours:oe?ce:null,snap:C,needsConversion:!oe,onConvert:D=>{const R=po(D);$({base:R,serialized:R,contours:D});const Q={...E.current,pathFit:"viewbox",pathViewBox:hs,customPath:R};E.current=Q,l==null||l(Q)},onChange:(D,R)=>{B(!0),ie(!!(R!=null&&R.carryImage)),fe(D,!1)},onCommit:(D,R)=>{fe(D,!0,R),B(!1)}}:null,[W,oe,ce,C,l,fe]),xe=v==="avoid"&&!!(e!=null&&e.image),ue=s.useMemo(()=>({focalX:(e==null?void 0:e.imageFocalX)??.5,focalY:(e==null?void 0:e.imageFocalY)??.5,scale:(e==null?void 0:e.imageScale)??1}),[e==null?void 0:e.imageFocalX,e==null?void 0:e.imageFocalY,e==null?void 0:e.imageScale]),[U,se]=s.useState(null),re=U??ue,Re=s.useCallback(D=>se(D),[]),Se=s.useCallback(D=>{se(D);const R={...E.current,imageFocalX:D.focalX,imageFocalY:D.focalY,imageScale:D.scale};E.current=R,l==null||l(R)},[l]);s.useEffect(()=>{U&&Math.abs(U.focalX-ue.focalX)<1e-9&&Math.abs(U.focalY-ue.focalY)<1e-9&&Math.abs(U.scale-ue.scale)<1e-9&&se(null)},[U,ue]);const ke=s.useMemo(()=>!W||!xe?null:{onChange:Re,onCommit:Se},[W,xe,Re,Se]),[ye,be]=s.useState(void 0),Ce=s.useRef(void 0),h=s.useCallback(D=>{const R=Ce.current;R!==void 0&&Math.abs(R-D)<.005||(Ce.current=D,be(D))},[]),q=s.useMemo(()=>w&&typeof ye=="number"?ye:1,[ye,w]),X=D=>`calc(${D} * var(--${d}-fit, 1))`,ee=s.useMemo(()=>{var Q,ne,N,te,Ee;const D=(e==null?void 0:e.textFontSize)??.012,R=Math.max((e==null?void 0:e.textLineHeight)??D,D);return{fontFamily:fo(e==null?void 0:e.textFontFamily),fontWeight:(Q=e==null?void 0:e.textFontSettings)==null?void 0:Q.fontWeight,fontStyle:(ne=e==null?void 0:e.textFontSettings)==null?void 0:ne.fontStyle,fontSize:X(j.scalingValue(D,u)),lineHeight:X(j.scalingValue(R,u)),letterSpacing:X(j.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:X(j.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(N=e==null?void 0:e.textTextAppearance)==null?void 0:N.textTransform,textDecoration:(te=e==null?void 0:e.textTextAppearance)==null?void 0:te.textDecoration,fontVariant:(Ee=e==null?void 0:e.textTextAppearance)==null?void 0:Ee.fontVariant}},[e,u,d]),ve={[`--${d}-text-color`]:(e==null?void 0:e.textColor)??"#000000",[`--${d}-link-color`]:(e==null?void 0:e.linkColor)??(e==null?void 0:e.textColor)??"#000000",[`--${d}-background-color`]:(e==null?void 0:e.backgroundColor)??"transparent"};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx("div",{className:`${d}-wrapper`,style:{...ve},children:a.jsx(VS,{P:d,item:x,shape:de,customPath:m,pathFit:g,viewBox:f,mode:v,align:I,allowOverflow:y,fitEnabled:w,scale:q,onFitScale:h,padding:z,hyphenate:V,showOverflowIndicator:K,dropCapLines:M,dropCapSize:Y,showGuides:(F||W)&&O,typography:ee,imageUrl:v==="avoid"?e==null?void 0:e.image:null,imageFocalX:re.focalX,imageFocalY:re.focalY,imageScale:re.scale,imageCustomPath:G,pathDragActive:H,pathCarryImage:le,onCarryImageConsumed:k,pathEditor:O?Ie:null,imageEditor:O?ke:null})})]})}const KS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
23938
23938
|
import type React from 'react';
|
|
23939
23939
|
import { CommonComponentProps } from '../props';
|
|
23940
23940
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -24761,4 +24761,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
24761
24761
|
</>
|
|
24762
24762
|
);
|
|
24763
24763
|
}
|
|
24764
|
-
`,nd=[...Ou],
|
|
24764
|
+
`,nd=[...Ou],ZS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},JS={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:nd},enum:nd},customPath:{type:"string",scope:"layout",title:"Path",tooltip:"SVG path (M…) or a point list (0,0 100,0 50,100). Used when Shape is set to custom.",display:{type:"full-width-input",placeholder:"M0,0 C…"}},pathSnap:{type:"number",scope:"common",title:"Snap",tooltip:"Grid the points snap to while dragging, in path units (the path box is 100 x 100). 0 is off.",min:0,max:25,step:.5,display:{type:"numeric-input"}},pathFit:{type:"string",scope:"common",title:"Path fit",tooltip:"Stretch — the drawing fills the box. Viewbox — the drawing keeps its position in path coordinates (0–100).",display:{type:"toggle-cycle",enum:["stretch","viewbox"]}},shapeMode:{type:"string",scope:"common",title:"",tooltip:"A — text fills the path. B — text flows around the path.",display:{type:"radio-group"},enum:["A","B"]},fitText:{type:"string",scope:"common",title:"Fit text",tooltip:"Scales the type down until all text fits the path.",display:{type:"toggle-cycle",enum:["off","on"]}},hyphenate:{type:"string",scope:"common",title:"Hyphenate",tooltip:"Breaks long words with a hyphen when they don’t fit on a line.",display:{type:"toggle-cycle",enum:["off","on"]}},padding:{type:"number",scope:"layout",title:"Padding",tooltip:"Insets the shape and its text on all sides.",min:0,display:{type:"numeric-input"}},dropCapLines:{type:"number",scope:"common",title:"Drop cap lines",min:1,max:8,step:1,display:{type:"numeric-input"}},dropCapSize:{type:"number",scope:"common",title:"Drop cap size",tooltip:"Height of the drop cap, in lines of body text.",min:1,max:8,step:1,display:{type:"common-numeric-input"}},image:{type:["string","null"],scope:"common",title:"",display:{type:"settings-image-input"}},backgroundColor:{type:"string",scope:"common",title:"BG Shape",display:{type:"settings-color-picker"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...ZS.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},textFontSize:{type:"number",scope:"layout",title:"Font Size",display:{type:"font-size"}},textLineHeight:{type:"number",scope:"layout",title:"Line Height",display:{type:"line-height-input"}},textLetterSpacing:{type:"number",scope:"layout",title:"Letter Spacing",display:{type:"letter-spacing-input"}},textWordSpacing:{type:"number",scope:"layout",title:"Word Spacing",display:{type:"word-spacing-input"}},textAlign:{type:"string",scope:"layout",title:"",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"style-panel-color-picker"}},linkColor:{type:"string",scope:"common",title:"Link Default",display:{type:"style-panel-color-picker"}}},defaults:{...Wu("circle"),pathSnap:0,shapeMode:"A",fitText:"off",hyphenate:"off",dropCapLines:1,dropCapSize:1,image:"https://cdn.cntrl.site/component-assets/shapedType_img.jpg",backgroundColor:"rgba(0, 0, 0, 0)",textFontFamily:"Basteleur",textFontSettings:{fontWeight:400,fontStyle:"normal"},textAlign:"center",textTextAppearance:{textTransform:"uppercase",textDecoration:"none",fontVariant:"normal"},textColor:"#000000",linkColor:"#000000"},layoutDefaults:{m:{textFontSize:.037,textLineHeight:.048,textLetterSpacing:0,textWordSpacing:0,padding:0},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0,padding:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0,padding:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","hyphenate","padding","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.display.visible",value:!1}},{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.padding.display.visible",value:!1}},{if:{name:"shapeMode",value:"A"},then:{name:"properties.shape.display.isFilled",value:!0}},{if:{name:"shapeMode",value:"B"},then:{name:"properties.shape.display.isFilled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["shapeMode"]},{type:"row",title:"Shape",items:["shape"]},{type:"row",items:["dropCapSize","hyphenate"]},{type:"row",items:["padding","image"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",{type:"group",title:"",items:["textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textAlign","textTextAppearance"]}]}],paletteBookmark:{items:["textColor","linkColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",max:1,settings:{addItemWithoutImage:!0,addItemFromFileExplorer:!1},display:{type:"array"},items:{type:"object",properties:{text:{label:"Text",placeholder:"Add Text...",display:{type:"rich-text"}}}},default:[{text:[{type:"paragraph",children:[{text:"Le loro superficie, excelso Duca, fra loro similmente possiamo dire al medesimo modo esser proportionali commo de lor massa corporea s'è dicto, cioè irrationali per la malitia de la figura pentagona che in lo duodecedron se interpone. Ma de l'altre possano a le volte essere rationali, commo quelle del tetracedron, cubo, octocedron, per essere triangole e quadrate e note in proportione con lo diametro de la loro sphera in la quale si formano, commo s'è veduto di sopra."}]}]}]}},QS={element:YS,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||Ou.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...Wu(n)}},defaultSize:{d:{width:1420,height:640},t:{width:710,height:320},m:{width:355,height:160}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/pretext.png"},schema:JS,sourceCode:KS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},e$=[Zm,og,Z0,Kg,rh,hh,Fh,of,uf,vf,Bf,_y,Dv,Yv,P0,z0,cx,rb,bx,Sb,Qb,Nw,QS];exports.components=e$;exports.isSchemaV1=zu;
|