@cntrl-site/components 1.0.73 → 1.0.75
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 +3 -1
- package/dist/index.js +85 -61
- package/dist/index.mjs +4602 -4567
- 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"),ht=require("classnames"),O=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Vn=require("react-dom");function _u(e){return e.type==="object"&&e.version===1}const Wu="ControlSlider-module__wrapper___sHEkd",Nu="ControlSlider-module__hoverArrow___A-dOH",Hu="ControlSlider-module__sliderItem___QQSkR",Ou="ControlSlider-module__sliderImage___9hRl-",Du="ControlSlider-module__arrow___05ghY",ju="ControlSlider-module__arrowVertical___tBfVN",zu="ControlSlider-module__nextArrow___-30Yc",Bu="ControlSlider-module__arrowInner___aEra3",Vu="ControlSlider-module__arrowIcon___S4ztF",Gu="ControlSlider-module__arrowImg___2dwJW",qu="ControlSlider-module__mirror___brd6U",Xu="ControlSlider-module__pagination___bicLF",Uu="ControlSlider-module__paginationInner___bT-P-",Yu="ControlSlider-module__paginationVertical___zYqKw",Ku="ControlSlider-module__paginationItem___nTRbk",Zu="ControlSlider-module__dot___p1Qun",Ju="ControlSlider-module__activeDot___LHFaj",Qu="ControlSlider-module__paginationInsideBottom___R3FWn",ep="ControlSlider-module__paginationInsideTop___V-qb-",tp="ControlSlider-module__paginationOutsideBottom___14w8D",np="ControlSlider-module__paginationOutsideTop___SCLqB",ip="ControlSlider-module__paginationInsideLeft___yOBRZ",op="ControlSlider-module__paginationInsideRight___Rtt3o",rp="ControlSlider-module__paginationOutsideLeft___lahaw",ap="ControlSlider-module__paginationOutsideRight___EtuQa",sp="ControlSlider-module__imgWrapper___UjEgB",lp="ControlSlider-module__captionBlock___dJ6-j",cp="ControlSlider-module__captionTextWrapper___HFlpf",dp="ControlSlider-module__captionText___uGBVc",up="ControlSlider-module__active___WZK4G",pp="ControlSlider-module__withPointerEvents___t-18M",mp="ControlSlider-module__topLeftAlignment___zjnGM",gp="ControlSlider-module__topCenterAlignment___gD1xW",hp="ControlSlider-module__topRightAlignment___NMapS",fp="ControlSlider-module__middleLeftAlignment___OnUrY",yp="ControlSlider-module__middleCenterAlignment___Tdkl0",vp="ControlSlider-module__middleRightAlignment___wEbfX",xp="ControlSlider-module__bottomLeftAlignment___cTP2-",bp="ControlSlider-module__bottomCenterAlignment___c54fB",wp="ControlSlider-module__bottomRightAlignment___kEwrz",Sp="ControlSlider-module__clickOverlay___DZA28",$p="ControlSlider-module__contain___pLyq7",Cp="ControlSlider-module__cover___KdDat",mt={wrapper:Wu,hoverArrow:Nu,sliderItem:Hu,sliderImage:Ou,arrow:Du,arrowVertical:ju,nextArrow:zu,arrowInner:Bu,arrowIcon:Vu,arrowImg:Gu,mirror:qu,pagination:Xu,paginationInner:Uu,paginationVertical:Yu,paginationItem:Ku,dot:Zu,activeDot:Ju,paginationInsideBottom:Qu,paginationInsideTop:ep,paginationOutsideBottom:tp,paginationOutsideTop:np,paginationInsideLeft:ip,paginationInsideRight:op,paginationOutsideLeft:rp,paginationOutsideRight:ap,imgWrapper:sp,captionBlock:lp,captionTextWrapper:cp,captionText:dp,active:up,withPointerEvents:pp,topLeftAlignment:mp,topCenterAlignment:gp,topRightAlignment:hp,middleLeftAlignment:fp,middleCenterAlignment:yp,middleRightAlignment:vp,bottomLeftAlignment:xp,bottomCenterAlignment:bp,bottomRightAlignment:wp,clickOverlay:Sp,contain:$p,cover:Cp};function Tp(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 Lp(e,t,n){return t&&Tp(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sl="(prefers-reduced-motion: reduce)",ji=1,Rp=2,Ki=3,uo=4,Go=5,Er=6,Wr=7,Ip={CREATED:ji,MOUNTED:Rp,IDLE:Ki,MOVING:uo,SCROLLING:Go,DRAGGING:Er,DESTROYED:Wr};function zn(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ut(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var Jc=setTimeout,Za=function(){};function ll(e){return requestAnimationFrame(e)}function Yr(e,t){return typeof t===e}function ko(e){return!Ts(e)&&Yr("object",e)}var Cs=Array.isArray,Qc=Ut(Yr,"function"),ti=Ut(Yr,"string"),qo=Ut(Yr,"undefined");function Ts(e){return e===null}function ed(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return Cs(e)?e:[e]}function bn(e,t){Xo(e).forEach(t)}function Ls(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Xo(t)),e}function Nn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Pn(e,t){Nn(e,ti(t)?t.split(" "):t,!0)}function Uo(e,t){bn(t,e.appendChild.bind(e))}function Rs(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ao(e,t){return ed(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function td(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return Ao(i,t)}):n}function Yo(e,t){return t?td(e,t)[0]:e.firstElementChild}var Fo=Object.keys;function $i(e,t,n){return e&&(n?Fo(e).reverse():Fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function _o(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){e[i]=t[i]})}),e}function Kn(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){Cs(n)?e[i]=n.slice():ko(n)?e[i]=Kn({},ko(e[i])?e[i]:{},n):e[i]=n})}),e}function cl(e,t){bn(t||Fo(e),function(n){delete e[n]})}function kn(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Tt(e,t,n){ko(t)?$i(t,function(i,o){Tt(e,o,i)}):bn(e,function(i){Ts(n)||n===""?kn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ti(t)?Pn(i,t):Tt(i,t)),n&&Uo(n,i),i}function Sn(e,t,n){if(qo(n))return getComputedStyle(e)[t];Ts(n)||(e.style[t]=""+n)}function Wo(e,t){Sn(e,"display",t)}function nd(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function dl(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Ti(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function id(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Wn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function od(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Hn(e,t){Nn(e,t,!1)}function Ja(e){return e.timeStamp}function pi(e){return ti(e)?e:e?e+"px":""}var Ko="splide",Es="data-"+Ko;function Io(e,t){if(!e)throw new Error("["+Ko+"] "+(t||""))}var ni=Math.min,Nr=Math.max,Hr=Math.floor,No=Math.ceil,un=Math.abs;function rd(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=ni(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Ni(e,t,n){var i=ni(t,n),o=Nr(t,n);return ni(Nr(i,e),o)}function Qa(e){return+(e>0)-+(e<0)}function es(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function Ms(e){return e<10?"0"+e:""+e}var ul={};function Ep(e){return""+e+Ms(ul[e]=(ul[e]||0)+1)}function ad(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,y){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,y,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===b&&(!c||y[3]===c)?(y[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){bn(l,function(u){u&&bn(d,function(p){p.split(" ").forEach(function(b){var y=b.split(".");c(u,y[0],y[1])})})})}function r(){e.forEach(function(l){l[4]()}),zn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",ts="ready",Bn="move",po="moved",Ps="click",sd="active",ld="inactive",cd="visible",dd="hidden",Qt="refresh",cn="updated",Zi="resize",Kr="resized",ud="drag",pd="dragging",md="dragged",Zr="scroll",Ii="scrolled",Mp="overflow",ks="destroy",gd="arrows:mounted",hd="arrows:updated",fd="pagination:mounted",yd="pagination:updated",As="navigation:mounted",Fs="autoplay:play",vd="autoplay:playing",_s="autoplay:pause",Ws="lazyload:loaded",xd="sk",bd="sh",Or="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=ad();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,Cs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(ks,n.destroy),_o(n,{bus:t,on:i,off:Ut(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?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return y();d=ll(p)}}function b(S){S||h(),r=o()-(S?l*e:0),c=!1,d=ll(p)}function y(){c=!0}function g(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(S){e=S}function x(){return c}return{start:b,rewind:g,pause:y,cancel:h,set:f,isPaused:x}}function Pp(e){var t=e;function n(o){t=o}function i(o){return Ls(Xo(o),t)}return{set:n,is:i}}function kp(e,t){var n=Jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Ap(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=ad(),d=[];function c(){var h=n.mediaQuery==="min";Fo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,sl),b()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",b),d.push([h,x])}function b(){var h=i.is(Wr),f=n.direction,x=d.reduce(function(S,v){return Kn(S,v[1].matches?v[0]:{})},{});cl(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function y(h){matchMedia(sl).matches&&(h?Kn(n,r):cl(n,Fo(r)))}function g(h,f,x){Kn(n,h),f&&Kn(Object.getPrototypeOf(n),h),(x||!i.is(ji))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:y,set:g}}var Qr="Arrow",ea=Qr+"Left",ta=Qr+"Right",wd=Qr+"Up",Sd=Qr+"Down",pl="rtl",na="ttb",ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[wd,ta],ArrowRight:[Sd,ea]};function Fp(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===pl&&!l?1:d===na?0:-1;return ha[r]&&ha[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ha[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===pl?1:-1)}return{resolve:i,orient:o}}var On="role",qi="tabindex",_p="disabled",Cn="aria-",Zo=Cn+"controls",$d=Cn+"current",ml=Cn+"selected",vn=Cn+"label",Ns=Cn+"labelledby",Cd=Cn+"hidden",Hs=Cn+"orientation",Ho=Cn+"roledescription",gl=Cn+"live",hl=Cn+"busy",fl=Cn+"atomic",Os=[On,qi,_p,Zo,$d,vn,Ns,Cd,Hs,Ho],Fn=Ko+"__",li="is-",fa=Ko,yl=Fn+"track",Wp=Fn+"list",ia=Fn+"slide",Td=ia+"--clone",Np=ia+"__container",Ds=Fn+"arrows",oa=Fn+"arrow",Ld=oa+"--prev",Rd=oa+"--next",ra=Fn+"pagination",Id=ra+"__page",Hp=Fn+"progress",Op=Hp+"__bar",Dp=Fn+"toggle",jp=Fn+"spinner",zp=Fn+"sr",Bp=li+"initialized",Li=li+"active",Ed=li+"prev",Md=li+"next",ns=li+"visible",is=li+"loading",Pd=li+"focus-in",kd=li+"overflow",Vp=[Li,ns,Ed,Md,is,Pd,kd],Gp={slide:ia,clone:Td,arrows:Ds,arrow:oa,prev:Ld,next:Rd,pagination:ra,page:Id,spinner:jp};function qp(e,t){if(Qc(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ao(n,t);)n=n.parentElement;return n}var Xp=5,vl=200,Ad="touchstart mousedown",ya="touchmove mousemove",va="touchend touchcancel mouseup click";function Up(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],y,g,h;function f(){w(),H(),v()}function x(){o(Qt,S),o(Qt,f),o(cn,v),r(document,Ad+" keydown",function(D){h=D.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Nn(l,Pd,!!h)})}function S(D){var C=Os.concat("style");zn(u),Hn(l,p),Hn(y,b),kn([y,g],C),kn(l,D?C:["style",Ho])}function v(){Hn(l,p),Hn(y,b),p=Y(fa),b=Y(yl),Pn(l,p),Pn(y,b),Tt(l,vn,n.label),Tt(l,Ns,n.labelledby)}function w(){y=N("."+yl),g=Yo(y,"."+Wp),Io(y&&g,"A track/list element is missing."),Mr(u,td(g,"."+ia+":not(."+Td+")")),$i({arrows:Ds,pagination:ra,prev:Ld,next:Rd,bar:Op,toggle:Dp},function(D,C){c[C]=N("."+D)}),_o(c,{root:l,track:y,list:g,slides:u})}function H(){var D=l.id||Ep(Ko),C=n.role;l.id=D,y.id=y.id||D+"-track",g.id=g.id||D+"-list",!$n(l,On)&&l.tagName!=="SECTION"&&C&&Tt(l,On,C),Tt(l,Ho,d.carousel),Tt(g,On,"presentation")}function N(D){var C=od(l,D);return C&&qp(C,"."+fa)===l?C:void 0}function Y(D){return[D+"--"+n.type,D+"--"+n.direction,n.drag&&D+"--draggable",n.isNavigation&&D+"--nav",D===fa&&Li]}return _o(c,{setup:f,mount:x,destroy:S})}var Ji="slide",mo="loop",Jo="fade";function Yp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,y=p.updateOnMove,g=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,S=$n(i,"style"),v=$n(i,vn),w=n>-1,H=Yo(i,"."+Np),N;function Y(){w||(i.id=u.id+"-slide"+Ms(t+1),Tt(i,On,h?"tabpanel":"group"),Tt(i,Ho,g.slide),Tt(i,vn,v||es(g.slideLabel,[t+1,e.length]))),D()}function D(){d(i,"click",Ut(l,Ps,ne)),d(i,"keydown",Ut(l,xd,ne)),r([po,bd,Ii],I),r(As,V),y&&r(Bn,$)}function C(){N=!0,o.destroy(),Hn(i,Vp),kn(i,Os),Tt(i,"style",S),Tt(i,vn,v||"")}function V(){var R=e.splides.map(function(W){var K=W.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Tt(i,vn,es(g.slideX,(w?n:t)+1)),Tt(i,Zo,R),Tt(i,On,f?"button":""),f&&kn(i,Ho)}function $(){N||I()}function I(){if(!N){var R=e.index;k(),T(),Nn(i,Ed,t===R-1),Nn(i,Md,t===R+1)}}function k(){var R=M();R!==dl(i,Li)&&(Nn(i,Li,R),Tt(i,$d,b&&R||""),l(R?sd:ld,ne))}function T(){var R=E(),W=!R&&(!M()||w);if(e.state.is([uo,Go])||Tt(i,Cd,W||""),Tt(Is(i,p.focusableNodes||""),qi,W?-1:""),f&&Tt(i,qi,W?-1:0),R!==dl(i,ns)&&(Nn(i,ns,R),l(R?cd:dd,ne)),!R&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&nd(K.slide)}}function m(R,W,K){Sn(K&&H||i,R,W)}function M(){var R=e.index;return R===t||p.cloneStatus&&R===n}function E(){if(e.is(Jo))return M();var R=fn(c.Elements.track),W=fn(i),K=x("left",!0),ae=x("right",!0);return Hr(R[K])<=No(W[K])&&Hr(W[ae])<=No(R[ae])}function z(R,W){var K=un(R-t);return!w&&(p.rewind||e.is(mo))&&(K=ni(K,e.length-K)),K<=W}var ne={index:t,slideIndex:n,slide:i,container:H,isClone:w,mount:Y,destroy:C,update:I,style:m,isWithin:z};return ne}function Kp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){y(),o(Qt,g),o(Qt,y)}function y(){c.forEach(function(I,k){f(I,k,-1)})}function g(){N(function(I){I.destroy()}),zn(p)}function h(){N(function(I){I.update()})}function f(I,k,T){var m=Yp(e,k,T,I);m.mount(),p.push(m),p.sort(function(M,E){return M.index-E.index})}function x(I){return I?Y(function(k){return!k.isClone}):p}function S(I){var k=t.Controller,T=k.toIndex(I),m=k.hasFocus()?1:n.perPage;return Y(function(M){return Pr(M.index,T,T+m-1)})}function v(I){return Y(I)[0]}function w(I,k){bn(I,function(T){if(ti(T)&&(T=id(T)),ed(T)){var m=c[k];m?Rs(T,m):Uo(u,T),Pn(T,n.classes.slide),C(T,Ut(r,Zi))}}),r(Qt)}function H(I){Ti(Y(I).map(function(k){return k.slide})),r(Qt)}function N(I,k){x(k).forEach(I)}function Y(I){return p.filter(Qc(I)?I:function(k){return ti(I)?Ao(k.slide,I):Ls(Xo(I),k.index)})}function D(I,k,T){N(function(m){m.style(I,k,T)})}function C(I,k){var T=Is(I,"img"),m=T.length;m?T.forEach(function(M){l(M,"load error",function(){--m||k()})}):k()}function V(I){return I?c.length:p.length}function $(){return p.length>n.perPage}return{mount:b,destroy:g,update:h,register:f,get:x,getIn:S,getAt:v,add:w,remove:H,forEach:N,filter:Y,style:D,getLength:V,isEnough:$}}function Zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,y=u.list,g=d.getAt,h=d.style,f,x,S;function v(){w(),r(window,"resize load",kp(Ut(l,Zi))),o([cn,Qt],w),o(Zi,H)}function w(){f=n.direction===na,Sn(p,"maxWidth",pi(n.width)),Sn(b,c("paddingLeft"),N(!1)),Sn(b,c("paddingRight"),N(!0)),H(!0)}function H(ne){var R=fn(p);(ne||x.width!==R.width||x.height!==R.height)&&(Sn(b,"height",Y()),h(c("marginRight"),pi(n.gap)),h("width",C()),h("height",V(),!0),x=R,l(Kr),S!==(S=z())&&(Nn(p,kd,S),l(Mp,S)))}function N(ne){var R=n.padding,W=c(ne?"right":"left");return R&&pi(R[W]||(ko(R)?0:R))||"0px"}function Y(){var ne="";return f&&(ne=D(),Io(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function D(){return pi(n.height||fn(y).width*n.heightRatio)}function C(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function V(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():D())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function I(){return fn(y)[c("width")]}function k(ne,R){var W=g(ne||0);return W?fn(W.slide)[c("width")]+(R?0:M()):0}function T(ne,R){var W=g(ne);if(W){var K=fn(W.slide)[c("right")],ae=fn(y)[c("left")];return un(K-ae)+(R?0:M())}return 0}function m(ne){return T(e.length-1)-T(0)+k(0,ne)}function M(){var ne=g(0);return ne&&parseFloat(Sn(ne.slide,c("marginRight")))||0}function E(ne){return parseFloat(Sn(b,c("padding"+(ne?"Right":"Left"))))||0}function z(){return e.is(Jo)||m(!0)>I()}return{mount:v,resize:H,listSize:I,slideSize:k,sliderSize:m,totalSize:T,getPadding:E,isOverflow:z}}var Jp=2;function Qp(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([cn,Zi],g),(u=x())&&(h(u),t.Layout.resize(!0))}function b(){y(),p()}function y(){Ti(c),zn(c),i.destroy()}function g(){var S=x();u!==S&&(u<S||!S)&&i.emit(Qt)}function h(S){var v=l.get().slice(),w=v.length;if(w){for(;v.length<S;)Mr(v,v);Mr(v.slice(-S),v.slice(0,S)).forEach(function(H,N){var Y=N<S,D=f(H.slide,N);Y?Rs(D,v[0].slide):Uo(r.list,D),Mr(c,D),l.register(D,N-S+(Y?0:w),H.index)})}}function f(S,v){var w=S.cloneNode(!0);return Pn(w,n.classes.clone),w.id=e.root.id+"-clone"+Ms(v+1),w}function x(){var S=n.clones;if(!e.is(mo))S=0;else if(qo(S)){var v=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=v&&No(fn(r.track)[d("width")]/v);S=w||n[d("autoWidth")]&&e.length||n.perPage*Jp}return S}return{mount:p,destroy:y}}function em(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,y=d.sliderSize,g=t.Direction,h=g.resolve,f=g.orient,x=t.Elements,S=x.list,v=x.track,w;function H(){w=t.Transition,o([si,Kr,cn,Qt],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),D(e.index),t.Slides.update())}function Y(W,K,ae,de){W!==K&&ne(W>ae)&&(I(),C($(m(),W>ae),!0)),l(uo),r(Bn,K,ae,W),w.start(K,function(){l(Ki),r(po,K,ae,W),de&&de()})}function D(W){C(T(W,!0))}function C(W,K){if(!e.is(Jo)){var ae=K?W:V(W);Sn(S,"transform","translate"+h("X")+"("+ae+"px)"),W!==ae&&r(bd)}}function V(W){if(e.is(mo)){var K=k(W),ae=K>t.Controller.getEnd(),de=K<0;(de||ae)&&(W=$(W,ae))}return W}function $(W,K){var ae=W-z(K),de=y();return W-=f(de*(No(un(ae)/de)||1))*(K?1:-1),W}function I(){C(m(),!0),w.cancel()}function k(W){for(var K=t.Slides.get(),ae=0,de=1/0,A=0;A<K.length;A++){var he=K[A].index,q=un(T(he,!0)-W);if(q<=de)de=q,ae=he;else break}return ae}function T(W,K){var ae=f(p(W-1)-E(W));return K?M(ae):ae}function m(){var W=h("left");return fn(S)[W]-fn(v)[W]+f(u(!1))}function M(W){return n.trimSpace&&e.is(Ji)&&(W=Ni(W,0,f(y(!0)-b()))),W}function E(W){var K=n.focus;return K==="center"?(b()-c(W,!0))/2:+K*c(W)||0}function z(W){return T(W?t.Controller.getEnd():0,!!n.trimSpace)}function ne(W){var K=f($(m(),W));return W?K>=0:K<=S[h("scrollWidth")]-fn(v)[h("width")]}function R(W,K){K=qo(K)?m():K;var ae=W!==!0&&f(K)<f(z(!1)),de=W!==!1&&f(K)>f(z(!0));return ae||de}return{mount:H,move:Y,jump:D,translate:C,shift:$,cancel:I,toIndex:k,toPosition:T,getPosition:m,getLimit:z,exceededLimit:R,reposition:N}}function tm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,y=p.getLength,g=n.omitEnd,h=e.is(mo),f=e.is(Ji),x=Ut(m,!1),S=Ut(m,!0),v=n.start||0,w,H=v,N,Y,D;function C(){V(),o([cn,Qt,Or],V),o(Kr,$)}function V(){N=y(!0),Y=n.perMove,D=n.perPage,w=ne();var q=Ni(v,0,g?w:N-1);q!==v&&(v=q,l.reposition())}function $(){w!==ne()&&r(Or)}function I(q,ce,Q){if(!he()){var be=T(q),We=z(be);We>-1&&(ce||We!==v)&&(ae(We),l.move(be,We,H,Q))}}function k(q,ce,Q,be){t.Scroll.scroll(q,ce,Q,function(){var We=z(l.toIndex(d()));ae(g?ni(We,w):We),be&&be()})}function T(q){var ce=v;if(ti(q)){var Q=q.match(/([+\-<>])(\d+)?/)||[],be=Q[1],We=Q[2];be==="+"||be==="-"?ce=M(v+ +(""+be+(+We||1)),v):be===">"?ce=We?R(+We):x(!0):be==="<"&&(ce=S(!0))}else ce=h?q:Ni(q,0,w);return ce}function m(q,ce){var Q=Y||(A()?1:D),be=M(v+Q*(q?-1:1),v,!(Y||A()));return be===-1&&f&&!rd(d(),c(!q),1)?q?0:w:ce?be:z(be)}function M(q,ce,Q){if(b()||A()){var be=E(q);be!==q&&(ce=q,q=be,Q=!1),q<0||q>w?!Y&&(Pr(0,q,ce,!0)||Pr(w,ce,q,!0))?q=R(W(q)):h?q=Q?q<0?-(N%D||D):N:q:n.rewind?q=q<0?w:0:q=-1:Q&&q!==ce&&(q=R(W(ce)+(q<ce?-1:1)))}else q=-1;return q}function E(q){if(f&&n.trimSpace==="move"&&q!==v)for(var ce=d();ce===u(q,!0)&&Pr(q,0,e.length-1,!n.rewind);)q<v?--q:++q;return q}function z(q){return h?(q+N)%N||0:q}function ne(){for(var q=N-(A()||h&&Y?1:D);g&&q-- >0;)if(u(N-1,!0)!==u(q,!0)){q++;break}return Ni(q,0,N-1)}function R(q){return Ni(A()?q:D*q,0,w)}function W(q){return A()?ni(q,w):Hr((q>=w?N-1:q)/D)}function K(q){var ce=l.toIndex(q);return f?Ni(ce,0,w):ce}function ae(q){q!==v&&(H=v,v=q)}function de(q){return q?H:v}function A(){return!qo(n.focus)||n.isNavigation}function he(){return e.state.is([uo,Go])&&!!n.waitForTransition}return{mount:C,go:I,scroll:k,getNext:x,getPrev:S,getAdjacent:m,getEnd:ne,setIndex:ae,getIndex:de,toIndex:R,toPage:W,toDest:K,hasFocus:A,isBusy:he}}var nm="http://www.w3.org/2000/svg",im="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ar=40;function om(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,y=u.track,g=b,h=u.prev,f=u.next,x,S,v={};function w(){N(),o(cn,H)}function H(){Y(),w()}function N(){var k=n.arrows;k&&!(h&&f)&&V(),h&&f&&(_o(v,{prev:h,next:f}),Wo(g,k?"":"none"),Pn(g,S=Ds+"--"+n.direction),k&&(D(),I(),Tt([h,f],Zo,y.id),l(gd,h,f)))}function Y(){i.destroy(),Hn(g,S),x?(Ti(b?[h,f]:g),h=f=null):kn([h,f],Os)}function D(){o([si,po,Qt,Ii,Or],I),r(f,"click",Ut(C,">")),r(h,"click",Ut(C,"<"))}function C(k){p.go(k,!0)}function V(){g=b||Gi("div",d.arrows),h=$(!0),f=$(!1),x=!0,Uo(g,[h,f]),!b&&Rs(g,y)}function $(k){var T='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+nm+'" viewBox="0 0 '+ar+" "+ar+'" width="'+ar+'" height="'+ar+'" focusable="false"><path d="'+(n.arrowPath||im)+'" />';return id(T)}function I(){if(h&&f){var k=e.index,T=p.getPrev(),m=p.getNext(),M=T>-1&&k<T?c.last:c.prev,E=m>-1&&k>m?c.first:c.next;h.disabled=T<0,f.disabled=m<0,Tt(h,vn,M),Tt(f,vn,E),l(hd,h,f,T,m)}}return{arrows:v,mount:w,destroy:Y,update:I}}var rm=Es+"-interval";function am(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Jr(n.interval,e.go.bind(e,">"),D),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,y=p.toggle,g=n.autoplay,h,f,x=g==="pause";function S(){g&&(v(),y&&Tt(y,Zo,u.track.id),x||w(),Y())}function v(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(V){h=V.type==="mouseenter",N()}),n.pauseOnFocus&&r(b,"focusin focusout",function(V){f=V.type==="focusin",N()}),y&&r(y,"click",function(){x?w():H(!0)}),o([Bn,Zr,Qt],d.rewind),o(Bn,C)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,Y(),l(Fs))}function H(V){V===void 0&&(V=!0),x=!!V,Y(),c()||(d.pause(),l(_s))}function N(){x||(h||f?H(!1):w())}function Y(){y&&(Nn(y,Li,!x),Tt(y,vn,n.i18n[x?"play":"pause"]))}function D(V){var $=u.bar;$&&Sn($,"width",V*100+"%"),l(vd,V)}function C(V){var $=t.Slides.getAt(V);d.set($&&+$n($.slide,rm)||n.interval)}return{mount:S,destroy:d.cancel,play:w,pause:H,isPaused:c}}function sm(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Ws,Ut(d,!0)),o([si,cn,Qt],Ut(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(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),Wo(u,c?"none":"")}return{mount:r,destroy:Ut(l,!1)}}var lm=10,cm=600,dm=.6,um=1.5,pm=800;function mm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,y=e.is(Ji),g,h,f=1;function x(){o(Bn,H),o([cn,Qt],N)}function S(D,C,V,$,I){var k=c();if(H(),V&&(!y||!p())){var T=t.Layout.sliderSize(),m=Qa(D)*T*Hr(un(D)/T)||0;D=d.toPosition(t.Controller.toDest(D%T))+m}var M=rd(k,D,1);f=1,C=M?0:C||Nr(un(D-k)/um,pm),h=$,g=Jr(C,v,Ut(w,k,D,I),1),l(Go),r(Zr),g.start()}function v(){l(Ki),h&&h(),r(Ii)}function w(D,C,V,$){var I=c(),k=D+(C-D)*Y($),T=(k-I)*f;b(I+T),y&&!V&&p()&&(f*=dm,un(T)<lm&&S(u(p(!0)),cm,!1,h,!0))}function H(){g&&g.cancel()}function N(){g&&!g.isPaused()&&(H(),v())}function Y(D){var C=n.easingFunc;return C?C(D):1-Math.pow(1-D,4)}return{mount:x,destroy:H,scroll:S,cancel:N}}var Hi={passive:!1,capture:!0};function gm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,y=t.Elements.track,g=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,S=u.getPosition,v=u.exceededLimit,w,H,N,Y,D,C=!1,V,$,I;function k(){l(y,ya,Za,Hi),l(y,va,Za,Hi),l(y,Ad,m,Hi),l(y,"click",z,{capture:!0}),l(y,"dragstart",Wn),o([si,cn],T)}function T(){var ee=n.drag;le(!ee),Y=ee==="free"}function m(ee){if(V=!1,!$){var ue=We(ee);be(ee.target)&&(ue||!ee.button)&&(b.isBusy()?Wn(ee,!0):(I=ue?y:window,D=c.is([uo,Go]),N=null,l(I,ya,M,Hi),l(I,va,E,Hi),u.cancel(),p.cancel(),ne(ee)))}}function M(ee){if(c.is(Er)||(c.set(Er),r(ud)),ee.cancelable)if(D){u.translate(w+Q(A(ee)));var ue=he(ee)>vl,oe=C!==(C=v());(ue||oe)&&ne(ee),V=!0,r(pd),Wn(ee)}else K(ee)&&(D=W(ee),Wn(ee))}function E(ee){c.is(Er)&&(c.set(Ki),r(md)),D&&(R(ee),Wn(ee)),d(I,ya,M),d(I,va,E),D=!1}function z(ee){!$&&V&&Wn(ee,!0)}function ne(ee){N=H,H=ee,w=S()}function R(ee){var ue=ae(ee),oe=de(ue),Ne=n.rewind&&n.rewindByDrag;g(!1),Y?b.scroll(oe,0,n.snap):e.is(Jo)?b.go(x(Qa(ue))<0?Ne?"<":"-":Ne?">":"+"):e.is(Ji)&&C&&Ne?b.go(v(!0)?">":"<"):b.go(b.toDest(oe),!0),g(!0)}function W(ee){var ue=n.dragMinThreshold,oe=ko(ue),Ne=oe&&ue.mouse||0,Te=(oe?ue.touch:+ue)||10;return un(A(ee))>(We(ee)?Te:Ne)}function K(ee){return un(A(ee))>un(A(ee,!0))}function ae(ee){if(e.is(mo)||!C){var ue=he(ee);if(ue&&ue<vl)return A(ee)/ue}return 0}function de(ee){return S()+Qa(ee)*ni(un(ee)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(ee,ue){return ce(ee,ue)-ce(q(ee),ue)}function he(ee){return Ja(ee)-Ja(q(ee))}function q(ee){return H===ee&&N||H}function ce(ee,ue){return(We(ee)?ee.changedTouches[0]:ee)["page"+f(ue?"Y":"X")]}function Q(ee){return ee/(C&&e.is(Ji)?Xp:1)}function be(ee){var ue=n.noDrag;return!Ao(ee,"."+Id+", ."+oa)&&(!ue||!Ao(ee,ue))}function We(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function xe(){return D}function le(ee){$=ee}return{mount:k,disable:le,isDragging:xe}}var hm={Spacebar:" ",Right:ta,Left:ea,Up:wd,Down:Sd};function js(e){return e=ti(e)?e:e.key,hm[e]||e}var xl="keydown";function fm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){y(),o(cn,g),o(cn,y),o(Bn,f)}function y(){var S=n.keyboard;S&&(u=S==="global"?window:d,r(u,xl,x))}function g(){l(u,xl)}function h(S){p=S}function f(){var S=p;p=!0,Jc(function(){p=S})}function x(S){if(!p){var v=js(S);v===c(ea)?e.go("<"):v===c(ta)&&e.go(">")}}return{mount:b,destroy:g,disable:h}}var Eo=Es+"-lazy",kr=Eo+"-srcset",ym="["+Eo+"], ["+kr+"]";function vm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[po,Ii],p=[];function b(){n.lazyLoad&&(y(),o(Qt,y))}function y(){zn(p),g(),c?S():(r(u),o(u,h),h())}function g(){t.Slides.forEach(function(v){Is(v.slide,ym).forEach(function(w){var H=$n(w,Eo),N=$n(w,kr);if(H!==w.src||N!==w.srcset){var Y=n.classes.spinner,D=w.parentElement,C=Yo(D,"."+Y)||Gi("span",Y,D);p.push([w,v,C]),w.src||Wo(w,"none")}})})}function h(){p=p.filter(function(v){var w=n.perPage*((n.preloadPages||1)+1)-1;return v[1].isWithin(e.index,w)?f(v):!0}),p.length||r(u)}function f(v){var w=v[0];Pn(v[1].slide,is),l(w,"load error",Ut(x,v)),Tt(w,"src",$n(w,Eo)),Tt(w,"srcset",$n(w,kr)),kn(w,Eo),kn(w,kr)}function x(v,w){var H=v[0],N=v[1];Hn(N.slide,is),w.type!=="error"&&(Ti(v[2]),Wo(H,""),d(Ws,H,N),d(Zi)),c&&S()}function S(){p.length&&f(p.shift())}return{mount:b,destroy:Ut(zn,p),check:h}}function xm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,y=u.go,g=t.Direction.resolve,h=c.pagination,f=[],x,S;function v(){w(),o([cn,Qt,Or],v);var $=n.pagination;h&&Wo(h,$?"":"none"),$&&(o([Bn,Zr,Ii],V),H(),V(),r(fd,{list:x,items:f},C(e.index)))}function w(){x&&(Ti(h?ai(x.children):x),Hn(x,S),zn(f),x=null),i.destroy()}function H(){var $=e.length,I=n.classes,k=n.i18n,T=n.perPage,m=p()?u.getEnd()+1:No($/T);x=h||Gi("ul",I.pagination,c.track.parentElement),Pn(x,S=ra+"--"+D()),Tt(x,On,"tablist"),Tt(x,vn,k.select),Tt(x,Hs,D()===na?"vertical":"");for(var M=0;M<m;M++){var E=Gi("li",null,x),z=Gi("button",{class:I.page,type:"button"},E),ne=d.getIn(M).map(function(W){return W.slide.id}),R=!p()&&T>1?k.pageX:k.slideX;l(z,"click",Ut(N,M)),n.paginationKeyboard&&l(z,"keydown",Ut(Y,M)),Tt(E,On,"presentation"),Tt(z,On,"tab"),Tt(z,Zo,ne.join(" ")),Tt(z,vn,es(R,M+1)),Tt(z,qi,-1),f.push({li:E,button:z,page:M})}}function N($){y(">"+$,!0)}function Y($,I){var k=f.length,T=js(I),m=D(),M=-1;T===g(ta,!1,m)?M=++$%k:T===g(ea,!1,m)?M=(--$+k)%k:T==="Home"?M=0:T==="End"&&(M=k-1);var E=f[M];E&&(nd(E.button),y(">"+M),Wn(I,!0))}function D(){return n.paginationDirection||n.direction}function C($){return f[u.toPage($)]}function V(){var $=C(b(!0)),I=C(b());if($){var k=$.button;Hn(k,Li),kn(k,ml),Tt(k,qi,-1)}if(I){var T=I.button;Pn(T,Li),Tt(T,ml,!0),Tt(T,qi,"")}r(yd,{list:x,items:f},$,I)}return{items:f,mount:v,destroy:w,getAt:C,update:V}}var bm=[" ","Enter"];function wm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),zn(r)}function c(){d(),l()}function u(h,f){var x=Kt(h);x.on(Bn,function(S,v,w){f.go(f.is(mo)?w:S)}),r.push(x)}function p(){var h=Kt(e),f=h.on;f(Ps,y),f(xd,g),f([si,cn],b),r.push(h),h.emit(As,e.splides)}function b(){Tt(t.Elements.list,Hs,n.direction===na?"vertical":"")}function y(h){e.go(h.index)}function g(h,f){Ls(bm,js(f))&&(y(h),Wn(f))}return{setup:Ut(t.Media.set,{slideFocus:qo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Sm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,y=Ja(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;un(p)>g&&y-r>h&&(e.go(b?"<":">"),r=y),c(b)&&Wn(u)}}function c(u){return!n.releaseWheel||e.state.is(uo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var $m=90;function Cm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",zp),c=Jr($m,Ut(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),Tt(r,fl,!0),d.textContent="…",o(Fs,Ut(y,!0)),o(_s,Ut(y,!1)),o([po,Ii],Ut(p,!0)))}function p(g){Tt(r,hl,g),g?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function b(){kn(r,[gl,fl,hl]),Ti(d)}function y(g){l&&Tt(r,gl,g?"off":"polite")}return{mount:u,disable:y,destroy:b}}var Tm=Object.freeze({__proto__:null,Media:Ap,Direction:Fp,Elements:Up,Slides:Kp,Layout:Zp,Clones:Qp,Move:em,Controller:tm,Arrows:om,Autoplay:am,Cover:sm,Scroll:mm,Drag:gm,Keyboard:fm,LazyLoad:vm,Pagination:xm,Sync:wm,Wheel:Sm,Live:Cm}),Lm={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"},Rm={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:Gp,i18n:Lm,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Im(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,Qt],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),Jc(c)}return{mount:o,start:l,cancel:Za}}function Em(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(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,h){var f=i.toPosition(g,!0),x=i.getPosition(),S=y(g);un(f-x)>=1&&S>=1?n.useScroll?r.scroll(f,S,!1,h):(d("transform "+S+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(g),h())}function b(){d(""),r.cancel()}function y(g){var h=n.rewindSpeed;if(e.is(Ji)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&g>=x||f>=x&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Mm=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Pp(ji),this.splides=[],this._o={},this._E={};var o=ti(n)?od(document,n):n;Io(o,o+" is invalid."),this.root=o,i=Kn({label:$n(o,vn)||"",labelledby:$n(o,Ns)||""},Rm,e.defaults,i||{});try{Kn(i,JSON.parse($n(o,Es)))}catch{Io(!1,"Invalid JSON")}this._o=Object.create(Kn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Io(l.is([ji,Wr]),"Already mounted!"),l.set(ji),this._C=d,this._T=o||this._T||(this.is(Jo)?Im:Em),this._E=i||this._E;var c=_o({},Tm,this._E,{Transition:this._T});return $i(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),$i(d,function(u){u.mount&&u.mount()}),this.emit(si),Pn(this.root,Bp),l.set(Ki),this.emit(ts),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ki)&&(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(ai(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(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(ji)?Kt(this).on(ts,this.destroy.bind(this,i)):($i(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ks),o.destroy(),i&&zn(this.splides),r.set(Wr)),this},Lp(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})(),zs=Mm;zs.defaults={};zs.STATES=Ip;var bl=[[si,"onMounted"],[ts,"onReady"],[Bn,"onMove"],[po,"onMoved"],[Ps,"onClick"],[sd,"onActive"],[ld,"onInactive"],[cd,"onVisible"],[dd,"onHidden"],[Qt,"onRefresh"],[cn,"onUpdated"],[Zi,"onResize"],[Kr,"onResized"],[ud,"onDrag"],[pd,"onDragging"],[md,"onDragged"],[Zr,"onScroll"],[Ii,"onScrolled"],[ks,"onDestroy"],[gd,"onArrowsMounted"],[hd,"onArrowsUpdated"],[fd,"onPaginationMounted"],[yd,"onPaginationUpdated"],[As,"onNavigationMounted"],[Fs,"onAutoplayPlay"],[vd,"onAutoplayPlaying"],[_s,"onAutoplayPause"],[Ws,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function os(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!os(n,t[i]));if(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)||!os(e[o],t[o]))}return e===t}function Pm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function km(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 rs(e,t){const n=e;return km(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=rs(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Am=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Vs=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 zs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=rs({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!os(this.options,e)&&(this.splide.options=e,this.options=rs({},e));const t=this.getSlides();Pm(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){bl.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:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...bl.map(r=>r[1])])},n?s.createElement(Am,null,i):i)}},Gs=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),yt=require("classnames"),D=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Vn=require("react-dom");function Hu(e){return e.type==="object"&&e.version===1}const Ou="ControlSlider-module__wrapper___sHEkd",Du="ControlSlider-module__hoverArrow___A-dOH",ju="ControlSlider-module__sliderItem___QQSkR",zu="ControlSlider-module__sliderImage___9hRl-",Bu="ControlSlider-module__arrow___05ghY",Vu="ControlSlider-module__arrowVertical___tBfVN",Gu="ControlSlider-module__nextArrow___-30Yc",qu="ControlSlider-module__arrowInner___aEra3",Xu="ControlSlider-module__arrowIcon___S4ztF",Uu="ControlSlider-module__arrowImg___2dwJW",Yu="ControlSlider-module__mirror___brd6U",Ku="ControlSlider-module__pagination___bicLF",Zu="ControlSlider-module__paginationInner___bT-P-",Ju="ControlSlider-module__paginationVertical___zYqKw",Qu="ControlSlider-module__paginationItem___nTRbk",ep="ControlSlider-module__dot___p1Qun",tp="ControlSlider-module__activeDot___LHFaj",np="ControlSlider-module__paginationInsideBottom___R3FWn",ip="ControlSlider-module__paginationInsideTop___V-qb-",op="ControlSlider-module__paginationOutsideBottom___14w8D",rp="ControlSlider-module__paginationOutsideTop___SCLqB",ap="ControlSlider-module__paginationInsideLeft___yOBRZ",sp="ControlSlider-module__paginationInsideRight___Rtt3o",lp="ControlSlider-module__paginationOutsideLeft___lahaw",cp="ControlSlider-module__paginationOutsideRight___EtuQa",dp="ControlSlider-module__imgWrapper___UjEgB",up="ControlSlider-module__captionBlock___dJ6-j",pp="ControlSlider-module__captionTextWrapper___HFlpf",mp="ControlSlider-module__captionText___uGBVc",gp="ControlSlider-module__active___WZK4G",hp="ControlSlider-module__withPointerEvents___t-18M",fp="ControlSlider-module__topLeftAlignment___zjnGM",yp="ControlSlider-module__topCenterAlignment___gD1xW",vp="ControlSlider-module__topRightAlignment___NMapS",xp="ControlSlider-module__middleLeftAlignment___OnUrY",bp="ControlSlider-module__middleCenterAlignment___Tdkl0",wp="ControlSlider-module__middleRightAlignment___wEbfX",Sp="ControlSlider-module__bottomLeftAlignment___cTP2-",$p="ControlSlider-module__bottomCenterAlignment___c54fB",Cp="ControlSlider-module__bottomRightAlignment___kEwrz",Tp="ControlSlider-module__clickOverlay___DZA28",Lp="ControlSlider-module__contain___pLyq7",Rp="ControlSlider-module__cover___KdDat",ht={wrapper:Ou,hoverArrow:Du,sliderItem:ju,sliderImage:zu,arrow:Bu,arrowVertical:Vu,nextArrow:Gu,arrowInner:qu,arrowIcon:Xu,arrowImg:Uu,mirror:Yu,pagination:Ku,paginationInner:Zu,paginationVertical:Ju,paginationItem:Qu,dot:ep,activeDot:tp,paginationInsideBottom:np,paginationInsideTop:ip,paginationOutsideBottom:op,paginationOutsideTop:rp,paginationInsideLeft:ap,paginationInsideRight:sp,paginationOutsideLeft:lp,paginationOutsideRight:cp,imgWrapper:dp,captionBlock:up,captionTextWrapper:pp,captionText:mp,active:gp,withPointerEvents:hp,topLeftAlignment:fp,topCenterAlignment:yp,topRightAlignment:vp,middleLeftAlignment:xp,middleCenterAlignment:bp,middleRightAlignment:wp,bottomLeftAlignment:Sp,bottomCenterAlignment:$p,bottomRightAlignment:Cp,clickOverlay:Tp,contain:Lp,cover:Rp};function Ip(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 Ep(e,t,n){return t&&Ip(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var sl="(prefers-reduced-motion: reduce)",ji=1,Mp=2,Ki=3,uo=4,Go=5,Er=6,Wr=7,Pp={CREATED:ji,MOUNTED:Mp,IDLE:Ki,MOVING:uo,SCROLLING:Go,DRAGGING:Er,DESTROYED:Wr};function zn(e){e.length=0}function ai(e,t,n){return Array.prototype.slice.call(e,t,n)}function Ut(e){return e.bind.apply(e,[null].concat(ai(arguments,1)))}var Qc=setTimeout,Za=function(){};function ll(e){return requestAnimationFrame(e)}function Yr(e,t){return typeof t===e}function ko(e){return!Ts(e)&&Yr("object",e)}var Cs=Array.isArray,ed=Ut(Yr,"function"),ti=Ut(Yr,"string"),qo=Ut(Yr,"undefined");function Ts(e){return e===null}function td(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Xo(e){return Cs(e)?e:[e]}function bn(e,t){Xo(e).forEach(t)}function Ls(e,t){return e.indexOf(t)>-1}function Mr(e,t){return e.push.apply(e,Xo(t)),e}function Nn(e,t,n){e&&bn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Pn(e,t){Nn(e,ti(t)?t.split(" "):t,!0)}function Uo(e,t){bn(t,e.appendChild.bind(e))}function Rs(e,t){bn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function Ao(e,t){return td(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function nd(e,t){var n=e?ai(e.children):[];return t?n.filter(function(i){return Ao(i,t)}):n}function Yo(e,t){return t?nd(e,t)[0]:e.firstElementChild}var Fo=Object.keys;function $i(e,t,n){return e&&(n?Fo(e).reverse():Fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function _o(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){e[i]=t[i]})}),e}function Kn(e){return ai(arguments,1).forEach(function(t){$i(t,function(n,i){Cs(n)?e[i]=n.slice():ko(n)?e[i]=Kn({},ko(e[i])?e[i]:{},n):e[i]=n})}),e}function cl(e,t){bn(t||Fo(e),function(n){delete e[n]})}function kn(e,t){bn(e,function(n){bn(t,function(i){n&&n.removeAttribute(i)})})}function Ct(e,t,n){ko(t)?$i(t,function(i,o){Ct(e,o,i)}):bn(e,function(i){Ts(n)||n===""?kn(i,t):i.setAttribute(t,String(n))})}function Gi(e,t,n){var i=document.createElement(e);return t&&(ti(t)?Pn(i,t):Ct(i,t)),n&&Uo(n,i),i}function Sn(e,t,n){if(qo(n))return getComputedStyle(e)[t];Ts(n)||(e.style[t]=""+n)}function Wo(e,t){Sn(e,"display",t)}function id(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function $n(e,t){return e.getAttribute(t)}function dl(e,t){return e&&e.classList.contains(t)}function fn(e){return e.getBoundingClientRect()}function Ti(e){bn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function od(e){return Yo(new DOMParser().parseFromString(e,"text/html").body)}function Wn(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function rd(e,t){return e&&e.querySelector(t)}function Is(e,t){return t?ai(e.querySelectorAll(t)):[]}function Hn(e,t){Nn(e,t,!1)}function Ja(e){return e.timeStamp}function pi(e){return ti(e)?e:e?e+"px":""}var Ko="splide",Es="data-"+Ko;function Io(e,t){if(!e)throw new Error("["+Ko+"] "+(t||""))}var ni=Math.min,Nr=Math.max,Hr=Math.floor,No=Math.ceil,un=Math.abs;function ad(e,t,n){return un(e-t)<n}function Pr(e,t,n,i){var o=ni(t,n),r=Nr(t,n);return i?o<e&&e<r:o<=e&&e<=r}function Ni(e,t,n){var i=ni(t,n),o=Nr(t,n);return ni(Nr(i,e),o)}function Qa(e){return+(e>0)-+(e<0)}function es(e,t){return bn(t,function(n){e=e.replace("%s",""+n)}),e}function Ms(e){return e<10?"0"+e:""+e}var ul={};function kp(e){return""+e+Ms(ul[e]=(ul[e]||0)+1)}function sd(){var e=[];function t(l,d,c,u){o(l,d,function(p,b,v){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,b,c,u):p.removeListener.bind(p,c);g?p.addEventListener(b,c,u):p.addListener(c),e.push([p,b,v,c,h])})}function n(l,d,c){o(l,d,function(u,p,b){e=e.filter(function(v){return v[0]===u&&v[1]===p&&v[2]===b&&(!c||v[3]===c)?(v[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(b){var v=b.split(".");c(u,v[0],v[1])})})})}function r(){e.forEach(function(l){l[4]()}),zn(e)}return{bind:t,unbind:n,dispatch:i,destroy:r}}var si="mounted",ts="ready",Bn="move",po="moved",Ps="click",ld="active",cd="inactive",dd="visible",ud="hidden",Qt="refresh",cn="updated",Zi="resize",Kr="resized",pd="drag",md="dragging",gd="dragged",Zr="scroll",Ii="scrolled",Ap="overflow",ks="destroy",hd="arrows:mounted",fd="arrows:updated",yd="pagination:mounted",vd="pagination:updated",As="navigation:mounted",Fs="autoplay:play",xd="autoplay:playing",_s="autoplay:pause",Ws="lazyload:loaded",bd="sk",wd="sh",Or="ei";function Kt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=sd();function i(r,l){n.bind(t,Xo(r).join(" "),function(d){l.apply(l,Cs(d.detail)?d.detail:[])})}function o(r){n.dispatch(t,r,ai(arguments,1))}return e&&e.event.on(ks,n.destroy),_o(n,{bus:t,on:i,off:Ut(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?ni((o()-r)/e,1):1,n&&n(l),l>=1&&(t(),r=o(),i&&++u>=i))return v();d=ll(p)}}function b(S){S||h(),r=o()-(S?l*e:0),c=!1,d=ll(p)}function v(){c=!0}function g(){r=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function f(S){e=S}function x(){return c}return{start:b,rewind:g,pause:v,cancel:h,set:f,isPaused:x}}function Fp(e){var t=e;function n(o){t=o}function i(o){return Ls(Xo(o),t)}return{set:n,is:i}}function _p(e,t){var n=Jr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Wp(e,t,n){var i=e.state,o=n.breakpoints||{},r=n.reducedMotion||{},l=sd(),d=[];function c(){var h=n.mediaQuery==="min";Fo(o).sort(function(f,x){return h?+f-+x:+x-+f}).forEach(function(f){p(o[f],"("+(h?"min":"max")+"-width:"+f+"px)")}),p(r,sl),b()}function u(h){h&&l.destroy()}function p(h,f){var x=matchMedia(f);l.bind(x,"change",b),d.push([h,x])}function b(){var h=i.is(Wr),f=n.direction,x=d.reduce(function(S,y){return Kn(S,y[1].matches?y[0]:{})},{});cl(n),g(x),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):f!==n.direction&&e.refresh()}function v(h){matchMedia(sl).matches&&(h?Kn(n,r):cl(n,Fo(r)))}function g(h,f,x){Kn(n,h),f&&Kn(Object.getPrototypeOf(n),h),(x||!i.is(ji))&&e.emit(cn,n)}return{setup:c,destroy:u,reduce:v,set:g}}var Qr="Arrow",ea=Qr+"Left",ta=Qr+"Right",Sd=Qr+"Up",$d=Qr+"Down",pl="rtl",na="ttb",ha={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Sd,ta],ArrowRight:[$d,ea]};function Np(e,t,n){function i(r,l,d){d=d||n.direction;var c=d===pl&&!l?1:d===na?0:-1;return ha[r]&&ha[r][c]||r.replace(/width|left|right/i,function(u,p){var b=ha[u.toLowerCase()][c]||u;return p>0?b.charAt(0).toUpperCase()+b.slice(1):b})}function o(r){return r*(n.direction===pl?1:-1)}return{resolve:i,orient:o}}var On="role",qi="tabindex",Hp="disabled",Cn="aria-",Zo=Cn+"controls",Cd=Cn+"current",ml=Cn+"selected",vn=Cn+"label",Ns=Cn+"labelledby",Td=Cn+"hidden",Hs=Cn+"orientation",Ho=Cn+"roledescription",gl=Cn+"live",hl=Cn+"busy",fl=Cn+"atomic",Os=[On,qi,Hp,Zo,Cd,vn,Ns,Td,Hs,Ho],Fn=Ko+"__",li="is-",fa=Ko,yl=Fn+"track",Op=Fn+"list",ia=Fn+"slide",Ld=ia+"--clone",Dp=ia+"__container",Ds=Fn+"arrows",oa=Fn+"arrow",Rd=oa+"--prev",Id=oa+"--next",ra=Fn+"pagination",Ed=ra+"__page",jp=Fn+"progress",zp=jp+"__bar",Bp=Fn+"toggle",Vp=Fn+"spinner",Gp=Fn+"sr",qp=li+"initialized",Li=li+"active",Md=li+"prev",Pd=li+"next",ns=li+"visible",is=li+"loading",kd=li+"focus-in",Ad=li+"overflow",Xp=[Li,ns,Md,Pd,is,kd,Ad],Up={slide:ia,clone:Ld,arrows:Ds,arrow:oa,prev:Rd,next:Id,pagination:ra,page:Ed,spinner:Vp};function Yp(e,t){if(ed(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!Ao(n,t);)n=n.parentElement;return n}var Kp=5,vl=200,Fd="touchstart mousedown",ya="touchmove mousemove",va="touchend touchcancel mouseup click";function Zp(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],b=[],v,g,h;function f(){w(),H(),y()}function x(){o(Qt,S),o(Qt,f),o(cn,y),r(document,Fd+" keydown",function(O){h=O.type==="keydown"},{capture:!0}),r(l,"focusin",function(){Nn(l,kd,!!h)})}function S(O){var C=Os.concat("style");zn(u),Hn(l,p),Hn(v,b),kn([v,g],C),kn(l,O?C:["style",Ho])}function y(){Hn(l,p),Hn(v,b),p=Y(fa),b=Y(yl),Pn(l,p),Pn(v,b),Ct(l,vn,n.label),Ct(l,Ns,n.labelledby)}function w(){v=N("."+yl),g=Yo(v,"."+Op),Io(v&&g,"A track/list element is missing."),Mr(u,nd(g,"."+ia+":not(."+Ld+")")),$i({arrows:Ds,pagination:ra,prev:Rd,next:Id,bar:zp,toggle:Bp},function(O,C){c[C]=N("."+O)}),_o(c,{root:l,track:v,list:g,slides:u})}function H(){var O=l.id||kp(Ko),C=n.role;l.id=O,v.id=v.id||O+"-track",g.id=g.id||O+"-list",!$n(l,On)&&l.tagName!=="SECTION"&&C&&Ct(l,On,C),Ct(l,Ho,d.carousel),Ct(g,On,"presentation")}function N(O){var C=rd(l,O);return C&&Yp(C,"."+fa)===l?C:void 0}function Y(O){return[O+"--"+n.type,O+"--"+n.direction,n.drag&&O+"--draggable",n.isNavigation&&O+"--nav",O===fa&&Li]}return _o(c,{setup:f,mount:x,destroy:S})}var Ji="slide",mo="loop",Jo="fade";function Jp(e,t,n,i){var o=Kt(e),r=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,b=p.isNavigation,v=p.updateOnMove,g=p.i18n,h=p.pagination,f=p.slideFocus,x=c.Direction.resolve,S=$n(i,"style"),y=$n(i,vn),w=n>-1,H=Yo(i,"."+Dp),N;function Y(){w||(i.id=u.id+"-slide"+Ms(t+1),Ct(i,On,h?"tabpanel":"group"),Ct(i,Ho,g.slide),Ct(i,vn,y||es(g.slideLabel,[t+1,e.length]))),O()}function O(){d(i,"click",Ut(l,Ps,ne)),d(i,"keydown",Ut(l,bd,ne)),r([po,wd,Ii],R),r(As,V),v&&r(Bn,$)}function C(){N=!0,o.destroy(),Hn(i,Xp),kn(i,Os),Ct(i,"style",S),Ct(i,vn,y||"")}function V(){var I=e.splides.map(function(W){var K=W.splide.Components.Slides.getAt(t);return K?K.slide.id:""}).join(" ");Ct(i,vn,es(g.slideX,(w?n:t)+1)),Ct(i,Zo,I),Ct(i,On,f?"button":""),f&&kn(i,Ho)}function $(){N||R()}function R(){if(!N){var I=e.index;k(),T(),Nn(i,Md,t===I-1),Nn(i,Pd,t===I+1)}}function k(){var I=M();I!==dl(i,Li)&&(Nn(i,Li,I),Ct(i,Cd,b&&I||""),l(I?ld:cd,ne))}function T(){var I=E(),W=!I&&(!M()||w);if(e.state.is([uo,Go])||Ct(i,Td,W||""),Ct(Is(i,p.focusableNodes||""),qi,W?-1:""),f&&Ct(i,qi,W?-1:0),I!==dl(i,ns)&&(Nn(i,ns,I),l(I?dd:ud,ne)),!I&&document.activeElement===i){var K=c.Slides.getAt(e.index);K&&id(K.slide)}}function m(I,W,K){Sn(K&&H||i,I,W)}function M(){var I=e.index;return I===t||p.cloneStatus&&I===n}function E(){if(e.is(Jo))return M();var I=fn(c.Elements.track),W=fn(i),K=x("left",!0),ae=x("right",!0);return Hr(I[K])<=No(W[K])&&Hr(W[ae])<=No(I[ae])}function z(I,W){var K=un(I-t);return!w&&(p.rewind||e.is(mo))&&(K=ni(K,e.length-K)),K<=W}var ne={index:t,slideIndex:n,slide:i,container:H,isClone:w,mount:Y,destroy:C,update:R,style:m,isWithin:z};return ne}function Qp(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function b(){v(),o(Qt,g),o(Qt,v)}function v(){c.forEach(function(R,k){f(R,k,-1)})}function g(){N(function(R){R.destroy()}),zn(p)}function h(){N(function(R){R.update()})}function f(R,k,T){var m=Jp(e,k,T,R);m.mount(),p.push(m),p.sort(function(M,E){return M.index-E.index})}function x(R){return R?Y(function(k){return!k.isClone}):p}function S(R){var k=t.Controller,T=k.toIndex(R),m=k.hasFocus()?1:n.perPage;return Y(function(M){return Pr(M.index,T,T+m-1)})}function y(R){return Y(R)[0]}function w(R,k){bn(R,function(T){if(ti(T)&&(T=od(T)),td(T)){var m=c[k];m?Rs(T,m):Uo(u,T),Pn(T,n.classes.slide),C(T,Ut(r,Zi))}}),r(Qt)}function H(R){Ti(Y(R).map(function(k){return k.slide})),r(Qt)}function N(R,k){x(k).forEach(R)}function Y(R){return p.filter(ed(R)?R:function(k){return ti(R)?Ao(k.slide,R):Ls(Xo(R),k.index)})}function O(R,k,T){N(function(m){m.style(R,k,T)})}function C(R,k){var T=Is(R,"img"),m=T.length;m?T.forEach(function(M){l(M,"load error",function(){--m||k()})}):k()}function V(R){return R?c.length:p.length}function $(){return p.length>n.perPage}return{mount:b,destroy:g,update:h,register:f,get:x,getIn:S,getAt:y,add:w,remove:H,forEach:N,filter:Y,style:O,getLength:V,isEnough:$}}function em(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,b=u.track,v=u.list,g=d.getAt,h=d.style,f,x,S;function y(){w(),r(window,"resize load",_p(Ut(l,Zi))),o([cn,Qt],w),o(Zi,H)}function w(){f=n.direction===na,Sn(p,"maxWidth",pi(n.width)),Sn(b,c("paddingLeft"),N(!1)),Sn(b,c("paddingRight"),N(!0)),H(!0)}function H(ne){var I=fn(p);(ne||x.width!==I.width||x.height!==I.height)&&(Sn(b,"height",Y()),h(c("marginRight"),pi(n.gap)),h("width",C()),h("height",V(),!0),x=I,l(Kr),S!==(S=z())&&(Nn(p,Ad,S),l(Ap,S)))}function N(ne){var I=n.padding,W=c(ne?"right":"left");return I&&pi(I[W]||(ko(I)?0:I))||"0px"}function Y(){var ne="";return f&&(ne=O(),Io(ne,"height or heightRatio is missing."),ne="calc("+ne+" - "+N(!1)+" - "+N(!0)+")"),ne}function O(){return pi(n.height||fn(v).width*n.heightRatio)}function C(){return n.autoWidth?null:pi(n.fixedWidth)||(f?"":$())}function V(){return pi(n.fixedHeight)||(f?n.autoHeight?null:$():O())}function $(){var ne=pi(n.gap);return"calc((100%"+(ne&&" + "+ne)+")/"+(n.perPage||1)+(ne&&" - "+ne)+")"}function R(){return fn(v)[c("width")]}function k(ne,I){var W=g(ne||0);return W?fn(W.slide)[c("width")]+(I?0:M()):0}function T(ne,I){var W=g(ne);if(W){var K=fn(W.slide)[c("right")],ae=fn(v)[c("left")];return un(K-ae)+(I?0:M())}return 0}function m(ne){return T(e.length-1)-T(0)+k(0,ne)}function M(){var ne=g(0);return ne&&parseFloat(Sn(ne.slide,c("marginRight")))||0}function E(ne){return parseFloat(Sn(b,c("padding"+(ne?"Right":"Left"))))||0}function z(){return e.is(Jo)||m(!0)>R()}return{mount:y,resize:H,listSize:R,slideSize:k,sliderSize:m,totalSize:T,getPadding:E,isOverflow:z}}var tm=2;function nm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,b),o([cn,Zi],g),(u=x())&&(h(u),t.Layout.resize(!0))}function b(){v(),p()}function v(){Ti(c),zn(c),i.destroy()}function g(){var S=x();u!==S&&(u<S||!S)&&i.emit(Qt)}function h(S){var y=l.get().slice(),w=y.length;if(w){for(;y.length<S;)Mr(y,y);Mr(y.slice(-S),y.slice(0,S)).forEach(function(H,N){var Y=N<S,O=f(H.slide,N);Y?Rs(O,y[0].slide):Uo(r.list,O),Mr(c,O),l.register(O,N-S+(Y?0:w),H.index)})}}function f(S,y){var w=S.cloneNode(!0);return Pn(w,n.classes.clone),w.id=e.root.id+"-clone"+Ms(y+1),w}function x(){var S=n.clones;if(!e.is(mo))S=0;else if(qo(S)){var y=n[d("fixedWidth")]&&t.Layout.slideSize(0),w=y&&No(fn(r.track)[d("width")]/y);S=w||n[d("autoWidth")]&&e.length||n.perPage*tm}return S}return{mount:p,destroy:v}}function im(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,b=d.listSize,v=d.sliderSize,g=t.Direction,h=g.resolve,f=g.orient,x=t.Elements,S=x.list,y=x.track,w;function H(){w=t.Transition,o([si,Kr,cn,Qt],N)}function N(){t.Controller.isBusy()||(t.Scroll.cancel(),O(e.index),t.Slides.update())}function Y(W,K,ae,de){W!==K&&ne(W>ae)&&(R(),C($(m(),W>ae),!0)),l(uo),r(Bn,K,ae,W),w.start(K,function(){l(Ki),r(po,K,ae,W),de&&de()})}function O(W){C(T(W,!0))}function C(W,K){if(!e.is(Jo)){var ae=K?W:V(W);Sn(S,"transform","translate"+h("X")+"("+ae+"px)"),W!==ae&&r(wd)}}function V(W){if(e.is(mo)){var K=k(W),ae=K>t.Controller.getEnd(),de=K<0;(de||ae)&&(W=$(W,ae))}return W}function $(W,K){var ae=W-z(K),de=v();return W-=f(de*(No(un(ae)/de)||1))*(K?1:-1),W}function R(){C(m(),!0),w.cancel()}function k(W){for(var K=t.Slides.get(),ae=0,de=1/0,A=0;A<K.length;A++){var he=K[A].index,q=un(T(he,!0)-W);if(q<=de)de=q,ae=he;else break}return ae}function T(W,K){var ae=f(p(W-1)-E(W));return K?M(ae):ae}function m(){var W=h("left");return fn(S)[W]-fn(y)[W]+f(u(!1))}function M(W){return n.trimSpace&&e.is(Ji)&&(W=Ni(W,0,f(v(!0)-b()))),W}function E(W){var K=n.focus;return K==="center"?(b()-c(W,!0))/2:+K*c(W)||0}function z(W){return T(W?t.Controller.getEnd():0,!!n.trimSpace)}function ne(W){var K=f($(m(),W));return W?K>=0:K<=S[h("scrollWidth")]-fn(y)[h("width")]}function I(W,K){K=qo(K)?m():K;var ae=W!==!0&&f(K)<f(z(!1)),de=W!==!1&&f(K)>f(z(!0));return ae||de}return{mount:H,move:Y,jump:O,translate:C,shift:$,cancel:R,toIndex:k,toPosition:T,getPosition:m,getLimit:z,exceededLimit:I,reposition:N}}function om(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,b=p.isEnough,v=p.getLength,g=n.omitEnd,h=e.is(mo),f=e.is(Ji),x=Ut(m,!1),S=Ut(m,!0),y=n.start||0,w,H=y,N,Y,O;function C(){V(),o([cn,Qt,Or],V),o(Kr,$)}function V(){N=v(!0),Y=n.perMove,O=n.perPage,w=ne();var q=Ni(y,0,g?w:N-1);q!==y&&(y=q,l.reposition())}function $(){w!==ne()&&r(Or)}function R(q,ce,Q){if(!he()){var be=T(q),He=z(be);He>-1&&(ce||He!==y)&&(ae(He),l.move(be,He,H,Q))}}function k(q,ce,Q,be){t.Scroll.scroll(q,ce,Q,function(){var He=z(l.toIndex(d()));ae(g?ni(He,w):He),be&&be()})}function T(q){var ce=y;if(ti(q)){var Q=q.match(/([+\-<>])(\d+)?/)||[],be=Q[1],He=Q[2];be==="+"||be==="-"?ce=M(y+ +(""+be+(+He||1)),y):be===">"?ce=He?I(+He):x(!0):be==="<"&&(ce=S(!0))}else ce=h?q:Ni(q,0,w);return ce}function m(q,ce){var Q=Y||(A()?1:O),be=M(y+Q*(q?-1:1),y,!(Y||A()));return be===-1&&f&&!ad(d(),c(!q),1)?q?0:w:ce?be:z(be)}function M(q,ce,Q){if(b()||A()){var be=E(q);be!==q&&(ce=q,q=be,Q=!1),q<0||q>w?!Y&&(Pr(0,q,ce,!0)||Pr(w,ce,q,!0))?q=I(W(q)):h?q=Q?q<0?-(N%O||O):N:q:n.rewind?q=q<0?w:0:q=-1:Q&&q!==ce&&(q=I(W(ce)+(q<ce?-1:1)))}else q=-1;return q}function E(q){if(f&&n.trimSpace==="move"&&q!==y)for(var ce=d();ce===u(q,!0)&&Pr(q,0,e.length-1,!n.rewind);)q<y?--q:++q;return q}function z(q){return h?(q+N)%N||0:q}function ne(){for(var q=N-(A()||h&&Y?1:O);g&&q-- >0;)if(u(N-1,!0)!==u(q,!0)){q++;break}return Ni(q,0,N-1)}function I(q){return Ni(A()?q:O*q,0,w)}function W(q){return A()?ni(q,w):Hr((q>=w?N-1:q)/O)}function K(q){var ce=l.toIndex(q);return f?Ni(ce,0,w):ce}function ae(q){q!==y&&(H=y,y=q)}function de(q){return q?H:y}function A(){return!qo(n.focus)||n.isNavigation}function he(){return e.state.is([uo,Go])&&!!n.waitForTransition}return{mount:C,go:R,scroll:k,getNext:x,getPrev:S,getAdjacent:m,getEnd:ne,setIndex:ae,getIndex:de,toIndex:I,toPage:W,toDest:K,hasFocus:A,isBusy:he}}var rm="http://www.w3.org/2000/svg",am="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z",ar=40;function sm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,b=u.arrows,v=u.track,g=b,h=u.prev,f=u.next,x,S,y={};function w(){N(),o(cn,H)}function H(){Y(),w()}function N(){var k=n.arrows;k&&!(h&&f)&&V(),h&&f&&(_o(y,{prev:h,next:f}),Wo(g,k?"":"none"),Pn(g,S=Ds+"--"+n.direction),k&&(O(),R(),Ct([h,f],Zo,v.id),l(hd,h,f)))}function Y(){i.destroy(),Hn(g,S),x?(Ti(b?[h,f]:g),h=f=null):kn([h,f],Os)}function O(){o([si,po,Qt,Ii,Or],R),r(f,"click",Ut(C,">")),r(h,"click",Ut(C,"<"))}function C(k){p.go(k,!0)}function V(){g=b||Gi("div",d.arrows),h=$(!0),f=$(!1),x=!0,Uo(g,[h,f]),!b&&Rs(g,v)}function $(k){var T='<button class="'+d.arrow+" "+(k?d.prev:d.next)+'" type="button"><svg xmlns="'+rm+'" viewBox="0 0 '+ar+" "+ar+'" width="'+ar+'" height="'+ar+'" focusable="false"><path d="'+(n.arrowPath||am)+'" />';return od(T)}function R(){if(h&&f){var k=e.index,T=p.getPrev(),m=p.getNext(),M=T>-1&&k<T?c.last:c.prev,E=m>-1&&k>m?c.first:c.next;h.disabled=T<0,f.disabled=m<0,Ct(h,vn,M),Ct(f,vn,E),l(fd,h,f,T,m)}}return{arrows:y,mount:w,destroy:Y,update:R}}var lm=Es+"-interval";function cm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.emit,d=Jr(n.interval,e.go.bind(e,">"),O),c=d.isPaused,u=t.Elements,p=t.Elements,b=p.root,v=p.toggle,g=n.autoplay,h,f,x=g==="pause";function S(){g&&(y(),v&&Ct(v,Zo,u.track.id),x||w(),Y())}function y(){n.pauseOnHover&&r(b,"mouseenter mouseleave",function(V){h=V.type==="mouseenter",N()}),n.pauseOnFocus&&r(b,"focusin focusout",function(V){f=V.type==="focusin",N()}),v&&r(v,"click",function(){x?w():H(!0)}),o([Bn,Zr,Qt],d.rewind),o(Bn,C)}function w(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),f=h=x=!1,Y(),l(Fs))}function H(V){V===void 0&&(V=!0),x=!!V,Y(),c()||(d.pause(),l(_s))}function N(){x||(h||f?H(!1):w())}function Y(){v&&(Nn(v,Li,!x),Ct(v,vn,n.i18n[x?"play":"pause"]))}function O(V){var $=u.bar;$&&Sn($,"width",V*100+"%"),l(xd,V)}function C(V){var $=t.Slides.getAt(V);d.set($&&+$n($.slide,lm)||n.interval)}return{mount:S,destroy:d.cancel,play:w,pause:H,isPaused:c}}function dm(e,t,n){var i=Kt(e),o=i.on;function r(){n.cover&&(o(Ws,Ut(d,!0)),o([si,cn,Qt],Ut(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Yo(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),Wo(u,c?"none":"")}return{mount:r,destroy:Ut(l,!1)}}var um=10,pm=600,mm=.6,gm=1.5,hm=800;function fm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,b=d.translate,v=e.is(Ji),g,h,f=1;function x(){o(Bn,H),o([cn,Qt],N)}function S(O,C,V,$,R){var k=c();if(H(),V&&(!v||!p())){var T=t.Layout.sliderSize(),m=Qa(O)*T*Hr(un(O)/T)||0;O=d.toPosition(t.Controller.toDest(O%T))+m}var M=ad(k,O,1);f=1,C=M?0:C||Nr(un(O-k)/gm,hm),h=$,g=Jr(C,y,Ut(w,k,O,R),1),l(Go),r(Zr),g.start()}function y(){l(Ki),h&&h(),r(Ii)}function w(O,C,V,$){var R=c(),k=O+(C-O)*Y($),T=(k-R)*f;b(R+T),v&&!V&&p()&&(f*=mm,un(T)<um&&S(u(p(!0)),pm,!1,h,!0))}function H(){g&&g.cancel()}function N(){g&&!g.isPaused()&&(H(),y())}function Y(O){var C=n.easingFunc;return C?C(O):1-Math.pow(1-O,4)}return{mount:x,destroy:H,scroll:S,cancel:N}}var Hi={passive:!1,capture:!0};function ym(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,b=t.Controller,v=t.Elements.track,g=t.Media.reduce,h=t.Direction,f=h.resolve,x=h.orient,S=u.getPosition,y=u.exceededLimit,w,H,N,Y,O,C=!1,V,$,R;function k(){l(v,ya,Za,Hi),l(v,va,Za,Hi),l(v,Fd,m,Hi),l(v,"click",z,{capture:!0}),l(v,"dragstart",Wn),o([si,cn],T)}function T(){var ee=n.drag;le(!ee),Y=ee==="free"}function m(ee){if(V=!1,!$){var ue=He(ee);be(ee.target)&&(ue||!ee.button)&&(b.isBusy()?Wn(ee,!0):(R=ue?v:window,O=c.is([uo,Go]),N=null,l(R,ya,M,Hi),l(R,va,E,Hi),u.cancel(),p.cancel(),ne(ee)))}}function M(ee){if(c.is(Er)||(c.set(Er),r(pd)),ee.cancelable)if(O){u.translate(w+Q(A(ee)));var ue=he(ee)>vl,oe=C!==(C=y());(ue||oe)&&ne(ee),V=!0,r(md),Wn(ee)}else K(ee)&&(O=W(ee),Wn(ee))}function E(ee){c.is(Er)&&(c.set(Ki),r(gd)),O&&(I(ee),Wn(ee)),d(R,ya,M),d(R,va,E),O=!1}function z(ee){!$&&V&&Wn(ee,!0)}function ne(ee){N=H,H=ee,w=S()}function I(ee){var ue=ae(ee),oe=de(ue),Fe=n.rewind&&n.rewindByDrag;g(!1),Y?b.scroll(oe,0,n.snap):e.is(Jo)?b.go(x(Qa(ue))<0?Fe?"<":"-":Fe?">":"+"):e.is(Ji)&&C&&Fe?b.go(y(!0)?">":"<"):b.go(b.toDest(oe),!0),g(!0)}function W(ee){var ue=n.dragMinThreshold,oe=ko(ue),Fe=oe&&ue.mouse||0,Ce=(oe?ue.touch:+ue)||10;return un(A(ee))>(He(ee)?Ce:Fe)}function K(ee){return un(A(ee))>un(A(ee,!0))}function ae(ee){if(e.is(mo)||!C){var ue=he(ee);if(ue&&ue<vl)return A(ee)/ue}return 0}function de(ee){return S()+Qa(ee)*ni(un(ee)*(n.flickPower||600),Y?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function A(ee,ue){return ce(ee,ue)-ce(q(ee),ue)}function he(ee){return Ja(ee)-Ja(q(ee))}function q(ee){return H===ee&&N||H}function ce(ee,ue){return(He(ee)?ee.changedTouches[0]:ee)["page"+f(ue?"Y":"X")]}function Q(ee){return ee/(C&&e.is(Ji)?Kp:1)}function be(ee){var ue=n.noDrag;return!Ao(ee,"."+Ed+", ."+oa)&&(!ue||!Ao(ee,ue))}function He(ee){return typeof TouchEvent<"u"&&ee instanceof TouchEvent}function xe(){return O}function le(ee){$=ee}return{mount:k,disable:le,isDragging:xe}}var vm={Spacebar:" ",Right:ta,Left:ea,Up:Sd,Down:$d};function js(e){return e=ti(e)?e:e.key,vm[e]||e}var xl="keydown";function xm(e,t,n){var i=Kt(e),o=i.on,r=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function b(){v(),o(cn,g),o(cn,v),o(Bn,f)}function v(){var S=n.keyboard;S&&(u=S==="global"?window:d,r(u,xl,x))}function g(){l(u,xl)}function h(S){p=S}function f(){var S=p;p=!0,Qc(function(){p=S})}function x(S){if(!p){var y=js(S);y===c(ea)?e.go("<"):y===c(ta)&&e.go(">")}}return{mount:b,destroy:g,disable:h}}var Eo=Es+"-lazy",kr=Eo+"-srcset",bm="["+Eo+"], ["+kr+"]";function wm(e,t,n){var i=Kt(e),o=i.on,r=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[po,Ii],p=[];function b(){n.lazyLoad&&(v(),o(Qt,v))}function v(){zn(p),g(),c?S():(r(u),o(u,h),h())}function g(){t.Slides.forEach(function(y){Is(y.slide,bm).forEach(function(w){var H=$n(w,Eo),N=$n(w,kr);if(H!==w.src||N!==w.srcset){var Y=n.classes.spinner,O=w.parentElement,C=Yo(O,"."+Y)||Gi("span",Y,O);p.push([w,y,C]),w.src||Wo(w,"none")}})})}function h(){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];Pn(y[1].slide,is),l(w,"load error",Ut(x,y)),Ct(w,"src",$n(w,Eo)),Ct(w,"srcset",$n(w,kr)),kn(w,Eo),kn(w,kr)}function x(y,w){var H=y[0],N=y[1];Hn(N.slide,is),w.type!=="error"&&(Ti(y[2]),Wo(H,""),d(Ws,H,N),d(Zi)),c&&S()}function S(){p.length&&f(p.shift())}return{mount:b,destroy:Ut(zn,p),check:h}}function Sm(e,t,n){var i=Kt(e),o=i.on,r=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,b=u.getIndex,v=u.go,g=t.Direction.resolve,h=c.pagination,f=[],x,S;function y(){w(),o([cn,Qt,Or],y);var $=n.pagination;h&&Wo(h,$?"":"none"),$&&(o([Bn,Zr,Ii],V),H(),V(),r(yd,{list:x,items:f},C(e.index)))}function w(){x&&(Ti(h?ai(x.children):x),Hn(x,S),zn(f),x=null),i.destroy()}function H(){var $=e.length,R=n.classes,k=n.i18n,T=n.perPage,m=p()?u.getEnd()+1:No($/T);x=h||Gi("ul",R.pagination,c.track.parentElement),Pn(x,S=ra+"--"+O()),Ct(x,On,"tablist"),Ct(x,vn,k.select),Ct(x,Hs,O()===na?"vertical":"");for(var M=0;M<m;M++){var E=Gi("li",null,x),z=Gi("button",{class:R.page,type:"button"},E),ne=d.getIn(M).map(function(W){return W.slide.id}),I=!p()&&T>1?k.pageX:k.slideX;l(z,"click",Ut(N,M)),n.paginationKeyboard&&l(z,"keydown",Ut(Y,M)),Ct(E,On,"presentation"),Ct(z,On,"tab"),Ct(z,Zo,ne.join(" ")),Ct(z,vn,es(I,M+1)),Ct(z,qi,-1),f.push({li:E,button:z,page:M})}}function N($){v(">"+$,!0)}function Y($,R){var k=f.length,T=js(R),m=O(),M=-1;T===g(ta,!1,m)?M=++$%k:T===g(ea,!1,m)?M=(--$+k)%k:T==="Home"?M=0:T==="End"&&(M=k-1);var E=f[M];E&&(id(E.button),v(">"+M),Wn(R,!0))}function O(){return n.paginationDirection||n.direction}function C($){return f[u.toPage($)]}function V(){var $=C(b(!0)),R=C(b());if($){var k=$.button;Hn(k,Li),kn(k,ml),Ct(k,qi,-1)}if(R){var T=R.button;Pn(T,Li),Ct(T,ml,!0),Ct(T,qi,"")}r(vd,{list:x,items:f},$,R)}return{items:f,mount:y,destroy:w,getAt:C,update:V}}var $m=[" ","Enter"];function Cm(e,t,n){var i=n.isNavigation,o=n.slideFocus,r=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){r.forEach(function(h){h.destroy()}),zn(r)}function c(){d(),l()}function u(h,f){var x=Kt(h);x.on(Bn,function(S,y,w){f.go(f.is(mo)?w:S)}),r.push(x)}function p(){var h=Kt(e),f=h.on;f(Ps,v),f(bd,g),f([si,cn],b),r.push(h),h.emit(As,e.splides)}function b(){Ct(t.Elements.list,Hs,n.direction===na?"vertical":"")}function v(h){e.go(h.index)}function g(h,f){Ls($m,js(f))&&(v(h),Wn(f))}return{setup:Ut(t.Media.set,{slideFocus:qo(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Tm(e,t,n){var i=Kt(e),o=i.bind,r=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Hi)}function d(u){if(u.cancelable){var p=u.deltaY,b=p<0,v=Ja(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;un(p)>g&&v-r>h&&(e.go(b?"<":">"),r=v),c(b)&&Wn(u)}}function c(u){return!n.releaseWheel||e.state.is(uo)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Lm=90;function Rm(e,t,n){var i=Kt(e),o=i.on,r=t.Elements.track,l=n.live&&!n.isNavigation,d=Gi("span",Gp),c=Jr(Lm,Ut(p,!1));function u(){l&&(v(!t.Autoplay.isPaused()),Ct(r,fl,!0),d.textContent="…",o(Fs,Ut(v,!0)),o(_s,Ut(v,!1)),o([po,Ii],Ut(p,!0)))}function p(g){Ct(r,hl,g),g?(Uo(r,d),c.start()):(Ti(d),c.cancel())}function b(){kn(r,[gl,fl,hl]),Ti(d)}function v(g){l&&Ct(r,gl,g?"off":"polite")}return{mount:u,disable:v,destroy:b}}var Im=Object.freeze({__proto__:null,Media:Wp,Direction:Np,Elements:Zp,Slides:Qp,Layout:em,Clones:nm,Move:im,Controller:om,Arrows:sm,Autoplay:cm,Cover:dm,Scroll:fm,Drag:ym,Keyboard:xm,LazyLoad:wm,Pagination:Sm,Sync:Cm,Wheel:Tm,Live:Rm}),Em={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"},Mm={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:Up,i18n:Em,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Pm(e,t,n){var i=t.Slides;function o(){Kt(e).on([si,Qt],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),Qc(c)}return{mount:o,start:l,cancel:Za}}function km(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(){Kt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(b(),c())})}function p(g,h){var f=i.toPosition(g,!0),x=i.getPosition(),S=v(g);un(f-x)>=1&&S>=1?n.useScroll?r.scroll(f,S,!1,h):(d("transform "+S+"ms "+n.easing),i.translate(f,!0),c=h):(i.jump(g),h())}function b(){d(""),r.cancel()}function v(g){var h=n.rewindSpeed;if(e.is(Ji)&&h){var f=o.getIndex(!0),x=o.getEnd();if(f===0&&g>=x||f>=x&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:b}}var Am=(function(){function e(n,i){this.event=Kt(),this.Components={},this.state=Fp(ji),this.splides=[],this._o={},this._E={};var o=ti(n)?rd(document,n):n;Io(o,o+" is invalid."),this.root=o,i=Kn({label:$n(o,vn)||"",labelledby:$n(o,Ns)||""},Mm,e.defaults,i||{});try{Kn(i,JSON.parse($n(o,Es)))}catch{Io(!1,"Invalid JSON")}this._o=Object.create(Kn({},i))}var t=e.prototype;return t.mount=function(i,o){var r=this,l=this.state,d=this.Components;Io(l.is([ji,Wr]),"Already mounted!"),l.set(ji),this._C=d,this._T=o||this._T||(this.is(Jo)?Pm:km),this._E=i||this._E;var c=_o({},Im,this._E,{Transition:this._T});return $i(c,function(u,p){var b=u(r,d,r._o);d[p]=b,b.setup&&b.setup()}),$i(d,function(u){u.mount&&u.mount()}),this.emit(si),Pn(this.root,qp),l.set(Ki),this.emit(ts),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(Ki)&&(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(ai(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(Qt),this},t.destroy=function(i){i===void 0&&(i=!0);var o=this.event,r=this.state;return r.is(ji)?Kt(this).on(ts,this.destroy.bind(this,i)):($i(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(ks),o.destroy(),i&&zn(this.splides),r.set(Wr)),this},Ep(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})(),zs=Am;zs.defaults={};zs.STATES=Pp;var bl=[[si,"onMounted"],[ts,"onReady"],[Bn,"onMove"],[po,"onMoved"],[Ps,"onClick"],[ld,"onActive"],[cd,"onInactive"],[dd,"onVisible"],[ud,"onHidden"],[Qt,"onRefresh"],[cn,"onUpdated"],[Zi,"onResize"],[Kr,"onResized"],[pd,"onDrag"],[md,"onDragging"],[gd,"onDragged"],[Zr,"onScroll"],[Ii,"onScrolled"],[ks,"onDestroy"],[hd,"onArrowsMounted"],[fd,"onArrowsUpdated"],[yd,"onPaginationMounted"],[vd,"onPaginationUpdated"],[As,"onNavigationMounted"],[Fs,"onAutoplayPlay"],[xd,"onAutoplayPlaying"],[_s,"onAutoplayPause"],[Ws,"onLazyLoadLoaded"]];function Bs(...e){return e.filter(Boolean).join(" ")}function Dr(e){return e!==null&&typeof e=="object"}function os(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!os(n,t[i]));if(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)||!os(e[o],t[o]))}return e===t}function Fm(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function _m(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 rs(e,t){const n=e;return _m(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():Dr(i)?n[o]=rs(Dr(n[o])?n[o]:{},i):n[o]=i}),n}var Wm=({children:e,className:t,...n})=>s.createElement("div",{className:Bs("splide__track",t),...n},s.createElement("ul",{className:"splide__list"},e)),Vs=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 zs(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=rs({},e||{}),this.slides=this.getSlides())}componentWillUnmount(){this.splide&&(this.splide.destroy(),this.splide=void 0),this.options=void 0,this.slides.length=0}componentDidUpdate(){if(!this.splide)return;const{options:e}=this.props;e&&!os(this.options,e)&&(this.splide.options=e,this.options=rs({},e));const t=this.getSlides();Fm(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){bl.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:Bs("splide",e),ref:this.splideRef,...this.omit(o,["options",...bl.map(r=>r[1])])},n?s.createElement(Wm,null,i):i)}},Gs=({children:e,className:t,...n})=>s.createElement("li",{className:Bs("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 Fm="RichTextRenderer-module__link___BWeZ2",_m={link:Fm},Wm=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))},go=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Wm(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Yt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:go(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:O.scalingValue(e.letterSpacing,t),wordSpacing:O.scalingValue(e.wordSpacing,t),fontSize:O.scalingValue(n,t),lineHeight:i!==void 0?O.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 Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:_m.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Nm(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 Nm(e){return{...e.fontFamily&&{fontFamily:go(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 Hm="SvgImage-module__svg___q3xE-",Om="SvgImage-module__img___VsTm-",wl={svg:Hm,img:Om},Dm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},jm=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)}},[]),!Dm(e)||!r?a.jsx("img",{src:e,alt:"",className:ht(wl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:ht(wl.svg,i),style:{"--svg":jm(e),"--fill":t,"--hover-fill":n,...o??{}}})},zm={"top-left":mt.topLeftAlignment,"top-center":mt.topCenterAlignment,"top-right":mt.topRightAlignment,"middle-left":mt.middleLeftAlignment,"middle-center":mt.middleCenterAlignment,"middle-right":mt.middleRightAlignment,"bottom-left":mt.bottomLeftAlignment,"bottom-center":mt.bottomCenterAlignment,"bottom-right":mt.bottomRightAlignment};function Bm({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:y,color:g}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,S]=s.useState(null),[v,w]=s.useState(0),[H,N]=s.useState(0),{direction:Y,transition:D,controls:C,pagination:V,imageCaption:$,triggers:I}=e,k=s.useRef(D.type),{x:T,y:m}=e.controls.offset,M=E=>{o&&o.go(E)};return s.useEffect(()=>{if(!x)return;const E=new ResizeObserver(z=>{if(!o)return;const[ne]=z;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return E.observe(x),()=>E.unobserve(x)},[x]),s.useEffect(()=>{!o||k.current===D.type||(N(E=>E+1),k.current=D.type)},[D.type]),a.jsx("div",{className:ht(mt.wrapper,{[mt.editor]:i}),ref:S,children:a.jsxs("div",{className:mt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:D.backgroundColor&&D.type==="fade in"?D.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:ht(mt.captionBlock),children:a.jsx("div",{className:mt.captionTextWrapper,children:t.map((E,z)=>a.jsx("div",{className:ht(mt.captionText,zm[$.alignment],{[mt.withPointerEvents]:z===v&&i,[mt.active]:z===v}),style:{fontFamily:go(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":O.scalingValue(l.width,i),letterSpacing:O.scalingValue(c,i),wordSpacing:O.scalingValue(p,i),textAlign:u,fontSize:O.scalingValue(b.fontSize,i),lineHeight:O.scalingValue(b.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:D.duration?`${Math.round(parseInt(D.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:mt.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:O.scalingValue($.offset.y,i),left:O.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:E.imageCaption})})},z))})}),a.jsx(Vs,{onMove:E=>{w(E.index)},ref:r,options:{arrows:!1,speed:D.duration?parseInt(D.duration):500,autoplay:I.autoPlay!==null,...I.autoPlay!==null&&{interval:parseInt(I.autoPlay)*1e3},direction:Y==="horiz"||D.type==="fade in"?"ltr":"ttb",pagination:!1,drag:I.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:D.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((E,z)=>a.jsx(Gs,{children:a.jsx("div",{className:mt.sliderItem,children:a.jsx("div",{className:mt.imgWrapper,children:a.jsx("img",{className:ht(mt.sliderImage,{[mt.contain]:E.image.objectFit==="contain",[mt.cover]:E.image.objectFit==="cover"}),src:E.image.url,alt:E.image.name??""})})})},z))},H),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ht(mt.arrow,{[mt.arrowVertical]:Y==="vert",[mt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{M("-1")},className:mt.arrowInner,style:{transform:`translate(${O.scalingValue(T,i)}, ${O.scalingValue(m*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ht(mt.arrowImg,mt.mirror)}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:ht(mt.arrowIcon,mt.arrowImg,mt.mirror)})]})}),a.jsx("div",{className:ht(mt.arrow,mt.nextArrow,{[mt.arrowVertical]:Y==="vert",[mt.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:mt.arrowInner,onClick:()=>M("+1"),style:{transform:`translate(${O.scalingValue(T*(Y==="horiz"?-1:1),i)}, ${O.scalingValue(m,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:mt.arrowImg}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:ht(mt.arrowIcon,mt.arrowImg)})]})})]}),I.triggersList.click&&a.jsx("div",{className:mt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&a.jsx("div",{className:ht(mt.pagination,{[mt.paginationInsideBottom]:V.position==="inside-1"&&Y==="horiz",[mt.paginationInsideTop]:V.position==="inside-2"&&Y==="horiz",[mt.paginationOutsideBottom]:V.position==="outside-1"&&Y==="horiz",[mt.paginationOutsideTop]:V.position==="outside-2"&&Y==="horiz",[mt.paginationInsideLeft]:V.position==="inside-1"&&Y==="vert",[mt.paginationInsideRight]:V.position==="inside-2"&&Y==="vert",[mt.paginationOutsideLeft]:V.position==="outside-1"&&Y==="vert",[mt.paginationOutsideRight]:V.position==="outside-2"&&Y==="vert",[mt.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:mt.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${O.scalingValue(V.offset.x,i)}, ${O.scalingValue(V.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((E,z)=>a.jsx("button",{onClick:()=>{o&&o.go(z)},className:ht(mt.paginationItem),children:a.jsx("div",{className:ht(mt.dot,{[mt.activeDot]:z===v}),style:{backgroundColor:z===v?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},z))})})]})})}function Sl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Vm={element:Bm,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"]}},Gm="ImageRevealSlider-module__imageRevealSlider___UE5Ob",qm="ImageRevealSlider-module__image___Qjt-e",Xm="ImageRevealSlider-module__link___N-iLG",Um="ImageRevealSlider-module__cursor___2U03d",Pi={imageRevealSlider:Gm,image:qm,link:Xm,cursor:Um};function $l(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 Ym(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 Km({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,b]=s.useState({x:0,y:0}),[y,g]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[S,v]=s.useState(!1),{sizeType:w,imageWidth:H,randomRangeImageWidth:N}=e.imageSize,{revealPosition:Y,visible:D}=e.position,{cursorType:C,target:V,defaultCursorScale:$,defaultCursor:I,hoverCursorScale:k,hoverCursor:T}=e.cursor;s.useEffect(()=>{if(!i)return;const E=(R,W)=>{const K=i.getBoundingClientRect(),ae=R-K.left,de=W-K.top;if(b({x:ae,y:de}),C==="system"){f("none"),g(1);return}const A=ae,he=de,q=document.elementFromPoint(K.left+A,K.top+he);if(q&&q.closest("a")){f("none"),g(1);return}const ce=$l(A,he,r)||V==="area"?{img:T??"none",scale:k}:{img:I??"none",scale:$};f(ce.img),g(ce.scale)},z=R=>{R.stopPropagation(),x.current={x:R.clientX,y:R.clientY},E(R.clientX,R.clientY)},ne=()=>{S&&E(x.current.x,x.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ne,!0)}},[i,S,p,C,V,T,I,k,$,r]),s.useEffect(()=>{S||(f("none"),g(0))},[S]);const m=async(E,z,ne,R={})=>{const{width:W,height:K,finalWidth:ae}=await Ym(E.image.url,w,H,N);let de=0,A=0;Y==="same"?(de=z/2,A=ne/2):(de=R.x??Math.random()*z,A=R.y??Math.random()*ne);const he=Math.min(Math.max(de,W/2),z-W/2),q=Math.min(Math.max(A,K/2),ne-K/2);return{id:u.current++,url:E.image.url,link:E.link,name:E.image.name,x:he,y:q,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const E=i.getBoundingClientRect(),z=E.width,ne=E.height,R=[];(async()=>{const K=t[0],ae=await m(K,z,ne);R.push(ae),l(R),c(1)})()},[w,H,N,Y,i]),s.useEffect(()=>{D==="last One"&&l(E=>E.length>0?[E[E.length-1]]:[])},[D]);const M=async E=>{if(!i)return;const z=i.getBoundingClientRect(),ne=E.clientX-z.left,R=E.clientY-z.top;if(V==="image"&&!$l(ne,R,r))return;let W=0,K=0;Y==="on Click"?(W=ne,K=R):Y==="same"?(W=z.width/2,K=z.height/2):(W=Math.random()*z.width,K=Math.random()*z.height);const ae=t[d],de=await m(ae,z.width,z.height,{x:W,y:K});l(A=>D==="all"?[...A,de]:[de]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:M,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),className:Pi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(E=>a.jsx("div",{className:Pi.wrapper,style:{top:`${E.y}px`,left:`${E.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:E.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:V==="area"&&E.link?a.jsx("a",{href:E.link,target:"_blank",className:Pi.link,children:a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)}):a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)},E.id)),S&&a.jsx("div",{className:Pi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${y})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const Zm={element:Km,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:""}]}}}},Jm="LightBox-module__hidden___9s-9x",Qm="LightBox-module__heroImage___sTxNF",eg="LightBox-module__background___rm9ml",tg="LightBox-module__editor___4ACaY",ng="LightBox-module__contentStyle___Bgnsq",ig="LightBox-module__imageStyle___tLIlB",og="LightBox-module__imgWrapper___LuFUp",rg="LightBox-module__contain___8-yaS",ag="LightBox-module__cover___hNvOG",sg="LightBox-module__caption___b6L2I",lg="LightBox-module__captionTextInner___rCGNH",cg="LightBox-module__lightboxSplide___XFuWC",dg="LightBox-module__arrow___iz38X",ug="LightBox-module__arrowVertical___Zfz81",pg="LightBox-module__nextArrow___zkAQN",mg="LightBox-module__arrowInner___p48sW",gg="LightBox-module__arrowIcon___3VaFf",hg="LightBox-module__arrowImg___pNV88",fg="LightBox-module__mirror___pjeXc",yg="LightBox-module__thumbsWrapper___GB-nU",vg="LightBox-module__thumbsContainerVertical___wttk5",xg="LightBox-module__thumbsContainer___osSma",bg="LightBox-module__thumbsAlignStart___MO6tY",wg="LightBox-module__thumbsAlignCenter___Q4sUx",Sg="LightBox-module__thumbsAlignEnd___p4y9R",$g="LightBox-module__thumbItem___HvnF3",Cg="LightBox-module__closeButton___g2khP",Tg="LightBox-module__fadeIn___0m5GW",Lg="LightBox-module__slideInLeft___gPYwC",Rg="LightBox-module__slideInRight___S-pPp",Ig="LightBox-module__slideInTop___DFdAj",Eg="LightBox-module__slideInBottom___m27kZ",Mg="LightBox-module__fadeOut___55qBR",Pg="LightBox-module__slideOutLeft___NvU7P",kg="LightBox-module__slideOutRight___SK7eC",Ag="LightBox-module__slideOutTop___Vgg0z",Fg="LightBox-module__slideOutBottom___nJ0Ef",_g="LightBox-module__scaleSlide___vZriG",et={hidden:Jm,heroImage:Qm,background:eg,editor:tg,contentStyle:ng,imageStyle:ig,imgWrapper:og,contain:rg,cover:ag,caption:sg,captionTextInner:lg,lightboxSplide:cg,arrow:dg,arrowVertical:ug,nextArrow:pg,arrowInner:mg,arrowIcon:gg,arrowImg:hg,mirror:fg,thumbsWrapper:yg,thumbsContainerVertical:vg,thumbsContainer:xg,thumbsAlignStart:bg,thumbsAlignCenter:wg,thumbsAlignEnd:Sg,thumbItem:$g,closeButton:Cg,fadeIn:Tg,slideInLeft:Lg,slideInRight:Rg,slideInTop:Ig,slideInBottom:Eg,fadeOut:Mg,slideOutLeft:Pg,slideOutRight:kg,slideOutTop:Ag,slideOutBottom:Fg,scaleSlide:_g},sr=(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% + ${O.scalingValue(t.x,n)}), calc(-50% + ${O.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${O.scalingValue(t.x,n)}, calc(-50% + ${O.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${O.scalingValue(t.x,n)}), ${O.scalingValue(t.y,n)})`:i.transform=`translate(${O.scalingValue(t.x,n)}, ${O.scalingValue(t.y,n)})`,i};function Fd(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 Wg(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 _d(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 Ng(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 Wd(e,t,n,i,o){const{x:r,y:l}=Wg(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function Hg(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"?Ng:_d,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:y}=Wd(n,i,u,p,d),g=(b+u/2)/n*100,h=(y+p/2)/i*100;return`${g}% ${h}%`}function Og(e){return Hg(e)}function jr(e){const t=e.getBoundingClientRect(),n=Fd(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}=_d(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=Wd(i,o,d,c,u),y=t.left+n.left,g=t.top+n.top;return{x:p+y,y:b+g,width:d,height:c}}function Cl(e){const t=e.getBoundingClientRect(),n=Fd(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tl(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 Dg(e,t){const n=(()=>{if(e==="fade in")return et.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return et.fadeIn;if(e==="slide in")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return et.fadeOut;if(e==="slide in")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})(),r=(()=>{if(e==="fade in")return et.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const jg=({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:et.heroImage,onClick:()=>c(!0)}),a.jsx(zg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},zg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ie;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:y,fontSizeLineHeight:g,textAppearance:h,color:f}=i.imageCaption??{},[x,S]=s.useState(0),[v,w]=s.useState(0),[H,N]=s.useState(!1),[Y,D]=s.useState(!1),[C,V]=s.useState({}),$=s.useRef(null),I=s.useRef(null),k=s.useRef(null),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(null),ne=s.useRef(!1),R=s.useRef(null),[W,K]=s.useState(!1),{appear:ae,triggers:de,slider:A,thumbnail:he,controls:q,area:ce,caption:Q,layout:be}=o.lightboxBlock,{appearClass:We,backdropAppearClass:xe,backdropDisappearClass:le,disappearClass:ee}=Dg(ae.type,ae.direction),ue=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const j=()=>{setTimeout(()=>{var J,te;(te=(J=$.current)==null?void 0:J.splide)==null||te.refresh()},16)},B=()=>{w(J=>J+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",B),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",B)}},[]),s.useEffect(()=>{if(!e||!he.isActive){K(!1);return}const j=R.current;if(!j)return;const B=()=>{A.direction==="horiz"?K(j.scrollWidth>j.clientWidth):K(j.scrollHeight>j.clientHeight)};B();const J=new ResizeObserver(B);return J.observe(j),()=>J.disconnect()},[e,he.isActive,n.length,C,A.direction]);const oe=s.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,B=Tl(ce.color);j&&!l&&B>.9&&(document.body.style.backgroundColor=""),N(!0),T.current=!0;const J=te=>{te.target===m.current&&te.animationName&&(m.current&&M.current&&m.current.removeEventListener("animationend",M.current),M.current=null,T.current&&(T.current=!1,t()),N(!1))};m.current&&(M.current=J,m.current.addEventListener("animationend",J))},[t,ce.color,l]),Ne=(j,B,J)=>{var te,Ce;if(j){if(de.type==="click"&&de.switch==="image")de.repeat==="close"&&x===n.length-1?oe():(te=$.current)==null||te.go("+1");else if(de.type==="click"&&de.switch==="50/50"){const ye=j.getBoundingClientRect(),F=B-ye.left,ve=J-ye.top,pe=ye.width,Z=ye.height;let me;A.direction==="horiz"?me=F<pe/2?"-1":"+1":me=ve<Z/2?"-1":"+1",(Ce=$.current)==null||Ce.go(me)}}},Te=j=>{if(ne.current){ne.current=!1;return}const B=n[x],J=(B==null?void 0:B.image.objectFit)==="cover";let te,Ce;if("changedTouches"in j&&j.changedTouches.length>0)te=j.changedTouches[0].clientX,Ce=j.changedTouches[0].clientY;else if("clientX"in j)te=j.clientX,Ce=j.clientY;else return;let ye;if(J&&k.current){const F=Cl(k.current);ye=te>=F.left&&te<=F.right&&Ce>=F.top&&Ce<=F.bottom}else{const F=k.current?jr(k.current):null;if(!F){j.target===j.currentTarget&&oe();return}ye=te>=F.x&&te<=F.x+F.width&&Ce>=F.y&&Ce<=F.y+F.height}ye?Ne(k.current,te,Ce):oe()},P=j=>{const B=j.target;(B.classList.contains(et.thumbsWrapper)||B.classList.contains(et.thumbsContainer))&&Te(j)};s.useEffect(()=>{if(!e)return;const j=B=>{var J,te;if(B.key==="Escape"){oe();return}if(B.key==="ArrowRight"){S(Ce=>(Ce+1)%Math.max(n.length,1)),(J=$.current)==null||J.go("+1");return}B.key==="ArrowLeft"&&(S(Ce=>(Ce-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=$.current)==null||te.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(S(0),w(B=>B+1),T.current=!1,N(!1),D(!1),V({}),!ue)return;const j=new CustomEvent("page-overlay",{detail:{itemId:ue}});window.dispatchEvent(j)}return()=>{m.current&&M.current&&(m.current.removeEventListener("animationend",M.current),M.current=null),D(!1)}},[e,ue]),s.useEffect(()=>{I.current!==null&&I.current!==A.type&&w(j=>j+1),I.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,B=window.matchMedia("(max-width: 768px)").matches,J=Tl(ce.color);document.body.style.overflow="hidden",D(!1);const te=ye=>{ye.target===m.current&&!T.current&&ye.animationName&&(B&&!l&&J>.9&&(document.body.style.backgroundColor=ce.color),D(!0),m.current&&E.current&&m.current.removeEventListener("animationend",E.current),E.current=null)};m.current&&(E.current=te,m.current.addEventListener("animationend",te));const Ce=ye=>{const F=ye.target;F&&(F.closest(`.${et.thumbsWrapper}`)||F.closest(`.${et.thumbsContainer}`))||A.type!=="slide"&&ye.preventDefault()};return document.addEventListener("touchmove",Ce,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",Ce),m.current&&E.current&&(m.current.removeEventListener("animationend",E.current),E.current=null),D(!1)}},[e,l,ce.color,A.type]),s.useEffect(()=>{if(!e)return;const j=B=>{var te,Ce;if(T.current){B.stopPropagation();return}if(ne.current){ne.current=!1;return}const J=B.target;if(!(J&&(J.closest(`.${et.thumbsContainer}`)||J.closest(`.${et.thumbItem}`)||J.closest(`.${et.arrow}`)||J.closest(`.${et.closeButton}`)||J.closest(`.${et.caption}`)))){if(A.type==="slide"&&de.type==="drag"&&((Ce=(te=$.current)==null?void 0:te.splide)!=null&&Ce.root)){const ye=$.current.splide.root;if(J&&(ye.contains(J)||ye===J))return}if(B.touches.length===0&&B.changedTouches.length>0){const ye=n[x],F=(ye==null?void 0:ye.image.objectFit)==="cover",ve=B.changedTouches[0];let pe;if(F&&k.current){const Z=Cl(k.current);pe=ve.clientX>=Z.left&&ve.clientX<=Z.right&&ve.clientY>=Z.top&&ve.clientY<=Z.bottom}else{const Z=k.current?jr(k.current):null;if(!Z)return;pe=ve.clientX>=Z.x&&ve.clientX<=Z.x+Z.width&&ve.clientY>=Z.y&&ve.clientY<=Z.y+Z.height}if(!pe){B.stopPropagation(),T.current=!0;const Z=me=>{me.stopPropagation(),me.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),oe()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,oe,x,n]);const U=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&de.type==="drag";s.useEffect(()=>{var me,De;if(!e||!U||!((De=(me=$.current)==null?void 0:me.splide)!=null&&De.root))return;const j=$.current.splide.root,B=30,J=(ge,G)=>{if(z.current){const ke=Math.abs(ge-z.current.x),Fe=Math.abs(G-z.current.y);(ke>0||Fe>0)&&(ne.current=!0)}},te=ge=>{z.current&&(ge.preventDefault(),J(ge.clientX,ge.clientY))},Ce=ge=>{z.current&&ge.touches.length>0&&(ge.preventDefault(),J(ge.touches[0].clientX,ge.touches[0].clientY))},ye=(ge,G)=>{if(!z.current||!$.current){z.current=null;return}const ke=Math.abs(ge-z.current.x),Fe=Math.abs(G-z.current.y);Fe>B&&Fe>ke&&$.current.go(G<z.current.y?"+1":"-1"),z.current=null},F=ge=>{z.current&&ye(ge.clientX,ge.clientY),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("pointermove",te)},ve=ge=>{if(z.current){if(ge.changedTouches.length>0){const G=ge.changedTouches[0];ye(G.clientX,G.clientY)}document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),document.removeEventListener("touchmove",Ce)}},pe=ge=>{z.current={x:ge.clientX,y:ge.clientY},ne.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",F),document.addEventListener("pointercancel",F)},Z=ge=>{ge.touches.length>0&&(z.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",Ce,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve))};return j.addEventListener("pointerdown",pe),j.addEventListener("touchstart",Z),()=>{j.removeEventListener("pointerdown",pe),j.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("touchmove",Ce),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),z.current=null,ne.current=!1}},[e,U,v]);const X={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Vn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:m,className:ht(et.background,H?le:xe,{[et.editor]:l},{[et.hidden]:!e}),style:{...X,...Y&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?m:null,className:ht(et.contentStyle,H?ee:We,{[et.editor]:l},{[et.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Vs,{onMove:j=>S(j.index),ref:$,className:et.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:de.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:de.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((j,B)=>{const J=sr(be.position,be.offset,l),te=`${O.scalingValue(be.padding.top,l)} ${O.scalingValue(be.padding.right,l)} ${O.scalingValue(be.padding.bottom,l)} ${O.scalingValue(be.padding.left,l)}`,Ce=A.type==="scale"?(()=>{const{transform:ye,...F}=J;return{...F,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ye||"none"}})():{...J,position:"absolute",padding:te,boxSizing:"border-box"};return a.jsx(Gs,{children:a.jsx("div",{className:et.imgWrapper,onClick:Te,children:a.jsx("img",{ref:B===x?k:null,className:ht(et.imageStyle,{[et.contain]:j.image.objectFit==="contain",[et.cover]:j.image.objectFit==="cover",[et.scaleSlide]:A.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...Ce,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},B)})},v),q.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ht(et.arrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${O.scalingValue(q.offset.x,l)}, ${O.scalingValue(q.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:ht(et.arrowImg,et.mirror)}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:ht(et.arrowIcon,et.arrowImg,et.mirror)})]})}),a.jsx("div",{className:ht(et.arrow,et.nextArrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${O.scalingValue(q.offset.x*(A.direction==="horiz"?-1:1),l)}, ${O.scalingValue(q.offset.y,l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:et.arrowImg}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:ht(et.arrowIcon,et.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const j=sr(ce.closeIconAlign,ce.closeIconOffset,l),B=`scale(${ce.closeIconScale})`,J=j.transform?`${j.transform} ${B}`:B;return a.jsx("button",{className:et.closeButton,style:{...j,transform:J},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(ln,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((ie=n[x])==null?void 0:ie.imageCaption)&&a.jsx("div",{className:et.caption,style:{...sr(Q.alignment,Q.offset,l),fontFamily:go(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":O.scalingValue(c.width,l),letterSpacing:O.scalingValue(p,l),wordSpacing:O.scalingValue(y,l),textAlign:b,fontSize:O.scalingValue(g.fontSize,l),lineHeight:O.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:et.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),he.isActive&&(()=>{const[j,B]=he.position.split("-"),J=A.direction==="horiz"?`${j}-left`:he.position,te=sr(J,he.offset,l),Ce=()=>{if(A.direction==="horiz"){if(B==="left")return"flex-start";if(B==="center")return"center";if(B==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:R,className:et.thumbsWrapper,onClick:ye=>P(ye),style:{position:l?"absolute":"fixed",...te,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:ht(et.thumbsContainer,{[et.thumbsContainerVertical]:A.direction==="vert",[et.thumbsAlignStart]:he.align==="start",[et.thumbsAlignCenter]:he.align==="center",[et.thumbsAlignEnd]:he.align==="end"}),style:{gap:O.scalingValue(he.grid.gap,l),justifyContent:W?"flex-start":Ce()},children:n.map((ye,F)=>{const ve=F===x,pe=C[F],me=he.grid.size*(ve?he.activeState.scale:1),De=()=>{if(he.fit!=="fit")return{};if(!pe)return A.direction==="horiz"?{height:O.scalingValue(me,l)}:{width:O.scalingValue(me,l)};const ge=pe.width/pe.height;if(A.direction==="horiz"){const G=me,ke=G*ge;return{width:O.scalingValue(ke,l),height:O.scalingValue(G,l)}}else{const G=me,ke=G/ge;return{width:O.scalingValue(G,l),height:O.scalingValue(ke,l)}}};return a.jsx("button",{className:et.thumbItem,style:{...A.direction==="horiz"&&he.fit!=="fit"?{height:O.scalingValue(me,l)}:{},...A.direction==="vert"&&he.fit!=="fit"?{width:O.scalingValue(me,l)}:{},...he.fit==="cover"?{width:O.scalingValue(me,l),height:O.scalingValue(me,l)}:{},...De(),transition:ve?"all 0.25s ease-out":"none",opacity:ve?he.activeState.opacity/100:he.opacity/100,"--thumb-hover":he.activeState.opacity/100},onClick:ge=>{var G;ge.stopPropagation(),S(F),(G=$.current)==null||G.go(F)},onMouseEnter:()=>{var ge;he.triggers==="hov"&&((ge=$.current)==null||ge.go(F))},children:a.jsx("img",{src:ye.image.url,alt:ye.image.name??"",onLoad:ge=>{const G=ge.currentTarget;G.naturalWidth&&G.naturalHeight&&V(ke=>({...ke,[F]:{width:G.naturalWidth,height:G.naturalHeight}}))},style:{objectFit:he.fit==="cover"?"cover":"contain",...he.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...he.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ye.image.name}-${F}`)})})})})()]})]}),document.getElementById(r))};function Ll({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 Bg={element:jg,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 lr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Vg(e){return`
|
|
6
|
+
*/const Nm="RichTextRenderer-module__link___BWeZ2",Hm={link:Nm},Om=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))},go=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Om(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function sn(e){const{color:t,...n}=e;return n}function Yt(e,t){var o,r,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:go(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:D.scalingValue(e.letterSpacing,t),wordSpacing:D.scalingValue(e.wordSpacing,t),fontSize:D.scalingValue(n,t),lineHeight:i!==void 0?D.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 Ri=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?a.jsx("a",{className:Hm.link,href:i.value,target:i.target,children:t(i.children)},o):a.jsx("span",{style:Dm(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 Dm(e){return{...e.fontFamily&&{fontFamily:go(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 jm="SvgImage-module__svg___q3xE-",zm="SvgImage-module__img___VsTm-",wl={svg:jm,img:zm},Bm=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},Vm=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)}},[]),!Bm(e)||!r?a.jsx("img",{src:e,alt:"",className:yt(wl.img,i),style:o}):a.jsx("span",{"data-supports-mask":r,className:yt(wl.svg,i),style:{"--svg":Vm(e),"--fill":t,"--hover-fill":n,...o??{}}})},Gm={"top-left":ht.topLeftAlignment,"top-center":ht.topCenterAlignment,"top-right":ht.topRightAlignment,"middle-left":ht.middleLeftAlignment,"middle-center":ht.middleCenterAlignment,"middle-right":ht.middleRightAlignment,"bottom-left":ht.bottomLeftAlignment,"bottom-center":ht.bottomCenterAlignment,"bottom-right":ht.bottomRightAlignment};function qm({settings:e,content:t,styles:n,isEditor:i}){const[o,r]=s.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:b,textAppearance:v,color:g}=n.imageCaption??{},[h,f]=s.useState(void 0),[x,S]=s.useState(null),[y,w]=s.useState(0),[H,N]=s.useState(0),{direction:Y,transition:O,controls:C,pagination:V,imageCaption:$,triggers:R}=e,k=s.useRef(O.type),{x:T,y:m}=e.controls.offset,M=E=>{o&&o.go(E)};return s.useEffect(()=>{if(!x)return;const E=new ResizeObserver(z=>{if(!o)return;const[ne]=z;f({width:Math.round(ne.contentRect.width),height:Math.round(ne.contentRect.height)})});return E.observe(x),()=>E.unobserve(x)},[x]),s.useEffect(()=>{!o||k.current===O.type||(N(E=>E+1),k.current=O.type)},[O.type]),a.jsx("div",{className:yt(ht.wrapper,{[ht.editor]:i}),ref:S,children:a.jsxs("div",{className:ht.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:O.backgroundColor&&O.type==="fade in"?O.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&a.jsx("div",{className:yt(ht.captionBlock),children:a.jsx("div",{className:ht.captionTextWrapper,children:t.map((E,z)=>a.jsx("div",{className:yt(ht.captionText,Gm[$.alignment],{[ht.withPointerEvents]:z===y&&i,[ht.active]:z===y}),style:{fontFamily:go(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":D.scalingValue(l.width,i),letterSpacing:D.scalingValue(c,i),wordSpacing:D.scalingValue(p,i),textAlign:u,fontSize:D.scalingValue(b.fontSize,i),lineHeight:D.scalingValue(b.lineHeight,i),textTransform:v.textTransform??"none",textDecoration:v.textDecoration??"none",fontVariant:v.fontVariant??"normal",color:g,transitionDuration:O.duration?`${Math.round(parseInt(O.duration)/2)}ms`:"500ms"},children:a.jsx("div",{"data-styles":"imageCaption",className:ht.captionTextInner,style:{"--link-hover-color":$.linkHoverColor,"--link-color":$.linkColor,position:"relative",top:D.scalingValue($.offset.y,i),left:D.scalingValue($.offset.x,i)},children:a.jsx(Ri,{content:E.imageCaption})})},z))})}),a.jsx(Vs,{onMove:E=>{w(E.index)},ref:r,options:{arrows:!1,speed:O.duration?parseInt(O.duration):500,autoplay:R.autoPlay!==null,...R.autoPlay!==null&&{interval:parseInt(R.autoPlay)*1e3},direction:Y==="horiz"||O.type==="fade in"?"ltr":"ttb",pagination:!1,drag:R.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:O.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((E,z)=>a.jsx(Gs,{children:a.jsx("div",{className:ht.sliderItem,children:a.jsx("div",{className:ht.imgWrapper,children:a.jsx("img",{className:yt(ht.sliderImage,{[ht.contain]:E.image.objectFit==="contain",[ht.cover]:E.image.objectFit==="cover"}),src:E.image.url,alt:E.image.name??""})})})},z))},H),C.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(ht.arrow,{[ht.arrowVertical]:Y==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{onClick:()=>{M("-1")},className:ht.arrowInner,style:{transform:`translate(${D.scalingValue(T,i)}, ${D.scalingValue(m*(Y==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:yt(ht.arrowImg,ht.mirror)}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg,ht.mirror)})]})}),a.jsx("div",{className:yt(ht.arrow,ht.nextArrow,{[ht.arrowVertical]:Y==="vert",[ht.hoverArrow]:C.show==="on hover"}),style:{color:C.color,"--arrow-hover-color":C.hover},children:a.jsxs("button",{className:ht.arrowInner,onClick:()=>M("+1"),style:{transform:`translate(${D.scalingValue(T*(Y==="horiz"?-1:1),i)}, ${D.scalingValue(m,i)}) scale(${e.controls.scale/100}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:[C.arrowsImgUrl&&a.jsx(ln,{url:C.arrowsImgUrl,fill:C.color,hoverFill:C.hover,className:ht.arrowImg}),!C.arrowsImgUrl&&a.jsx(Sl,{color:C.color,className:yt(ht.arrowIcon,ht.arrowImg)})]})})]}),R.triggersList.click&&a.jsx("div",{className:ht.clickOverlay,onClick:()=>{o&&o.go("+1")}}),V.isActive&&a.jsx("div",{className:yt(ht.pagination,{[ht.paginationInsideBottom]:V.position==="inside-1"&&Y==="horiz",[ht.paginationInsideTop]:V.position==="inside-2"&&Y==="horiz",[ht.paginationOutsideBottom]:V.position==="outside-1"&&Y==="horiz",[ht.paginationOutsideTop]:V.position==="outside-2"&&Y==="horiz",[ht.paginationInsideLeft]:V.position==="inside-1"&&Y==="vert",[ht.paginationInsideRight]:V.position==="inside-2"&&Y==="vert",[ht.paginationOutsideLeft]:V.position==="outside-1"&&Y==="vert",[ht.paginationOutsideRight]:V.position==="outside-2"&&Y==="vert",[ht.paginationVertical]:Y==="vert"}),children:a.jsx("div",{className:ht.paginationInner,style:{backgroundColor:V.colors[2],transform:`scale(${V.scale/100}) translate(${D.scalingValue(V.offset.x,i)}, ${D.scalingValue(V.offset.y,i)}) rotate(${Y==="horiz"?"0deg":"90deg"})`},children:t.map((E,z)=>a.jsx("button",{onClick:()=>{o&&o.go(z)},className:yt(ht.paginationItem),children:a.jsx("div",{className:yt(ht.dot,{[ht.activeDot]:z===y}),style:{backgroundColor:z===y?V.colors[0]:V.colors[1],"--pagination-hover-color":V.hover}})},z))})})]})})}function Sl({color:e,className:t}){return a.jsx("svg",{viewBox:"0 0 10 18",className:t,children:a.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:a.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:e,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}const Xm={element:qm,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"]}},Um="ImageRevealSlider-module__imageRevealSlider___UE5Ob",Ym="ImageRevealSlider-module__image___Qjt-e",Km="ImageRevealSlider-module__link___N-iLG",Zm="ImageRevealSlider-module__cursor___2U03d",Pi={imageRevealSlider:Um,image:Ym,link:Km,cursor:Zm};function $l(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 Jm(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 Qm({settings:e,content:t,isEditor:n}){const[i,o]=s.useState(null),[r,l]=s.useState([]),[d,c]=s.useState(0),u=s.useRef(0),[p,b]=s.useState({x:0,y:0}),[v,g]=s.useState(1),[h,f]=s.useState("none"),x=s.useRef({x:0,y:0}),[S,y]=s.useState(!1),{sizeType:w,imageWidth:H,randomRangeImageWidth:N}=e.imageSize,{revealPosition:Y,visible:O}=e.position,{cursorType:C,target:V,defaultCursorScale:$,defaultCursor:R,hoverCursorScale:k,hoverCursor:T}=e.cursor;s.useEffect(()=>{if(!i)return;const E=(I,W)=>{const K=i.getBoundingClientRect(),ae=I-K.left,de=W-K.top;if(b({x:ae,y:de}),C==="system"){f("none"),g(1);return}const A=ae,he=de,q=document.elementFromPoint(K.left+A,K.top+he);if(q&&q.closest("a")){f("none"),g(1);return}const ce=$l(A,he,r)||V==="area"?{img:T??"none",scale:k}:{img:R??"none",scale:$};f(ce.img),g(ce.scale)},z=I=>{I.stopPropagation(),x.current={x:I.clientX,y:I.clientY},E(I.clientX,I.clientY)},ne=()=>{S&&E(x.current.x,x.current.y)};return i.addEventListener("mousemove",z),window.addEventListener("scroll",ne,!0),()=>{i.removeEventListener("mousemove",z),window.removeEventListener("scroll",ne,!0)}},[i,S,p,C,V,T,R,k,$,r]),s.useEffect(()=>{S||(f("none"),g(0))},[S]);const m=async(E,z,ne,I={})=>{const{width:W,height:K,finalWidth:ae}=await Jm(E.image.url,w,H,N);let de=0,A=0;Y==="same"?(de=z/2,A=ne/2):(de=I.x??Math.random()*z,A=I.y??Math.random()*ne);const he=Math.min(Math.max(de,W/2),z-W/2),q=Math.min(Math.max(A,K/2),ne-K/2);return{id:u.current++,url:E.image.url,link:E.link,name:E.image.name,x:he,y:q,width:ae}};s.useEffect(()=>{if(!i||t.length===0)return;const E=i.getBoundingClientRect(),z=E.width,ne=E.height,I=[];(async()=>{const K=t[0],ae=await m(K,z,ne);I.push(ae),l(I),c(1)})()},[w,H,N,Y,i]),s.useEffect(()=>{O==="last One"&&l(E=>E.length>0?[E[E.length-1]]:[])},[O]);const M=async E=>{if(!i)return;const z=i.getBoundingClientRect(),ne=E.clientX-z.left,I=E.clientY-z.top;if(V==="image"&&!$l(ne,I,r))return;let W=0,K=0;Y==="on Click"?(W=ne,K=I):Y==="same"?(W=z.width/2,K=z.height/2):(W=Math.random()*z.width,K=Math.random()*z.height);const ae=t[d],de=await m(ae,z.width,z.height,{x:W,y:K});l(A=>O==="all"?[...A,de]:[de]),c(A=>A>=t.length-1?0:A+1)};return a.jsxs("div",{ref:o,onClick:M,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:Pi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[r.map(E=>a.jsx("div",{className:Pi.wrapper,style:{top:`${E.y}px`,left:`${E.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:E.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:V==="area"&&E.link?a.jsx("a",{href:E.link,target:"_blank",className:Pi.link,children:a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)}):a.jsx("img",{src:E.url,alt:E.name,className:Pi.image},E.id)},E.id)),S&&a.jsx("div",{className:Pi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${v})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const eg={element:Qm,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:""}]}}}},tg="LightBox-module__hidden___9s-9x",ng="LightBox-module__heroImage___sTxNF",ig="LightBox-module__background___rm9ml",og="LightBox-module__editor___4ACaY",rg="LightBox-module__contentStyle___Bgnsq",ag="LightBox-module__imageStyle___tLIlB",sg="LightBox-module__imgWrapper___LuFUp",lg="LightBox-module__contain___8-yaS",cg="LightBox-module__cover___hNvOG",dg="LightBox-module__caption___b6L2I",ug="LightBox-module__captionTextInner___rCGNH",pg="LightBox-module__lightboxSplide___XFuWC",mg="LightBox-module__arrow___iz38X",gg="LightBox-module__arrowVertical___Zfz81",hg="LightBox-module__nextArrow___zkAQN",fg="LightBox-module__arrowInner___p48sW",yg="LightBox-module__arrowIcon___3VaFf",vg="LightBox-module__arrowImg___pNV88",xg="LightBox-module__mirror___pjeXc",bg="LightBox-module__thumbsWrapper___GB-nU",wg="LightBox-module__thumbsContainerVertical___wttk5",Sg="LightBox-module__thumbsContainer___osSma",$g="LightBox-module__thumbsAlignStart___MO6tY",Cg="LightBox-module__thumbsAlignCenter___Q4sUx",Tg="LightBox-module__thumbsAlignEnd___p4y9R",Lg="LightBox-module__thumbItem___HvnF3",Rg="LightBox-module__closeButton___g2khP",Ig="LightBox-module__fadeIn___0m5GW",Eg="LightBox-module__slideInLeft___gPYwC",Mg="LightBox-module__slideInRight___S-pPp",Pg="LightBox-module__slideInTop___DFdAj",kg="LightBox-module__slideInBottom___m27kZ",Ag="LightBox-module__fadeOut___55qBR",Fg="LightBox-module__slideOutLeft___NvU7P",_g="LightBox-module__slideOutRight___SK7eC",Wg="LightBox-module__slideOutTop___Vgg0z",Ng="LightBox-module__slideOutBottom___nJ0Ef",Hg="LightBox-module__scaleSlide___vZriG",et={hidden:tg,heroImage:ng,background:ig,editor:og,contentStyle:rg,imageStyle:ag,imgWrapper:sg,contain:lg,cover:cg,caption:dg,captionTextInner:ug,lightboxSplide:pg,arrow:mg,arrowVertical:gg,nextArrow:hg,arrowInner:fg,arrowIcon:yg,arrowImg:vg,mirror:xg,thumbsWrapper:bg,thumbsContainerVertical:wg,thumbsContainer:Sg,thumbsAlignStart:$g,thumbsAlignCenter:Cg,thumbsAlignEnd:Tg,thumbItem:Lg,closeButton:Rg,fadeIn:Ig,slideInLeft:Eg,slideInRight:Mg,slideInTop:Pg,slideInBottom:kg,fadeOut:Ag,slideOutLeft:Fg,slideOutRight:_g,slideOutTop:Wg,slideOutBottom:Ng,scaleSlide:Hg},sr=(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% + ${D.scalingValue(t.x,n)}), calc(-50% + ${D.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${D.scalingValue(t.x,n)}, calc(-50% + ${D.scalingValue(t.y,n)}))`:r==="center"?i.transform=`translate(calc(-50% + ${D.scalingValue(t.x,n)}), ${D.scalingValue(t.y,n)})`:i.transform=`translate(${D.scalingValue(t.x,n)}, ${D.scalingValue(t.y,n)})`,i};function _d(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 Og(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 Wd(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 Dg(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 Nd(e,t,n,i,o){const{x:r,y:l}=Og(o);return{offsetX:r*(e-n),offsetY:l*(t-i)}}function jg(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"?Dg:Wd,{renderedW:u,renderedH:p}=c(n,i,o,r),{offsetX:b,offsetY:v}=Nd(n,i,u,p,d),g=(b+u/2)/n*100,h=(v+p/2)/i*100;return`${g}% ${h}%`}function zg(e){return jg(e)}function jr(e){const t=e.getBoundingClientRect(),n=_d(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}=Wd(i,o,r,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:b}=Nd(i,o,d,c,u),v=t.left+n.left,g=t.top+n.top;return{x:p+v,y:b+g,width:d,height:c}}function Cl(e){const t=e.getBoundingClientRect(),n=_d(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Tl(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 Bg(e,t){const n=(()=>{if(e==="fade in")return et.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return et.fadeIn;if(e==="slide in")switch(t){case"left":return et.slideInLeft;case"right":return et.slideInRight;case"top":return et.slideInTop;case"bottom":return et.slideInBottom;default:return et.slideInRight}return et.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return et.fadeOut;if(e==="slide in")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})(),r=(()=>{if(e==="fade in")return et.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return et.slideOutLeft;case"right":return et.slideOutRight;case"top":return et.slideOutTop;case"bottom":return et.slideOutBottom;default:return et.slideOutRight}return et.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:r}}const Vg=({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:et.heroImage,onClick:()=>c(!0)}),a.jsx(Gg,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:r})]})},Gg=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:r,isEditor:l,metadata:d})=>{var ie;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:b,wordSpacing:v,fontSizeLineHeight:g,textAppearance:h,color:f}=i.imageCaption??{},[x,S]=s.useState(0),[y,w]=s.useState(0),[H,N]=s.useState(!1),[Y,O]=s.useState(!1),[C,V]=s.useState({}),$=s.useRef(null),R=s.useRef(null),k=s.useRef(null),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(null),ne=s.useRef(!1),I=s.useRef(null),[W,K]=s.useState(!1),{appear:ae,triggers:de,slider:A,thumbnail:he,controls:q,area:ce,caption:Q,layout:be}=o.lightboxBlock,{appearClass:He,backdropAppearClass:xe,backdropDisappearClass:le,disappearClass:ee}=Bg(ae.type,ae.direction),ue=(d==null?void 0:d.itemId)??null;s.useEffect(()=>{const j=()=>{setTimeout(()=>{var J,te;(te=(J=$.current)==null?void 0:J.splide)==null||te.refresh()},16)},B=()=>{w(J=>J+1)};return window.addEventListener("ArticleEditor.Layout:change",j),window.addEventListener("ArticleEditor.ComponentContent:change",B),()=>{window.removeEventListener("ArticleEditor.Layout:change",j),window.removeEventListener("ArticleEditor.ComponentContent:change",B)}},[]),s.useEffect(()=>{if(!e||!he.isActive){K(!1);return}const j=I.current;if(!j)return;const B=()=>{A.direction==="horiz"?K(j.scrollWidth>j.clientWidth):K(j.scrollHeight>j.clientHeight)};B();const J=new ResizeObserver(B);return J.observe(j),()=>J.disconnect()},[e,he.isActive,n.length,C,A.direction]);const oe=s.useCallback(()=>{const j=window.matchMedia("(max-width: 768px)").matches,B=Tl(ce.color);j&&!l&&B>.9&&(document.body.style.backgroundColor=""),N(!0),T.current=!0;const J=te=>{te.target===m.current&&te.animationName&&(m.current&&M.current&&m.current.removeEventListener("animationend",M.current),M.current=null,T.current&&(T.current=!1,t()),N(!1))};m.current&&(M.current=J,m.current.addEventListener("animationend",J))},[t,ce.color,l]),Fe=(j,B,J)=>{var te,$e;if(j){if(de.type==="click"&&de.switch==="image")de.repeat==="close"&&x===n.length-1?oe():(te=$.current)==null||te.go("+1");else if(de.type==="click"&&de.switch==="50/50"){const ye=j.getBoundingClientRect(),F=B-ye.left,ve=J-ye.top,pe=ye.width,Z=ye.height;let me;A.direction==="horiz"?me=F<pe/2?"-1":"+1":me=ve<Z/2?"-1":"+1",($e=$.current)==null||$e.go(me)}}},Ce=j=>{if(ne.current){ne.current=!1;return}const B=n[x],J=(B==null?void 0:B.image.objectFit)==="cover";let te,$e;if("changedTouches"in j&&j.changedTouches.length>0)te=j.changedTouches[0].clientX,$e=j.changedTouches[0].clientY;else if("clientX"in j)te=j.clientX,$e=j.clientY;else return;let ye;if(J&&k.current){const F=Cl(k.current);ye=te>=F.left&&te<=F.right&&$e>=F.top&&$e<=F.bottom}else{const F=k.current?jr(k.current):null;if(!F){j.target===j.currentTarget&&oe();return}ye=te>=F.x&&te<=F.x+F.width&&$e>=F.y&&$e<=F.y+F.height}ye?Fe(k.current,te,$e):oe()},P=j=>{const B=j.target;(B.classList.contains(et.thumbsWrapper)||B.classList.contains(et.thumbsContainer))&&Ce(j)};s.useEffect(()=>{if(!e)return;const j=B=>{var J,te;if(B.key==="Escape"){oe();return}if(B.key==="ArrowRight"){S($e=>($e+1)%Math.max(n.length,1)),(J=$.current)==null||J.go("+1");return}B.key==="ArrowLeft"&&(S($e=>($e-1+Math.max(n.length,1))%Math.max(n.length,1)),(te=$.current)==null||te.go("-1"))};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j)}},[e,oe,n.length]),s.useEffect(()=>{if(e){if(S(0),w(B=>B+1),T.current=!1,N(!1),O(!1),V({}),!ue)return;const j=new CustomEvent("page-overlay",{detail:{itemId:ue}});window.dispatchEvent(j)}return()=>{m.current&&M.current&&(m.current.removeEventListener("animationend",M.current),M.current=null),O(!1)}},[e,ue]),s.useEffect(()=>{R.current!==null&&R.current!==A.type&&w(j=>j+1),R.current=A.type},[A.type]),s.useEffect(()=>{if(!e)return;const j=document.body.style.overflow,B=window.matchMedia("(max-width: 768px)").matches,J=Tl(ce.color);document.body.style.overflow="hidden",O(!1);const te=ye=>{ye.target===m.current&&!T.current&&ye.animationName&&(B&&!l&&J>.9&&(document.body.style.backgroundColor=ce.color),O(!0),m.current&&E.current&&m.current.removeEventListener("animationend",E.current),E.current=null)};m.current&&(E.current=te,m.current.addEventListener("animationend",te));const $e=ye=>{const F=ye.target;F&&(F.closest(`.${et.thumbsWrapper}`)||F.closest(`.${et.thumbsContainer}`))||A.type!=="slide"&&ye.preventDefault()};return document.addEventListener("touchmove",$e,{passive:!1}),()=>{document.body.style.overflow=j,document.removeEventListener("touchmove",$e),m.current&&E.current&&(m.current.removeEventListener("animationend",E.current),E.current=null),O(!1)}},[e,l,ce.color,A.type]),s.useEffect(()=>{if(!e)return;const j=B=>{var te,$e;if(T.current){B.stopPropagation();return}if(ne.current){ne.current=!1;return}const J=B.target;if(!(J&&(J.closest(`.${et.thumbsContainer}`)||J.closest(`.${et.thumbItem}`)||J.closest(`.${et.arrow}`)||J.closest(`.${et.closeButton}`)||J.closest(`.${et.caption}`)))){if(A.type==="slide"&&de.type==="drag"&&(($e=(te=$.current)==null?void 0:te.splide)!=null&&$e.root)){const ye=$.current.splide.root;if(J&&(ye.contains(J)||ye===J))return}if(B.touches.length===0&&B.changedTouches.length>0){const ye=n[x],F=(ye==null?void 0:ye.image.objectFit)==="cover",ve=B.changedTouches[0];let pe;if(F&&k.current){const Z=Cl(k.current);pe=ve.clientX>=Z.left&&ve.clientX<=Z.right&&ve.clientY>=Z.top&&ve.clientY<=Z.bottom}else{const Z=k.current?jr(k.current):null;if(!Z)return;pe=ve.clientX>=Z.x&&ve.clientX<=Z.x+Z.width&&ve.clientY>=Z.y&&ve.clientY<=Z.y+Z.height}if(!pe){B.stopPropagation(),T.current=!0;const Z=me=>{me.stopPropagation(),me.preventDefault(),document.removeEventListener("click",Z,!0)};document.addEventListener("click",Z,!0),oe()}}}};return document.addEventListener("touchend",j,{passive:!0}),()=>{document.removeEventListener("touchend",j)}},[e,oe,x,n]);const U=(A.type==="scale"||A.type==="fade")&&A.direction==="vert"&&de.type==="drag";s.useEffect(()=>{var me,De;if(!e||!U||!((De=(me=$.current)==null?void 0:me.splide)!=null&&De.root))return;const j=$.current.splide.root,B=30,J=(ge,G)=>{if(z.current){const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);(Me>0||_e>0)&&(ne.current=!0)}},te=ge=>{z.current&&(ge.preventDefault(),J(ge.clientX,ge.clientY))},$e=ge=>{z.current&&ge.touches.length>0&&(ge.preventDefault(),J(ge.touches[0].clientX,ge.touches[0].clientY))},ye=(ge,G)=>{if(!z.current||!$.current){z.current=null;return}const Me=Math.abs(ge-z.current.x),_e=Math.abs(G-z.current.y);_e>B&&_e>Me&&$.current.go(G<z.current.y?"+1":"-1"),z.current=null},F=ge=>{z.current&&ye(ge.clientX,ge.clientY),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("pointermove",te)},ve=ge=>{if(z.current){if(ge.changedTouches.length>0){const G=ge.changedTouches[0];ye(G.clientX,G.clientY)}document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),document.removeEventListener("touchmove",$e)}},pe=ge=>{z.current={x:ge.clientX,y:ge.clientY},ne.current=!1,document.addEventListener("pointermove",te,{passive:!1}),document.addEventListener("pointerup",F),document.addEventListener("pointercancel",F)},Z=ge=>{ge.touches.length>0&&(z.current={x:ge.touches[0].clientX,y:ge.touches[0].clientY},ne.current=!1,document.addEventListener("touchmove",$e,{passive:!1}),document.addEventListener("touchend",ve),document.addEventListener("touchcancel",ve))};return j.addEventListener("pointerdown",pe),j.addEventListener("touchstart",Z),()=>{j.removeEventListener("pointerdown",pe),j.removeEventListener("touchstart",Z),document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("touchmove",$e),document.removeEventListener("touchend",ve),document.removeEventListener("touchcancel",ve),z.current=null,ne.current=!1}},[e,U,y]);const X={backgroundColor:ce.color,backdropFilter:`blur(${ce.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(r)?null:Vn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:l?null:m,className:yt(et.background,H?le:xe,{[et.editor]:l},{[et.hidden]:!e}),style:{...X,...Y&&!l&&!H?{position:"absolute"}:{}}}),a.jsxs("div",{ref:l?m:null,className:yt(et.contentStyle,H?ee:He,{[et.editor]:l},{[et.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[a.jsx(Vs,{onMove:j=>S(j.index),ref:$,className:et.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:de.type==="drag"&&!U,perPage:1,width:"100%",height:"100%",type:A.type==="fade"||A.type==="scale"?"fade":"loop",padding:0,rewind:de.repeat!=="close",start:0},style:{"--splide-speed":A.duration},children:n.map((j,B)=>{const J=sr(be.position,be.offset,l),te=`${D.scalingValue(be.padding.top,l)} ${D.scalingValue(be.padding.right,l)} ${D.scalingValue(be.padding.bottom,l)} ${D.scalingValue(be.padding.left,l)}`,$e=A.type==="scale"?(()=>{const{transform:ye,...F}=J;return{...F,position:"absolute",padding:te,boxSizing:"border-box","--position-transform":ye||"none"}})():{...J,position:"absolute",padding:te,boxSizing:"border-box"};return a.jsx(Gs,{children:a.jsx("div",{className:et.imgWrapper,onClick:Ce,children:a.jsx("img",{ref:B===x?k:null,className:yt(et.imageStyle,{[et.contain]:j.image.objectFit==="contain",[et.cover]:j.image.objectFit==="cover",[et.scaleSlide]:A.type==="scale"}),src:j.image.url,alt:j.image.name??"",style:{...$e,pointerEvents:j.image.objectFit==="contain"?"none":"auto"}})})},B)})},y),q.isActive&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(et.arrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x,l)}, ${D.scalingValue(q.offset.y*(A.direction==="horiz"?1:-1),l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("-1")},"aria-label":"Previous",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:yt(et.arrowImg,et.mirror)}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg,et.mirror)})]})}),a.jsx("div",{className:yt(et.arrow,et.nextArrow,{[et.arrowVertical]:A.direction==="vert"}),style:{color:q.color,"--arrow-hover-color":q.hover},children:a.jsxs("button",{className:et.arrowInner,style:{transform:`translate(${D.scalingValue(q.offset.x*(A.direction==="horiz"?-1:1),l)}, ${D.scalingValue(q.offset.y,l)}) scale(${q.scale}) rotate(${A.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var j;return(j=$.current)==null?void 0:j.go("+1")},"aria-label":"Next",children:[q.arrowsImgUrl&&a.jsx(ln,{url:q.arrowsImgUrl,fill:q.color,hoverFill:q.hover,className:et.arrowImg}),!q.arrowsImgUrl&&a.jsx(Ll,{color:q.color,className:yt(et.arrowIcon,et.arrowImg)})]})})]}),ce.closeIconUrl&&(()=>{const j=sr(ce.closeIconAlign,ce.closeIconOffset,l),B=`scale(${ce.closeIconScale})`,J=j.transform?`${j.transform} ${B}`:B;return a.jsx("button",{className:et.closeButton,style:{...j,transform:J},onClick:oe,"aria-label":"Close lightbox",children:a.jsx(ln,{url:ce.closeIconUrl,fill:ce.closeIconColor??"#000000",hoverFill:ce.closeIconHover??"#cccccc"})})})(),Q&&Q.isActive&&i.imageCaption&&((ie=n[x])==null?void 0:ie.imageCaption)&&a.jsx("div",{className:et.caption,style:{...sr(Q.alignment,Q.offset,l),fontFamily:go(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":D.scalingValue(c.width,l),letterSpacing:D.scalingValue(p,l),wordSpacing:D.scalingValue(v,l),textAlign:b,fontSize:D.scalingValue(g.fontSize,l),lineHeight:D.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:f},onClick:j=>j.stopPropagation(),children:a.jsx("div",{"data-styles":"imageCaption",className:et.captionTextInner,style:{"--link-color":Q.linkColor,"--link-hover-color":Q.linkHoverColor},children:a.jsx(Ri,{content:n[x].imageCaption})})}),he.isActive&&(()=>{const[j,B]=he.position.split("-"),J=A.direction==="horiz"?`${j}-left`:he.position,te=sr(J,he.offset,l),$e=()=>{if(A.direction==="horiz"){if(B==="left")return"flex-start";if(B==="center")return"center";if(B==="right")return"flex-end"}else{if(j==="top")return"flex-start";if(j==="middle")return"center";if(j==="bottom")return"flex-end"}return"flex-start"};return a.jsx("div",{ref:I,className:et.thumbsWrapper,onClick:ye=>P(ye),style:{position:l?"absolute":"fixed",...te,...A.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:a.jsx("div",{className:yt(et.thumbsContainer,{[et.thumbsContainerVertical]:A.direction==="vert",[et.thumbsAlignStart]:he.align==="start",[et.thumbsAlignCenter]:he.align==="center",[et.thumbsAlignEnd]:he.align==="end"}),style:{gap:D.scalingValue(he.grid.gap,l),justifyContent:W?"flex-start":$e()},children:n.map((ye,F)=>{const ve=F===x,pe=C[F],me=he.grid.size*(ve?he.activeState.scale:1),De=()=>{if(he.fit!=="fit")return{};if(!pe)return A.direction==="horiz"?{height:D.scalingValue(me,l)}:{width:D.scalingValue(me,l)};const ge=pe.width/pe.height;if(A.direction==="horiz"){const G=me,Me=G*ge;return{width:D.scalingValue(Me,l),height:D.scalingValue(G,l)}}else{const G=me,Me=G/ge;return{width:D.scalingValue(G,l),height:D.scalingValue(Me,l)}}};return a.jsx("button",{className:et.thumbItem,style:{...A.direction==="horiz"&&he.fit!=="fit"?{height:D.scalingValue(me,l)}:{},...A.direction==="vert"&&he.fit!=="fit"?{width:D.scalingValue(me,l)}:{},...he.fit==="cover"?{width:D.scalingValue(me,l),height:D.scalingValue(me,l)}:{},...De(),transition:ve?"all 0.25s ease-out":"none",opacity:ve?he.activeState.opacity/100:he.opacity/100,"--thumb-hover":he.activeState.opacity/100},onClick:ge=>{var G;ge.stopPropagation(),S(F),(G=$.current)==null||G.go(F)},onMouseEnter:()=>{var ge;he.triggers==="hov"&&((ge=$.current)==null||ge.go(F))},children:a.jsx("img",{src:ye.image.url,alt:ye.image.name??"",onLoad:ge=>{const G=ge.currentTarget;G.naturalWidth&&G.naturalHeight&&V(Me=>({...Me,[F]:{width:G.naturalWidth,height:G.naturalHeight}}))},style:{objectFit:he.fit==="cover"?"cover":"contain",...he.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...he.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${ye.image.name}-${F}`)})})})})()]})]}),document.getElementById(r))};function Ll({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 qg={element:Vg,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 lr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Xg(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
|
|
158
|
+
`}function Ug({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:r}){const l=!!n,d=i&&t||!t,{prefix:c}=D.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:b=[],buttonLabel:v,gap:g,fieldsGap:h,buttonCorners:f,buttonStroke:x,buttonPadding:S,isButtonFullWidth:y,inputCorners:w,inputStroke:H,inputPadding:N,inputColor:Y,inputTextColor:O,inputBorderColor:C,placeholderColor:V,buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M,fontFamily:E,inputFontSettings:z,inputFontSize:ne,inputLineHeight:I,inputLetterSpacing:W,inputWordSpacing:K,inputTextAppearance:ae,buttonFontSettings:de,buttonFontSize:A,buttonLineHeight:he,buttonLetterSpacing:q,buttonWordSpacing:ce,buttonTextAppearance:Q,labelFontSettings:be,labelFontSize:He,labelLineHeight:xe,labelLetterSpacing:le,labelWordSpacing:ee,labelTextAppearance:ue,statusFontSettings:oe,statusFontSize:Fe,statusLineHeight:Ce,statusLetterSpacing:P,statusWordSpacing:U,statusTextAppearance:X,successMessage:ie,errorMessage:j,stateOverrides:B}=e,J=u==="B",te=b.slice(0,Math.min(p,b.length)),$e={fontSettings:{fontFamily:E,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:ne??.01,lineHeight:I,letterSpacing:W??0,wordSpacing:K??0,textAppearance:ae,color:O},ye=sn(Yt($e,t)),F=D.scalingValue(H??0,t),ve=D.scalingValue((I??ne??.01)+((N==null?void 0:N.top)??0)+((N==null?void 0:N.bottom)??0)+(u==="C"?H??0:(H??0)*2),t),pe={...ye,borderStyle:"solid",borderRadius:u==="C"?0:D.scalingValue(w??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:F,borderLeftWidth:0}:{borderWidth:F},paddingTop:D.scalingValue((N==null?void 0:N.top)??0,t),paddingRight:D.scalingValue((N==null?void 0:N.right)??0,t),paddingBottom:D.scalingValue((N==null?void 0:N.bottom)??0,t),paddingLeft:D.scalingValue((N==null?void 0:N.left)??0,t),height:ve,minHeight:ve},Z={fontSettings:{fontFamily:E,fontWeight:(de==null?void 0:de.fontWeight)??400,fontStyle:(de==null?void 0:de.fontStyle)??"normal"},fontSize:A??.01,lineHeight:he,letterSpacing:q??0,wordSpacing:ce??0,textAppearance:Q,color:R},me=sn(Yt(Z,t)),De=D.scalingValue(x??0,t),ge={fontSettings:{fontFamily:E,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:He??.01,lineHeight:xe,letterSpacing:le??0,wordSpacing:ee??0,textAppearance:ue,color:T},G=Yt(ge,t),Me={fontSettings:{fontFamily:E,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:Fe??.01,lineHeight:Ce,letterSpacing:P??0,wordSpacing:U??0,textAppearance:X,color:m},_e=sn(Yt(Me,t)),rt=D.buildColorVars(c,{inputColor:Y,inputTextColor:O,inputBorderColor:C,placeholderColor:V!=null&&V.trim()?V:"#cccccc",buttonColor:$,buttonTextColor:R,buttonBorderColor:k,labelTextColor:T,successColor:m,errorColor:M},Yg,Kg,B),[Je,at]=s.useState(()=>Object.fromEntries(te.map(Ae=>[Ae.name,""]))),[it,je]=s.useState("idle"),[Se,We]=s.useState(null),Be=r==="success"?"success":r==="error"?"error":it,Ze=r==="error"?j:Se,Le=r==="filled",Ve=s.useMemo(()=>{if(!Le)return Je;let Ae=null;for(const Ke of te)(Je[Ke.name]??"").trim().length>0||(Ae=Ae??{...Je},Ae[Ke.name]="Filled");return Ae??Je},[Je,Le,te]),se=Be==="error"?D.getFormFieldValidationError(te,Ve):null,Xe=`${r&&r!=="default"?`${c}-state-${r}`:""}`.trim(),ze=o==null?void 0:o.submitUrl,Re=(Ae,Ke)=>{at(Oe=>({...Oe,[Ae]:Ke}))},Pe=async Ae=>{if(Ae.preventDefault(),!d)return;const Ke=Object.fromEntries(te.map(Qe=>{var tt;return[Qe.name,((tt=Je[Qe.name])==null?void 0:tt.trim())??""]}).filter(([,Qe])=>Qe));if(!ze){je("error"),We("No integrations were found for this form.");return}if(Object.keys(Ke).length===0)return;const Oe=D.getFormFieldValidationError(te,Je);if(Oe){je("error"),We(Oe);return}je("submitting"),We(null);try{const Qe=await fetch(ze,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ke)});if(!Qe.ok){const tt=await Qe.text();throw new Error(tt||`Request failed: ${Qe.status}`)}je("success"),at(Object.fromEntries(te.map(tt=>[tt.name,""])))}catch(Qe){je("error"),We(Qe instanceof Error?Qe.message:"Something went wrong")}};return a.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Xe}`.trim(),style:rt,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:Xg(c)}}),a.jsxs("form",{onSubmit:Pe,className:`${c}-form`,children:[a.jsx("div",{className:`${c}-fields`,children:te.map((Ae,Ke)=>a.jsxs(s.Fragment,{children:[Ke>0&&a.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(h??0,t)}}),a.jsxs("div",{className:`${c}-field-group${J?` ${c}-labeled`:""}`,children:[J&&a.jsx("span",{className:`${c}-field-label`,style:G?{...G,lineHeight:G.fontSize}:void 0,children:Ae.label||Ae.name}),Ae.type==="textarea"?a.jsx("textarea",{name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,className:`${c}-input`,style:pe,rows:1,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0,"data-field-type":"textarea"}):a.jsx("input",{type:Ae.type==="phone"?"tel":Ae.type==="email"?"email":"text",name:Ae.name,autoComplete:"off",value:Ve[Ae.name]??"",onChange:Oe=>Re(Ae.name,Oe.target.value),placeholder:Ae.placeholder,required:Ae.isRequired??Ae.type==="email",className:`${c}-input`,style:pe,"data-filled":Le||(Ve[Ae.name]??"").trim().length>0})]})]},Ke))}),a.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:D.scalingValue(g??0,t)}}),a.jsx("div",{className:`${c}-overlay-anchor`,children:a.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:D.scalingValue(f??0,t),borderWidth:De,paddingTop:D.scalingValue((S==null?void 0:S.top)??0,t),paddingRight:D.scalingValue((S==null?void 0:S.right)??0,t),paddingBottom:D.scalingValue((S==null?void 0:S.bottom)??0,t),paddingLeft:D.scalingValue((S==null?void 0:S.left)??0,t),pointerEvents:d?"auto":void 0,...me,...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:it==="submitting"?"...":v})})})]}),Be==="success"&&a.jsx("p",{className:`${c}-success`,style:{..._e},children:ie}),Be==="error"&&a.jsx("p",{className:`${c}-error`,style:{..._e},role:"alert",children:se??Ze??j})]})}const Yg={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"},Kg=["hover","focus","filled","success","error"],Zg=`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';
|
|
@@ -789,7 +789,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
789
789
|
};
|
|
790
790
|
|
|
791
791
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
792
|
-
`,Yg=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{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."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],cr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],Zg={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","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"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},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"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",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"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},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"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...cr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},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:{...cr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},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"}},labelFontSettings:{...cr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...cr.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:{fieldsToShow:2,fields:Yg,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",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:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{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:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{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:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},Jg={element:Gg,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:Zg,sourceCode:Ug,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function dr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qg(e){return`
|
|
792
|
+
`,Jg=[{name:"name",type:"text",placeholder:"Enter your name",label:"Name",isRequired:!1,error:"Please, enter your name."},{name:"email",type:"email",placeholder:"Enter your email",label:"Email",isRequired:!0,error:"Please, enter a valid e-mail."},{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."},{name:"message",type:"textarea",placeholder:"Enter your message",label:"Message",isRequired:!1,error:"Message is required"},{name:"message2",type:"textarea",placeholder:"Enter your message 2",label:"Message 2",isRequired:!1,error:"Message 2 is required"},{name:"message3",type:"textarea",placeholder:"Enter your message 3",label:"Message 3",isRequired:!1,error:"Message 3 is required"}],cr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Qg=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],eh={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"common",title:"Fields",display:{type:"common-numeric-input"},min:1,max:7},fields:{type:"array",scope:"common",display:{type:"fields-group"},items:{type:"object",properties:{name:{type:"string"},type:{type:"string",enum:["text","textarea","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"}},successMessage:{type:"string",scope:"common",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"common",title:"Error Message",display:{type:"text-input"}},type:{type:"string",scope:"common",title:"",display:{type:"radio-group"},enum:["A","B","C"]},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input"},min:0,max:100},fieldsGap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",enabled:!0},min:0,max:100},buttonPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},inputPadding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},buttonStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},buttonCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},inputStroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"numeric-input"},min:0,max:20},inputCorners:{type:"number",scope:"layout",title:"Corners",display:{type:"numeric-input",enabled:!0},min:0,max:100},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"}},inputBorderColor:{type:"string",scope:"common",title:"Stroke Input",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"}},isButtonFullWidth:{type:"boolean",scope:"common",title:"Full Width",display:{type:"toggle",enum:["On","Off"]}},buttonBorderColor:{type:"string",scope:"common",title:"Stroke Button",display:{type:"palette-color-picker"}},labelTextColor:{type:"string",scope:"common",title:"Label Button",display:{type:"palette-color-picker",visible:!1}},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"}},stateOverrides:{type:"object",scope:"common"},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},inputFontSettings:{...cr.fontSettings,scope:"common",title:"Input",display:{type:"font-settings-weight"}},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:{...cr.fontSettings,scope:"common",title:"Button",display:{type:"font-settings-weight"}},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"}},labelFontSettings:{...cr.fontSettings,scope:"common",title:"Label",display:{type:"font-settings-weight",visible:!1}},labelFontSize:{type:"number",scope:"layout",title:"Label Font Size",display:{type:"font-size",visible:!1}},labelLineHeight:{type:"number",scope:"layout",title:"Label Line Height",display:{type:"line-height-input",visible:!1}},labelLetterSpacing:{type:"number",scope:"layout",title:"Label Letter Spacing",display:{type:"letter-spacing-input",visible:!1}},labelWordSpacing:{type:"number",scope:"layout",title:"Label Word Spacing",display:{type:"word-spacing-input",visible:!1}},labelTextAppearance:{type:"object",scope:"layout",title:"Label Text Appearance",display:{type:"text-appearance",visible:!1}},statusFontSettings:{...cr.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:{fieldsToShow:2,fields:Jg,type:"A",inputColor:"#FFFFFF",inputTextColor:"#0A00F8",inputBorderColor:"#A7A7A7",placeholderColor:"#808080",buttonColor:"#0A00F8",buttonTextColor:"#ffffff",buttonBorderColor:"#0A00F8",labelTextColor:"#999999",successColor:"#22c55e",errorColor:"#ef4444",stateOverrides:{hover:{buttonColor:"#194EFF"}},fontFamily:"Arial",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:"none",textDecoration:"none",fontVariant:"normal"},labelFontSettings:{fontWeight:400,fontStyle:"normal"},labelLetterSpacing:0,labelWordSpacing:0,labelTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},statusFontSettings:{fontWeight:400,fontStyle:"normal"},statusLetterSpacing:0,statusWordSpacing:0,statusTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},isButtonFullWidth:!0,buttonLabel:"Sign up",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields."},layoutDefaults:{m:{gap:.032,fieldsGap:.032,buttonStroke:0,buttonCorners:.192,inputStroke:.003,inputCorners:.192,buttonPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputPadding:{top:.0373,right:.0373,bottom:.0373,left:.0373},inputFontSize:.043,inputLineHeight:.043,buttonFontSize:.0426,buttonLineHeight:.0426,labelFontSize:.0373,labelLineHeight:.0373,statusFontSize:.0373,statusLineHeight:.0373},t:{gap:.02604,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.039,buttonPadding:{top:.0195,right:.02604,bottom:.0195,left:.0195},inputPadding:{top:.0195,right:.0195,bottom:.0195,left:.0195},inputFontSize:.02083,inputLineHeight:.02604,buttonFontSize:.02083,buttonLineHeight:.02604,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01},d:{gap:.0083,fieldsGap:.0083,buttonStroke:0,buttonCorners:.05,inputStroke:.001,inputCorners:.05,buttonPadding:{top:.01,right:.01,bottom:.01,left:.01},inputPadding:{top:.01,right:.01,bottom:.01,left:.01},inputFontSize:.01,inputLineHeight:.01,buttonFontSize:.01,buttonLineHeight:.01,labelFontSize:.01,labelLineHeight:.01,statusFontSize:.01,statusLineHeight:.01}},displayRules:[{if:{name:"type",value:"B"},then:{name:"properties.labelTextColor.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSettings.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelFontSize.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLineHeight.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelLetterSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelWordSpacing.display.visible",value:!0}},{if:{name:"type",value:"B"},then:{name:"properties.labelTextAppearance.display.visible",value:!0}},{if:{name:"type",value:"C"},then:{name:"properties.buttonCorners.display.enabled",value:!1}},{if:{name:"type",value:"C"},then:{name:"properties.inputCorners.display.enabled",value:!1}},{if:{name:"buttonStroke",value:0},then:{name:"properties.buttonBorderColor.display.visible",value:!1}},{if:{name:"inputStroke",value:0},then:{name:"properties.inputBorderColor.display.visible",value:!1}},{if:{name:"fieldsToShow",value:1},then:{name:"properties.fieldsGap.display.enabled",value:!1}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"group",title:"",items:[{type:"row",title:"Input",items:["inputCorners","inputPadding"]},{type:"row",title:"",items:["fieldsToShow","inputStroke"]}]},{type:"group",title:"",items:[{type:"row",title:"Button",items:["buttonCorners","buttonPadding"]},{type:"row",title:"",items:["buttonStroke","isButtonFullWidth"]}]}]},{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:["labelFontSettings",{type:"row",items:["labelFontSize","labelLineHeight","labelLetterSpacing","labelWordSpacing"]},"labelTextAppearance"]},{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:[...Qg],panelIds:["general","typeStyle"],stateItems:{default:["placeholderColor","inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor","labelTextColor"],hover:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],focus:["inputColor","inputBorderColor","buttonTextColor","buttonColor","buttonBorderColor"],filled:["inputTextColor","inputColor","inputBorderColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},allowedPlugins:["newsletter"],states:["default","hover","focus","filled","success","error"]},th={element:Ug,id:"form",name:"Newsletter Stacked",category:"forms",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Newsletter_Stacked.png"},defaultSize:{d:{width:300},t:{width:300},m:{width:340}},schema:eh,sourceCode:Zg,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function dr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function nh(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -982,7 +982,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
982
982
|
font-size: ${dr(14)};
|
|
983
983
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
984
984
|
}
|
|
985
|
-
`}const
|
|
985
|
+
`}const ih=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:r}=D.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:b,inputFontSettings:v,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:f,inputWordSpacing:x,inputTextAppearance:S,buttonFontSettings:y,buttonFontSize:w,buttonLineHeight:H,buttonLetterSpacing:N,buttonWordSpacing:Y,buttonTextAppearance:O,statusFontSettings:C,statusFontSize:V,statusLineHeight:$,statusLetterSpacing:R,statusWordSpacing:k,statusTextAppearance:T,iconMaxWidth:m,minHeight:M,corners:E,stroke:z,stateOverrides:ne,inputPadding:I,buttonPadding:W,successMessage:K="Thanks for subscribing!",errorMessage:ae="Please, fill all required fields."}=e,de=d.slice(0,Math.min(p,d.length)),[A,he]=s.useState(()=>Object.fromEntries(de.map(ge=>[ge.name,""]))),[q,ce]=s.useState("idle"),[Q,be]=s.useState(null),He=o==="success"?"success":o==="error"?"error":q,xe=o==="error"?ae:Q,le=o==="filled",ee=s.useMemo(()=>{if(!le)return A;let ge=null;for(const G of de)(A[G.name]??"").trim().length>0||(ge=ge??{...A},ge[G.name]="Filled");return ge??A},[le,A,de]),ue=He==="error"?D.getFormFieldValidationError(de,ee):null,oe=o&&o!=="default"?`${r}-state-${o}`:"",Fe=de.some(ge=>(ee[ge.name]??"").trim().length>0),Ce=oe!==`${r}-state-filled`&&Fe?`${r}-state-filled`:"",P=`${oe} ${Ce}`.trim(),U=i==null?void 0:i.submitUrl,X=u??"",ie=(c==null?void 0:c.icon)??"",j=(c==null?void 0:c.mode)==="On",B=X||"Submit",J={fontSettings:{fontFamily:b,fontWeight:(v==null?void 0:v.fontWeight)??400,fontStyle:(v==null?void 0:v.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:f??0,wordSpacing:x??0,textAppearance:S,color:e.inputTextColor??"#111111"},te={fontSettings:{fontFamily:b,fontWeight:(y==null?void 0:y.fontWeight)??400,fontStyle:(y==null?void 0:y.fontStyle)??"normal"},fontSize:w??.01,lineHeight:H,letterSpacing:N??0,wordSpacing:Y??0,textAppearance:O,color:e.buttonTextColor??"#ffffff"},$e={fontSettings:{fontFamily:b,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:V??.01,lineHeight:$,letterSpacing:R??0,wordSpacing:k??0,textAppearance:T,color:e.successColor??"#22c55e"},ye=sn(Yt(J,t)),F=sn(Yt(te,t)),ve=sn(Yt($e,t)),pe=D.buildColorVars(r,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(J==null?void 0:J.color)??"#111111",buttonTextColor:e.buttonTextColor??(te==null?void 0:te.color)??"#ffffff"},oh,rh,ne),Z={borderRadius:D.scalingValue(E,t),borderWidth:D.scalingValue(z,t),borderStyle:"solid"},me={borderLeftWidth:D.scalingValue(z,t)},De=async ge=>{if(ge.preventDefault(),!l)return;const G=Object.fromEntries(de.map(_e=>{var rt;return[_e.name,((rt=A[_e.name])==null?void 0:rt.trim())??""]}).filter(([,_e])=>_e));if(!U){ce("error"),be("No integrations were found for this form.");return}if(Object.keys(G).length===0)return;const Me=D.getFormFieldValidationError(de,A);if(Me){ce("error"),be(Me);return}ce("submitting"),be(null);try{const _e=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)});if(!_e.ok){const rt=await _e.text();throw new Error(rt||`Request failed: ${_e.status}`)}ce("success"),he(Object.fromEntries(de.map(rt=>[rt.name,""])))}catch(_e){ce("error"),be(_e instanceof Error?_e.message:"Something went wrong")}};return a.jsxs("div",{className:`${r}-wrapper ${P}`.trim(),style:pe,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nh(r)}}),a.jsxs("form",{onSubmit:De,className:`${r}-form`,style:{...Z,height:D.scalingValue(M,t),minHeight:D.scalingValue(M,t)},children:[a.jsx("div",{className:`${r}-inputWrap ${r}-overlayAnchor`,style:{flex:1,minWidth:0},children:de.map(ge=>a.jsx("input",{type:ge.type==="email"?"email":ge.type==="phone"?"tel":"text",name:ge.name,autoComplete:"off",value:ee[ge.name]??"",onChange:G=>he(Me=>({...Me,[ge.name]:G.target.value})),placeholder:ge.placeholder,required:ge.isRequired??ge.type==="email",className:`${r}-input`,style:{...ye,paddingRight:D.scalingValue(I.right,t),paddingLeft:D.scalingValue(I.left,t),paddingTop:D.scalingValue(I.top,t),paddingBottom:D.scalingValue(I.bottom,t)}},ge.name))}),a.jsx("div",{className:`${r}-overlayAnchor`,children:a.jsx("button",{type:l?"submit":"button",className:`${r}-submitBtn`,"aria-label":B,style:{...F,...me,paddingRight:D.scalingValue(W.right,t),paddingLeft:D.scalingValue(W.left,t),paddingTop:D.scalingValue(W.top,t),paddingBottom:D.scalingValue(W.bottom,t),pointerEvents:l?"auto":void 0},children:q==="submitting"?"...":j?ie&&a.jsx(ln,{url:ie,className:`${r}-submitBtnIcon`,style:{maxWidth:D.scalingValue(m??0,t)},fill:`var(--${r}-button-text-color)`,hoverFill:`var(--${r}-button-text-color)`}):X})})]}),He==="success"&&a.jsx("p",{className:`${r}-success`,style:{...ve},children:K}),He==="error"&&a.jsx("p",{className:`${r}-error`,style:{...ve},role:"alert",children:ue??xe??ae})]})},oh={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"},rh=["hover","focus","filled","success","error"],ah=`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
|
-
`,oh="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>'),rh=[{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"}}}},ah=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],sh={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:rh,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:oh},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:[...ah],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"]},lh={element:eh,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:sh,sourceCode:ih};function ch(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1564
|
+
`,sh="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>'),lh=[{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"}}}},ch=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],dh={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:lh,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:sh},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:[...ch],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"]},uh={element:ih,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:dh,sourceCode:ah};function ph(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
|
|
1696
|
+
`}const mh=30,gh=20,wa=3,hh=12,fh=32,yh=3,vh=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")},xh=(e,t)=>Array.from({length:t},()=>e).flat(),bh=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},Hd=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Rl=(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=Hd(d);return c<=0?0:c+r*Math.max(0,t-1)},wh=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=Hd(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},Sh=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},$h=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>Sh(i,e))},Ch=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??"")},Th=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,Lh=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:r,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var k,T,m,M;const p=s.useRef(null),b=!!((k=e.image)!=null&&k.url&&Ch(e.image));s.useLayoutEffect(()=>{d&&Th(p.current)&&(u==null||u())},[d,(T=e.image)==null?void 0:T.url,u]);const v=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[f,x]=g.split(":").map(Number),w=(h?x:f)/(h?f:x),H=i/w,N=H>o?o:H,Y=H>o?o*w:i,O=c(Y),C=c(N),V={borderRadius:c(r)},$=v?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...V}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...V},R=((m=e.image)==null?void 0:m.url)&&(b?a.jsx("video",{ref:E=>{p.current=E},src:e.image.url,style:$,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):a.jsx("img",{ref:E=>{p.current=E},src:e.image.url,alt:((M=e.image)==null?void 0:M.name)??"",style:$,onLoad:d?u:void 0,onError:d?u:void 0}));return a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...v?{width:O}:{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,...v?{width:O,height:C,overflow:"hidden",...V}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:R&&e.link?a.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:yt(`${t}-marquee-link`,!v&&`${t}-marquee-link-contain`),children:R}):R})})},Rh=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),[l,d]=s.useState(0),c=l>0?Math.round(l):0,u=s.useMemo(()=>ph(r,c),[r,c]),{speed:p,direction:b,pauseOnHover:v,gap:g,imageMaxWidth:h,imageMaxHeight:f,hoverEffect:x,cornerRadius:S=0}=e,y=s.useMemo(()=>bh(e.imageFit),[e.imageFit]),w=(t==null?void 0:t.length)??0,H=!!o,N=!n||!!i,Y=N&&x!=="off"&&x!=="randomize"?`${r}-image-hover-${x}`:void 0,O=n?!!i:!0,V=((t==null?void 0:t.length)??0)>0&&(O||!!n),$=Math.max(0,p)*mh,R=Ce=>D.scalingValue(Ce,n??!1),k=s.useRef(null),T=s.useRef(null),m=s.useRef(null),[M,E]=s.useState(0),z=O&&v==="on",[ne,I]=s.useState(!1),[W,K]=s.useState({}),ae=s.useRef(W);ae.current=W;const de=s.useRef(null),A=s.useRef(0),he=s.useRef(null),q=s.useMemo(()=>(t??[]).map(Ce=>{var P;return((P=Ce.image)==null?void 0:P.url)??""}).join("\0"),[t]),[ce,Q]=s.useState(wa),be=s.useMemo(()=>{const Ce=t??[];return Ce.length===0||!(O||!!n)?Ce:xh(Ce,ce)},[t,O,ce,n]),He=s.useMemo(()=>(t??[]).filter(Ce=>{var P;return!!((P=Ce.image)!=null&&P.url)}).length,[t]),xe=V?yh:1;s.useLayoutEffect(()=>{A.current=0,K({}),de.current=null,Q(wa),d(0)},[q]),s.useEffect(()=>{if(!N||x!=="randomize")return;const Ce=k.current;if(!Ce)return;const P=j=>{K(B=>{const J=Array.from(j).filter($e=>$e in B&&!$h(Ce,$e));if(J.length===0)return B;const te={...B};return J.forEach($e=>{delete te[$e]}),te})},U=new IntersectionObserver(j=>{const B=new Set;for(const J of j){const te=J.target.dataset.marqueeItemIndex,$e=te!==void 0?Number(te):NaN;Number.isNaN($e)||B.add($e)}B.size>0&&P(B)},{root:Ce,threshold:0});Object.keys(W).forEach(j=>{const B=Number(j);Ce.querySelectorAll(`[data-marquee-item-index="${B}"]`).forEach(J=>U.observe(J))});const X={current:0},ie=()=>{const j=Object.keys(ae.current);j.length!==0&&(P(j.map(Number)),X.current=requestAnimationFrame(ie))};return Object.keys(ae.current).length>0&&(X.current=requestAnimationFrame(ie)),()=>{cancelAnimationFrame(X.current),U.disconnect()}},[x,W,N]),s.useLayoutEffect(()=>{if(!V)return;const Ce=k.current,P=m.current;if(!Ce||!P)return;const U={current:0},X=()=>{const B=Ce.getBoundingClientRect().width||Ce.offsetWidth,J=wh(P),te=de.current,$e=typeof te=="number"&&Math.abs(te-J)<=.25;de.current=J;let ye=ce,F=0;if((O||n)&&w>0&&B>0){const Z=Rl(P,w);if(Z>=fh){F=Z;const me=Math.min(hh,Math.max(wa,Math.ceil(B/Z)+1));ye=me,me!==ce&&Q(me)}}const pe=ye!==ce&&F>0?F*ye:J>0?J:F>0?F*ye:(()=>{const Z=Rl(P,w);return Z>0?Z*ye:0})();pe>0?d(Z=>Z<=0?pe:!$e||Math.round(Z)===Math.round(pe)?Z:pe):!$e&&l<=0&&(cancelAnimationFrame(U.current),U.current=requestAnimationFrame(X))},ie=()=>{cancelAnimationFrame(U.current),U.current=requestAnimationFrame(X)};he.current=ie,ie();const j=new ResizeObserver(ie);return j.observe(Ce),j.observe(P),()=>{he.current=null,cancelAnimationFrame(U.current),j.disconnect()}},[O,V,l,q,ce,w,n]),s.useLayoutEffect(()=>{if(!V||c<=0)return;const Ce=T.current;Ce&&vh(Ce)},[V,c,b,$]),s.useLayoutEffect(()=>{if(!V||l<=0){E(0);return}const Ce=T.current,P=m.current;if(!Ce||!P)return;const U=()=>{const ie=Ce.offsetHeight||Ce.getBoundingClientRect().height,j=Array.from(P.children).reduce((J,te)=>Math.max(J,te.offsetHeight||te.getBoundingClientRect().height),0),B=ie>0?ie:j;E(B>0?B:0)};U();const X=new ResizeObserver(U);return X.observe(Ce),X.observe(P),()=>X.disconnect()},[V,xe,be,n,g,h,f,l,y,W]),s.useLayoutEffect(()=>{if(!n||!H||!V||typeof window>"u")return;const Ce=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Ce)},[n,H,V,b,l,M,g,be]);const le=()=>{z&&I(!0)},ee=()=>{z&&I(!1)},ue=s.useCallback(()=>{var Ce;A.current=Math.min(He,A.current+1),(Ce=he.current)==null||Ce.call(he)},[He]),oe=s.useCallback((Ce,P)=>{K(U=>{const X=U[Ce]??P,ie=(t??[]).filter(B=>B!==X);if(ie.length===0)return U;const j=ie[Math.floor(Math.random()*ie.length)];return{...U,[Ce]:j}})},[t]),Fe=(Ce,P,U,X)=>{const ie=N&&x==="randomize"&&y.display==="cover"?W[U]??Ce:Ce,j=`max(${R(g)}, ${gh}px)`,B=`calc(-0.5 * (${j} + ${R(g)}))`;return a.jsxs("div",{className:`${r}-marquee-card`,"data-marquee-item-index":U,onMouseEnter:N&&x==="randomize"&&y.display==="cover"?()=>oe(U,Ce):void 0,children:[a.jsx(Lh,{item:ie,prefix:r,imageFit:y,imageMaxWidth:h,imageMaxHeight:f,cornerRadius:S,imageHoverClass:Y,isEditor:n,isFirstSet:X,scaled:R,onFirstSetImageDone:ue}),H&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${r}-gap-control`,style:{position:"absolute",top:0,right:B,width:j,height:"100%"}})]},`${P}-${U}`)};if(V){const Ce=O?z&&ne?"paused":"running":"paused",P=c>0&&$>0?c/$*1e3:0,U=`${Math.max(0,P)/1e3}s`;return a.jsxs("div",{ref:k,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Marquee",style:M>0?{height:M}:void 0,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{ref:T,className:`${r}-marquee-track`,"data-direction":b,onMouseEnter:le,onMouseLeave:ee,style:{WebkitAnimationDuration:U,animationDuration:U,WebkitAnimationPlayState:Ce,animationPlayState:Ce},children:Array.from({length:xe},(X,ie)=>a.jsx("div",{ref:ie===0?m:void 0,className:yt(`${r}-marquee-row`,`${r}-marquee-set`),style:{gap:R(g),paddingRight:R(g)},"aria-hidden":ie>0,children:be.map((j,B)=>Fe(j,ie,B,ie===0&&B<w))},`set-${ie}`))})]})}return a.jsxs("div",{ref:k,className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),a.jsx("div",{className:yt(`${r}-marquee-row`,`${r}-marquee-static`),style:{gap:R(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Ce,P)=>Fe(Ce,0,P))},"marquee-static")]})},Ih=`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';
|
|
@@ -2476,7 +2476,7 @@ type MarqueeProps = {
|
|
|
2476
2476
|
isPreviewMode?: boolean;
|
|
2477
2477
|
isEditMode?: boolean;
|
|
2478
2478
|
} & CommonComponentProps;
|
|
2479
|
-
`,
|
|
2479
|
+
`,Eh={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},hoverEffect:{type:"string",scope:"common",title:"Effect",display:{type:"toggle-cycle",enum:["off","brightness","grayscale"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},imageMaxWidth:{type:"number",scope:"layout",title:"Max width",min:10,display:{type:"numeric-input"}},imageMaxHeight:{type:"number",scope:"layout",title:"Max height",min:10,display:{type:"numeric-input"}},imageFit:{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",min:0,display:{type:"numeric-input"}}},defaults:{direction:"left",pauseOnHover:"off",hoverEffect:"off",imageFit:{display:"fit",ratioValue:"16:9",reversed:!1}},layoutDefaults:{m:{speed:.55,gap:.04,imageMaxWidth:.8,imageMaxHeight:.8,cornerRadius:0},t:{speed:1.64,gap:.02,imageMaxWidth:.5208,imageMaxHeight:.5208,cornerRadius:0},d:{speed:1.64,gap:.02,imageMaxWidth:.208,imageMaxHeight:.278,cornerRadius:0}},displayRules:[{if:{name:"imageFit.display",value:"cover"},then:{name:"properties.hoverEffect.display.enum",value:["off","brightness","grayscale","randomize"]}}],layout:["__componentName__","speed","direction","pauseOnHover","hoverEffect","gap","imageMaxWidth","imageMaxHeight","imageFit","cornerRadius"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction"]},{type:"row",items:["speed","imageFit"]},{type:"row",items:["imageMaxWidth","imageMaxHeight"]},{type:"row",items:["cornerRadius"]},{type:"row",title:"Hover Settings",items:[{type:"row",title:"",items:["hoverEffect","pauseOnHover"]}]}]}],content:{type:"array",settings:{addItemFromFileExplorer:!0,allowsVideo:!0},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"]}}},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}}},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:""},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:""},link:""}]}},Mh={element:Rh,id:"marquee",name:"Simple Marquee",category:"galleries",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Simple-Marquee.mp4"},schema:Eh,sourceCode:Ih,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function Ph(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2480
2480
|
.${e}-item-image-wrap {
|
|
2481
2481
|
display: flex;
|
|
2482
2482
|
flex: 0 0 auto;
|
|
@@ -2605,7 +2605,7 @@ ${o}
|
|
|
2605
2605
|
left: -9999px;
|
|
2606
2606
|
top: 0;
|
|
2607
2607
|
}
|
|
2608
|
-
`}const Eh=30,Sa=3,Mh=12,Ph=3,as=.72,kh=100,Ah=10,Fh=e=>e/kh,_h=e=>Math.max(0,e)/Ah,Wh=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")},Nh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},Hh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),Oh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Il=e=>{e.style.transform=""},Dh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},jh=(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)},zh=96,Bh=(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 b=p*c,y=b+c;o[p+1]=y,r[p+1]=r[p]+(d(b)+d(y))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Vh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const f=g+h>>1;return l[f]<=r?c(f,h):c(g,f)},[u,p]=c(0,l.length-1),b=l[p]-l[u],y=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*y)},Gh=(e,t,n,i)=>{const o=Math.max(0,n),r=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(r*p),d=p=>t*r*Math.cos(r*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,b)=>{const y=b/c*e,g=(b+1)/c*e,h=g-y,f=l(y),x=l(g),S=y+h/3,v=f+d(y)*h/3,w=g-h/3,H=x-d(g)*h/3;return`C${S.toFixed(2)} ${v.toFixed(2)} ${w.toFixed(2)} ${H.toFixed(2)} ${g.toFixed(2)} ${x.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},qh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${as}em`},u=((g=e.image)==null?void 0:g.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=a.jsxs(a.Fragment,{children:[p,b]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:y}):y})},Xh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=O.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:y,curveAmplitude:g,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:S,textLineHeight:v,textLetterSpacing:w,textWordSpacing:H,textTextAppearance:N,textColor:Y,backgroundColor:D,ribbonWidth:C}=e,V=C??v,$=y==="curve",I=Fh(g),k=_h(h),T=s.useMemo(()=>Ih(o,d,$),[o,d,$]),m=s.useMemo(()=>Yt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:H,fontSize:S,lineHeight:v,textAppearance:N,color:Y},n),[f,x,w,H,S,v,N,Y,n]),M=we=>O.scalingValue(we,n??!1),E=((t==null?void 0:t.length)??0)>0,z=n?!!i:!0,ne=E&&(z||!!n),R=Math.max(0,c)*Eh,W=z&&p==="on",[K,ae]=s.useState(!1),de=z?W&&K?"paused":"running":"paused",A=de==="running"&&R>0&&d>0,he=d>0&&R>0?d/R*1e3:0,q=s.useRef(null),ce=s.useRef(null),Q=s.useRef(null),be=s.useRef(null),We=s.useRef(null),xe=s.useRef(null),le=s.useRef(A),ee=s.useRef(null),ue=s.useRef(null),oe=s.useRef(I),Ne=s.useRef(k);le.current=A,oe.current=I,Ne.current=k;const[Te,P]=s.useState(0),[U,X]=s.useState(0),[ie,j]=s.useState(0),[B,J]=s.useState(0),[te,Ce]=s.useState(0),ye=s.useMemo(()=>(t??[]).map(we=>{var Le;return`${we.text}\0${((Le=we.image)==null?void 0:Le.url)??""}\0${we.link??""}`}).join("\0"),[t]),[F,ve]=s.useState(Sa),pe=s.useMemo(()=>{const we=t??[];return we.length===0||!(z||n)?we:Nh(we,F)},[t,z,F,n]),Z=ne?Ph:1;s.useLayoutEffect(()=>{ve(Sa),l(0)},[ye]),s.useLayoutEffect(()=>{var Ue;const we=xe.current;if(!we)return;const Le=()=>{const He=getComputedStyle(we),Qe=parseFloat(He.fontSize)||0;if(Qe<=0)return;const it=Hh();if(!it){P(Qe*as),X(0);return}it.font=`${He.fontStyle} ${He.fontWeight} ${Qe}px ${He.fontFamily}`;const tt=it.measureText("H"),St=tt.actualBoundingBoxAscent>0?tt.actualBoundingBoxAscent:Qe*as,$t=Math.max(0,tt.actualBoundingBoxDescent||0),Rt=tt.fontBoundingBoxAscent||0,yt=tt.fontBoundingBoxDescent||0;P(kt=>Math.abs(kt-St)>.5?St:kt);const pt=Rt>0||yt>0?(yt-$t-(Rt-St))/2:0;X(kt=>Math.abs(kt-pt)>.25?pt:kt)};Le();const Ze=typeof document<"u"?document.fonts:void 0;(Ue=Ze==null?void 0:Ze.ready)==null||Ue.then(Le).catch(()=>{});const Oe=new ResizeObserver(Le);return Oe.observe(we),()=>Oe.disconnect()},[m.fontFamily,m.fontWeight,m.fontStyle,m.fontSize,m.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const we=q.current,Le=be.current;if(!we||!Le)return;const Ze={id:0},Oe=()=>{const it=we.offsetWidth||we.getBoundingClientRect().width,tt=Le.offsetWidth||Le.getBoundingClientRect().width;if(E&&it>0&&tt>0){const St=tt/F;if(St>0){const $t=Math.min(Mh,Math.max(Sa,Math.ceil(it/St)+1));if($t!==F){ve($t);return}}}tt>0&&l(tt)},Ue=()=>{cancelAnimationFrame(Ze.id),Ze.id=requestAnimationFrame(Oe)};Ue();const He=new ResizeObserver(Ue);He.observe(we),He.observe(Le);const Qe=()=>{document.hidden||Ue()};return document.addEventListener("visibilitychange",Qe),window.addEventListener("pageshow",Qe),window.addEventListener("focus",Qe),()=>{cancelAnimationFrame(Ze.id),He.disconnect(),document.removeEventListener("visibilitychange",Qe),window.removeEventListener("pageshow",Qe),window.removeEventListener("focus",Qe)}},[ne,ye,F,E,Te]),s.useLayoutEffect(()=>{const we=We.current;if(!we)return;const Le={id:0},Ze=()=>{const Ue=we.offsetHeight;Ue>0&&Ce(He=>Math.abs(He-Ue)>.5?Ue:He)};Le.id=requestAnimationFrame(Ze);const Oe=new ResizeObserver(()=>{cancelAnimationFrame(Le.id),Le.id=requestAnimationFrame(Ze)});return Oe.observe(we),()=>{cancelAnimationFrame(Le.id),Oe.disconnect()}},[V,n]),s.useLayoutEffect(()=>{if(!$){j(0),J(0);return}const we=q.current,Le=be.current;if(!we||!Le)return;const Ze={id:0},Oe=()=>{const He=we.offsetWidth,Qe=Le.offsetHeight;He>0&&J(it=>Math.abs(it-He)>.5?He:it),Qe>0&&j(it=>Math.abs(it-Qe)>.5?Qe:it)};Ze.id=requestAnimationFrame(Oe);const Ue=new ResizeObserver(()=>{cancelAnimationFrame(Ze.id),Ze.id=requestAnimationFrame(Oe)});return Ue.observe(we),Ue.observe(Le),()=>{cancelAnimationFrame(Ze.id),Ue.disconnect()}},[$,ye,Te,v,S,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const we=Q.current;we&&Wh(we)},[ne,d,u,R]),s.useLayoutEffect(()=>{if(!$||!E)return;const we=q.current;if(!we)return;const Le={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ze=()=>{for(const St of Le.itemsCache)for(const $t of St.glyphs)Il($t.inner)},Oe=()=>{const St=ce.current??we;Le.itemsCache=Array.from(we.querySelectorAll("[data-marquee-text-item]"),$t=>{const Rt=[];return $t.querySelectorAll("[data-marquee-wave-node]").forEach(yt=>{const pt=yt.firstElementChild;pt&&Rt.push({inner:pt,layoutLocalX:jh(yt,St)})}),{item:$t,glyphs:Rt}}),Le.cacheDirty=!1},Ue=()=>{Le.cacheDirty&&Oe();const $t=(ce.current??we).offsetWidth||1,Rt=$t*oe.current,yt=Ne.current,pt=2*Math.PI*yt/$t,kt=`${$t}|${Rt}|${pt}`;if(kt!==Le.lutKey&&(Le.lutKey=kt,Le.lut=Bh(Rt,pt,zh)),Math.abs(Rt)<=0||pt<=0){Ze();return}const Wt=Q.current,bt=Wt?Dh(getComputedStyle(Wt).transform):0,Nt=we.getBoundingClientRect(),Gt=Nt.left,Zt=Nt.right,en=Le.lut&&Le.lut.wavelength>0?Math.max(0,(Le.lut.periodArc/Le.lut.wavelength-1)*$t):0;for(const{item:Lt,glyphs:Ht}of Le.itemsCache){const nn=Lt.getBoundingClientRect();if(nn.right<Gt||nn.left>Zt+en){for(const ut of Ht)Il(ut.inner);continue}for(const ut of Ht){const Me=ut.layoutLocalX+bt,Ge=Le.lut?Vh(Le.lut,Me):Me,st=pt*Ge,gt=Rt*Math.sin(st),vt=Rt*pt*Math.cos(st),It=Math.atan(vt)*(180/Math.PI);Oh(ut.inner,Ge-Me,gt,It)}}},He=()=>{Le.cancelled||(Le.raf=0,Ue(),le.current&&!document.hidden&&(Le.raf=requestAnimationFrame(He)))},Qe=()=>{Le.cancelled||Le.raf||(Le.raf=requestAnimationFrame(He))},it=()=>{Le.cacheDirty=!0,Ue(),Qe()};ee.current=Qe,ue.current=it,Ue(),Qe();const tt=()=>{if(document.hidden){cancelAnimationFrame(Le.raf),Le.raf=0;return}cancelAnimationFrame(Le.raf),Le.raf=0,it()};return document.addEventListener("visibilitychange",tt),window.addEventListener("pageshow",tt),window.addEventListener("focus",tt),()=>{Le.cancelled=!0,ee.current=null,ue.current=null,cancelAnimationFrame(Le.raf),document.removeEventListener("visibilitychange",tt),window.removeEventListener("pageshow",tt),window.removeEventListener("focus",tt),Ze()}},[$,E]),s.useLayoutEffect(()=>{var we;!$||!E||(we=ue.current)==null||we.call(ue)},[$,E,r,ye,F,Te,I,k,B]),s.useLayoutEffect(()=>{var we;(we=ee.current)==null||we.call(ee)},[A,u]);const me=()=>{W&&ae(!0)},De=()=>{W&&ae(!1)},ge=$?Math.abs(I)*100:0,G=M(V),ke={minHeight:G,...$?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},Fe={height:G,...$?{visibility:"hidden"}:{backgroundColor:D}},rt={gap:M(b),minHeight:G},Je=B*I,at=Math.abs(Je),nt=te>0?te:ie,je=Math.max(ie,nt),$e=at+je/2,Ae=$&&B>0&&je>0?Gh(B,Je,k,$e):"",Be=at*2+je,Ke=Ae?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${B} ${Be}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Ae,fill:"none",stroke:D,strokeWidth:nt,strokeLinecap:"round",strokeLinejoin:"round"})}):null,Ie=a.jsx("div",{ref:We,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),ze=(we,Le,Ze)=>a.jsx(qh,{item:we,prefix:o,textCss:m,capHeightPx:Te,opticalOffsetY:U,imageGapPx:M(b),isCurve:$},`${Le}-${Ze}`),se=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:m,children:"H"}),Re=`${Math.max(0,he)/1e3}s`,qe=ne?a.jsx("div",{ref:Q,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:me,onMouseLeave:De,style:{WebkitAnimationDuration:Re,animationDuration:Re,WebkitAnimationPlayState:de,animationPlayState:de},children:Array.from({length:Z},(we,Le)=>a.jsx("div",{ref:Le===0?be:void 0,className:`${o}-marquee-set`,style:{...rt,paddingRight:M(b)},"aria-hidden":Le>0,children:pe.map((Ze,Oe)=>ze(Ze,Le,Oe))},`set-${Le}`))}):a.jsx("div",{ref:be,className:ht(`${o}-marquee-set`,`${o}-marquee-static`),style:rt,children:t==null?void 0:t.map((we,Le)=>ze(we,0,Le))});return a.jsxs("div",{ref:q,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),se,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:ke,children:[Ie,Ke,qe]})]})},Uh=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2608
|
+
`}const kh=30,Sa=3,Ah=12,Fh=96,Il=3,as=.72,_h=100,Wh=10,Nh=e=>e/_h,Hh=e=>Math.max(0,e)/Wh,Oh=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")},Dh=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),ki={ctx:void 0},jh=()=>ki.ctx!==void 0?ki.ctx:typeof document>"u"?(ki.ctx=null,ki.ctx):(ki.ctx=document.createElement("canvas").getContext("2d"),ki.ctx),zh=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},El=e=>{e.style.transform=""},Bh=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},Vh=(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)},Od=96,Dd=(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 b=p*c,v=b+c;o[p+1]=v,r[p+1]=r[p]+(d(b)+d(v))*.5*c}),{wavelength:i,periodArc:r[n],x:o,s:r}},Gh=(e,t)=>{const n=Dd(e,t,Od);return!n||n.wavelength<=0?1:n.periodArc/n.wavelength},qh=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),r=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const f=g+h>>1;return l[f]<=r?c(f,h):c(g,f)},[u,p]=c(0,l.length-1),b=l[p]-l[u],v=b>0?(r-l[u])/b:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*v)},Xh=(e,t,n,i,o=0)=>{const r=Math.max(0,n),l=e>0?2*Math.PI*r/e:0,d=h=>i+t*Math.sin(l*h),c=h=>t*l*Math.cos(l*h),u=-o,b=e+o-u,v=Math.max(4,Math.ceil(r*4*(b/Math.max(e,1)))),g=Array.from({length:v},(h,f)=>{const x=u+f/v*b,S=u+(f+1)/v*b,y=S-x,w=d(x),H=d(S),N=x+y/3,Y=w+c(x)*y/3,O=S-y/3,C=H-c(S)*y/3;return`C${N.toFixed(2)} ${Y.toFixed(2)} ${O.toFixed(2)} ${C.toFixed(2)} ${S.toFixed(2)} ${H.toFixed(2)}`});return[`M${u.toFixed(2)} ${d(u).toFixed(2)}`,...g].join(" ")},Uh=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:r,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${as}em`},u=((g=e.image)==null?void 0:g.url)&&a.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?a.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),b=l?a.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,f)=>a.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:a.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},f))}):a.jsx("span",{className:`${t}-text`,style:d,children:e.text}),v=a.jsxs(a.Fragment,{children:[p,b]});return a.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:r},children:e.link?a.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:r},children:v}):v})},Yh=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=D.useScopedStyles(),[r,l]=s.useState(0),d=r>0?Math.round(r):0,{speed:c,direction:u,pauseOnHover:p,gap:b,layoutType:v,curveAmplitude:g,curveFrequency:h,textFontFamily:f,textFontSettings:x,textFontSize:S,textLineHeight:y,textLetterSpacing:w,textWordSpacing:H,textTextAppearance:N,textColor:Y,backgroundColor:O,ribbonWidth:C}=e,V=C??y,$=v==="curve",R=Nh(g),k=Hh(h),T=s.useMemo(()=>Ph(o,d,$),[o,d,$]),m=s.useMemo(()=>Yt({fontSettings:{fontFamily:f,fontWeight:x.fontWeight,fontStyle:x.fontStyle},letterSpacing:w,wordSpacing:H,fontSize:S,lineHeight:y,textAppearance:N,color:Y},n),[f,x,w,H,S,y,N,Y,n]),M=Re=>D.scalingValue(Re,n??!1),E=((t==null?void 0:t.length)??0)>0,z=n?!!i:!0,ne=E&&(z||!!n),I=Math.max(0,c)*kh,W=z&&p==="on",[K,ae]=s.useState(!1),de=z?W&&K?"paused":"running":"paused",A=de==="running"&&I>0&&d>0,he=d>0&&I>0?d/I*1e3:0,q=s.useRef(null),ce=s.useRef(null),Q=s.useRef(null),be=s.useRef(null),He=s.useRef(null),xe=s.useRef(null),le=s.useRef(A),ee=s.useRef(null),ue=s.useRef(null),oe=s.useRef(R),Fe=s.useRef(k);le.current=A,oe.current=R,Fe.current=k;const[Ce,P]=s.useState(0),[U,X]=s.useState(0),[ie,j]=s.useState(0),[B,J]=s.useState(0),[te,$e]=s.useState(0),ye=s.useMemo(()=>(t??[]).map(Re=>{var Pe;return`${Re.text}\0${((Pe=Re.image)==null?void 0:Pe.url)??""}\0${Re.link??""}`}).join("\0"),[t]),[F,ve]=s.useState(Sa),pe=s.useMemo(()=>{const Re=t??[];return Re.length===0||!(z||n)?Re:Dh(Re,F)},[t,z,F,n]),Z=ne?Il:1;s.useLayoutEffect(()=>{ve(Sa),l(0)},[ye]),s.useLayoutEffect(()=>{var Oe;const Re=xe.current;if(!Re)return;const Pe=()=>{const Qe=getComputedStyle(Re),tt=parseFloat(Qe.fontSize)||0;if(tt<=0)return;const nt=jh();if(!nt){P(tt*as),X(0);return}nt.font=`${Qe.fontStyle} ${Qe.fontWeight} ${tt}px ${Qe.fontFamily}`;const xt=nt.measureText("H"),It=xt.actualBoundingBoxAscent>0?xt.actualBoundingBoxAscent:tt*as,Tt=Math.max(0,xt.actualBoundingBoxDescent||0),ut=xt.fontBoundingBoxAscent||0,ft=xt.fontBoundingBoxDescent||0;P(Lt=>Math.abs(Lt-It)>.5?It:Lt);const Et=ut>0||ft>0?(ft-Tt-(ut-It))/2:0;X(Lt=>Math.abs(Lt-Et)>.25?Et:Lt)};Pe();const Ae=typeof document<"u"?document.fonts:void 0;(Oe=Ae==null?void 0:Ae.ready)==null||Oe.then(Pe).catch(()=>{});const Ke=new ResizeObserver(Pe);return Ke.observe(Re),()=>Ke.disconnect()},[m.fontFamily,m.fontWeight,m.fontStyle,m.fontSize,m.lineHeight]),s.useLayoutEffect(()=>{if(!ne)return;const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const nt=Re.offsetWidth||Re.getBoundingClientRect().width,xt=Pe.offsetWidth||Pe.getBoundingClientRect().width;if(E&&nt>0&&xt>0){const It=xt/F;if(It>0){let Tt=nt,ut=Ah;if($){const Et=nt*oe.current,Lt=Fe.current,bt=Lt>0?2*Math.PI*Lt/nt:0,Nt=Gh(Et,bt);Tt=Math.max(nt,Nt*nt/(Il-1)),ut=Fh}const ft=Math.min(ut,Math.max(Sa,Math.ceil(Tt/It)+1));if(ft!==F){ve(ft);return}}}xt>0&&l(xt)},Oe=()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)};Oe();const Qe=new ResizeObserver(Oe);Qe.observe(Re),Qe.observe(Pe);const tt=()=>{document.hidden||Oe()};return document.addEventListener("visibilitychange",tt),window.addEventListener("pageshow",tt),window.addEventListener("focus",tt),()=>{cancelAnimationFrame(Ae.id),Qe.disconnect(),document.removeEventListener("visibilitychange",tt),window.removeEventListener("pageshow",tt),window.removeEventListener("focus",tt)}},[ne,ye,F,E,Ce,$,R,k]),s.useLayoutEffect(()=>{const Re=He.current;if(!Re)return;const Pe={id:0},Ae=()=>{const Oe=Re.offsetHeight;Oe>0&&$e(Qe=>Math.abs(Qe-Oe)>.5?Oe:Qe)};Pe.id=requestAnimationFrame(Ae);const Ke=new ResizeObserver(()=>{cancelAnimationFrame(Pe.id),Pe.id=requestAnimationFrame(Ae)});return Ke.observe(Re),()=>{cancelAnimationFrame(Pe.id),Ke.disconnect()}},[V,n]),s.useLayoutEffect(()=>{if(!$){j(0),J(0);return}const Re=q.current,Pe=be.current;if(!Re||!Pe)return;const Ae={id:0},Ke=()=>{const Qe=Re.offsetWidth,tt=Pe.offsetHeight;Qe>0&&J(nt=>Math.abs(nt-Qe)>.5?Qe:nt),tt>0&&j(nt=>Math.abs(nt-tt)>.5?tt:nt)};Ae.id=requestAnimationFrame(Ke);const Oe=new ResizeObserver(()=>{cancelAnimationFrame(Ae.id),Ae.id=requestAnimationFrame(Ke)});return Oe.observe(Re),Oe.observe(Pe),()=>{cancelAnimationFrame(Ae.id),Oe.disconnect()}},[$,ye,Ce,y,S,ne]),s.useLayoutEffect(()=>{if(!ne||d<=0)return;const Re=Q.current;Re&&Oh(Re)},[ne,d,u,I]),s.useLayoutEffect(()=>{if(!$||!E)return;const Re=q.current;if(!Re)return;const Pe={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},Ae=()=>{for(const It of Pe.itemsCache)for(const Tt of It.glyphs)El(Tt.inner)},Ke=()=>{const It=ce.current??Re;Pe.itemsCache=Array.from(Re.querySelectorAll("[data-marquee-text-item]"),Tt=>{const ut=[];return Tt.querySelectorAll("[data-marquee-wave-node]").forEach(ft=>{const Et=ft.firstElementChild;Et&&ut.push({inner:Et,layoutLocalX:Vh(ft,It)})}),{item:Tt,glyphs:ut}}),Pe.cacheDirty=!1},Oe=()=>{Pe.cacheDirty&&Ke();const Tt=(ce.current??Re).offsetWidth||1,ut=Tt*oe.current,ft=Fe.current,Et=2*Math.PI*ft/Tt,Lt=`${Tt}|${ut}|${Et}`;if(Lt!==Pe.lutKey&&(Pe.lutKey=Lt,Pe.lut=Dd(ut,Et,Od)),Math.abs(ut)<=0||Et<=0){Ae();return}const bt=Q.current,Nt=bt?Bh(getComputedStyle(bt).transform):0,Bt=Re.getBoundingClientRect(),Zt=Bt.left,en=Bt.right,Rt=Pe.lut&&Pe.lut.wavelength>0?Math.max(0,(Pe.lut.periodArc/Pe.lut.wavelength-1)*Tt):0;for(const{item:Ot,glyphs:nn}of Pe.itemsCache){const pt=Ot.getBoundingClientRect();if(pt.right<Zt||pt.left>en+Rt){for(const Ee of nn)El(Ee.inner);continue}for(const Ee of nn){const qe=Ee.layoutLocalX+Nt,st=Pe.lut?qh(Pe.lut,qe):qe,mt=Et*st,vt=ut*Math.sin(mt),Mt=ut*Et*Math.cos(mt),gt=Math.atan(Mt)*(180/Math.PI);zh(Ee.inner,st-qe,vt,gt)}}},Qe=()=>{Pe.cancelled||(Pe.raf=0,Oe(),le.current&&!document.hidden&&(Pe.raf=requestAnimationFrame(Qe)))},tt=()=>{Pe.cancelled||Pe.raf||(Pe.raf=requestAnimationFrame(Qe))},nt=()=>{Pe.cacheDirty=!0,Oe(),tt()};ee.current=tt,ue.current=nt,Oe(),tt();const xt=()=>{if(document.hidden){cancelAnimationFrame(Pe.raf),Pe.raf=0;return}cancelAnimationFrame(Pe.raf),Pe.raf=0,nt()};return document.addEventListener("visibilitychange",xt),window.addEventListener("pageshow",xt),window.addEventListener("focus",xt),()=>{Pe.cancelled=!0,ee.current=null,ue.current=null,cancelAnimationFrame(Pe.raf),document.removeEventListener("visibilitychange",xt),window.removeEventListener("pageshow",xt),window.removeEventListener("focus",xt),Ae()}},[$,E]),s.useLayoutEffect(()=>{var Re;!$||!E||(Re=ue.current)==null||Re.call(ue)},[$,E,r,ye,F,Ce,R,k,B]),s.useLayoutEffect(()=>{var Re;(Re=ee.current)==null||Re.call(ee)},[A,u]);const me=()=>{W&&ae(!0)},De=()=>{W&&ae(!1)},ge=$?Math.abs(R)*100:0,G=M(V),Me={minHeight:G,...$?{paddingTop:`${ge}%`,paddingBottom:`${ge}%`}:{}},_e={height:G,...$?{visibility:"hidden"}:{backgroundColor:O}},rt={gap:M(b),minHeight:G},Je=B*R,at=Math.abs(Je),it=te>0?te:ie,je=Math.max(ie,it),Se=at+je/2,We=Math.max(it,1),Be=$&&B>0&&je>0?Xh(B,Je,k,Se,We):"",Ze=at*2+je,Le=Be?a.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${B} ${Ze}`,preserveAspectRatio:"none","aria-hidden":!0,children:a.jsx("path",{d:Be,fill:"none",stroke:O,strokeWidth:it,strokeLinecap:"butt",strokeLinejoin:"round"})}):null,Ve=a.jsx("div",{ref:He,className:`${o}-ribbon`,style:_e,"aria-hidden":!0}),se=(Re,Pe,Ae)=>a.jsx(Uh,{item:Re,prefix:o,textCss:m,capHeightPx:Ce,opticalOffsetY:U,imageGapPx:M(b),isCurve:$},`${Pe}-${Ae}`),Te=a.jsx("span",{ref:xe,"aria-hidden":!0,className:`${o}-cap-ref`,style:m,children:"H"}),Xe=`${Math.max(0,he)/1e3}s`,ze=ne?a.jsx("div",{ref:Q,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:me,onMouseLeave:De,style:{WebkitAnimationDuration:Xe,animationDuration:Xe,WebkitAnimationPlayState:de,animationPlayState:de},children:Array.from({length:Z},(Re,Pe)=>a.jsx("div",{ref:Pe===0?be:void 0,className:`${o}-marquee-set`,style:{...rt,paddingRight:M(b)},"aria-hidden":Pe>0,children:pe.map((Ae,Ke)=>se(Ae,Pe,Ke))},`set-${Pe}`))}):a.jsx("div",{ref:be,className:yt(`${o}-marquee-set`,`${o}-marquee-static`),style:rt,children:t==null?void 0:t.map((Re,Pe)=>se(Re,0,Pe))});return a.jsxs("div",{ref:q,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),Te,a.jsxs("div",{ref:ce,className:`${o}-marquee-wrapper`,style:Me,children:[Ve,Le,ze]})]})},Kh=`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';
|
|
@@ -2750,6 +2750,7 @@ function getCSS(P: string, setWidthPx: number, isCurve: boolean): string {
|
|
|
2750
2750
|
const PX_PER_SEC_PER_SPEED_UNIT = 30;
|
|
2751
2751
|
const MIN_CONTENT_SEQUENCE_REPEAT = 3;
|
|
2752
2752
|
const MAX_CONTENT_SEQUENCE_REPEAT = 12;
|
|
2753
|
+
const MAX_CURVE_CONTENT_SEQUENCE_REPEAT = 96;
|
|
2753
2754
|
const OUTER_SET_COPIES = 3;
|
|
2754
2755
|
const DEFAULT_CAP_HEIGHT_RATIO = 0.72;
|
|
2755
2756
|
const CURVE_AMPLITUDE_SCALE = 100;
|
|
@@ -2860,6 +2861,12 @@ const buildWaveArcLut = (amplitude: number, k: number, samples: number): WaveArc
|
|
|
2860
2861
|
return { wavelength, periodArc: s[samples], x, s };
|
|
2861
2862
|
};
|
|
2862
2863
|
|
|
2864
|
+
const getWaveArcRatio = (amplitude: number, k: number): number => {
|
|
2865
|
+
const lut = buildWaveArcLut(amplitude, k, WAVE_ARC_LUT_SAMPLES);
|
|
2866
|
+
if (!lut || lut.wavelength <= 0) return 1;
|
|
2867
|
+
return lut.periodArc / lut.wavelength;
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2863
2870
|
const xFromArcLength = (lut: WaveArcLut, targetS: number): number => {
|
|
2864
2871
|
if (lut.periodArc <= 0) return targetS;
|
|
2865
2872
|
const sign = targetS < 0 ? -1 : 1;
|
|
@@ -2883,15 +2890,19 @@ const buildCurveBackgroundPath = (
|
|
|
2883
2890
|
amplitude: number,
|
|
2884
2891
|
frequency: number,
|
|
2885
2892
|
centerY: number,
|
|
2893
|
+
extendX = 0,
|
|
2886
2894
|
): string => {
|
|
2887
2895
|
const periods = Math.max(0, frequency);
|
|
2888
2896
|
const k = width > 0 ? (2 * Math.PI * periods) / width : 0;
|
|
2889
2897
|
const yAt = (x: number) => centerY + amplitude * Math.sin(k * x);
|
|
2890
2898
|
const dyAt = (x: number) => amplitude * k * Math.cos(k * x);
|
|
2891
|
-
const
|
|
2899
|
+
const startX = -extendX;
|
|
2900
|
+
const endX = width + extendX;
|
|
2901
|
+
const span = endX - startX;
|
|
2902
|
+
const segments = Math.max(4, Math.ceil(periods * 4 * (span / Math.max(width, 1))));
|
|
2892
2903
|
const curveParts = Array.from({ length: segments }, (_, i) => {
|
|
2893
|
-
const x0 = (i / segments) *
|
|
2894
|
-
const x1 = ((i + 1) / segments) *
|
|
2904
|
+
const x0 = startX + (i / segments) * span;
|
|
2905
|
+
const x1 = startX + ((i + 1) / segments) * span;
|
|
2895
2906
|
const dx = x1 - x0;
|
|
2896
2907
|
const y0 = yAt(x0);
|
|
2897
2908
|
const y1 = yAt(x1);
|
|
@@ -2901,7 +2912,7 @@ const buildCurveBackgroundPath = (
|
|
|
2901
2912
|
const c2y = y1 - (dyAt(x1) * dx) / 3;
|
|
2902
2913
|
return \`C\${c1x.toFixed(2)} \${c1y.toFixed(2)} \${c2x.toFixed(2)} \${c2y.toFixed(2)} \${x1.toFixed(2)} \${y1.toFixed(2)}\`;
|
|
2903
2914
|
});
|
|
2904
|
-
return [\`
|
|
2915
|
+
return [\`M\${startX.toFixed(2)} \${yAt(startX).toFixed(2)}\`, ...curveParts].join(' ');
|
|
2905
2916
|
};
|
|
2906
2917
|
|
|
2907
2918
|
const MarqueeTextItemView = ({ item, prefix: P, textCss, capHeightPx, opticalOffsetY, imageGapPx, isCurve }: MarqueeTextItemViewProps) => {
|
|
@@ -3086,9 +3097,19 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3086
3097
|
if (hasContent && containerWidth > 0 && rawSetWidth > 0) {
|
|
3087
3098
|
const singleCycleWidth = rawSetWidth / contentSequenceRepeat;
|
|
3088
3099
|
if (singleCycleWidth > 0) {
|
|
3100
|
+
let coverageWidth = containerWidth;
|
|
3101
|
+
let maxRepeat = MAX_CONTENT_SEQUENCE_REPEAT;
|
|
3102
|
+
if (isCurveLayout) {
|
|
3103
|
+
const amplitude = containerWidth * amplitudeRatioRef.current;
|
|
3104
|
+
const periods = curvePeriodsRef.current;
|
|
3105
|
+
const k = periods > 0 ? (2 * Math.PI * periods) / containerWidth : 0;
|
|
3106
|
+
const arcRatio = getWaveArcRatio(amplitude, k);
|
|
3107
|
+
coverageWidth = Math.max(containerWidth, (arcRatio * containerWidth) / (OUTER_SET_COPIES - 1));
|
|
3108
|
+
maxRepeat = MAX_CURVE_CONTENT_SEQUENCE_REPEAT;
|
|
3109
|
+
}
|
|
3089
3110
|
const targetRepeat = Math.min(
|
|
3090
|
-
|
|
3091
|
-
Math.max(MIN_CONTENT_SEQUENCE_REPEAT, Math.ceil(
|
|
3111
|
+
maxRepeat,
|
|
3112
|
+
Math.max(MIN_CONTENT_SEQUENCE_REPEAT, Math.ceil(coverageWidth / singleCycleWidth) + 1),
|
|
3092
3113
|
);
|
|
3093
3114
|
if (targetRepeat !== contentSequenceRepeat) {
|
|
3094
3115
|
setContentSequenceRepeat(targetRepeat);
|
|
@@ -3125,7 +3146,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3125
3146
|
window.removeEventListener('pageshow', onVisible);
|
|
3126
3147
|
window.removeEventListener('focus', onVisible);
|
|
3127
3148
|
};
|
|
3128
|
-
}, [useMarqueeTrack, contentKey, contentSequenceRepeat, hasContent, capHeightPx]);
|
|
3149
|
+
}, [useMarqueeTrack, contentKey, contentSequenceRepeat, hasContent, capHeightPx, isCurveLayout, amplitudeRatio, curvePeriods]);
|
|
3129
3150
|
|
|
3130
3151
|
useLayoutEffect(() => {
|
|
3131
3152
|
const ribbon = ribbonRef.current;
|
|
@@ -3370,12 +3391,15 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3370
3391
|
const curveContentBandPx = Math.max(curveBandHeightPx, curveStrokeWidth);
|
|
3371
3392
|
// Center with |amplitude| so a negative (inverted) wave still fits in the viewBox.
|
|
3372
3393
|
const curveCenterY = curveAmplitudeAbsPx + curveContentBandPx / 2;
|
|
3394
|
+
// Past-edge path so caps sit outside the clipped band (see buildCurveBackgroundPath).
|
|
3395
|
+
const curvePathExtendX = Math.max(curveStrokeWidth, 1);
|
|
3373
3396
|
const curveBgPath = isCurveLayout && curveWidthPx > 0 && curveContentBandPx > 0
|
|
3374
3397
|
? buildCurveBackgroundPath(
|
|
3375
3398
|
curveWidthPx,
|
|
3376
3399
|
curveAmplitudePx,
|
|
3377
3400
|
curvePeriods,
|
|
3378
3401
|
curveCenterY,
|
|
3402
|
+
curvePathExtendX,
|
|
3379
3403
|
)
|
|
3380
3404
|
: '';
|
|
3381
3405
|
const curveViewBoxH = curveAmplitudeAbsPx * 2 + curveContentBandPx;
|
|
@@ -3391,7 +3415,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: Marq
|
|
|
3391
3415
|
fill="none"
|
|
3392
3416
|
stroke={backgroundColor}
|
|
3393
3417
|
strokeWidth={curveStrokeWidth}
|
|
3394
|
-
strokeLinecap="
|
|
3418
|
+
strokeLinecap="butt"
|
|
3395
3419
|
strokeLinejoin="round"
|
|
3396
3420
|
/>
|
|
3397
3421
|
</svg>
|
|
@@ -3511,7 +3535,7 @@ type MarqueeTextProps = {
|
|
|
3511
3535
|
isPreviewMode?: boolean;
|
|
3512
3536
|
isEditMode?: boolean;
|
|
3513
3537
|
} & CommonComponentProps;
|
|
3514
|
-
`,
|
|
3538
|
+
`,Zh={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Jh={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,display:{type:"numeric-input"}},ribbonWidth:{type:"number",scope:"layout",title:"Ribbon Width",min:0,display:{type:"numeric-input"}},layoutType:{type:"string",scope:"common",title:"Path Type",display:{type:"toggle-cycle",enum:["straight","curve"]}},curveAmplitude:{type:"number",scope:"layout",title:"Amplitude",min:-30,max:30,step:1,display:{type:"common-numeric-input",visible:!1}},curveFrequency:{type:"number",scope:"layout",title:"Frequency",min:0,max:100,step:1,display:{type:"common-numeric-input",visible:!1}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Zh.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"}},textTextAppearance:{type:"object",scope:"layout",title:"Text Appearance",display:{type:"text-appearance"}},textColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Text Color"},backgroundColor:{display:{type:"style-panel-color-picker"},type:"string",scope:"common",title:"Ribbon Color"}},defaults:{direction:"left",pauseOnHover:"off",layoutType:"curve",textFontFamily:"Antique Série",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textColor:"#FFFFFF",backgroundColor:"#2E12F0"},layoutDefaults:{m:{speed:.55,gap:.04,ribbonWidth:.08,curveAmplitude:6,curveFrequency:15,textFontSize:.08,textLineHeight:.08},t:{speed:1.3,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:15,textFontSize:.07,textLineHeight:.05},d:{speed:2.5,gap:.02,ribbonWidth:.11,curveAmplitude:5,curveFrequency:18,textFontSize:.071,textLineHeight:.035}},displayRules:[{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveAmplitude.display.visible",value:!0}},{if:{name:"layoutType",value:"curve"},then:{name:"properties.curveFrequency.display.visible",value:!0}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","ribbonWidth","layoutType","curveAmplitude","curveFrequency"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["direction","speed"]},{type:"row",items:["ribbonWidth","gap"]},{type:"row",items:["pauseOnHover","layoutType"]},{type:"row",items:["curveAmplitude","curveFrequency"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","textFontFamily","textFontSettings",{type:"row",items:["textFontSize","textLineHeight","textLetterSpacing","textWordSpacing"]},"textTextAppearance"]}],paletteBookmark:{items:["textColor","backgroundColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{text:{placeholder:"Add text...",label:"Text",display:{type:"text-input"}},image:{type:"object",label:"Image",display:{type:"media-input"}},link:{type:"string",label:"Link",placeholder:"Add link...",display:{type:"text-input"}}}},default:[{text:"NEW WORK",image:{url:"https://cdn.cntrl.site/component-assets/marquee_text_icon.svg",name:""},link:""}]}},Qh={element:Yh,id:"marquee-text",name:"Marquee Text",category:"typography",version:1,defaultSize:{d:{width:"100%"},t:{width:"100%"},m:{width:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Text_Marquee.mp4"},schema:Jh,sourceCode:Kh,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function ef(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3515
3539
|
.${e}-marquee-wrapper {
|
|
3516
3540
|
overflow: hidden;
|
|
3517
3541
|
width: 100%;
|
|
@@ -3600,7 +3624,7 @@ type MarqueeTextProps = {
|
|
|
3600
3624
|
pointer-events: auto;
|
|
3601
3625
|
z-index: 10;
|
|
3602
3626
|
}
|
|
3603
|
-
`}const
|
|
3627
|
+
`}const tf=30,Ml=2,nf=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")},of=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:b,corners:v,stroke:g,strokeColor:h,bgColor:f,padding:x,logoMarginTop:S,logoWidth:y,logoHeight:w,captionMarginTop:H}=e,N=!!o,Y=((t==null?void 0:t.length)??0)>0,O=d>0&&(!n||i),C=Y&&(O||n),V=Math.max(0,d)*tf,$=F=>D.scalingValue(F,n??!1),R=s.useRef(null),k=s.useRef(null),T=s.useRef(null),[m,M]=s.useState(0),[E,z]=s.useState(0),ne=E>0?E:0,I=s.useMemo(()=>ef(r,ne),[r,ne]),[W,K]=s.useState(0),ae=O&&u==="on",[de,A]=s.useState(!1),he=s.useRef(null),[q,ce]=s.useState(0),[Q,be]=s.useState(0),He=s.useRef(null),xe=F=>{var pe,Z,me,De,ge;return{fontSettings:{fontFamily:(e==null?void 0:e[`${F}FontFamily`])??"Arial",fontWeight:((pe=e==null?void 0:e[`${F}FontSettings`])==null?void 0:pe.fontWeight)??400,fontStyle:((Z=e==null?void 0:e[`${F}FontSettings`])==null?void 0:Z.fontStyle)??"normal"},textAppearance:{textTransform:((me=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:me.textTransform)??"none",textDecoration:((De=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:De.textDecoration)??"none",fontVariant:((ge=e==null?void 0:e[`${F}TextAppearance`])==null?void 0:ge.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${F}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${F}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${F}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${F}LineHeight`])??.01,color:(e==null?void 0:e[`${F}Color`])??"#000000"}},le=xe("text"),ee=xe("caption"),ue=s.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(F=>{var ve,pe;return(((ve=F.text)==null?void 0:ve.length)??0)>0||(((pe=F.caption)==null?void 0:pe.length)??0)>0}),[t]),oe=s.useMemo(()=>!C||(t==null?void 0:t.length)===0?1:E<=0||m<=0?Ml:Math.max(Ml,Math.ceil(m/E)+1),[C,t==null?void 0:t.length,E,m]);s.useLayoutEffect(()=>{if(!C)return;const F=R.current,ve=T.current;if(!F||!ve)return;let pe=0;const Z=()=>{const ge=F.getBoundingClientRect().width,G=ve.getBoundingClientRect().width,Me=He.current,_e=typeof Me=="number"&&Math.abs(Me-G)<=.25;if(He.current=G,M(ge),typeof G=="number"&&G>0&&E<=0){z(G);return}_e&&G!==E?z(G):!_e&&E<=0&&(cancelAnimationFrame(pe),pe=requestAnimationFrame(Z))},me=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(Z)};me();const De=new ResizeObserver(me);return De.observe(F),De.observe(ve),()=>{cancelAnimationFrame(pe),De.disconnect()}},[O,C,E]);const Fe=ne>0&&V>0?ne/V*1e3:0,Ce=`${Math.max(0,Fe)/1e3}s`;s.useLayoutEffect(()=>{if(!C||ne<=0)return;const F=k.current;F&&nf(F)},[C,ne,c]),s.useLayoutEffect(()=>{if(!C){K(0);return}const F=T.current,ve=k.current;if(!F||!ve)return;const pe=()=>{let me=0;for(let De=0;De<F.children.length;De++){const G=F.children[De].firstElementChild;G&&(me=Math.max(me,G.offsetHeight))}me<=0&&(me=ve.offsetHeight),K(me>0?me:0)};pe();const Z=new ResizeObserver(pe);return Z.observe(F),Z.observe(ve),()=>{Z.disconnect()}},[C,oe,t,n,p,b,x,g,v,y,w,q,Q]);const P=()=>{ae&&A(!0)},U=()=>{ae&&A(!1)},X=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),ie=s.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),j=s.useCallback((F,ve,pe,Z)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N?Z==null?void 0:Z.controlsName:void 0,"data-controls-axis":N?"y":void 0,className:N?`${r}-control`:void 0,style:{height:$((Z==null?void 0:Z.marginTop)??0)}}),a.jsx("div",{...Z!=null&&Z.dataMeasureKind?{"data-testimonial-measure":Z.dataMeasureKind}:{},style:{...Yt(F,n),textAlign:ie,pointerEvents:"auto",...typeof(Z==null?void 0:Z.minHeightPx)=="number"&&Z.minHeightPx>0?{minHeight:Z.minHeightPx}:{}},children:a.jsx(Ri,{content:ve})})]},pe),[X,ie,n,N,r,$]),B=s.useCallback((F,ve,pe)=>{var Z,me,De;return a.jsxs("div",{style:{padding:`${$(x.top)} ${$(x.right)} ${$(x.bottom)} ${$(x.left)}`,width:$(b+g*2),height:"100%",borderRadius:$(v),border:`${$(g)} solid ${h}`,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:X,textAlign:ie},children:[F.text&&j(le,F.text,"text",pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(pe==null?void 0:pe.textMinHeightPx)=="number"&&pe.textMinHeightPx>0?{minHeightPx:pe.textMinHeightPx}:void 0),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:X,width:"100%"},children:[a.jsx("div",{"data-controls":N&&!(pe!=null&&pe.dataMeasureAttrs)?"logoMarginTop":void 0,className:N&&!(pe!=null&&pe.dataMeasureAttrs)?`${r}-control`:void 0,style:{height:$(S)}}),a.jsx("div",{style:{width:$(y),height:$(w)},children:((Z=F.logo)==null?void 0:Z.url)&&a.jsx("img",{src:F.logo.url,alt:((me=F.logo)==null?void 0:me.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((De=F.logo)==null?void 0:De.objectFit)||"contain"}})})]}),F.caption&&j(ee,F.caption,"caption",{...pe!=null&&pe.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:H,...pe!=null&&pe.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(pe==null?void 0:pe.captionMinHeightPx)=="number"&&pe.captionMinHeightPx>0?{minHeightPx:pe.captionMinHeightPx}:{}})]})]},ve)},[f,H,ee,b,v,w,S,y,X,ie,x.bottom,x.left,x.right,x.top,j,g,h,le,n,N,r]),J=s.useCallback(F=>{ce(F.maxTextPx),be(F.maxCaptionPx)},[]);s.useLayoutEffect(()=>{if(!ue){J({maxTextPx:0,maxCaptionPx:0});return}const F=he.current;if(!F)return;const ve=()=>{D.readTestimonialTextMeasure(F,J)};ve();const pe=new ResizeObserver(ve);return pe.observe(F),()=>{pe.disconnect()}},[ue,J,t,B]);const te=ue?{textMinHeightPx:q,captionMinHeightPx:Q}:void 0,$e=ue?a.jsx("div",{ref:he,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((F,ve)=>B(F,`measure-${ve}`,{dataMeasureAttrs:!0}))}):null,ye=(F,ve)=>a.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[B(F,`card-${ve}`,te),N&&a.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${$(p)})`,width:$(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ve);if(C){const F=O?ae&&de?"paused":"running":"paused";return a.jsxs("div",{ref:R,className:yt(`${r}-wrapper`,`${r}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...W>0?{height:W}:{}},children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{ref:k,className:`${r}-marquee-track`,"data-direction":c,onMouseEnter:P,onMouseLeave:U,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:Ce,WebkitAnimationDuration:Ce,animationPlayState:F,WebkitAnimationPlayState:F},children:Array.from({length:oe},(ve,pe)=>a.jsx("div",{ref:pe===0?T:void 0,className:`${r}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:$(p),paddingRight:$(p)},"aria-hidden":pe>0,children:t==null?void 0:t.map((Z,me)=>ye(Z,`${pe}-${me}`))},`set-${pe}`))})]})}return a.jsxs("div",{className:`${r}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:I}}),$e,a.jsx("div",{style:{gap:$(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((F,ve)=>ye(F,ve))})]})},rf=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3604
3628
|
import cn from 'classnames';
|
|
3605
3629
|
import { CommonComponentProps } from '../props';
|
|
3606
3630
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4231,7 +4255,7 @@ type TestimonialsSettings = {
|
|
|
4231
4255
|
logoHeight: number;
|
|
4232
4256
|
captionMarginTop: number;
|
|
4233
4257
|
};
|
|
4234
|
-
`,
|
|
4258
|
+
`,Pl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},af={type:"object",version:1,settings:{sizing:"auto manual",properties:{speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:8},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},pauseOnHover:{title:"Pause on hover",type:"string",scope:"common",display:{type:"toggle-cycle",enum:["on","off"]}},gap:{type:"number",scope:"layout",title:"Gap",min:0,max:200,display:{type:"range-control"}},align:{type:"string",title:"Alignment",display:{type:"align-group",direction:"horizontal"},enum:["start","center","end"]},cardWidth:{type:"number",scope:"layout",title:"width",min:0,max:400,display:{type:"numeric-input"}},corners:{type:"number",scope:"layout",title:"Corners",min:0,max:100,display:{type:"numeric-input"}},stroke:{type:"number",scope:"layout",title:"Stroke",min:0,max:10,display:{type:"numeric-input"}},strokeColor:{type:"string",scope:"common",title:"Stroke Card",display:{type:"palette-color-picker",visible:!0}},bgColor:{title:"BG card",type:"string",scope:"common",display:{type:"palette-color-picker"}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},logoMarginTop:{type:"number",scope:"layout",title:"Logo margin top",min:0,max:200,display:{type:"range-control"}},logoWidth:{type:"number",scope:"layout",title:"width",min:0,max:200,display:{type:"numeric-input"}},logoHeight:{type:"number",scope:"layout",title:"height",min:0,max:200,display:{type:"numeric-input"}},textColor:{type:"string",scope:"common",title:"Text Default",display:{type:"palette-color-picker"}},captionColor:{type:"string",scope:"common",title:"Caption Default",display:{type:"palette-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:{...Pl.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"}},textFontFamily:{type:"string",scope:"common",title:"Font Family",display:{type:"font-family-select"}},textFontSettings:{...Pl.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"}}},defaults:{direction:"left",pauseOnHover:"off",strokeColor:"#000000",bgColor:"rgba(255, 255, 255, 0.81)",textColor:"#000000",captionColor:"#000000",captionFontFamily:"Goudy Bookletter 1911",captionFontSettings:{fontWeight:400,fontStyle:"normal"},align:"center",captionLetterSpacing:0,captionWordSpacing:0,captionTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},textFontFamily:"Goudy Bookletter 1911",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{m:{speed:.55,gap:.04,cardWidth:.8,corners:.02,stroke:.001,padding:{top:.053,right:.026,bottom:.053,left:.026},logoMarginTop:.18,logoWidth:.21,logoHeight:.21,captionMarginTop:.056,textFontSize:.069,textLineHeight:.093,captionFontSize:.053,captionLineHeight:.069},t:{speed:1.64,gap:.02,cardWidth:.44,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.065,left:.01},logoMarginTop:.1,logoWidth:.052,logoHeight:.052,captionMarginTop:.005,textFontSize:.035,textLineHeight:.04,captionFontSize:.023,captionLineHeight:.029},d:{speed:1.64,gap:.02,cardWidth:.15,corners:.005,stroke:.001,padding:{top:.01,right:.01,bottom:.01,left:.01},logoMarginTop:.048,logoWidth:.055,logoHeight:.027,captionMarginTop:.005,textFontSize:.012,textLineHeight:.013,captionFontSize:.01,captionLineHeight:.01}},displayRules:[{if:{name:"stroke",value:0},then:{name:"properties.strokeColor.display.visible",value:!1}}],layout:["__componentName__","speed","direction","pauseOnHover","gap","cardWidth","corners","stroke","strokeColor","bgColor","padding","logoMarginTop","logoWidth","logoHeight","captionMarginTop"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__"]},{type:"row",items:["align","direction"]},{type:"row",items:["speed","pauseOnHover"]},{type:"row",title:"Card",items:[{type:"group",title:"",items:["cardWidth","corners"]},{type:"group",title:"",items:["stroke","padding"]}]},{type:"row",title:"Image Container",items:["logoWidth","logoHeight"]}]},{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:["bgColor","strokeColor","textColor","captionColor"],panelIds:["general","typeStyle"]},content:{type:"array",settings:{addItemFromFileExplorer:!1},items:{type:"object",properties:{logo:{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:[{logo:{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"}]}]},{logo:{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"}]}]},{logo:{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"}]}]}]}},sf={element:of,id:"testimonials",name:"Eliana",category:"testimonials",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Testimonials_Grid.mp4"},defaultSize:{d:{width:"100%",height:320}},schema:af,sourceCode:rf,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function lf(e){return`
|
|
4235
4259
|
.${e}-container {
|
|
4236
4260
|
position: relative;
|
|
4237
4261
|
overflow-x: clip;
|
|
@@ -4355,7 +4379,7 @@ type TestimonialsSettings = {
|
|
|
4355
4379
|
width: 100%;
|
|
4356
4380
|
height: 100%;
|
|
4357
4381
|
}
|
|
4358
|
-
`}const
|
|
4382
|
+
`}const cf=3e3,df=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:r}=D.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:b,captionMarginTop:v,imageWidth:g,imageHeight:h,controlsWidth:f,controlsColor:x,controlsHoverColor:S}=e,y=d>0&&(!n||!!i),[w,H]=s.useState(0),[N,Y]=s.useState(null),[O,C]=s.useState(!1),V=s.useRef(null),$=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),R=s.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);s.useEffect(()=>{H(0),Y(null),C(!1)},[l.length]);const k=l[w],T=N===null?null:l[N],m=xe=>{var ee,ue,oe,Fe,Ce;return{fontSettings:{fontFamily:(e==null?void 0:e[`${xe}FontFamily`])??"Arial",fontWeight:((ee=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ee.fontWeight)??400,fontStyle:((ue=e==null?void 0:e[`${xe}FontSettings`])==null?void 0:ue.fontStyle)??"normal"},textAppearance:{textTransform:((oe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:oe.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((Ce=e==null?void 0:e[`${xe}TextAppearance`])==null?void 0:Ce.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"}},M=m("text"),E=m("caption"),z=l.length>1&&l.some(xe=>{var le,ee;return(((le=xe.text)==null?void 0:le.length)??0)>0||(((ee=xe.caption)==null?void 0:ee.length)??0)>0}),ne=s.useRef(null),[I,W]=s.useState(0),[K,ae]=s.useState(0),de=e.controls??{mode:"Off",icon:null},A=l.length>1,he=s.useCallback((xe,le)=>!A||le===xe?xe:(V.current&&window.clearTimeout(V.current),Y(xe),C(!0),V.current=window.setTimeout(()=>{Y(null),C(!1),V.current=null},300),le),[A]),q=s.useCallback(()=>{A&&H(xe=>he(xe,(xe-1+l.length)%l.length))},[A,he,l.length]),ce=s.useCallback(()=>{A&&H(xe=>he(xe,(xe+1)%l.length))},[A,he,l.length]);s.useEffect(()=>{if(!y||!A)return;const xe=Math.max(300,cf/d),le=window.setInterval(()=>{H(ee=>he(ee,(ee+1)%l.length))},xe);return()=>{window.clearInterval(le)}},[y,A,he,l.length,d]),s.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current)},[]);const Q=(xe,le)=>{var Ce,P,U,X;const ee=le==null?void 0:le.textMinHeightPx,ue=le==null?void 0:le.captionMinHeightPx,oe=le==null?void 0:le.dataMeasureAttrs,Fe=o&&!(le!=null&&le.dataMeasureAttrs)&&!(le!=null&&le.hideControls);return a.jsxs(a.Fragment,{children:[xe.text&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"textMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(b??0,n??!1)}}),a.jsx("div",{...oe&&{"data-testimonial-measure":"text"},style:{...Yt(M,n),...ee&&ee>0?{minHeight:ee}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.text})})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"imageMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(p??0,n??!1)}}),a.jsx("div",{style:{width:D.scalingValue(g??0,n??!1),height:D.scalingValue(h??0,n??!1)},children:((Ce=xe.image)==null?void 0:Ce.url)&&a.jsx("img",{src:(P=xe.image)==null?void 0:P.url,alt:((U=xe.image)==null?void 0:U.name)??"",className:`${r}-icon`,style:{objectFit:((X=xe.image)==null?void 0:X.objectFit)||"contain"}})})]}),xe.caption&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:$,width:"100%"},children:[a.jsx("div",{"data-controls":Fe?"captionMarginTop":void 0,className:Fe?`${r}-control`:void 0,style:{height:D.scalingValue(v??0,n??!1)}}),a.jsx("div",{...oe?{"data-testimonial-measure":"caption"}:{},style:{...Yt(E,n),...ue&&ue>0?{minHeight:ue}:{},textAlign:R,pointerEvents:"auto"},children:a.jsx(Ri,{content:xe.caption})})]})]})},be=s.useCallback(xe=>{W(xe.maxTextPx),ae(xe.maxCaptionPx)},[]);if(s.useLayoutEffect(()=>{if(!z){be({maxTextPx:0,maxCaptionPx:0});return}const xe=ne.current;if(!xe)return;const le=()=>{D.readTestimonialTextMeasure(xe,be)};le();const ee=new ResizeObserver(le);return ee.observe(xe),()=>{ee.disconnect()}},[z,be,t]),!k)return a.jsx(a.Fragment,{});const He=z?{textMinHeightPx:I,captionMinHeightPx:K}:void 0;return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`${r}-container`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:lf(r)}}),a.jsxs("div",{className:`${r}-wrapper`,style:{width:D.scalingValue(u??0,n??!1),alignItems:$},children:[z&&a.jsx("div",{ref:ne,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((xe,le)=>a.jsx("div",{style:{width:"100%"},children:Q(xe,{dataMeasureAttrs:!0})},le))}),a.jsxs("div",{className:`${r}-fade-stack`,children:[T&&O&&a.jsx("div",{className:yt(`${r}-fade-item-prev`,`${r}-fade-out`),children:Q(T,{...He,hideControls:!0})}),a.jsx("div",{className:yt(`${r}-fade-item-current`,O?`${r}-fade-in`:void 0),children:Q(k,He)})]})]}),de.mode==="On"&&a.jsxs("div",{className:`${r}-controls`,children:[a.jsx("div",{className:`${r}-arrow`,style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:q,disabled:!A,"aria-label":"Previous testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:yt(`${r}-arrow-img`,`${r}-mirror`)})})}),a.jsx("div",{className:yt(`${r}-arrow`,`${r}-next-arrow`),style:{width:D.scalingValue(f??.02,n??!1),height:D.scalingValue(f??.02,n??!1),"--arrow-hover-color":S},children:a.jsx("button",{type:"button",className:`${r}-arrow-inner`,onClick:ce,disabled:!A,"aria-label":"Next testimonial",children:de.icon&&a.jsx(ln,{url:de.icon,fill:x,hoverFill:S,className:`${r}-arrow-img`})})})]})]})})},uf=`import cn from 'classnames';
|
|
4359
4383
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4360
4384
|
import { CommonComponentProps } from '../props';
|
|
4361
4385
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4851,12 +4875,12 @@ type TestimonialsSettings = {
|
|
|
4851
4875
|
icon?: string | null;
|
|
4852
4876
|
};
|
|
4853
4877
|
};
|
|
4854
|
-
`,
|
|
4878
|
+
`,pf="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>'),kl={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},mf={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:{...kl.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:{...kl.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:pf},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"}]}]}]}},gf={element:df,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:mf,sourceCode:uf,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function hf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Al(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`]:D.scalingValue((o-t)/2,i)}}function ff(e){return`
|
|
4855
4879
|
.${e}-wrapper {
|
|
4856
4880
|
display: grid;
|
|
4857
4881
|
align-items: start;
|
|
4858
4882
|
justify-content: center;
|
|
4859
|
-
min-height: ${
|
|
4883
|
+
min-height: ${hf(48)};
|
|
4860
4884
|
}
|
|
4861
4885
|
.${e}-item {
|
|
4862
4886
|
display: flex;
|
|
@@ -5198,7 +5222,7 @@ type TestimonialsSettings = {
|
|
|
5198
5222
|
z-index: 2;
|
|
5199
5223
|
width: 100%;
|
|
5200
5224
|
}
|
|
5201
|
-
`}function hf(){return Math.random()<.5?"ltr":"ttb"}function ff(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function yf(e){const t=hf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ff(e)})})}const wn=500,vf=750,Gn="cubic-bezier(0.22, 1, 0.36, 1)",xf=72,bf=50;function wf(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 Sf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function $f(e){const[t]=e.media;return t!=null&&t.url?t:null}function Hd(e){return!Array.isArray(e)||e.length===0?[]:wf(e)?e.flatMap(t=>{const n=Sf(t);if(!n)return[];const i=$f(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 Ci(e){return e.type==="video"}function Cf(e){const t=new Set,n=[];for(const i of e){const o=Hd(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 Tf({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=>Ci(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 Lf(e){e.pause(),e.removeAttribute("src"),e.load()}function Al({media:e,className:t,style:n,onMediaClick:i}){return Ci(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 Fl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Rf(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 If({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{Lf(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 Ef({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),y=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),v=s.useRef(!1),w=s.useRef(!1),H=s.useRef(null),N=s.useRef(0),Y=s.useRef(null),D=s.useRef(!1),C=s.useRef(null),V=s.useRef(null),$=s.useRef(null),I=s.useRef(()=>{}),[k,T]=s.useState(null),[m,M]=s.useState(null),[E,z]=s.useState("opening"),[ne,R]=s.useState(0),[W,K]=s.useState(0),[ae,de]=s.useState(null),[A,he]=s.useState(!1),[q,ce]=s.useState(!1),[Q,be]=s.useState(!1),[We,xe]=s.useState(null),le=s.useRef(n),ee=s.useRef(void 0),ue=t[n],oe=ue?Ci(ue):!1,Ne=W!==0||A,Te=ae!==null,P=s.useCallback(Ie=>{const ze=Ie.currentTarget,se=ze instanceof HTMLVideoElement?{width:ze.videoWidth,height:ze.videoHeight}:{width:ze.naturalWidth,height:ze.naturalHeight};!se.width||!se.height||xe(se)},[]);s.useEffect(()=>{H.current=m},[m]),s.useEffect(()=>{const Ie=b.current;if(!Ie)return;const ze=()=>M(Fl(Ie));ze();const se=new ResizeObserver(ze);return se.observe(Ie),()=>se.disconnect()},[]);const U=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),X=s.useCallback(()=>{const Ie=V.current;V.current=null,U(),Y.current=null,D.current=!1,de(null),he(!1),K(0),N.current=0,ce(!1),v.current=!1,x.current=0,S.current="none",Ie===1?d():Ie===-1&&l()},[U,d,l]),ie=s.useCallback(()=>{U(),V.current=null,Y.current=null,D.current=!1,de(null),he(!1),K(0),N.current=0},[U]),j=s.useCallback(()=>{U(),C.current=window.setTimeout(()=>{V.current!==null&&X()},wn+32)},[U,X]),B=s.useCallback((Ie,ze)=>{var Re;const se=((Re=H.current)==null?void 0:Re.width)??0;if(U(),Y.current=Ie,de(Ie),D.current=!0,he(!0),ze){V.current=Ie;const qe=-Ie*se;N.current=qe,K(qe),j();return}N.current=0,K(0),C.current=window.setTimeout(()=>{C.current=null,ie()},wn+32)},[U,ie,j]),J=s.useCallback(Ie=>{if(!(t.length<=1)){if(D.current){if(V.current===Ie){$.current=Ie,X();return}ie()}U(),Y.current=Ie,de(Ie),D.current=!1,he(!1),N.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(Ie,!0)})})}},[t.length,B,X,ie,U]);I.current=J;const te=s.useCallback(Ie=>{Ie.propertyName!=="transform"||!D.current||V.current!==null&&X()},[X]),Ce=s.useCallback(()=>{const Ie=y.current;if(!Ie)return;const ze=Fl(Ie);!ze.width||!ze.height||T(ze)},[]);s.useEffect(()=>{Ce();const Ie=y.current;if(!Ie)return;const ze=new ResizeObserver(()=>Ce());return ze.observe(Ie),()=>ze.disconnect()},[Ce]),s.useEffect(()=>{E==="opening"&&k&&z("open")},[E,k]),s.useEffect(()=>{if(E!=="closing")return;const Ie=setTimeout(()=>r(),wn);return()=>clearTimeout(Ie)},[E,r]),s.useEffect(()=>()=>{U()},[U]),s.useLayoutEffect(()=>{le.current===n&&ee.current===(ue==null?void 0:ue.url)||(U(),V.current=null,de(null),R(0),K(0),he(!1),be(!1),ce(!1),xe(null),f.current=0,x.current=0,S.current="none",v.current=!1,D.current=!1,N.current=0,Y.current=null,h.current=null,w.current=!1,le.current=n,ee.current=ue==null?void 0:ue.url)},[n,ue==null?void 0:ue.url,U]),s.useLayoutEffect(()=>{const Ie=$.current;Ie!==null&&($.current=null,requestAnimationFrame(()=>{I.current(Ie)}))},[n,ue==null?void 0:ue.url]),s.useEffect(()=>{if(E!=="open")return;let Ie=null;const ze=()=>{Ie&&(document.removeEventListener("click",Ie,!0),Ie=null)},se=()=>{ze(),Ie=Ze=>{Ze.stopPropagation(),Ze.preventDefault(),ze()},document.addEventListener("click",Ie,!0)},Re=Ze=>{const Oe=Ze<0?1:-1;if(Math.abs(Ze)>bf&&t.length>1){B(Oe,!0);return}B(Oe,!1)},qe=Ze=>{if(Ze.touches.length!==1||D.current)return;const Oe=Ze.touches[0];w.current=!0,h.current={x:Oe.clientX,y:Oe.clientY},S.current="none",x.current=0,v.current=!1},we=Ze=>{if(!h.current||Ze.touches.length!==1||D.current)return;const Oe=Ze.touches[0],Ue=Oe.clientX-h.current.x,He=Oe.clientY-h.current.y;if(S.current==="none"){if(Math.abs(Ue)<10&&Math.abs(He)<10)return;if(Math.abs(Ue)>Math.abs(He)){if(t.length<=1)return;S.current="horizontal"}else if(He>0)S.current="vertical";else return}if(S.current==="horizontal"){v.current=!0,ce(!0),x.current=Ue;const Qe=Ue<0?1:-1;Y.current!==Qe&&(Y.current=Qe,de(Qe)),N.current=Ue,K(Ue),Ze.preventDefault();return}S.current==="vertical"&&(v.current=!0,ce(!0),f.current=He,R(He),Ze.preventDefault())},Le=()=>{if(!h.current)return;const Ze=S.current,Oe=v.current;if(Oe&&Ze==="horizontal")Re(x.current),se();else if(Oe&&Ze==="vertical")if(f.current>xf){const He=window.innerHeight;f.current=He,be(!0),R(He),z("closing")}else f.current=0,R(0),se();else Ze==="horizontal"&&Math.abs(x.current)>0&&(Re(x.current),se());h.current=null,S.current="none",x.current=0,v.current=!1,ce(!1)};return document.addEventListener("touchstart",qe,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Le),document.addEventListener("touchcancel",Le),()=>{document.removeEventListener("touchstart",qe),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Le),document.removeEventListener("touchcancel",Le),ze()}},[E,t.length,B]),s.useEffect(()=>{const Ie=ze=>{ze.key==="Escape"&&(ze.preventDefault(),ze.stopPropagation(),E!=="closing"&&z("closing"))};return window.addEventListener("keydown",Ie,!0),()=>window.removeEventListener("keydown",Ie,!0)},[E]);const ye=()=>{E!=="closing"&&z("closing")},F=E==="open",ve=E==="closing",pe=ne>0?Math.max(0,1-ne/500):1,Z=ne>0?Math.max(.35,1-ne/500):1,me=k?p?k:Rf(k,We):null,De=Ie=>{if(Ie.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const ze=me??Ie.currentTarget.getBoundingClientRect(),se=Ie.clientY-ze.top,Re=Math.min(52,ze.height*.2);if(!(se>ze.height-Re)){if(Ie.clientX-ze.left<ze.width/2){J(-1);return}J(1)}},ge=Ie=>{if(t.length<=1)return;const ze=me??Ie.currentTarget.getBoundingClientRect(),se=Ie.clientX-ze.left,Re=Ie.clientY-ze.top,qe=Math.min(52,ze.height*.2);if(Re>ze.height-qe){Ie.currentTarget.style.cursor="default";return}Ie.currentTarget.style.cursor=se<ze.width/2?"w-resize":"e-resize"},G={position:"fixed",top:m==null?void 0:m.top,left:m==null?void 0:m.left,width:m==null?void 0:m.width,height:m==null?void 0:m.height,zIndex:9998},ke=p?"cover":"contain",Fe=W!==0||ne>0?`translate(${W}px, ${ne}px)`:void 0,rt=q&&!A?"none":A?`transform ${wn}ms ${Gn}`:Q?`transform ${wn}ms ${Gn}, opacity ${wn}ms ${Gn}`:E==="opening"||ve?`opacity ${wn}ms ${Gn}`:"none",Je={...G,transform:Fe,opacity:ne>0?Z:E==="opening"||ve?0:1,transition:rt,pointerEvents:"none"},at={position:"absolute",top:((me==null?void 0:me.top)??0)-((m==null?void 0:m.top)??0),left:((me==null?void 0:me.left)??0)-((m==null?void 0:m.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:ke,pointerEvents:oe&&F&&!Ne?"auto":"none",touchAction:oe&&F?"none":void 0},nt=(m==null?void 0:m.width)??0,je=Te?(n+ae+t.length)%t.length:null,$e=je!==null?t[je]:null,Ae={...G,transform:Te?`translateX(${ae*nt+W}px)`:void 0,opacity:1,transition:A?`transform ${wn}ms ${Gn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((m==null?void 0:m.top)??0),left:((k==null?void 0:k.left)??0)-((m==null?void 0:m.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:ke,pointerEvents:"none"},Ke=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:ye,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?pe:0,transition:q?"none":`opacity ${wn}ms ${Gn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&m&&$e&&a.jsx("div",{style:Ae,onTransitionEnd:te,children:Ci($e)?a.jsx("video",{src:$e.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${$e.url}`):a.jsx("img",{src:$e.url,alt:$e.name,style:Be},`neighbor-${je}-${$e.url}`)}),k&&m&&ue&&a.jsx("div",{style:Je,onTransitionEnd:te,children:oe?a.jsx(If,{src:ue.url,phase:E,mediaRef:g,mediaStyle:at,onLoadedMetadata:P,onClick:De,onMouseMove:ge},`${n}-${ue.url}`):a.jsx("img",{ref:g,src:ue.url,alt:ue.name,onLoad:P,style:at},`${n}-${ue.url}`)}),F&&Ke&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ke,left:me.left,cursor:"w-resize",pointerEvents:q?"none":"auto"},onClick:Ie=>{if(w.current){w.current=!1;return}Ie.stopPropagation(),J(-1)}}),a.jsx("div",{style:{...Ke,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:q?"none":"auto"},onClick:Ie=>{if(w.current){w.current=!1;return}Ie.stopPropagation(),J(1)}})]})]})}function Mf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Pf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=O.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:y=100,verticalGap:g,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:S,lightboxImageDisplay:v,slider:w,sliderTiming:H,direction:N,transition:Y,titleMarginTop:D,subtitleMarginTop:C,titleColor:V,subtitleColor:$,lightboxCounterColor:I,titleFontFamily:k,titleFontSettings:T,titleFontSize:m,titleLineHeight:M,titleLetterSpacing:E,titleWordSpacing:z,titleTextAppearance:ne,subtitleFontFamily:R,subtitleFontSettings:W,subtitleFontSize:K,subtitleLineHeight:ae,subtitleLetterSpacing:de,subtitleWordSpacing:A,subtitleTextAppearance:he,lightboxCounterFontFamily:q,lightboxCounterFontSettings:ce,lightboxCounterFontSize:Q,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:We,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:le,showText:ee="always",alignEntries:ue="off",align:oe="top"}=e,Ne={fontSettings:{fontFamily:k,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:m??.01,lineHeight:M,letterSpacing:E??0,wordSpacing:z??0,textAppearance:ne,color:V},P={...sn(Yt(Ne,n))},U={fontSettings:{fontFamily:R,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ae,letterSpacing:de??0,wordSpacing:A??0,textAppearance:he,color:$},ie={...sn(Yt(U,n))},j={fontSettings:{fontFamily:q,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:be,letterSpacing:We??0,wordSpacing:xe??0,textAppearance:le,color:I},J={...sn(Yt(j,n)),...Ca(Q,be,u,n)},te=$a(m,M,`${u}-item-title`,`${u}-text-tight-leading`),Ce=$a(K,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),ye=Ca(m,M,u,n),F=Ca(K,ae,u,n),ve=$a(Q,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),pe=O.buildColorVars(u,{titleColor:V,subtitleColor:$,lightboxCounterColor:I},kf,Af),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=h===0?1/0:h,G=(t??[]).slice(0,ge),ke=s.useMemo(()=>f==="on"?Cf(G):[],[G,f]),Fe=b.entryWidth??.2,rt=(x==null?void 0:x.display)==="cover",Je=(x==null?void 0:x.ratioValue)??"1:1",at=(x==null?void 0:x.reversed)??!1,[nt,je]=Je.split(":").map(Number),Be=`${at?je:nt} / ${at?nt:je}`,Ke=b.columnsCount,Ie=O.scalingValue(Fe??0,n),ze=Ie,se=!rt&&w!=="off",Re=G.length%Ke||Ke,qe=Re<Ke&&G.length>0,we=G.length-Re,Le=qe?Math.floor((Ke-Re)/2)+1:1,Ze=S?O.scalingValue(S,n):void 0,Oe={width:ze,...rt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Ze?{borderRadius:Ze,overflow:"hidden"}:{}},Ue=`${u}-item-image-wrapper${se?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),He=p==="d"||p==="e"||p==="f",Qe=ue==="on",it=`calc(${O.scalingValue(Fe??0,n)} * (${y} / 100))`,tt=O.scalingValue(Fe*y/100,n),St=rt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Ze?{borderRadius:Ze}:{}},[$t,Rt]=s.useState(0),yt=s.useRef(null),pt=Y==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const ut=yt.current;if(!ut)return;const Me=new ResizeObserver(Ge=>{Rt(Math.round(Ge[0].contentRect.width))});return Me.observe(ut),()=>Me.disconnect()},[]);const kt=(()=>{const ut={...pe},Me=yt.current?getComputedStyle(yt.current).getPropertyValue("--cntrl-article-width").trim():"";return Me&&(ut["--cntrl-article-width"]=Me),ut})(),[Wt,bt]=s.useState(!1),[Nt,Gt]=s.useState([]),[Zt,en]=s.useState(0),Lt=f==="on"&&(!n||i),Ht=(ut,Me)=>{n&&!i||f!=="off"&&(Gt(ut),en(Me),bt(!0))};s.useEffect(()=>{if(!Wt||f!=="on"||typeof document>"u")return;const ut=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ut}},[Wt,f]),s.useEffect(()=>{!n||i||bt(!1)},[n,i]);const nn=s.useMemo(()=>gf(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nn}}),f==="on"&&a.jsx(Tf,{mediaList:ke}),a.jsx("div",{style:pe,children:a.jsx("div",{ref:yt,className:`${u}-wrapper ${u}-type-${p}${Qe?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${Ke}, ${Ie})`,rowGap:Qe?0:O.scalingValue(g??0,n),columnGap:O.scalingValue(b.horizontalGap??0,n),width:O.scalingValue(b.wrapperWidth??0,n),...Qe?{[`--${u}-align-entries-row-gap`]:O.scalingValue(g??0,n)}:{}},children:G.map((ut,Me)=>{var Ot;const Ge=kl(ut.title),st=kl(ut.subtitle),gt=(((Ot=ut.link)==null?void 0:Ot.length)??0)>0&&f==="off"?ut.link:void 0,vt=Math.floor(Me/Ke)===Math.ceil(G.length/Ke)-1,It=qe&&Me>=we?`${Le+(Me-we)}`:void 0,ft=He?a.jsxs("div",{className:`${u}-item-text-block`,children:[Ge&&a.jsx("p",{className:te,style:{width:it,...P,...ye},children:ut.title}),Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(D??0,n),width:tt}}),st&&a.jsx("p",{className:Ce,style:{width:it,...ie,...F},children:ut.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(C??0,n),width:tt}})]}):null,Bt=Qe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!He&&a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?O.scalingValue(D??0,n):0,width:tt}}),Ge&&a.jsx("p",{className:te,style:{width:it,...P,...ye},children:ut.title}),He&&Ge&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(D??0,n),width:tt}})]}):null,_t=Qe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!He&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?O.scalingValue(C??0,n):0,width:tt}}),st&&a.jsx("p",{className:Ce,style:{width:it,...ie,...F},children:ut.subtitle}),He&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:O.scalingValue(C??0,n),width:tt}})]}):null,Ft=gt?a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[Bt,_t]}):a.jsxs(a.Fragment,{children:[Bt,_t]}),qt=Hd(ut.gallery),Xt=qt.filter(Ct=>Ct.lightboxMedia).map(Ct=>Ct.lightboxMedia),Dt=a.jsx("div",{className:Ue,style:Oe,children:qt.length===0?null:w==="off"?(()=>{const{displayMedia:Ct,lightboxMedia:_}=qt[0],Ee=_?Xt.findIndex(_e=>_e.url===_.url):-1;return a.jsx(Al,{media:Ct,className:`${u}-item-${Ci(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Lt&&Ee>=0?()=>Ht(Xt,Ee):void 0})})():a.jsxs(a.Fragment,{children:[se&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qt.map(({displayMedia:Ct})=>Ci(Ct)?a.jsx("video",{src:Ct.url,muted:!0,playsInline:!0},`sizer-${Ct.url}`):a.jsx("img",{src:Ct.url,alt:""},`sizer-${Ct.url}`))}),a.jsx(Vs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:vf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:pt},onMoved:Ct=>{N!=="random"||Y==="fade"||yf(Ct)},children:qt.map(({displayMedia:Ct,lightboxMedia:_},Ee)=>{const _e=_?Xt.findIndex(Ve=>Ve.url===_.url):-1;return a.jsx(Gs,{children:a.jsx(Al,{media:Ct,className:`${u}-item-${Ci(Ct)?"video":"image"}`.trim(),style:St,onMediaClick:Lt&&_e>=0?()=>Ht(Xt,_e):void 0})},Ee)})},`${Y}-${Fe}-${N}-${H}-${$t}-${d}`)]})}),jt=He?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":o&&Ge?"titleMarginTop":void 0,className:o&&Ge?`${u}-control`:void 0,style:{height:Ge?O.scalingValue(D??0,n):0,width:tt}}),a.jsx("p",{className:te,style:{width:it,...P,...ye},children:ut.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?O.scalingValue(C??0,n):0,width:tt}}),a.jsx("p",{className:Ce,style:{width:it,...ie,...F},children:ut.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:It&&!Qe?{gridColumn:It}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Qe&&vt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${Ie} * (${y} / 100))`:Ie,...It&&Qe?{gridColumn:It}:{}},children:Qe?a.jsx(a.Fragment,{children:He?a.jsxs(a.Fragment,{children:[Ft,a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),Ft]})}):gt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[ft,Dt]}),!He&&a.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):a.jsxs(a.Fragment,{children:[ft,Dt,jt]})})},Me)})})}),(!n||i)&&Wt&&typeof document<"u"&&f==="on"&&(()=>{const ut=(c?document.getElementById(c):null)??document.body;return Vn.createPortal(a.jsx("div",{style:kt,"data-selection":"none",children:a.jsx(Ef,{prefix:u,items:Nt,index:Zt,imageDisplay:Mf(v),isEditor:n,onClose:()=>bt(!1),onPrev:()=>en(Me=>(Me-1+Nt.length)%Nt.length),onNext:()=>en(Me=>(Me+1)%Nt.length),counterClassName:ve,counterStyle:J})}),ut)})()]})}const kf={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Af=["hover","focus","filled","success","error"],Ff=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5225
|
+
`}function yf(){return Math.random()<.5?"ltr":"ttb"}function vf(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function xf(e){const t=yf();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{vf(e)})})}const wn=500,bf=750,Gn="cubic-bezier(0.22, 1, 0.36, 1)",wf=72,Sf=50;function $f(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 Cf(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Tf(e){const[t]=e.media;return t!=null&&t.url?t:null}function jd(e){return!Array.isArray(e)||e.length===0?[]:$f(e)?e.flatMap(t=>{const n=Cf(t);if(!n)return[];const i=Tf(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 Ci(e){return e.type==="video"}function Lf(e){const t=new Set,n=[];for(const i of e){const o=jd(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 Rf({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=>Ci(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 If(e){e.pause(),e.removeAttribute("src"),e.load()}function Fl({media:e,className:t,style:n,onMediaClick:i}){return Ci(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 _l(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ef(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 Mf({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:r,onMouseMove:l}){return s.useEffect(()=>{const d=n.current;if(d)return()=>{If(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 Pf({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",b=s.useRef(null),v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(null),N=s.useRef(0),Y=s.useRef(null),O=s.useRef(!1),C=s.useRef(null),V=s.useRef(null),$=s.useRef(null),R=s.useRef(()=>{}),[k,T]=s.useState(null),[m,M]=s.useState(null),[E,z]=s.useState("opening"),[ne,I]=s.useState(0),[W,K]=s.useState(0),[ae,de]=s.useState(null),[A,he]=s.useState(!1),[q,ce]=s.useState(!1),[Q,be]=s.useState(!1),[He,xe]=s.useState(null),le=s.useRef(n),ee=s.useRef(void 0),ue=t[n],oe=ue?Ci(ue):!1,Fe=W!==0||A,Ce=ae!==null,P=s.useCallback(Le=>{const Ve=Le.currentTarget,se=Ve instanceof HTMLVideoElement?{width:Ve.videoWidth,height:Ve.videoHeight}:{width:Ve.naturalWidth,height:Ve.naturalHeight};!se.width||!se.height||xe(se)},[]);s.useEffect(()=>{H.current=m},[m]),s.useEffect(()=>{const Le=b.current;if(!Le)return;const Ve=()=>M(_l(Le));Ve();const se=new ResizeObserver(Ve);return se.observe(Le),()=>se.disconnect()},[]);const U=s.useCallback(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),X=s.useCallback(()=>{const Le=V.current;V.current=null,U(),Y.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0,ce(!1),y.current=!1,x.current=0,S.current="none",Le===1?d():Le===-1&&l()},[U,d,l]),ie=s.useCallback(()=>{U(),V.current=null,Y.current=null,O.current=!1,de(null),he(!1),K(0),N.current=0},[U]),j=s.useCallback(()=>{U(),C.current=window.setTimeout(()=>{V.current!==null&&X()},wn+32)},[U,X]),B=s.useCallback((Le,Ve)=>{var Te;const se=((Te=H.current)==null?void 0:Te.width)??0;if(U(),Y.current=Le,de(Le),O.current=!0,he(!0),Ve){V.current=Le;const Xe=-Le*se;N.current=Xe,K(Xe),j();return}N.current=0,K(0),C.current=window.setTimeout(()=>{C.current=null,ie()},wn+32)},[U,ie,j]),J=s.useCallback(Le=>{if(!(t.length<=1)){if(O.current){if(V.current===Le){$.current=Le,X();return}ie()}U(),Y.current=Le,de(Le),O.current=!1,he(!1),N.current=0,K(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(Le,!0)})})}},[t.length,B,X,ie,U]);R.current=J;const te=s.useCallback(Le=>{Le.propertyName!=="transform"||!O.current||V.current!==null&&X()},[X]),$e=s.useCallback(()=>{const Le=v.current;if(!Le)return;const Ve=_l(Le);!Ve.width||!Ve.height||T(Ve)},[]);s.useEffect(()=>{$e();const Le=v.current;if(!Le)return;const Ve=new ResizeObserver(()=>$e());return Ve.observe(Le),()=>Ve.disconnect()},[$e]),s.useEffect(()=>{E==="opening"&&k&&z("open")},[E,k]),s.useEffect(()=>{if(E!=="closing")return;const Le=setTimeout(()=>r(),wn);return()=>clearTimeout(Le)},[E,r]),s.useEffect(()=>()=>{U()},[U]),s.useLayoutEffect(()=>{le.current===n&&ee.current===(ue==null?void 0:ue.url)||(U(),V.current=null,de(null),I(0),K(0),he(!1),be(!1),ce(!1),xe(null),f.current=0,x.current=0,S.current="none",y.current=!1,O.current=!1,N.current=0,Y.current=null,h.current=null,w.current=!1,le.current=n,ee.current=ue==null?void 0:ue.url)},[n,ue==null?void 0:ue.url,U]),s.useLayoutEffect(()=>{const Le=$.current;Le!==null&&($.current=null,requestAnimationFrame(()=>{R.current(Le)}))},[n,ue==null?void 0:ue.url]),s.useEffect(()=>{if(E!=="open")return;let Le=null;const Ve=()=>{Le&&(document.removeEventListener("click",Le,!0),Le=null)},se=()=>{Ve(),Le=Pe=>{Pe.stopPropagation(),Pe.preventDefault(),Ve()},document.addEventListener("click",Le,!0)},Te=Pe=>{const Ae=Pe<0?1:-1;if(Math.abs(Pe)>Sf&&t.length>1){B(Ae,!0);return}B(Ae,!1)},Xe=Pe=>{if(Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0];w.current=!0,h.current={x:Ae.clientX,y:Ae.clientY},S.current="none",x.current=0,y.current=!1},ze=Pe=>{if(!h.current||Pe.touches.length!==1||O.current)return;const Ae=Pe.touches[0],Ke=Ae.clientX-h.current.x,Oe=Ae.clientY-h.current.y;if(S.current==="none"){if(Math.abs(Ke)<10&&Math.abs(Oe)<10)return;if(Math.abs(Ke)>Math.abs(Oe)){if(t.length<=1)return;S.current="horizontal"}else if(Oe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,ce(!0),x.current=Ke;const Qe=Ke<0?1:-1;Y.current!==Qe&&(Y.current=Qe,de(Qe)),N.current=Ke,K(Ke),Pe.preventDefault();return}S.current==="vertical"&&(y.current=!0,ce(!0),f.current=Oe,I(Oe),Pe.preventDefault())},Re=()=>{if(!h.current)return;const Pe=S.current,Ae=y.current;if(Ae&&Pe==="horizontal")Te(x.current),se();else if(Ae&&Pe==="vertical")if(f.current>wf){const Oe=window.innerHeight;f.current=Oe,be(!0),I(Oe),z("closing")}else f.current=0,I(0),se();else Pe==="horizontal"&&Math.abs(x.current)>0&&(Te(x.current),se());h.current=null,S.current="none",x.current=0,y.current=!1,ce(!1)};return document.addEventListener("touchstart",Xe,{passive:!0}),document.addEventListener("touchmove",ze,{passive:!1}),document.addEventListener("touchend",Re),document.addEventListener("touchcancel",Re),()=>{document.removeEventListener("touchstart",Xe),document.removeEventListener("touchmove",ze),document.removeEventListener("touchend",Re),document.removeEventListener("touchcancel",Re),Ve()}},[E,t.length,B]),s.useEffect(()=>{const Le=Ve=>{Ve.key==="Escape"&&(Ve.preventDefault(),Ve.stopPropagation(),E!=="closing"&&z("closing"))};return window.addEventListener("keydown",Le,!0),()=>window.removeEventListener("keydown",Le,!0)},[E]);const ye=()=>{E!=="closing"&&z("closing")},F=E==="open",ve=E==="closing",pe=ne>0?Math.max(0,1-ne/500):1,Z=ne>0?Math.max(.35,1-ne/500):1,me=k?p?k:Ef(k,He):null,De=Le=>{if(Le.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientY-Ve.top,Te=Math.min(52,Ve.height*.2);if(!(se>Ve.height-Te)){if(Le.clientX-Ve.left<Ve.width/2){J(-1);return}J(1)}},ge=Le=>{if(t.length<=1)return;const Ve=me??Le.currentTarget.getBoundingClientRect(),se=Le.clientX-Ve.left,Te=Le.clientY-Ve.top,Xe=Math.min(52,Ve.height*.2);if(Te>Ve.height-Xe){Le.currentTarget.style.cursor="default";return}Le.currentTarget.style.cursor=se<Ve.width/2?"w-resize":"e-resize"},G={position:"fixed",top:m==null?void 0:m.top,left:m==null?void 0:m.left,width:m==null?void 0:m.width,height:m==null?void 0:m.height,zIndex:9998},Me=p?"cover":"contain",_e=W!==0||ne>0?`translate(${W}px, ${ne}px)`:void 0,rt=q&&!A?"none":A?`transform ${wn}ms ${Gn}`:Q?`transform ${wn}ms ${Gn}, opacity ${wn}ms ${Gn}`:E==="opening"||ve?`opacity ${wn}ms ${Gn}`:"none",Je={...G,transform:_e,opacity:ne>0?Z:E==="opening"||ve?0:1,transition:rt,pointerEvents:"none"},at={position:"absolute",top:((me==null?void 0:me.top)??0)-((m==null?void 0:m.top)??0),left:((me==null?void 0:me.left)??0)-((m==null?void 0:m.left)??0),width:me==null?void 0:me.width,height:me==null?void 0:me.height,objectFit:Me,pointerEvents:oe&&F&&!Fe?"auto":"none",touchAction:oe&&F?"none":void 0},it=(m==null?void 0:m.width)??0,je=Ce?(n+ae+t.length)%t.length:null,Se=je!==null?t[je]:null,We={...G,transform:Ce?`translateX(${ae*it+W}px)`:void 0,opacity:1,transition:A?`transform ${wn}ms ${Gn}`:"none",pointerEvents:"none"},Be={position:"absolute",top:((k==null?void 0:k.top)??0)-((m==null?void 0:m.top)??0),left:((k==null?void 0:k.left)??0)-((m==null?void 0:m.left)??0),width:k==null?void 0:k.width,height:k==null?void 0:k.height,objectFit:Me,pointerEvents:"none"},Ze=me?{position:"fixed",top:me.top,height:me.height,width:me.width/2,zIndex:9999}:null;return a.jsxs("div",{ref:b,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:E==="open"?"none":void 0},onClick:ye,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:F?pe:0,transition:q?"none":`opacity ${wn}ms ${Gn}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:F?1:0,transition:`opacity ${wn}ms ${Gn}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),k&&m&&Se&&a.jsx("div",{style:We,onTransitionEnd:te,children:Ci(Se)?a.jsx("video",{src:Se.url,muted:!0,playsInline:!0,preload:"auto",style:Be},`neighbor-${je}-${Se.url}`):a.jsx("img",{src:Se.url,alt:Se.name,style:Be},`neighbor-${je}-${Se.url}`)}),k&&m&&ue&&a.jsx("div",{style:Je,onTransitionEnd:te,children:oe?a.jsx(Mf,{src:ue.url,phase:E,mediaRef:g,mediaStyle:at,onLoadedMetadata:P,onClick:De,onMouseMove:ge},`${n}-${ue.url}`):a.jsx("img",{ref:g,src:ue.url,alt:ue.name,onLoad:P,style:at},`${n}-${ue.url}`)}),F&&Ze&&t.length>1&&!oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...Ze,left:me.left,cursor:"w-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(-1)}}),a.jsx("div",{style:{...Ze,left:me.left+me.width/2,cursor:"e-resize",pointerEvents:q?"none":"auto"},onClick:Le=>{if(w.current){w.current=!1;return}Le.stopPropagation(),J(1)}})]})]})}function kf(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Af({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:r,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=D.useScopedStyles(),{type:p="a",gridLayout:b,textBoxWidth:v=100,verticalGap:g,entriesCount:h,lightbox:f,imageDisplay:x,imageCorners:S,lightboxImageDisplay:y,slider:w,sliderTiming:H,direction:N,transition:Y,titleMarginTop:O,subtitleMarginTop:C,titleColor:V,subtitleColor:$,lightboxCounterColor:R,titleFontFamily:k,titleFontSettings:T,titleFontSize:m,titleLineHeight:M,titleLetterSpacing:E,titleWordSpacing:z,titleTextAppearance:ne,subtitleFontFamily:I,subtitleFontSettings:W,subtitleFontSize:K,subtitleLineHeight:ae,subtitleLetterSpacing:de,subtitleWordSpacing:A,subtitleTextAppearance:he,lightboxCounterFontFamily:q,lightboxCounterFontSettings:ce,lightboxCounterFontSize:Q,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:He,lightboxCounterWordSpacing:xe,lightboxCounterTextAppearance:le,showText:ee="always",alignEntries:ue="off",align:oe="top"}=e,Fe={fontSettings:{fontFamily:k,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:m??.01,lineHeight:M,letterSpacing:E??0,wordSpacing:z??0,textAppearance:ne,color:V},P={...sn(Yt(Fe,n))},U={fontSettings:{fontFamily:I,fontWeight:(W==null?void 0:W.fontWeight)??400,fontStyle:(W==null?void 0:W.fontStyle)??"normal"},fontSize:K??.01,lineHeight:ae,letterSpacing:de??0,wordSpacing:A??0,textAppearance:he,color:$},ie={...sn(Yt(U,n))},j={fontSettings:{fontFamily:q,fontWeight:(ce==null?void 0:ce.fontWeight)??400,fontStyle:(ce==null?void 0:ce.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:be,letterSpacing:He??0,wordSpacing:xe??0,textAppearance:le,color:R},J={...sn(Yt(j,n)),...Ca(Q,be,u,n)},te=$a(m,M,`${u}-item-title`,`${u}-text-tight-leading`),$e=$a(K,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),ye=Ca(m,M,u,n),F=Ca(K,ae,u,n),ve=$a(Q,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),pe=D.buildColorVars(u,{titleColor:V,subtitleColor:$,lightboxCounterColor:R},Ff,_f),De=`${l&&l!=="default"?`${u}-state-${l}`:""}${ee==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ge=h===0?1/0:h,G=(t??[]).slice(0,ge),Me=s.useMemo(()=>f==="on"?Lf(G):[],[G,f]),_e=b.entryWidth??.2,rt=(x==null?void 0:x.display)==="cover",Je=(x==null?void 0:x.ratioValue)??"1:1",at=(x==null?void 0:x.reversed)??!1,[it,je]=Je.split(":").map(Number),Be=`${at?je:it} / ${at?it:je}`,Ze=b.columnsCount,Le=D.scalingValue(_e??0,n),Ve=Le,se=!rt&&w!=="off",Te=G.length%Ze||Ze,Xe=Te<Ze&&G.length>0,ze=G.length-Te,Re=Xe?Math.floor((Ze-Te)/2)+1:1,Pe=S?D.scalingValue(S,n):void 0,Ae={width:Ve,...rt?{aspectRatio:Be,height:"auto",overflow:"hidden"}:{height:"auto"},...Pe?{borderRadius:Pe,overflow:"hidden"}:{}},Ke=`${u}-item-image-wrapper${se?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",Qe=ue==="on",tt=`calc(${D.scalingValue(_e??0,n)} * (${v} / 100))`,nt=D.scalingValue(_e*v/100,n),xt=rt?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...Pe?{borderRadius:Pe}:{}},[It,Tt]=s.useState(0),ut=s.useRef(null),ft=Y==="fade"||N==="horizontal"?"ltr":N==="vertical"?"ttb":"ltr";s.useEffect(()=>{const pt=ut.current;if(!pt)return;const Ee=new ResizeObserver(qe=>{Tt(Math.round(qe[0].contentRect.width))});return Ee.observe(pt),()=>Ee.disconnect()},[]);const Et=(()=>{const pt={...pe},Ee=ut.current?getComputedStyle(ut.current).getPropertyValue("--cntrl-article-width").trim():"";return Ee&&(pt["--cntrl-article-width"]=Ee),pt})(),[Lt,bt]=s.useState(!1),[Nt,Bt]=s.useState([]),[Zt,en]=s.useState(0),Rt=f==="on"&&(!n||i),Ot=(pt,Ee)=>{n&&!i||f!=="off"&&(Bt(pt),en(Ee),bt(!0))};s.useEffect(()=>{if(!Lt||f!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[Lt,f]),s.useEffect(()=>{!n||i||bt(!1)},[n,i]);const nn=s.useMemo(()=>ff(u),[u]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:nn}}),f==="on"&&a.jsx(Rf,{mediaList:Me}),a.jsx("div",{style:pe,children:a.jsx("div",{ref:ut,className:`${u}-wrapper ${u}-type-${p}${Qe?` ${u}-align-entries`:""} ${u}-image-align-${oe} ${De}`.trim(),style:{gridTemplateColumns:`repeat(${Ze}, ${Le})`,rowGap:Qe?0:D.scalingValue(g??0,n),columnGap:D.scalingValue(b.horizontalGap??0,n),width:D.scalingValue(b.wrapperWidth??0,n),...Qe?{[`--${u}-align-entries-row-gap`]:D.scalingValue(g??0,n)}:{}},children:G.map((pt,Ee)=>{var Ht;const qe=Al(pt.title),st=Al(pt.subtitle),mt=(((Ht=pt.link)==null?void 0:Ht.length)??0)>0&&f==="off"?pt.link:void 0,vt=Math.floor(Ee/Ze)===Math.ceil(G.length/Ze)-1,Mt=Xe&&Ee>=ze?`${Re+(Ee-ze)}`:void 0,gt=Oe?a.jsxs("div",{className:`${u}-item-text-block`,children:[qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,Vt=Qe?a.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&qe?"titleMarginTop":void 0,className:o&&qe?`${u}-control`:void 0,style:{height:qe?D.scalingValue(O??0,n):0,width:nt}}),qe&&a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),Oe&&qe&&a.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(O??0,n),width:nt}})]}):null,Wt=Qe?a.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),st&&a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle}),Oe&&st&&a.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:D.scalingValue(C??0,n),width:nt}})]}):null,_t=mt?a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:[Vt,Wt]}):a.jsxs(a.Fragment,{children:[Vt,Wt]}),qt=jd(pt.gallery),Xt=qt.filter($t=>$t.lightboxMedia).map($t=>$t.lightboxMedia),Dt=a.jsx("div",{className:Ke,style:Ae,children:qt.length===0?null:w==="off"?(()=>{const{displayMedia:$t,lightboxMedia:_}=qt[0],Ie=_?Xt.findIndex(Ne=>Ne.url===_.url):-1;return a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ie>=0?()=>Ot(Xt,Ie):void 0})})():a.jsxs(a.Fragment,{children:[se&&a.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:qt.map(({displayMedia:$t})=>Ci($t)?a.jsx("video",{src:$t.url,muted:!0,playsInline:!0},`sizer-${$t.url}`):a.jsx("img",{src:$t.url,alt:""},`sizer-${$t.url}`))}),a.jsx(Vs,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:H*1e3,width:"100%",height:"100%",speed:bf,type:Y==="fade"?"fade":"loop",rewind:Y==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:ft},onMoved:$t=>{N!=="random"||Y==="fade"||xf($t)},children:qt.map(({displayMedia:$t,lightboxMedia:_},Ie)=>{const Ne=_?Xt.findIndex(Ge=>Ge.url===_.url):-1;return a.jsx(Gs,{children:a.jsx(Fl,{media:$t,className:`${u}-item-${Ci($t)?"video":"image"}`.trim(),style:xt,onMediaClick:Rt&&Ne>=0?()=>Ot(Xt,Ne):void 0})},Ie)})},`${Y}-${_e}-${N}-${H}-${It}-${d}`)]})}),jt=Oe?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?D.scalingValue(O??0,n):0,width:nt}}),a.jsx("p",{className:te,style:{width:tt,...P,...ye},children:pt.title}),a.jsx("div",{"data-controls":o&&st?"subtitleMarginTop":void 0,className:o&&st?`${u}-control`:void 0,style:{height:st?D.scalingValue(C??0,n):0,width:nt}}),a.jsx("p",{className:$e,style:{width:tt,...ie,...F},children:pt.subtitle})]});return a.jsx("div",{className:`${u}-item`.trim(),style:Mt&&!Qe?{gridColumn:Mt}:void 0,children:a.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${Qe&&vt?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(v??0)>100?`calc(${Le} * (${v} / 100))`:Le,...Mt&&Qe?{gridColumn:Mt}:{}},children:Qe?a.jsx(a.Fragment,{children:Oe?a.jsxs(a.Fragment,{children:[_t,a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt})]}):a.jsxs(a.Fragment,{children:[a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:Dt}),_t]})}):mt?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:mt,target:"_blank",className:`${u}-item-image-link`,children:[gt,Dt]}),!Oe&&a.jsx("a",{href:mt,target:"_blank",className:`${u}-item-text-link`,children:jt})]}):a.jsxs(a.Fragment,{children:[gt,Dt,jt]})})},Ee)})})}),(!n||i)&&Lt&&typeof document<"u"&&f==="on"&&(()=>{const pt=(c?document.getElementById(c):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Et,"data-selection":"none",children:a.jsx(Pf,{prefix:u,items:Nt,index:Zt,imageDisplay:kf(y),isEditor:n,onClose:()=>bt(!1),onPrev:()=>en(Ee=>(Ee-1+Nt.length)%Nt.length),onNext:()=>en(Ee=>(Ee+1)%Nt.length),counterClassName:ve,counterStyle:J})}),pt)})()]})}const Ff={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},_f=["hover","focus","filled","success","error"],Wf=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5202
5226
|
import '@splidejs/react-splide/css/core';
|
|
5203
5227
|
import { CommonComponentProps } from '../props';
|
|
5204
5228
|
import {
|
|
@@ -7251,12 +7275,12 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7251
7275
|
};
|
|
7252
7276
|
|
|
7253
7277
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7254
|
-
`,Ta={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},_f=["titleColor","subtitleColor","lightboxCounterColor"],Wf={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:[..._f],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Nf={element:Pf,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:Wf,sourceCode:Ff},Hf=50,_l=10,qs="cntrl-lightbox-journal",aa=qs,ss=`${qs}-`,sa=e=>`${qs}-${e}`,Xs=e=>e===aa||e.startsWith(ss),Wl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Nl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Wl(t.get(sa(e)));if(i)return i}const n=Wl(t.get(aa));if(n)return n;for(const[i]of t){if(!i.startsWith(ss))continue;const o=i.slice(ss.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Hl=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},Od=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xs(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)},Of=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:Xs(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)}},Dd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(sa(e)):[...t.keys()].some(n=>Xs(n))},Df=(e,t)=>{if(Dd(t)){if(e){window.history.back();return}Of(t)}},jf=20,zf=2,La=e=>`max(${e}, ${jf}px)`,Qi=e=>((e==null?void 0:e.image)??[]).slice(0,zf),jd=e=>e.reduce((t,n)=>t+Qi(n).length,0),Bf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Qi(r).length,1),i=Qi(e[t]).length;return{start:n,end:n+i-1}},Vf=(e,t)=>{const n=jd(e),{start:i,end:o}=Bf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>Qi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Qi(n)})),Gf=(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 Vf(i,o)},Ol=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",qf=(e,t,n)=>e==="B"?t.length>1:jd(n)>1,yn=.004,Zn=.004,Xi={title1Width:.13,title2Width:.13,title3Width:.14},Jn=(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},eo=(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},Oo=(e,t)=>eo(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)},Qn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:eo(e.length,n),effective:Oo(e.length,n)}},zd=(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),Bd=(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),ii=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Us={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Xf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Us[e],Ys(e)]))}),Uf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Yf={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ct(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[Uf[t]]}},wi=(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??Yf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)};function Vd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:y=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:S=null,closeIconMaxWidth:v=0,closeIconColor:w="#000000",closeIconHoverColor:H="#cccccc"}=n,N=O.scalingValue(f,i),Y=O.scalingValue(x,i),D=O.scalingValue(g,i),C=h==="mobile",V=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),I=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Xi.title1Width,title2Width:c??Xi.title2Width,title3Width:u??Xi.title3Width}),[d,c,u]),T=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:y}),[b,y]),m=s.useMemo(()=>Jn(e,t,V,$,I),[e,t,V,$,I]),M=s.useMemo(()=>m.map(Z=>k[Z.widthKey]),[m,k]),E=s.useMemo(()=>eo(m.length,M),[m.length,M]),z=s.useMemo(()=>Oo(m.length,M),[m.length,M]),ne=s.useMemo(()=>m.filter(Z=>Z.prefix==="title1"),[m]),R=s.useMemo(()=>m.filter(Z=>Z.prefix==="title2"||Z.prefix==="title3"),[m]),W=s.useMemo(()=>Qn(ne,k),[ne,k]),K=s.useMemo(()=>Qn(R,k),[R,k]),ae=!!(t.title1||t.title2||t.title3),de=S!==null;if(!(ae||de))return null;const he=(p??0)>0||o,q=(Z,me)=>{const De=m.findIndex(G=>G.prefix===Z.prefix);if(!C||me==="single-row")return{effectiveWidth:z[De]??0,resolvedWidth:E[De]??0,maxWidth:dn(De,E)};if(me==="two-row-top"){const G=ne.findIndex(ke=>ke.prefix===Z.prefix);return{effectiveWidth:W.effective[G]??0,resolvedWidth:W.resolved[G]??0,maxWidth:dn(G,W.resolved)}}const ge=R.findIndex(G=>G.prefix===Z.prefix);return{effectiveWidth:K.effective[ge]??0,resolvedWidth:K.resolved[ge]??0,maxWidth:dn(ge,K.resolved)}},ce=(Z,me,De)=>{if(!C||De==="single-row"){const rt=Z.findIndex(je=>je.prefix===me.prefix),Je=Z.map(je=>k[je.widthKey]),at=eo(Z.length,Je);return{effectiveWidth:Oo(Z.length,Je)[rt]??0,resolvedWidth:at[rt]??0,maxWidth:dn(rt,at)}}if(De==="two-row-top"){const rt=Z.filter(je=>je.prefix==="title1"),Je=rt.findIndex(je=>je.prefix===me.prefix),{resolved:at,effective:nt}=Qn(rt,k);return{effectiveWidth:nt[Je]??0,resolvedWidth:at[Je]??0,maxWidth:dn(Je,at)}}const ge=Z.filter(rt=>rt.prefix==="title2"||rt.prefix==="title3"),G=ge.findIndex(rt=>rt.prefix===me.prefix),{resolved:ke,effective:Fe}=Qn(ge,k);return{effectiveWidth:Fe[G]??0,resolvedWidth:ke[G]??0,maxWidth:dn(G,ke)}},Q=Z=>Bd(m,E,T,Z)+(C?0:p??0),be=()=>C?0:p??0,We=Z=>R.slice(0,Z).reduce((me,De,ge)=>me+(De.marginLeftKey?T[De.marginLeftKey]??0:0)+(K.resolved[ge]??0),0),xe=Z=>{const me=R[Z];return We(Z)+(me.marginLeftKey?T[me.marginLeftKey]??0:0)+(K.resolved[Z]??0)},le=(Z,me,De)=>{const ge=Z.marginLeftKey?T[Z.marginLeftKey]??0:0,{effectiveWidth:G,resolvedWidth:ke,maxWidth:Fe}=De??q(Z,me),rt=Math.max(ge,Zn),Je=o&&me==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Z.prefix,style:{width:O.scalingValue(G,i),...ge>0?{marginLeft:O.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:Z.className,style:Z.style,children:Z.text}),Je&&Z.marginLeftKey?a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:O.scalingValue(-ge,i),width:O.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:O.scalingValue(-yn/2,i),width:O.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},Z.className)},ee=(Z="two-row")=>{const me=m.findIndex(G=>G.prefix==="title1"),De=me>=0?E[me]:k.title1Width,ge=Z==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De)}:{},style:{width:O.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},ue=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:V,"aria-hidden":"true",children:" "}),oe=Z=>{const me=Jn(e,Z,V,$,I);return a.jsx(a.Fragment,{children:me.map(De=>le(De,"single-row",ce(me,De,"single-row")))})},Ne=Z=>{const me=Jn(e,Z,V,$,I),De=me.find(ge=>ge.prefix==="title1");return De?le(De,"two-row-top",ce(me,De,"two-row-top")):null},Te=(Z,me=!1)=>{const De=Jn(e,Z,V,$,I),ge=De.filter(Fe=>Fe.prefix==="title2"||Fe.prefix==="title3"),G=o&&me;return ge.length>0||G||(g??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(Fe=>le(Fe,"two-row-bottom",ce(De,Fe,"two-row-bottom")))}),me&&o?a.jsxs(a.Fragment,{children:[te(),Ce()]}):null]}):null,(g??0)>0||G?a.jsx("div",{"data-controls":G?"titleRowMarginBottom":void 0,"data-controls-axis":G?"y":void 0,"data-controls-reverse":G?"":void 0,className:G?`${e}-control`:void 0,style:{height:D,width:"100%",flexShrink:0,pointerEvents:G?"auto":"none"}}):null]}):null},P=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(v??0,i),height:O.scalingValue(v??0,i),marginRight:Y,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Z=>{Z.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:S??"",fill:w,hoverFill:i&&!r?w:H,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Y,height:"100%",pointerEvents:"auto"}})]}),U=()=>de?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:P()}):null,X=Z=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Z})}),ie=Z=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[de||ae?ue():null,he?ee("two-row"):null,X(Z),U()]}),j=(Z,me=!1)=>a.jsxs(a.Fragment,{children:[ie(Ne(Z)),Te(Z,me)]}),B=()=>{const Z=C?-1:m.findIndex(ge=>ge.prefix==="title1"),me=!C&&(o||(p??0)>0)?(()=>{const ge=p??0,G=Z>=0?E[Z]:k.title1Width,ke=Math.max(ge,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G),style:{position:"absolute",top:0,left:0,width:O.scalingValue(ke,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,De=m.flatMap((ge,G)=>{if(!ge.marginLeftKey)return[];const ke=T[ge.marginLeftKey]??0,Fe=zd(m,E,T,G)+be(),rt=Math.max(ke,Zn);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E[G]),style:{position:"absolute",top:0,left:O.scalingValue(Fe,i),width:O.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return me?[me,...De]:De},J=()=>m.map((Z,me)=>{const De=dn(me,E),G=Q(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(G,i),width:O.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),te=()=>R.flatMap((Z,me)=>{if(!Z.marginLeftKey)return[];const De=T[Z.marginLeftKey]??0,ge=We(me),G=Math.max(De,Zn),{resolvedWidth:ke}=q(Z,"two-row-bottom");return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:O.scalingValue(ge,i),width:O.scalingValue(G,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)}),Ce=()=>R.map((Z,me)=>{const{maxWidth:De}=q(Z,"two-row-bottom"),G=xe(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:O.scalingValue(G,i),width:O.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),ye=()=>!o||C?null:a.jsxs(a.Fragment,{children:[B(),J()]}),F=!!(t.title2||t.title3||(g??0)>0||o),ve=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[de||ae?ue():null,he?ee("single-row"):null,ae?X(oe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),U(),ye()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...F?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:F?void 0:{flex:"0 0 auto",height:"auto"},children:j(t,!0)}),ye()]});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:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?pe():ve()})})})]})}function Kf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Zf(e){return`
|
|
7278
|
+
`,Ta={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Nf=["titleColor","subtitleColor","lightboxCounterColor"],Hf={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:[...Nf],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Of={element:Af,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:Hf,sourceCode:Wf},Df=50,Wl=10,qs="cntrl-lightbox-journal",aa=qs,ss=`${qs}-`,sa=e=>`${qs}-${e}`,Xs=e=>e===aa||e.startsWith(ss),Nl=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Hl=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Nl(t.get(sa(e)));if(i)return i}const n=Nl(t.get(aa));if(n)return n;for(const[i]of t){if(!i.startsWith(ss))continue;const o=i.slice(ss.length);if(!/^\d+$/.test(o))continue;const r=Number.parseInt(o,10);if(Number.isFinite(r)&&r>=1)return r}return null},Ol=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},zd=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{Xs(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)},jf=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:Xs(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)}},Bd=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(sa(e)):[...t.keys()].some(n=>Xs(n))},zf=(e,t)=>{if(Bd(t)){if(e){window.history.back();return}jf(t)}},Bf=20,Vf=2,La=e=>`max(${e}, ${Bf}px)`,Qi=e=>((e==null?void 0:e.image)??[]).slice(0,Vf),Vd=e=>e.reduce((t,n)=>t+Qi(n).length,0),Gf=(e,t)=>{const n=e.slice(0,t).reduce((o,r)=>o+Qi(r).length,1),i=Qi(e[t]).length;return{start:n,end:n+i-1}},qf=(e,t)=>{const n=Vd(e),{start:i,end:o}=Gf(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},Ar=(e,t)=>t==="B"?e.flatMap((n,i)=>Qi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Qi(n)})),Xf=(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 qf(i,o)},Dl=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",Uf=(e,t,n)=>e==="B"?t.length>1:Vd(n)>1,yn=.004,Zn=.004,Xi={title1Width:.13,title2Width:.13,title3Width:.14},Jn=(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},eo=(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},Oo=(e,t)=>eo(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)},Qn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:eo(e.length,n),effective:Oo(e.length,n)}},Gd=(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),qd=(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),ii=["title1","title2","title3","count"],ct=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Us={title1:"1",title2:"2",title3:"3",count:"Count"},Ys=e=>[ct(e,"fontFamily"),ct(e,"fontSettings"),{type:"row",items:[ct(e,"fontSize"),ct(e,"lineHeight"),ct(e,"letterSpacing"),ct(e,"wordSpacing")]},ct(e,"textAlign"),ct(e,"textAppearance")],Yf=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(ii.map(e=>[Us[e],Ys(e)]))}),Kf={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},Zf={title1:.02,title2:.02,title3:.02,count:.017},bi=(e,t)=>{const n=i=>{const o=ct(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[Kf[t]]}},wi=(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??Zf[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)};function Xd({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:b=0,title3MarginLeft:v=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:f=0,iconMarginRight:x=0,closeIcon:S=null,closeIconMaxWidth:y=0,closeIconColor:w="#000000",closeIconHoverColor:H="#cccccc"}=n,N=D.scalingValue(f,i),Y=D.scalingValue(x,i),O=D.scalingValue(g,i),C=h==="mobile",V=wi("title1",bi(n,"title1"),i),$=wi("title2",bi(n,"title2"),i),R=wi("title3",bi(n,"title3"),i),k=s.useMemo(()=>({title1Width:d??Xi.title1Width,title2Width:c??Xi.title2Width,title3Width:u??Xi.title3Width}),[d,c,u]),T=s.useMemo(()=>({title2MarginLeft:b,title3MarginLeft:v}),[b,v]),m=s.useMemo(()=>Jn(e,t,V,$,R),[e,t,V,$,R]),M=s.useMemo(()=>m.map(Z=>k[Z.widthKey]),[m,k]),E=s.useMemo(()=>eo(m.length,M),[m.length,M]),z=s.useMemo(()=>Oo(m.length,M),[m.length,M]),ne=s.useMemo(()=>m.filter(Z=>Z.prefix==="title1"),[m]),I=s.useMemo(()=>m.filter(Z=>Z.prefix==="title2"||Z.prefix==="title3"),[m]),W=s.useMemo(()=>Qn(ne,k),[ne,k]),K=s.useMemo(()=>Qn(I,k),[I,k]),ae=!!(t.title1||t.title2||t.title3),de=S!==null;if(!(ae||de))return null;const he=(p??0)>0||o,q=(Z,me)=>{const De=m.findIndex(G=>G.prefix===Z.prefix);if(!C||me==="single-row")return{effectiveWidth:z[De]??0,resolvedWidth:E[De]??0,maxWidth:dn(De,E)};if(me==="two-row-top"){const G=ne.findIndex(Me=>Me.prefix===Z.prefix);return{effectiveWidth:W.effective[G]??0,resolvedWidth:W.resolved[G]??0,maxWidth:dn(G,W.resolved)}}const ge=I.findIndex(G=>G.prefix===Z.prefix);return{effectiveWidth:K.effective[ge]??0,resolvedWidth:K.resolved[ge]??0,maxWidth:dn(ge,K.resolved)}},ce=(Z,me,De)=>{if(!C||De==="single-row"){const rt=Z.findIndex(je=>je.prefix===me.prefix),Je=Z.map(je=>k[je.widthKey]),at=eo(Z.length,Je);return{effectiveWidth:Oo(Z.length,Je)[rt]??0,resolvedWidth:at[rt]??0,maxWidth:dn(rt,at)}}if(De==="two-row-top"){const rt=Z.filter(je=>je.prefix==="title1"),Je=rt.findIndex(je=>je.prefix===me.prefix),{resolved:at,effective:it}=Qn(rt,k);return{effectiveWidth:it[Je]??0,resolvedWidth:at[Je]??0,maxWidth:dn(Je,at)}}const ge=Z.filter(rt=>rt.prefix==="title2"||rt.prefix==="title3"),G=ge.findIndex(rt=>rt.prefix===me.prefix),{resolved:Me,effective:_e}=Qn(ge,k);return{effectiveWidth:_e[G]??0,resolvedWidth:Me[G]??0,maxWidth:dn(G,Me)}},Q=Z=>qd(m,E,T,Z)+(C?0:p??0),be=()=>C?0:p??0,He=Z=>I.slice(0,Z).reduce((me,De,ge)=>me+(De.marginLeftKey?T[De.marginLeftKey]??0:0)+(K.resolved[ge]??0),0),xe=Z=>{const me=I[Z];return He(Z)+(me.marginLeftKey?T[me.marginLeftKey]??0:0)+(K.resolved[Z]??0)},le=(Z,me,De)=>{const ge=Z.marginLeftKey?T[Z.marginLeftKey]??0:0,{effectiveWidth:G,resolvedWidth:Me,maxWidth:_e}=De??q(Z,me),rt=Math.max(ge,Zn),Je=o&&me==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Z.prefix,style:{width:D.scalingValue(G,i),...ge>0?{marginLeft:D.scalingValue(ge,i)}:{}},children:[a.jsx("p",{className:Z.className,style:Z.style,children:Z.text}),Je&&Z.marginLeftKey?a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(-ge,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}}):null,Je?a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(_e),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:D.scalingValue(-yn/2,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}}):null]},Z.className)},ee=(Z="two-row")=>{const me=m.findIndex(G=>G.prefix==="title1"),De=me>=0?E[me]:k.title1Width,ge=Z==="two-row"&&o;return a.jsx("div",{...ge?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De)}:{},style:{width:D.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ge?{pointerEvents:"auto"}:{}}})},ue=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:V,"aria-hidden":"true",children:" "}),oe=Z=>{const me=Jn(e,Z,V,$,R);return a.jsx(a.Fragment,{children:me.map(De=>le(De,"single-row",ce(me,De,"single-row")))})},Fe=Z=>{const me=Jn(e,Z,V,$,R),De=me.find(ge=>ge.prefix==="title1");return De?le(De,"two-row-top",ce(me,De,"two-row-top")):null},Ce=(Z,me=!1)=>{const De=Jn(e,Z,V,$,R),ge=De.filter(_e=>_e.prefix==="title2"||_e.prefix==="title3"),G=o&&me;return ge.length>0||G||(g??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(_e=>le(_e,"two-row-bottom",ce(De,_e,"two-row-bottom")))}),me&&o?a.jsxs(a.Fragment,{children:[te(),$e()]}):null]}):null,(g??0)>0||G?a.jsx("div",{"data-controls":G?"titleRowMarginBottom":void 0,"data-controls-axis":G?"y":void 0,"data-controls-reverse":G?"":void 0,className:G?`${e}-control`:void 0,style:{height:O,width:"100%",flexShrink:0,pointerEvents:G?"auto":"none"}}):null]}):null},P=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(y??0,i),height:D.scalingValue(y??0,i),marginRight:Y,"--close-icon-hover-color":H},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Z=>{Z.stopPropagation(),l==null||l()},"aria-label":"Close",children:a.jsx(ln,{url:S??"",fill:w,hoverFill:i&&!r?w:H,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:Y,height:"100%",pointerEvents:"auto"}})]}),U=()=>de?a.jsx("div",{className:`${e}-titles-row-header-controls`,children:P()}):null,X=Z=>a.jsx("div",{className:`${e}-titles-row-titles`,children:a.jsx("div",{className:`${e}-titles-stack`,children:Z})}),ie=Z=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[de||ae?ue():null,he?ee("two-row"):null,X(Z),U()]}),j=(Z,me=!1)=>a.jsxs(a.Fragment,{children:[ie(Fe(Z)),Ce(Z,me)]}),B=()=>{const Z=C?-1:m.findIndex(ge=>ge.prefix==="title1"),me=!C&&(o||(p??0)>0)?(()=>{const ge=p??0,G=Z>=0?E[Z]:k.title1Width,Me=Math.max(ge,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(G),style:{position:"absolute",top:0,left:0,width:D.scalingValue(Me,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,De=m.flatMap((ge,G)=>{if(!ge.marginLeftKey)return[];const Me=T[ge.marginLeftKey]??0,_e=Gd(m,E,T,G)+be(),rt=Math.max(Me,Zn);return a.jsx("div",{"data-controls":ge.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(E[G]),style:{position:"absolute",top:0,left:D.scalingValue(_e,i),width:D.scalingValue(rt,i),height:"100%",pointerEvents:"auto"}},ge.marginLeftKey)});return me?[me,...De]:De},J=()=>m.map((Z,me)=>{const De=dn(me,E),G=Q(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),te=()=>I.flatMap((Z,me)=>{if(!Z.marginLeftKey)return[];const De=T[Z.marginLeftKey]??0,ge=He(me),G=Math.max(De,Zn),{resolvedWidth:Me}=q(Z,"two-row-bottom");return a.jsx("div",{"data-controls":Z.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Me),style:{position:"absolute",top:0,left:D.scalingValue(ge,i),width:D.scalingValue(G,i),height:"100%",pointerEvents:"auto"}},Z.marginLeftKey)}),$e=()=>I.map((Z,me)=>{const{maxWidth:De}=q(Z,"two-row-bottom"),G=xe(me)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Z.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(De),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:D.scalingValue(G,i),width:D.scalingValue(yn,i),height:"100%",pointerEvents:"auto"}})},`${Z.widthKey}-junction`)}),ye=()=>!o||C?null:a.jsxs(a.Fragment,{children:[B(),J()]}),F=!!(t.title2||t.title3||(g??0)>0||o),ve=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[de||ae?ue():null,he?ee("single-row"):null,ae?X(oe(t)):a.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),U(),ye()]}),pe=()=>a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...F?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:F?void 0:{flex:"0 0 auto",height:"auto"},children:j(t,!0)}),ye()]});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:N,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...C?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${C?` ${e}-lightbox-content-area-stacked`:""}`,children:a.jsx("div",{className:`${e}-text-bar-cell${C?` ${e}-text-bar-cell-stacked`:""}`,style:C?void 0:{flex:1,minWidth:0,width:"100%"},children:C?pe():ve()})})})]})}function Jf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Qf(e){return`
|
|
7255
7279
|
.${e}-wrapper {
|
|
7256
7280
|
display: grid;
|
|
7257
7281
|
align-items: start;
|
|
7258
7282
|
justify-content: center;
|
|
7259
|
-
min-height: ${
|
|
7283
|
+
min-height: ${Jf(48)};
|
|
7260
7284
|
}
|
|
7261
7285
|
.${e}-item {
|
|
7262
7286
|
display: flex;
|
|
@@ -7571,7 +7595,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7571
7595
|
pointer-events: auto;
|
|
7572
7596
|
flex-shrink: 0;
|
|
7573
7597
|
}
|
|
7574
|
-
`}const Dl={url:"",name:"",objectFit:"cover"},Ln=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",Jf=72,Qf=50,ey=1e4,ty=650,ny=500;function iy(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 Gd(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 oy(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Gd(i,n):null}function ry(e){return e.reduce((t,n,i)=>{const o=Ks(n.gallery),l=Zs(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 To(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 jl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const ay=.03;function qd(e){return e.width*ay}const Ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function ur(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function zl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function sy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ls(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 ly(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ls(e,t.width,t.height)}function cy(e,t){if(ho(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 dy(e){const t=new Set,n=[];for(const i of e){const o=Ks(i.gallery),r=Zs(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 uy({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=>ho(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 to(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=to(e,t,n);return{...i,left:2*i.left-e.left}}function py(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 Xd(e,t,n,i){const o=to(e,"left",i),r=to(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 my(e,t,n,i){const{start:o,end:r}=Xd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function gy(e,t,n){const i=to(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ud(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ks(e){if(!e)return;if(Ud(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??Dl,i??o??Dl]}]}function hy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function fy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Zs(e){if(!Array.isArray(e)||e.length===0)return[];if(Ud(e)){const t=[];for(const n of e){const i=hy(n);if(!i)continue;const o=fy(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 ho(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function yy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ho(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 vy({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 pr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ho(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 xy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),v=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),D=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),R=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Ra),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[We,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Ne,Te]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[Ce,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],ke=G?ho(G):!1,Fe=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,nt=s.useCallback((_,Ee)=>t.length<=1?null:t[(_+Ee+t.length)%t.length]??null,[t]),je=at?To(u,p,-1):nt(n,-1),$e=at?To(u,p,1):nt(n,1),Ae=Ne===-1&&Fe?at&&P!==null?To(u,P,-1):X!==null?nt(X,-1):null:null,Be=Ne===1&&Fe?at&&P!==null?To(u,P,1):X!==null?nt(X,1):null:null,Ke=Ae&&Ae.url!==(je==null?void 0:je.url)?Ae:null,Ie=Be&&Be.url!==($e==null?void 0:$e.url)?Be:null,ze=je&&Je?(()=>{const _=at?jl(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=$e&&Je?(()=>{const _=at?jl(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return _&&_.url!==$e.url?_:null})():null,Re=Ke??ze,qe=Ie??se,we=s.useCallback((_,Ee,_e)=>{if(!_||!Ee||!_e)return;const Ve=H.current,dt=Ve.get(_);(dt==null?void 0:dt.width)===Ee&&(dt==null?void 0:dt.height)===_e||(Ve.set(_,{width:Ee,height:_e}),Y(At=>At+1))},[]),Le=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ee=H.current.get(_.url);return ly(v.current,Ee)},[N,q]),Ze=s.useCallback(()=>{if(!G)return;const _=Le(G);if(_){de(_);return}const Ee=v.current;Ee&&de(zl(Ee))},[G,Le]),Oe=s.useCallback(_=>{if(at){const Ee=u.length;U((p+_+Ee)%Ee),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ue=s.useCallback(_=>{T.current=_,oe(_)},[]),He=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{He(),m.current=window.setTimeout(()=>{He(),Ue(!1)},vo+32)},[He,Ue]),it=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ra.width,height:typeof window<"u"?window.innerHeight:Ra.height});return}const Ee=_.getBoundingClientRect();he({left:Ee.left,top:Ee.top,width:Ee.width,height:Ee.height})},[]),tt=s.useCallback((_,Ee)=>{if(Fe){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Ne!==null){const _e=Le(_);if(!_e)return;const{x:Ve,y:dt}=my(_e,Ee,Ne,A);return`translate(${Ve}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[Fe,ve,ue,le,Ne,A,Le]),St=s.useCallback(()=>{const _=M.current;M.current=null,He(),Ue(!1),Te(null),U(null),ie(null),ee(0),pe(!1),I.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[He,Ue,f,x]),$t=s.useCallback(()=>{He(),m.current=window.setTimeout(()=>{M.current!==null&&St()},vo+32)},[He,St]),Rt=s.useCallback(()=>{He(),M.current=null,Ue(!1),Te(null),U(null),ie(null),ee(0),pe(!1),I.current=!1,V.current=0,$.current="none"},[He,Ue]),yt=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,St();return}Rt()}He(),Oe(_),M.current=_,Te(_),Ue(!0),$t()}},[Je,ae,St,Rt,He,Oe,Ue,$t]);z.current=yt;const pt=s.useCallback(()=>{ne.current=null,K.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),kt=s.useCallback(_=>{R.current!==null&&window.clearInterval(R.current);const Ee=K.current?ny:ty;R.current=window.setInterval(()=>{z.current(_)},Ee)},[]),Wt=s.useCallback(_=>{ne.current!==_&&(pt(),ne.current=_,K.current=!1,z.current(_),kt(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,kt(_))},ey))},[pt,kt]),bt=s.useCallback(()=>{const _=v.current;if(!_)return;const Ee=G==null?void 0:G.url,_e=Ee?H.current.get(Ee):void 0;if(_e!=null&&_e.width&&(_e!=null&&_e.height)){de(ls(_,_e.width,_e.height));return}const Ve=w.current;if(Ve&&Ee&&(Ve.src===Ee||Ve.currentSrc===Ee)){const{width:At,height:lt}=sy(Ve);if(At&<){we(Ee,At,lt),de(ls(_,At,lt));return}}const dt=zl(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,we]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Gt=s.useCallback(()=>{it(),bt(),ce(_=>_+1)},[it,bt]);s.useEffect(()=>{Gt();const _=v.current,Ee=S.current,_e=new ResizeObserver(()=>Gt());return _&&_e.observe(_),Ee&&_e.observe(Ee),window.addEventListener("resize",Gt),()=>{_e.disconnect(),window.removeEventListener("resize",Gt)}},[Gt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Ze()},[Ze,N]),s.useEffect(()=>{const _=new Set,Ee=[],_e=Ve=>{!(Ve!=null&&Ve.url)||_.has(Ve.url)||(_.add(Ve.url),Ee.push(Ve))};t.forEach(_e),u.forEach(Ve=>Ve.items.forEach(_e)),Ee.forEach(Ve=>{H.current.has(Ve.url)||cy(Ve,we)})},[t,u,we]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!y){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,y]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Ln);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(He(),M.current=null,Te(null),U(null),ie(null),xe(0),ee(0),Ue(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",I.current=!1,D.current=null,k.current=!1,w.current=null,Ze(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ue,He,Ze]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!$e){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ee=lt=>{const xt=lt<0?1:-1;He(),Oe(xt),M.current=xt,Te(xt),Ue(!0),$t()},_e=lt=>{if(Math.abs(lt)>Qf&&Je){Ee(lt);return}M.current=null,Te(null),U(null),ie(null),Ue(!0),ee(0),Qe()},Ve=lt=>{if(lt.touches.length!==1||T.current)return;const xt=lt.touches[0];k.current=!0,D.current={x:xt.clientX,y:xt.clientY},$.current="none",V.current=0,I.current=!1},dt=lt=>{if(!D.current||lt.touches.length!==1||T.current)return;const xt=lt.touches[0],zt=xt.clientX-D.current.x,Et=xt.clientY-D.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Et)<10)return;if(Math.abs(zt)>Math.abs(Et)){if(!Je)return;$.current="horizontal"}else if(Et>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(I.current=!0,pe(!0),C.current=Et,xe(Et),lt.preventDefault())},At=()=>{if(!D.current)return;const lt=$.current,xt=I.current;if(xt&<==="horizontal")_e(V.current),_();else if(xt&<==="vertical"){const zt=C.current;if(rt&&zt>Jf){const Et=window.innerHeight;C.current=Et,me(!0),xe(Et),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(_e(V.current),_());D.current=null,$.current="none",V.current=0,I.current=!1,pe(!1)};return document.addEventListener("touchstart",Ve,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ve),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Je,Ue,Qe,He,rt,$t,Oe]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??y??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,y,ae]);s.useEffect(()=>{const _=Ve=>{if(Ve.key==="Escape"){if(r&&d||Q==="closing")return;pt(),Zt();return}if(Ve.key!=="ArrowLeft"&&Ve.key!=="ArrowRight"||Q!=="open"||!Je)return;Ve.preventDefault();const dt=Ve.key==="ArrowLeft"?-1:1;Ve.repeat&&ne.current===dt||Wt(dt)},Ee=Ve=>{if(Ve.key!=="ArrowLeft"&&Ve.key!=="ArrowRight")return;const dt=Ve.key==="ArrowLeft"?-1:1;ne.current===dt&&pt()},_e=()=>{pt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ee),window.addEventListener("blur",_e),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ee),window.removeEventListener("blur",_e),pt()}},[Q,r,d,Zt,Je,Wt,pt]),s.useEffect(()=>{Q!=="open"&&pt()},[Q,pt]);const en=()=>{Q==="closing"||l||Zt()},Lt=Q==="open",Ht=Q==="closing",nn=We>0?Math.max(0,1-We/500):1,ut=We>0?Math.max(.35,1-We/500):1,Me=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){St();return}He(),Ue(!1)}},[He,Ue,St]),Ge=Q==="closing"?J??y:y,st=Ge&&ae&&(Q==="opening"||Ht)?iy(Ge,ae):void 0,gt=Fe&&G?tt(G,"center"):We>0?`translateY(${We}px)`:st,vt=ae?ur(ae,A):null,It=!!(Ge&&ae),ft=It&&(Q==="closing"||Q==="open"&&j),Bt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:We>0?ut:It?1:Q==="opening"||Ht?0:1,transition:ve&&!ue?"none":ue?`transform ${vo}ms ${mn}`:Z?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:ft?`transform ${Ln}ms ${mn}`:Q==="opening"||Ht?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:ke&&Lt&&!Fe?"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&&!Fe?"auto":"none"},Ft=(_,Ee,_e="adjacent")=>{const Ve=Le(_);if(!Ve)return{display:"none"};const dt=_e==="far"?Ee==="left"?"far-left":"far-right":Ee==="left"?"left-adjacent":"right-adjacent",{start:At}=Ne!==null?Xd(Ve,dt,Ne,A):{start:_e==="far"?zr(Ve,Ee,A):to(Ve,Ee,A)},lt=ur(At,A),xt=tt(_,dt),zt=!Fe&&_e==="adjacent"&&Lt&&!Ce?gy(Ve,Ee,A):null,Et=_e==="far"&&Fe&&Ne===(Ee==="left"?-1:1),on=ve&&!ue?!1:ue,pn=_e==="adjacent"&&Lt&&Ce&&!Fe;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:xt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:_e==="far"?Lt&&Et?1:0:Lt?1:0,transition:on?_e==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:Q==="opening"||Ht?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ee)=>{const _e=Le(_);return _e?py(to(_e,Ee,A),Ee,A):null},Xt=_=>Ee=>{if(!l){if(k.current){k.current=!1;return}Ee.stopPropagation(),yt(_)}},Dt=je?qt(je,"left"):null,jt=$e?qt($e,"right"):null,Ot=Dt?ur(Dt,A):null,Ct=jt?ur(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Lt?nn:0,transition:ve?"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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Lt?1:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Vd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Lt&&Re&&a.jsx(pr,{media:Re,style:Ft(Re,"left","far"),onMeasure:we,onTransitionEnd:Me},`far-prev-${Re.url}`),Lt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:je,style:Ft(je,"left"),onMeasure:we,onTransitionEnd:Me},`prev-${je.url}`),Ot&&a.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Lt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:$e,style:Ft($e,"right"),onMeasure:we,onTransitionEnd:Me},`next-${$e.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Lt&&qe&&a.jsx(pr,{media:qe,style:Ft(qe,"right","far"),onMeasure:we,onTransitionEnd:Me},`far-next-${qe.url}`),ae&&G&&(ke?a.jsx(vy,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Bt,videoStyle:_t,onLoadedMetadata:bt,onTransitionEnd:Me},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Me,style:Bt},`${n}-${G.url}`))]})}function by({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=O.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,y=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[f,x]=g.split(":").map(Number),w=`${h?x:f} / ${h?f:x}`,H=c.entryWidth??.2,N=c.columnsCount,Y=O.scalingValue(H,n),D=O.scalingValue(c.horizontalGap??0,n),C=Y,V=Y,$={width:C,...y?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},I=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[T,m]=s.useState(!1),[M,E]=s.useState([]),[z,ne]=s.useState(0),[R,W]=s.useState(0),[K,ae]=s.useState(null),[de,A]=s.useState({title1:"",title2:"",title3:""}),he=(()=>{const X={},ie=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ie&&(X["--cntrl-article-width"]=ie),X})(),q=!n||i||o,ce=s.useMemo(()=>Zf(d),[d]),Q=t??[],be=Q.length%N||N,We=be<N&&Q.length>0,xe=Q.length-be,le=We?Math.floor((N-be)/2)+1:1,ee=s.useMemo(()=>ry(Q),[Q]),ue=s.useMemo(()=>dy(Q),[Q]),oe=(X,ie,j)=>{if(n&&!o&&!i)return;const B=ee.findIndex(te=>te.gridIndex===X);if(B<0)return;const J=ee[B];W(B),E(J.items),ne(ie),A(J.entry),ae(j??null),m(!0)},Ne=s.useCallback(()=>{m(!1),ae(null)},[]),Te=s.useCallback(()=>{const X=ee[R];return!X||!k.current?K:oy(k.current,X.gridIndex,y?"cover":"contain")??K},[ee,R,K,y]),P=s.useCallback(X=>{if(ee.length>1){const ie=ee.length,j=(R+X+ie)%ie,B=ee[j],J=Math.min(z,B.items.length-1);W(j),E(B.items),ne(J),A(B.entry);return}ne(ie=>(ie+X+M.length)%M.length)},[ee,R,z,M.length]),U=ee.length>1||M.length>1;return s.useEffect(()=>{if(!T||typeof document>"u")return;const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=X}},[T]),s.useEffect(()=>{!n||o||i||m(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(uy,{mediaList:ue}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${Y})`,rowGap:0,columnGap:D,width:O.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:O.scalingValue(u??0,n)},children:Q.map((X,ie)=>{const j=Ks(X.gallery),B=Zs(j),J=B.filter(pe=>pe.lightboxMedia).map(pe=>pe.lightboxMedia),te=Math.floor(ie/N)===Math.ceil(Q.length/N)-1,Ce=We&&ie>=xe?`${le+(ie-xe)}`:void 0,ye=B[0],F=ye!=null&&ye.lightboxMedia?J.findIndex(pe=>pe.url===ye.lightboxMedia.url):-1,ve=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:B.length>0&&a.jsx(yy,{media:ye.displayMedia,gridIndex:ie,className:`${d}-item-${ho(ye.displayMedia)?"video":"image"}`.trim(),style:I,onMediaClick:q&&F>=0?pe=>oe(ie,F,Gd(pe.currentTarget,y?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...Ce?{gridColumn:Ce}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:V}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ve}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:V}})})]})},ie)})}),T&&typeof document<"u"&&(()=>{const X=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:he,"data-selection":"none",children:a.jsx(xy,{prefix:d,items:M,index:z,entry:de,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:U,lightboxEntries:ee,entryIdx:R,layoutId:r,sourceRect:K,resolveCloseSourceRect:Te,onClose:Ne,onPrev:()=>P(-1),onNext:()=>P(1)})}),X)})()]})}const wy=`import { CommonComponentProps } from '../props';
|
|
7598
|
+
`}const jl={url:"",name:"",objectFit:"cover"},Ln=500,vo=650,mn="cubic-bezier(0.22, 1, 0.36, 1)",ey=72,ty=50,ny=1e4,iy=650,oy=500;function ry(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 Ud(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 ay(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Ud(i,n):null}function sy(e){return e.reduce((t,n,i)=>{const o=Ks(n.gallery),l=Zs(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 To(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function zl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return To(e,i,n)}const ly=.03;function Yd(e){return e.width*ly}const Ra={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function ur(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Bl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function cy(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function ls(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 dy(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:ls(e,t.width,t.height)}function uy(e,t){if(ho(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 py(e){const t=new Set,n=[];for(const i of e){const o=Ks(i.gallery),r=Zs(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 my({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=>ho(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 to(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=Yd(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=to(e,t,n);return{...i,left:2*i.left-e.left}}function gy(e,t,n){const{left:i,width:o}=n,r=Yd(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 Kd(e,t,n,i){const o=to(e,"left",i),r=to(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 hy(e,t,n,i){const{start:o,end:r}=Kd(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function fy(e,t,n){const i=to(e,t,n),o=zr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Zd(e){if(!Array.isArray(e)||e.length===0)return!1;const t=e[0];return t!==null&&typeof t=="object"&&"media"in t&&Array.isArray(t.media)}function Ks(e){if(!e)return;if(Zd(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??jl,i??o??jl]}]}function yy(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function vy(e){const[t]=e.media;return t!=null&&t.url?t:null}function Zs(e){if(!Array.isArray(e)||e.length===0)return[];if(Zd(e)){const t=[];for(const n of e){const i=yy(n);if(!i)continue;const o=vy(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 ho(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function xy({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return ho(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 by({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 pr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return ho(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 wy({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Ra),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?ho(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?To(u,p,-1):it(n,-1),Se=at?To(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?To(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?To(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?zl(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?zl(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),Y(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return dy(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(Bl(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;U((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},vo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Ra.width,height:typeof window<"u"?window.innerHeight:Ra.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=hy(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},vo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?oy:iy;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},ny))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(ls(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=cy(Ge);if(Ft&<){ze(Ie,Ft,lt),de(ls(_,Ft,lt));return}}const dt=Bl(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||uy(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Ln);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),U(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>ty&&Je){Ie(lt);return}M.current=null,Ce(null),U(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&<==="horizontal")Ne(V.current),_();else if(wt&<==="vertical"){const zt=C.current;if(rt&&zt>ey){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?ry(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?ur(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${vo}ms ${mn}`:Z?`transform ${Ln}ms ${mn}, opacity ${Ln}ms ${mn}`:gt?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?Kd(Ge,dt,Fe,A):{start:Ne==="far"?zr(Ge,Ie,A):to(Ge,Ie,A)},lt=ur(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?fy(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${vo}ms ${mn}`:`transform ${vo}ms ${mn}, opacity ${Ln}ms ${mn}`:pn?`transform ${Ln}ms ${mn}`:Q==="opening"||Ot?`opacity ${Ln}ms ${mn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?gy(to(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?ur(Dt,A):null,$t=jt?ur(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"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:Rt?1:0,transition:ve?"none":`opacity ${Ln}ms ${mn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(pr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(pr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(pr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(by,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}function Sy({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:b}=e,v=(b==null?void 0:b.display)==="cover",g=(b==null?void 0:b.ratioValue)??"1:1",h=(b==null?void 0:b.reversed)??!1,[f,x]=g.split(":").map(Number),w=`${h?x:f} / ${h?f:x}`,H=c.entryWidth??.2,N=c.columnsCount,Y=D.scalingValue(H,n),O=D.scalingValue(c.horizontalGap??0,n),C=Y,V=Y,$={width:C,...v?{aspectRatio:w,height:"auto",overflow:"hidden"}:{height:"auto"}},R=v?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},k=s.useRef(null),[T,m]=s.useState(!1),[M,E]=s.useState([]),[z,ne]=s.useState(0),[I,W]=s.useState(0),[K,ae]=s.useState(null),[de,A]=s.useState({title1:"",title2:"",title3:""}),he=(()=>{const X={},ie=k.current?getComputedStyle(k.current).getPropertyValue("--cntrl-article-width").trim():"";return ie&&(X["--cntrl-article-width"]=ie),X})(),q=!n||i||o,ce=s.useMemo(()=>Qf(d),[d]),Q=t??[],be=Q.length%N||N,He=be<N&&Q.length>0,xe=Q.length-be,le=He?Math.floor((N-be)/2)+1:1,ee=s.useMemo(()=>sy(Q),[Q]),ue=s.useMemo(()=>py(Q),[Q]),oe=(X,ie,j)=>{if(n&&!o&&!i)return;const B=ee.findIndex(te=>te.gridIndex===X);if(B<0)return;const J=ee[B];W(B),E(J.items),ne(ie),A(J.entry),ae(j??null),m(!0)},Fe=s.useCallback(()=>{m(!1),ae(null)},[]),Ce=s.useCallback(()=>{const X=ee[I];return!X||!k.current?K:ay(k.current,X.gridIndex,v?"cover":"contain")??K},[ee,I,K,v]),P=s.useCallback(X=>{if(ee.length>1){const ie=ee.length,j=(I+X+ie)%ie,B=ee[j],J=Math.min(z,B.items.length-1);W(j),E(B.items),ne(J),A(B.entry);return}ne(ie=>(ie+X+M.length)%M.length)},[ee,I,z,M.length]),U=ee.length>1||M.length>1;return s.useEffect(()=>{if(!T||typeof document>"u")return;const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=X}},[T]),s.useEffect(()=>{!n||o||i||m(!1)},[n,o,i]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ce}}),a.jsx(my,{mediaList:ue}),a.jsx("div",{ref:k,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${N}, ${Y})`,rowGap:0,columnGap:O,width:D.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:D.scalingValue(u??0,n)},children:Q.map((X,ie)=>{const j=Ks(X.gallery),B=Zs(j),J=B.filter(pe=>pe.lightboxMedia).map(pe=>pe.lightboxMedia),te=Math.floor(ie/N)===Math.ceil(Q.length/N)-1,$e=He&&ie>=xe?`${le+(ie-xe)}`:void 0,ye=B[0],F=ye!=null&&ye.lightboxMedia?J.findIndex(pe=>pe.url===ye.lightboxMedia.url):-1,ve=a.jsx("div",{className:`${d}-item-image-wrapper`,style:$,children:B.length>0&&a.jsx(xy,{media:ye.displayMedia,gridIndex:ie,className:`${d}-item-${ho(ye.displayMedia)?"video":"image"}`.trim(),style:R,onMediaClick:q&&F>=0?pe=>oe(ie,F,Ud(pe.currentTarget,v?"cover":"contain")):void 0})});return a.jsx("div",{className:`${d}-item`,children:a.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,te?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:Y,...$e?{gridColumn:$e}:{}},children:[a.jsx("div",{className:`${d}-item-title-row`,children:a.jsx("div",{style:{height:0,width:V}})}),a.jsx("a",{className:`${d}-item-image-link`,children:ve}),a.jsx("div",{className:`${d}-item-subtitle-row`,children:a.jsx("div",{style:{height:0,width:V}})})]})},ie)})}),T&&typeof document<"u"&&(()=>{const X=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:he,"data-selection":"none",children:a.jsx(wy,{prefix:d,items:M,index:z,entry:de,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:U,lightboxEntries:ee,entryIdx:I,layoutId:r,sourceRect:K,resolveCloseSourceRect:Ce,onClose:Fe,onPrev:()=>P(-1),onNext:()=>P(1)})}),X)})()]})}const $y=`import { CommonComponentProps } from '../props';
|
|
7575
7599
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7576
7600
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7577
7601
|
import { createPortal } from 'react-dom';
|
|
@@ -9914,7 +9938,7 @@ export function Hive({
|
|
|
9914
9938
|
</>
|
|
9915
9939
|
);
|
|
9916
9940
|
}
|
|
9917
|
-
`,Sy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),mi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function $y(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const no=ii.filter(e=>e!=="count"),Cy=no.reduce((e,t)=>({...e,...$y(t)}),{}),Ty=no.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Arial",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ia(e){return no.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Ly={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(no.map(e=>[Us[e],Ys(e)]))},Ry={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},Iy=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ry,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Ey={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:Iy},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"}},...Cy},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Sy,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Ty},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:[Ly]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},My={element:by,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:[...no.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...no.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})},schema:Ey,sourceCode:wy};function Py(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 ky({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 Ay(e){return String(e??"").trim().length>0}function Bl(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 Vl(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 Gl(e,t,n,i,o,r,l){const d=O.scalingValue(r,l),c=O.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Fy(e,t,n){const i=O.scalingValue(t,n),o=O.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const ql=10,Xl=10,xo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function _y(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Wy(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+ql,y:n.clientY-d.top+ql}}switch(e){case"left":return{x:Xl+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Xl-i/2,y:l};default:return{x:o/2,y:l}}}function Ny(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const g=n.current,h=i.current;g&&(g.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const g=i.current;t?(g.x=Ma(g.x,g.targetX,xo.positionEase),g.y=Ma(g.y,g.targetY,xo.positionEase),g.rotation=Ma(g.rotation,g.targetRotation,xo.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,f=Math.abs(g.rotation-g.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((g,h)=>{const f=i.current;f.targetX=g,f.targetY=h,f.targetRotation=0,f.x=g,f.y=h,f.rotation=0,f.lastX=g,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((g,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const x=g-f.lastX;f.targetRotation=_y(x*xo.rotationFactor,-20,xo.maxRotation)}else f.targetRotation=0;if(f.lastX=g,f.hasLastX=!0,f.targetX=g,f.targetY=h,t){c();return}f.x=g,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),b=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),y=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||y(),l),[e,y,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:b,reset:y}}function Hy(e){return`
|
|
9941
|
+
`,Cy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),mi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Ty(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...mi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...mi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...mi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...mi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...mi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...mi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...mi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const no=ii.filter(e=>e!=="count"),Ly=no.reduce((e,t)=>({...e,...Ty(t)}),{}),Ry=no.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Arial",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Ia(e){return no.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Iy={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(no.map(e=>[Us[e],Ys(e)]))},Ey={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},My=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Ey,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),Py={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:My},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"}},...Ly},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Cy,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Ry},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:[Iy]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},ky={element:Sy,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:[...no.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...no.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})},schema:Py,sourceCode:$y};function Ay(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 Fy({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 _y(e){return String(e??"").trim().length>0}function Vl(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 Gl(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 ql(e,t,n,i,o,r,l){const d=D.scalingValue(r,l),c=D.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Wy(e,t,n){const i=D.scalingValue(t,n),o=D.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Xl=10,Ul=10,xo={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Ny(e,t,n){return Math.max(t,Math.min(n,e))}function Ma(e,t,n){return e+(t-e)*n}function Hy(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+Xl,y:n.clientY-d.top+Xl}}switch(e){case"left":return{x:Ul+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Ul-i/2,y:l};default:return{x:o/2,y:l}}}function Oy(e,t){const n=s.useRef(null),i=s.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=s.useRef(null),r=s.useCallback(()=>{const g=n.current,h=i.current;g&&(g.style.transform=`translate3d(${h.x}px, ${h.y}px, 0) translate(-50%, -50%) rotate(${h.rotation.toFixed(3)}deg)`)},[]),l=s.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=s.useCallback(()=>{const g=i.current;t?(g.x=Ma(g.x,g.targetX,xo.positionEase),g.y=Ma(g.y,g.targetY,xo.positionEase),g.rotation=Ma(g.rotation,g.targetRotation,xo.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),r();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,f=Math.abs(g.rotation-g.targetRotation)<.08;!h||!f?o.current=requestAnimationFrame(d):o.current=null},[r,t]),c=s.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=s.useCallback((g,h)=>{const f=i.current;f.targetX=g,f.targetY=h,f.targetRotation=0,f.x=g,f.y=h,f.rotation=0,f.lastX=g,f.hasLastX=!0,r(),t&&c()},[r,t,c]),p=s.useCallback((g,h)=>{if(!e)return;const f=i.current;if(t&&f.hasLastX){const x=g-f.lastX;f.targetRotation=Ny(x*xo.rotationFactor,-20,xo.maxRotation)}else f.targetRotation=0;if(f.lastX=g,f.hasLastX=!0,f.targetX=g,f.targetY=h,t){c();return}f.x=g,f.y=h,f.rotation=f.targetRotation,r()},[e,r,t,c]),b=s.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),v=s.useCallback(()=>{l(),i.current={x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1},n.current&&(n.current.style.transform="")},[l]);return s.useEffect(()=>(e||v(),l),[e,v,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:b,reset:v}}function Dy(e){return`
|
|
9918
9942
|
.${e}-wrapper {
|
|
9919
9943
|
display: grid;
|
|
9920
9944
|
align-items: start;
|
|
@@ -10290,7 +10314,7 @@ a.${e}-list-item {
|
|
|
10290
10314
|
overflow-wrap: anywhere;
|
|
10291
10315
|
word-break: break-word;
|
|
10292
10316
|
}
|
|
10293
|
-
`}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Js=["AColumn","BColumn","CColumn","DColumn","EColumn"],Dn="cutLabel",Do=[...Js,Dn],la=["A","B","C","D","E"];function Yd(e){return`${e}ColumnVerticalAlign`}const cs=["Top","Center","Bottom"];function Qs(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 Oy(e){const t=Qs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Dy(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 Kd(e,t,n){const i=Dy(e);return i?i===t?!1:Oy(n[Yd(i)]):!0}function jo(e){const t=Qs(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 jy(e,t,n){if(Zd(e,t,n))return jo(e);const i=jo(e);return i.kind==="baseline"?{kind:"top"}:i}function zy(e){const t=jo(e);return t.kind==="baseline"?{kind:"top"}:t}function Zd(e,t,n){return Kd(e,n,t)?jo(e).kind==="baseline":!1}function By(e){const t={};let n=!1;for(const i of la){const o=Yd(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}Kd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function Vy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Gy(e){const t=jo(e).kind;return t==="baseline"?"center":t}function qy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Ul(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Xy(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=Xy(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 Uy(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 Yy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Ky={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function Pt(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Zy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function Jy(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),{type:"row",items:[Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing")]},Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Qy(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[Zy[e],Jy(e)]))}}function Br(e,t){const n=i=>{const o=Pt(t,i);return e[o]};return{textFontFamily:n("textFontFamily")??"Arial",textFontSettings:n("textFontSettings")??{fontWeight:400,fontStyle:"normal"},textFontSize:n("textFontSize"),textLineHeight:n("textLineHeight"),textLetterSpacing:n("textLetterSpacing")??0,textWordSpacing:n("textWordSpacing")??0,textTextAlign:n("textTextAlign")??(t===Dn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Yl(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(Yt(n,t))}function Kl(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 Zl(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`]:O.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],io=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],oo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ro=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],ev={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},tv=["hover","focus","filled","success","error"],Jl=.004,Oi=.004,ka=Oi,el=50,zo=1440,Bo=el/zo;function Jd(e){const t=typeof e=="number"&&e>0?e:zo;return el/t}function nv(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 zo}const Qd={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Mo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function iv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function ov(){return Object.fromEntries([...io.map(e=>[e,0]),...oo.map(e=>[e,0])])}function rv(){return Object.fromEntries(ro.map(e=>[e,0]))}function mr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Qd[t]]))}function eu(e,t,n){const i=e-Bo,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=tl(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 av(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=io[o],l=oo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=eu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function tl(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)+Bo;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]-Bo;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function sv(e,t,n){if(e<=1)return{};const i=tl(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 Ql(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function lv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function cv(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=io[c],b=oo[c],y=ro[c],g=xn[l],h=io[l],f=oo[l],x=ro[l],S=n[u],v=n[p],w=n[b],H=n[y];typeof S=="number"&&(r[g]=S),typeof v=="number"&&(r[h]=v),typeof w=="number"&&(r[f]=w),typeof H=="number"&&(r[x]=H)}return r}function tu(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 dv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Mo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...iv(n,o),...ov()};if(r)for(const d of ro)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,rv());return tu(e,l)?l:e}function uv(e,t,n){const i=By(e);i&&(e={...e,...i});const o=Jd(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Mo(e),c=Mo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,b=w=>{if(u)return w;const H=mr({...t,...w}),N=Mo(w),Y=Fr(p,N,H),D=av(p,Y,{...t,...w});return Object.keys(D).length===0?w:{...w,...D}};if(typeof r=="number"&&r!==l)return e;const y=Ql(e),g=Ql(t);if(!lv(y,g))return b({...e,...cv(y,g,t,p)});if(d<c&&typeof p=="number"&&!u){const w=mr({...t,...e});return b({...e,...sv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return w>H?{...e,textPaddingLR:H}:e}const h=mr({...t,...e}),f=Fr(p,c,mr(t)),S=Fr(p,d,h).some((w,H)=>w<(f[H]??w)),v=xn.some(w=>{const H=e[w],N=t[w];return typeof H=="number"&&typeof N=="number"&&H!==N});return S||v?b(e):e}function pv(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(Bo,i-o-r-Bo)}function mv(e,t){return Math.random()*(t-e)+e}function gv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:Qd[t]]))}function Aa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function hv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=io[d],u=oo[d],p=ro[d];return{key:l,textPrefix:Ky[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function fv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=O.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:y,entriesCount:g,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:S,showCut:v,cutCellMinHeight:w,cutLabel:H,imageSize:N,imageOnHover:Y,imagePosition:D="cursor",imageInterpolation:C="on",entryHoverEffect:V,entryHoverShowOption:$,rowPaddingTop:I,rowPaddingBottom:k,rowPaddingTopB:T,columnsOrder:m,textPaddingLR:M,textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:R,backgroundHoverColor:W,dividerHoverColor:K}=e,[ae,de]=s.useState(void 0),[A,he]=s.useState(null),q=s.useRef(null),ce=Y==="on"&&(!n||i),Q=D==="cursor",be=Q&&C==="on",{anchorRef:We,onShow:xe,onCursorMove:le,exit:ee}=Ny(!!(ce&&A!==null),be),ue=(S??0)>0,oe=b==="b",Ne=s.useRef(null),Te=s.useRef(null),[P,U]=s.useState(null),[X,ie]=s.useState(zo),j=Jd(X),B=Math.max(0,((y??0)-j)/2),J=Math.min(M??0,B),te=Math.max(J,Oi),Ce=((y??0)+j)/2;s.useLayoutEffect(()=>{if(!n){ie(zo);return}const Me=()=>{ie(nv(Ne.current))};Me();const Ge=Ne.current;if(!Ge)return;const st=new ResizeObserver(Me);st.observe(Ge);let gt=Ge;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&st.observe(gt),()=>st.disconnect()},[n,l]),s.useEffect(()=>{de(void 0)},[S,v,t,g]),s.useEffect(()=>{n&&!i&&de(void 0)},[n,i]);const ye=O.buildColorVars(c,{textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:R,backgroundHoverColor:W,dividerHoverColor:K},ev,tv),F=r&&r!=="default"?`${c}-state-${r}`:"",pe=`${!n||i?V==="default"?`${c}-entry-hover-default`:V==="blinds"?`${c}-entry-hover-blinds`:V==="reveal"?`${c}-entry-hover-reveal`:"":""} ${F}`.trim(),Z=V==="reveal"&&(!n||i),me=(x==null?void 0:x[0])??!1,De=(x==null?void 0:x[1])??!1,ge=s.useRef(e),G=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,G.current=l;return}if(G.current!==l){ge.current=e,G.current=l;return}const Me=ge.current;if(!(Me!==e))return;if(typeof Me.columns=="number"&&typeof e.columns=="number"&&Me.columns!==e.columns){ge.current=e;return}const st=uv(e,Me,{designWidth:X});ge.current=e,tu(e,st)&&d(st)},[e,d,n,l,X]);const ke=s.useMemo(()=>gv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Fe=s.useMemo(()=>Aa(e,io),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),rt=s.useMemo(()=>Aa(e,oo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Aa(e,ro),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=s.useMemo(()=>Array.isArray(m)&&m.length>0?m:[...oi],[m]),nt=s.useMemo(()=>hv(at,p,ke,Fe,rt,Je),[at,p,ke,Fe,rt,Je]),je=Mo(e),$e=s.useMemo(()=>xn.slice(0,p).map(Me=>ke[Me]),[p,ke]),Ae=s.useMemo(()=>tl(p,je,ke),[p,je,ke]),Be=s.useMemo(()=>Fr(p,je,ke),[p,je,ke]),Ke=s.useMemo(()=>nt.map((Me,Ge)=>eu(Be[Ge]??0,Me.paddingLeft,Me.paddingRight)),[nt,Be]),Ie=s.useMemo(()=>{const Me=g===0?1/0:g;return(t??[]).slice(0,Me).map((st,gt)=>({id:gt,cells:Object.fromEntries(oi.map(vt=>[vt,st[vt]??""])),image:st.image,link:st.link}))},[t,g]),ze=ue?ae??S:Ie.length,se=s.useMemo(()=>ue?Ie.slice(0,ze):Ie,[Ie,ue,ze]),Re=ue&&ze<Ie.length,qe=se.length>1||Re,we=[me?`${c}-divider-top`:"",De||qe?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Le=!n||i,Ze=()=>{if(!Le)return;const Me=ae??S;if(!v){de(Ie.length);return}de(Math.min(Me+v,Ie.length))},Oe=Me=>O.scalingValue(Me,n??!1),Ue=oe?T??0:I??0,He=k??0,Qe=h??0,it=Math.max(He,ka),tt=Gl(0,se.length,me,De,Re,f??0,n??!1).borderTopWidth,St=oe?"rowPaddingTopB":"rowPaddingTop",$t=nt[0],Rt=nt[nt.length-1],yt=Ke[0],pt=Ke[Ke.length-1],kt=$t&&yt?Math.max(yt.paddingLeft,Oi):0,Wt=Rt&&pt?Math.max(pt.paddingRight,Oi):0,bt=je,Nt=(Me,Ge)=>Wy(D,Ne.current,Q?Me:null,Ge),Gt=(Me,Ge)=>{if(!ce)return;const st=Me.image;if(!(st!=null&&st.url)){ee(()=>he(null));return}const gt=(N==null?void 0:N.min)??80,vt=(N==null?void 0:N.max)??320,It=(A==null?void 0:A.rowId)===Me.id,ft=It?A.widthPx:mv(gt,vt),{x:Bt,y:_t}=Nt(Ge,ft);if(It&&Q){le(Bt,_t);return}he({rowId:Me.id,url:st.url,objectFit:"contain",isVideo:Py(st),widthPx:ft}),q.current={x:Bt,y:_t}},Zt=Me=>{if(!ce||!A||!Q)return;const{x:Ge,y:st}=Nt(Me,A.widthPx);le(Ge,st)},en=()=>{A&&ee(()=>he(null))},Lt=Me=>{Z&&Bl(Me,c),!(!ce||!A)&&ee(()=>he(null))},Ht=Me=>{Z&&Vl(Me,c)};s.useLayoutEffect(()=>{if(!A||!q.current)return;const{x:Me,y:Ge}=q.current;q.current=null,xe(Me,Ge)},[A==null?void 0:A.rowId,A==null?void 0:A.url,xe]),s.useLayoutEffect(()=>{if(!u||oe){U(null);return}const Me=Te.current,Ge=Me==null?void 0:Me.parentElement;if(!Me||!Ge){U(null);return}const st=()=>{const vt=Me.querySelector("[data-list-row]");if(!vt){U(null);return}const It=Ge.getBoundingClientRect(),ft=vt.getBoundingClientRect();U(ft.top-It.top+ft.height/2)};st();const gt=new ResizeObserver(st);return gt.observe(Me),gt.observe(Ge),()=>gt.disconnect()},[u,oe,se,Ue,He,Qe,t,e,nt,Be,X,f,me,De,Re]);const nn=s.useMemo(()=>!oe&&Js.some(Me=>{const Ge=Me.charAt(0),st=e[`${Me}VerticalAlign`];return Zd(st,e,Ge)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Bt;const Me=Ne.current;if(!Me)return;const Ge=()=>{Me.querySelectorAll("[data-list-col]").forEach(_t=>{_t.style.transform="";const Ft=_t.querySelector(`.${c}-list-col`);Ft&&(Ft.style.minHeight="",Ft.style.height="");const qt=_t.querySelector(`.${c}-list-col-title`);qt&&(qt.style.transform="")})};if(oe||!nn){Ge();return}const st=()=>{const _t=Array.from(Me.querySelectorAll("[data-list-row]")),Ft=`${c}-list-col`,qt=`${c}-baseline-probe`;_t.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const jt=Dt.querySelector(`.${Ft}`);jt&&(jt.style.minHeight="",jt.style.height="");const Ot=Dt.querySelector(`.${c}-list-col-title`);Ot&&(Ot.style.transform="")})}),_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));Uy(Xt,Dt,Ft)}),Me.offsetHeight,_t.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),jt=Xt.getBoundingClientRect().top,Ot=new Map,Ct=Dt.map(_e=>{const Ve=_e.querySelector(`.${c}-list-col-title`),dt={el:_e,titleEl:Ve,letter:_e.getAttribute("data-col-letter")??"",kind:_e.getAttribute("data-valign")??"top",anchor:_e.getAttribute("data-valign-anchor")};return Ot.set(dt.letter,dt),dt}),_=new Map,Ee=(_e,Ve)=>{const dt=_.get(_e.letter);if(dt!==void 0)return dt;const At=_e.anchor?Ot.get(_e.anchor):void 0;if(_e.kind!=="baseline"||!At||Ve.has(_e.letter)){const on=Pa(_e,jt,Ft,qt);return _.set(_e.letter,on),on}Ve.add(_e.letter);const lt=Ee(At,Ve);Ve.delete(_e.letter);const xt=Pa(_e,jt,Ft,qt),zt=lt-xt;Yy(_e.titleEl,zt);const Et=Pa(_e,jt,Ft,qt);return _.set(_e.letter,Et),Et};Ct.forEach(_e=>Ee(_e,new Set))})};let gt=null;const vt=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,st()}))};st();const It=new ResizeObserver(()=>vt());It.observe(Me);let ft=!1;return typeof document<"u"&&((Bt=document.fonts)!=null&&Bt.ready)&&document.fonts.ready.then(()=>{ft||vt()}),()=>{ft=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),It.disconnect(),Ge()}},[nn,oe,e,t,X,se,Be]);const ut=s.useMemo(()=>Hy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:ut}}),a.jsx("div",{style:ye,children:a.jsxs("div",{ref:Ne,className:`${c}-wrapper ${pe}${we?` ${we}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:O.scalingValue(y??0,n)},onMouseMove:ce?Zt:void 0,onMouseLeave:ce?en:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[se.map((Me,Ge)=>{var It;const st=(((It=Me.link)==null?void 0:It.length)??0)>0,gt=st&&(!n||i)?"a":"div",vt=Gl(Ge,se.length,me,De,Re,f??0,n??!1);return a.jsxs(gt,{ref:Ge===0?ft=>{Te.current=ft}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Re&&Ge===se.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Me.link,target:"_blank"}:{},style:vt,onMouseEnter:ft=>{Z&&(st||$==="always")&&Bl(ft,c),ce&&Gt(Me,ft)},onMouseLeave:ft=>{Z&&(st||$==="always")&&Vl(ft,c)},children:[Ue>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(Ue)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&Ge===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Oe(Qe)},children:[nt.map((ft,Bt)=>{const _t=Bt===nt.length-1,Ft=Ke[Bt],qt=ft.paddingBottom,Xt=Ay(Me.cells[ft.key]),Dt=oe&&Xt&&qt>0,jt=oe?{minHeight:Oe(Qe)}:{width:Oe(Be[Bt])},Ot=oe?{paddingLeft:Oe(J),paddingRight:Oe(J)}:{paddingLeft:Oe(Ft.paddingLeft),paddingRight:Oe(Ft.paddingRight)},Ct=ft.textPrefix.charAt(0),_=oe?zy(e[`${ft.textPrefix}VerticalAlign`]):jy(e[`${ft.textPrefix}VerticalAlign`],e,Ct),Ee=oe&&Xt&&u&&Ge===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":Ct,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${_t?` ${c}-list-col-last`:""}`,style:{...Ot,...jt,...oe?{justifyContent:Ul(_.kind)}:{}},"data-test":ft.width,children:a.jsx("span",{className:Kl(e,ft.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Yl(Br(e,ft.textPrefix),n),...Zl(e,ft.textPrefix,c,n),...oe?{}:Vy(_.kind)},children:Me.cells[ft.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(qt)}}),Ee&&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:Oe(Math.max(qt,ka))}})]},ft.key)}),u&&Ge===0&&oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(te),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(Ce),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Oe(Math.max(te,je-te)),width:Oe(te),height:"100%"}})]})]}),!oe&&He>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Oe(He)}}),u&&Ge===0&&!oe&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Oe(it)}})]},Me.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":St,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:tt,left:0,width:"100%",height:Oe(Math.max(Ue,ka))}})},"row-padding-handles"),u&&!oe&&$t&&Rt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":$t.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((yt==null?void 0:yt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Oe(kt),height:"100%"}}),a.jsx("div",{"data-controls":Rt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[nt.length-1]-((pt==null?void 0:pt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(bt-Wt),width:Oe(Wt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&nt.slice(0,-1).map((Me,Ge)=>{const st=nt[Ge+1],gt=Ae.slice(0,Ge+1).reduce((_t,Ft)=>_t+Ft,0),vt=Ke[Ge],It=Ke[Ge+1],ft=Math.max(vt.paddingRight,Oi),Bt=Math.max(It.paddingLeft,Oi);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Me.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge]-vt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(gt-ft),width:Oe(ft),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[Ge+1]-It.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Oe(gt),width:Oe(Bt),height:"100%"}})]},`${Me.paddingRightKey}-padding`)}),u&&!oe&&nt.slice(0,-1).map((Me,Ge)=>{const st=pv(Ge,Ae,$e,je),vt=Ae.slice(0,Ge+1).reduce((It,ft)=>It+ft,0)-Jl/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Me.widthKey,"data-controls-axis":"x","data-controls-min":String(el),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Oe(vt),width:Oe(Jl),height:"calc(100%)",pointerEvents:"auto"}})},`${Me.widthKey}-junction`)})]}),Re&&(()=>{const Me=Br(e,Dn),Ge=Gy(e.cutLabelVerticalAlign),st=Me.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Oe(w??0),cursor:Le?"pointer":"default",...Fy(De,f??0,n??!1)},onClick:Le?Ze:void 0,onMouseEnter:Z||ce?Lt:void 0,onMouseLeave:Z?Ht:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Oe(J),paddingRight:Oe(J)}:{},justifyContent:qy(Me.textTextAlign),alignItems:Ul(Ge)},children:a.jsx("span",{className:Kl(e,Dn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Yl(Me,n),...Zl(e,Dn,c,n),...st?{width:"100%"}:{}},children:H})})})})(),ce&&A&&(()=>{const Me=`${A.widthPx}px`,Ge={width:Me,height:"auto",maxHeight:Me,objectFit:"contain"};return a.jsx("div",{ref:We,className:`${c}-hover-media-anchor`,children:a.jsx(ky,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:Ge},`${A.rowId}-${A.url}`)})})()]})})]})}const yv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10317
|
+
`}const oi=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Js=["AColumn","BColumn","CColumn","DColumn","EColumn"],Dn="cutLabel",Do=[...Js,Dn],la=["A","B","C","D","E"];function Jd(e){return`${e}ColumnVerticalAlign`}const cs=["Top","Center","Bottom"];function Qs(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 jy(e){const t=Qs(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function zy(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 Qd(e,t,n){const i=zy(e);return i?i===t?!1:jy(n[Jd(i)]):!0}function jo(e){const t=Qs(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 By(e,t,n){if(eu(e,t,n))return jo(e);const i=jo(e);return i.kind==="baseline"?{kind:"top"}:i}function Vy(e){const t=jo(e);return t.kind==="baseline"?{kind:"top"}:t}function eu(e,t,n){return Qd(e,n,t)?jo(e).kind==="baseline":!1}function Gy(e){const t={};let n=!1;for(const i of la){const o=Jd(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}Qd(r,i,e)||(t[o]="Top",n=!0)}return n?t:null}function qy(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function Xy(e){const t=jo(e).kind;return t==="baseline"?"center":t}function Uy(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Yl(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function Yy(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=Yy(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 Ky(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 Zy(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const Jy={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function At(e,t){return`${e}${t.replace(/^text/,"Text")}`}const Qy={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function ev(e){return[At(e,"textFontFamily"),At(e,"textFontSettings"),{type:"row",items:[At(e,"textFontSize"),At(e,"textLineHeight"),At(e,"textLetterSpacing"),At(e,"textWordSpacing")]},At(e,"textTextAlign"),At(e,"textTextAppearance"),`${e}VerticalAlign`]}function tv(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(Do.map(e=>[Qy[e],ev(e)]))}}function Br(e,t){const n=i=>{const o=At(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===Dn?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Kl(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(Yt(n,t))}function Zl(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 Jl(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`]:D.scalingValue((r-l)/2,i)}}const xn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],io=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],oo=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],ro=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],nv={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},iv=["hover","focus","filled","success","error"],Ql=.004,Oi=.004,ka=Oi,el=50,zo=1440,Bo=el/zo;function tu(e){const t=typeof e=="number"&&e>0?e:zo;return el/t}function ov(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 zo}const nu={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function Mo(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function rv(e,t=1){const n=t/e;return Object.fromEntries(xn.map(i=>[i,n]))}function av(){return Object.fromEntries([...io.map(e=>[e,0]),...oo.map(e=>[e,0])])}function sv(){return Object.fromEntries(ro.map(e=>[e,0]))}function mr(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function iu(e,t,n){const i=e-Bo,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=tl(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 lv(e,t,n){const i={};for(let o=0;o<e;o+=1){const r=io[o],l=oo[o],d=typeof n[r]=="number"?n[r]:0,c=typeof n[l]=="number"?n[l]:0,u=iu(t[o]??0,d,c);u.paddingLeft!==d&&(i[r]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function tl(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)+Bo;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]-Bo;if(p<=0)continue;const b=Math.min(c,p);d[u]-=b,c-=b}return[...d,i[e-1]]}function cv(e,t,n){if(e<=1)return{};const i=tl(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 ec(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...oi]}function dv(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function uv(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=io[c],b=oo[c],v=ro[c],g=xn[l],h=io[l],f=oo[l],x=ro[l],S=n[u],y=n[p],w=n[b],H=n[v];typeof S=="number"&&(r[g]=S),typeof y=="number"&&(r[h]=y),typeof w=="number"&&(r[f]=w),typeof H=="number"&&(r[x]=H)}return r}function ou(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 pv(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=Mo(e),r=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...rv(n,o),...av()};if(r)for(const d of ro)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,sv());return ou(e,l)?l:e}function mv(e,t,n){const i=Gy(e);i&&(e={...e,...i});const o=tu(n==null?void 0:n.designWidth),r=e.columns,l=t.columns,d=Mo(e),c=Mo(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof r=="number"?r:typeof l=="number"?l:oi.length,b=w=>{if(u)return w;const H=mr({...t,...w}),N=Mo(w),Y=Fr(p,N,H),O=lv(p,Y,{...t,...w});return Object.keys(O).length===0?w:{...w,...O}};if(typeof r=="number"&&r!==l)return e;const v=ec(e),g=ec(t);if(!dv(v,g))return b({...e,...uv(v,g,t,p)});if(d<c&&typeof p=="number"&&!u){const w=mr({...t,...e});return b({...e,...cv(p,d,w)})}if(u){const w=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,H=Math.max(0,(d-o)/2);return w>H?{...e,textPaddingLR:H}:e}const h=mr({...t,...e}),f=Fr(p,c,mr(t)),S=Fr(p,d,h).some((w,H)=>w<(f[H]??w)),y=xn.some(w=>{const H=e[w],N=t[w];return typeof H=="number"&&typeof N=="number"&&H!==N});return S||y?b(e):e}function gv(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(Bo,i-o-r-Bo)}function hv(e,t){return Math.random()*(t-e)+e}function fv(e){return Object.fromEntries(xn.map(t=>[t,typeof e[t]=="number"?e[t]:nu[t]]))}function Aa(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function yv(e,t,n,i,o,r){return e.slice(0,t).map((l,d)=>{const c=io[d],u=oo[d],p=ro[d];return{key:l,textPrefix:Jy[l],widthKey:xn[d],width:n[xn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:r[p]}})}function vv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r,layoutId:l,onUpdateSettings:d}){const{prefix:c}=D.useScopedStyles(),u=!!o,{columns:p,type:b,wrapperWidth:v,entriesCount:g,cellMinHeight:h,dividerWidth:f,showVisibility:x,cut:S,showCut:y,cutCellMinHeight:w,cutLabel:H,imageSize:N,imageOnHover:Y,imagePosition:O="cursor",imageInterpolation:C="on",entryHoverEffect:V,entryHoverShowOption:$,rowPaddingTop:R,rowPaddingBottom:k,rowPaddingTopB:T,columnsOrder:m,textPaddingLR:M,textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K}=e,[ae,de]=s.useState(void 0),[A,he]=s.useState(null),q=s.useRef(null),ce=Y==="on"&&(!n||i),Q=O==="cursor",be=Q&&C==="on",{anchorRef:He,onShow:xe,onCursorMove:le,exit:ee}=Oy(!!(ce&&A!==null),be),ue=(S??0)>0,oe=b==="b",Fe=s.useRef(null),Ce=s.useRef(null),[P,U]=s.useState(null),[X,ie]=s.useState(zo),j=tu(X),B=Math.max(0,((v??0)-j)/2),J=Math.min(M??0,B),te=Math.max(J,Oi),$e=((v??0)+j)/2;s.useLayoutEffect(()=>{if(!n){ie(zo);return}const Ee=()=>{ie(ov(Fe.current))};Ee();const qe=Fe.current;if(!qe)return;const st=new ResizeObserver(Ee);st.observe(qe);let mt=qe;for(;mt&&!mt.style.getPropertyValue("--cntrl-article-width");)mt=mt.parentElement;return mt&&st.observe(mt),()=>st.disconnect()},[n,l]),s.useEffect(()=>{de(void 0)},[S,y,t,g]),s.useEffect(()=>{n&&!i&&de(void 0)},[n,i]);const ye=D.buildColorVars(c,{textColor:E,backgroundColor:z,dividerColor:ne,textHoverColor:I,backgroundHoverColor:W,dividerHoverColor:K},nv,iv),F=r&&r!=="default"?`${c}-state-${r}`:"",pe=`${!n||i?V==="default"?`${c}-entry-hover-default`:V==="blinds"?`${c}-entry-hover-blinds`:V==="reveal"?`${c}-entry-hover-reveal`:"":""} ${F}`.trim(),Z=V==="reveal"&&(!n||i),me=(x==null?void 0:x[0])??!1,De=(x==null?void 0:x[1])??!1,ge=s.useRef(e),G=s.useRef(l);s.useEffect(()=>{if(!d||!n){ge.current=e,G.current=l;return}if(G.current!==l){ge.current=e,G.current=l;return}const Ee=ge.current;if(!(Ee!==e))return;if(typeof Ee.columns=="number"&&typeof e.columns=="number"&&Ee.columns!==e.columns){ge.current=e;return}const st=mv(e,Ee,{designWidth:X});ge.current=e,ou(e,st)&&d(st)},[e,d,n,l,X]);const Me=s.useMemo(()=>fv(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),_e=s.useMemo(()=>Aa(e,io),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),rt=s.useMemo(()=>Aa(e,oo),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),Je=s.useMemo(()=>Aa(e,ro),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),at=s.useMemo(()=>Array.isArray(m)&&m.length>0?m:[...oi],[m]),it=s.useMemo(()=>yv(at,p,Me,_e,rt,Je),[at,p,Me,_e,rt,Je]),je=Mo(e),Se=s.useMemo(()=>xn.slice(0,p).map(Ee=>Me[Ee]),[p,Me]),We=s.useMemo(()=>tl(p,je,Me),[p,je,Me]),Be=s.useMemo(()=>Fr(p,je,Me),[p,je,Me]),Ze=s.useMemo(()=>it.map((Ee,qe)=>iu(Be[qe]??0,Ee.paddingLeft,Ee.paddingRight)),[it,Be]),Le=s.useMemo(()=>{const Ee=g===0?1/0:g;return(t??[]).slice(0,Ee).map((st,mt)=>({id:mt,cells:Object.fromEntries(oi.map(vt=>[vt,st[vt]??""])),image:st.image,link:st.link}))},[t,g]),Ve=ue?ae??S:Le.length,se=s.useMemo(()=>ue?Le.slice(0,Ve):Le,[Le,ue,Ve]),Te=ue&&Ve<Le.length,Xe=se.length>1||Te,ze=[me?`${c}-divider-top`:"",De||Xe?`${c}-divider-bottom`:""].filter(Boolean).join(" "),Re=!n||i,Pe=()=>{if(!Re)return;const Ee=ae??S;if(!y){de(Le.length);return}de(Math.min(Ee+y,Le.length))},Ae=Ee=>D.scalingValue(Ee,n??!1),Ke=oe?T??0:R??0,Oe=k??0,Qe=h??0,tt=Math.max(Oe,ka),nt=ql(0,se.length,me,De,Te,f??0,n??!1).borderTopWidth,xt=oe?"rowPaddingTopB":"rowPaddingTop",It=it[0],Tt=it[it.length-1],ut=Ze[0],ft=Ze[Ze.length-1],Et=It&&ut?Math.max(ut.paddingLeft,Oi):0,Lt=Tt&&ft?Math.max(ft.paddingRight,Oi):0,bt=je,Nt=(Ee,qe)=>Hy(O,Fe.current,Q?Ee:null,qe),Bt=(Ee,qe)=>{if(!ce)return;const st=Ee.image;if(!(st!=null&&st.url)){ee(()=>he(null));return}const mt=(N==null?void 0:N.min)??80,vt=(N==null?void 0:N.max)??320,Mt=(A==null?void 0:A.rowId)===Ee.id,gt=Mt?A.widthPx:hv(mt,vt),{x:Vt,y:Wt}=Nt(qe,gt);if(Mt&&Q){le(Vt,Wt);return}he({rowId:Ee.id,url:st.url,objectFit:"contain",isVideo:Ay(st),widthPx:gt}),q.current={x:Vt,y:Wt}},Zt=Ee=>{if(!ce||!A||!Q)return;const{x:qe,y:st}=Nt(Ee,A.widthPx);le(qe,st)},en=()=>{A&&ee(()=>he(null))},Rt=Ee=>{Z&&Vl(Ee,c),!(!ce||!A)&&ee(()=>he(null))},Ot=Ee=>{Z&&Gl(Ee,c)};s.useLayoutEffect(()=>{if(!A||!q.current)return;const{x:Ee,y:qe}=q.current;q.current=null,xe(Ee,qe)},[A==null?void 0:A.rowId,A==null?void 0:A.url,xe]),s.useLayoutEffect(()=>{if(!u||oe){U(null);return}const Ee=Ce.current,qe=Ee==null?void 0:Ee.parentElement;if(!Ee||!qe){U(null);return}const st=()=>{const vt=Ee.querySelector("[data-list-row]");if(!vt){U(null);return}const Mt=qe.getBoundingClientRect(),gt=vt.getBoundingClientRect();U(gt.top-Mt.top+gt.height/2)};st();const mt=new ResizeObserver(st);return mt.observe(Ee),mt.observe(qe),()=>mt.disconnect()},[u,oe,se,Ke,Oe,Qe,t,e,it,Be,X,f,me,De,Te]);const nn=s.useMemo(()=>!oe&&Js.some(Ee=>{const qe=Ee.charAt(0),st=e[`${Ee}VerticalAlign`];return eu(st,e,qe)}),[oe,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);s.useLayoutEffect(()=>{var Vt;const Ee=Fe.current;if(!Ee)return;const qe=()=>{Ee.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${c}-list-col`);_t&&(_t.style.minHeight="",_t.style.height="");const qt=Wt.querySelector(`.${c}-list-col-title`);qt&&(qt.style.transform="")})};if(oe||!nn){qe();return}const st=()=>{const Wt=Array.from(Ee.querySelectorAll("[data-list-row]")),_t=`${c}-list-col`,qt=`${c}-baseline-probe`;Wt.forEach(Xt=>{Xt.querySelectorAll("[data-list-col]").forEach(Dt=>{Dt.style.transform="";const jt=Dt.querySelector(`.${_t}`);jt&&(jt.style.minHeight="",jt.style.height="");const Ht=Dt.querySelector(`.${c}-list-col-title`);Ht&&(Ht.style.transform="")})}),Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]"));Ky(Xt,Dt,_t)}),Ee.offsetHeight,Wt.forEach(Xt=>{const Dt=Array.from(Xt.querySelectorAll("[data-list-col]")),jt=Xt.getBoundingClientRect().top,Ht=new Map,$t=Dt.map(Ne=>{const Ge=Ne.querySelector(`.${c}-list-col-title`),dt={el:Ne,titleEl:Ge,letter:Ne.getAttribute("data-col-letter")??"",kind:Ne.getAttribute("data-valign")??"top",anchor:Ne.getAttribute("data-valign-anchor")};return Ht.set(dt.letter,dt),dt}),_=new Map,Ie=(Ne,Ge)=>{const dt=_.get(Ne.letter);if(dt!==void 0)return dt;const Ft=Ne.anchor?Ht.get(Ne.anchor):void 0;if(Ne.kind!=="baseline"||!Ft||Ge.has(Ne.letter)){const on=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,on),on}Ge.add(Ne.letter);const lt=Ie(Ft,Ge);Ge.delete(Ne.letter);const wt=Pa(Ne,jt,_t,qt),zt=lt-wt;Zy(Ne.titleEl,zt);const Pt=Pa(Ne,jt,_t,qt);return _.set(Ne.letter,Pt),Pt};$t.forEach(Ne=>Ie(Ne,new Set))})};let mt=null;const vt=()=>{mt===null&&(mt=requestAnimationFrame(()=>{mt=null,st()}))};st();const Mt=new ResizeObserver(()=>vt());Mt.observe(Ee);let gt=!1;return typeof document<"u"&&((Vt=document.fonts)!=null&&Vt.ready)&&document.fonts.ready.then(()=>{gt||vt()}),()=>{gt=!0,mt!==null&&(cancelAnimationFrame(mt),mt=null),Mt.disconnect(),qe()}},[nn,oe,e,t,X,se,Be]);const pt=s.useMemo(()=>Dy(c),[c]);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pt}}),a.jsx("div",{style:ye,children:a.jsxs("div",{ref:Fe,className:`${c}-wrapper ${pe}${ze?` ${ze}`:""}${oe?` ${c}-type-b`:""}`.trim(),style:{width:D.scalingValue(v??0,n)},onMouseMove:ce?Zt:void 0,onMouseLeave:ce?en:void 0,children:[a.jsxs("div",{style:{width:"100%",position:"relative"},children:[se.map((Ee,qe)=>{var Mt;const st=(((Mt=Ee.link)==null?void 0:Mt.length)??0)>0,mt=st&&(!n||i)?"a":"div",vt=ql(qe,se.length,me,De,Te,f??0,n??!1);return a.jsxs(mt,{ref:qe===0?gt=>{Ce.current=gt}:void 0,className:`${c}-list-item${st||$==="always"?` ${c}-list-item-has-link`:""}${Te&&qe===se.length-1?` ${c}-list-item-before-cut`:""}`,...st?{href:Ee.link,target:"_blank"}:{},style:vt,onMouseEnter:gt=>{Z&&(st||$==="always")&&Vl(gt,c),ce&&Bt(Ee,gt)},onMouseLeave:gt=>{Z&&(st||$==="always")&&Gl(gt,c)},children:[Ke>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Ke)}}),a.jsxs("div",{className:`${c}-list-cols-row${oe?"":` ${c}-list-cols-row-h`}${u&&qe===0&&oe?` ${c}-list-cols-row-controls`:""}`,...oe?{}:{"data-list-row":""},style:oe?void 0:{minHeight:Ae(Qe)},children:[it.map((gt,Vt)=>{const Wt=Vt===it.length-1,_t=Ze[Vt],qt=gt.paddingBottom,Xt=_y(Ee.cells[gt.key]),Dt=oe&&Xt&&qt>0,jt=oe?{minHeight:Ae(Qe)}:{width:Ae(Be[Vt])},Ht=oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{paddingLeft:Ae(_t.paddingLeft),paddingRight:Ae(_t.paddingRight)},$t=gt.textPrefix.charAt(0),_=oe?Vy(e[`${gt.textPrefix}VerticalAlign`]):By(e[`${gt.textPrefix}VerticalAlign`],e,$t),Ie=oe&&Xt&&u&&qe===0;return oe&&!Xt?null:a.jsxs("div",{className:oe?`${c}-list-col-wrap`:void 0,...oe?{}:{"data-list-col":"","data-col-letter":$t,"data-valign":_.kind,..._.kind==="baseline"?{"data-valign-anchor":_.anchorLetter}:{}},children:[a.jsx("div",{className:`${c}-list-col${Wt?` ${c}-list-col-last`:""}`,style:{...Ht,...jt,...oe?{justifyContent:Yl(_.kind)}:{}},"data-test":gt.width,children:a.jsx("span",{className:Zl(e,gt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Kl(Br(e,gt.textPrefix),n),...Jl(e,gt.textPrefix,c,n),...oe?{}:qy(_.kind)},children:Ee.cells[gt.key]??null})}),Dt&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(qt)}}),Ie&&a.jsx("div",{"data-controls":gt.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(Math.max(qt,ka))}})]},gt.key)}),u&&qe===0&&oe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(te),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($e),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:Ae(Math.max(te,je-te)),width:Ae(te),height:"100%"}})]})]}),!oe&&Oe>0&&a.jsx("div",{className:`${c}-row-padding-handle`,style:{height:Ae(Oe)}}),u&&qe===0&&!oe&&a.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:Ae(tt)}})]},Ee.id)}),u&&a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":xt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":oe?"center":"left-y",className:`${c}-control-anchor`,style:{top:nt,left:0,width:"100%",height:Ae(Math.max(Ke,ka))}})},"row-padding-handles"),u&&!oe&&It&&Tt&&a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":It.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[0]-((ut==null?void 0:ut.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:Ae(Et),height:"100%"}}),a.jsx("div",{"data-controls":Tt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[it.length-1]-((ft==null?void 0:ft.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(bt-Lt),width:Ae(Lt),height:"100%"}})]},"column-edge-padding-handles"),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=it[qe+1],mt=We.slice(0,qe+1).reduce((Wt,_t)=>Wt+_t,0),vt=Ze[qe],Mt=Ze[qe+1],gt=Math.max(vt.paddingRight,Oi),Vt=Math.max(Mt.paddingLeft,Oi);return a.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[a.jsx("div",{"data-controls":Ee.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Be[qe]-vt.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt-gt),width:Ae(gt),height:"100%"}}),a.jsx("div",{"data-controls":st.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Be[qe+1]-Mt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":P??void 0,className:`${c}-control-anchor`,style:{top:0,left:Ae(mt),width:Ae(Vt),height:"100%"}})]},`${Ee.paddingRightKey}-padding`)}),u&&!oe&&it.slice(0,-1).map((Ee,qe)=>{const st=gv(qe,We,Se,je),vt=We.slice(0,qe+1).reduce((Mt,gt)=>Mt+gt,0)-Ql/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Ee.widthKey,"data-controls-axis":"x","data-controls-min":String(el),"data-controls-max-fraction":String(st),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:Ae(vt),width:Ae(Ql),height:"calc(100%)",pointerEvents:"auto"}})},`${Ee.widthKey}-junction`)})]}),Te&&(()=>{const Ee=Br(e,Dn),qe=Xy(e.cutLabelVerticalAlign),st=Ee.textTextAlign==="justify"||oe;return a.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:Ae(w??0),cursor:Re?"pointer":"default",...Wy(De,f??0,n??!1)},onClick:Re?Pe:void 0,onMouseEnter:Z||ce?Rt:void 0,onMouseLeave:Z?Ot:void 0,children:a.jsx("div",{className:`${c}-list-cols-row`,style:{...oe?{paddingLeft:Ae(J),paddingRight:Ae(J)}:{},justifyContent:Uy(Ee.textTextAlign),alignItems:Yl(qe)},children:a.jsx("span",{className:Zl(e,Dn,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Kl(Ee,n),...Jl(e,Dn,c,n),...st?{width:"100%"}:{}},children:H})})})})(),ce&&A&&(()=>{const Ee=`${A.widthPx}px`,qe={width:Ee,height:"auto",maxHeight:Ee,objectFit:"contain"};return a.jsx("div",{ref:He,className:`${c}-hover-media-anchor`,children:a.jsx(Fy,{media:A,className:A.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:qe},`${A.rowId}-${A.url}`)})})()]})})]})}const xv=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10294
10318
|
import { CommonComponentProps } from '../props';
|
|
10295
10319
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10296
10320
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13378,7 +13402,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13378
13402
|
</>
|
|
13379
13403
|
);
|
|
13380
13404
|
}
|
|
13381
|
-
`,fo=["A","B","C","D","E"],ec=[...cs,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function vv(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function gr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function xv(){return Object.fromEntries(fo.map((e,t)=>{const n=oi[t],i=`${e} column`;return[n,vv(i)]}))}function bv(){const e={};for(const t of fo)e[`${t}ColumnWidth`]=gr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=gr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=gr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=gr(`${t} column padding bottom`);return e}function tc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...oi]};for(const r of fo)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 wv(e){const t={};if(e===Dn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...cs]},enum:[...cs]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ec],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...ec]}}return t[Pt(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[Pt(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[Pt(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Pt(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Pt(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Pt(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Pt(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Pt(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Sv=Do.reduce((e,t)=>({...e,...wv(t)}),{});function $v(e){return{verticalAlign:e===Dn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Dn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Cv(e,t={}){var n;return{...$v(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const nc=new Set(["textFontFamily","textFontSettings"]);function Tv(e,t,n){const i=r=>n===void 0?!0:n==="common"?nc.has(r):!nc.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Qs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[Pt(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[Pt(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[Pt(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[Pt(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[Pt(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[Pt(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[Pt(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[Pt(e,"textTextAppearance")]=t.textTextAppearance),o}function _r(e={},t){return Do.reduce((n,i)=>({...n,...Tv(i,Cv(i,e),t)}),{})}const Lv=_r(),Rv=Qy();function nu(e){return[Pt(e,"textFontFamily"),Pt(e,"textFontSettings"),Pt(e,"textFontSize"),Pt(e,"textLineHeight"),Pt(e,"textLetterSpacing"),Pt(e,"textWordSpacing"),Pt(e,"textTextAlign"),Pt(e,"textTextAppearance"),`${e}VerticalAlign`]}function Iv(){const e=[];return Js.forEach((t,n)=>{const i=oi[n],o=nu(t);for(let r=1;r<oi.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 Ev=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];nu(Dn);const Mv=[...fo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{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"}],Pv=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],kv=[...fo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Av={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array",ref:{columnsOrder:"settings.properties.columnsOrder",columnsCount:"settings.properties.columns"}},items:{type:"object",properties:{...xv(),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:Pv},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"}},...bv(),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"}},...Sv,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",...Lv,..._r({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:tc({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},..._r({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:tc({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},..._r({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Iv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Mv.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}},...fo.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",...kv]},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__",Rv]}],paletteBookmark:{items:[...Ev],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Fv={element:fv,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>dv(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:[...Do.map(e=>({path:`${Pt(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${Pt(t,"textFontFamily")}`}),{})},schema:Av,sourceCode:yv},ic=300,qn=.004,_v={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"},Wv=["hover","focus","filled","success","error"];function Nv(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function oc(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}-text-leading-gap`]:O.scalingValue((o-t)/2,i)}}function Hv(e){return`
|
|
13405
|
+
`,fo=["A","B","C","D","E"],tc=[...cs,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],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"},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function bv(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function gr(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function wv(){return Object.fromEntries(fo.map((e,t)=>{const n=oi[t],i=`${e} column`;return[n,bv(i)]}))}function Sv(){const e={};for(const t of fo)e[`${t}ColumnWidth`]=gr(`${t} column width`),e[`${t}ColumnPaddingLeft`]=gr(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=gr(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=gr(`${t} column padding bottom`);return e}function nc(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...oi]};for(const r of fo)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 $v(e){const t={};if(e===Dn)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...cs]},enum:[...cs]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...tc],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...tc]}}return t[At(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[At(e,"textFontSettings")]={...gi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[At(e,"textFontSize")]={...gi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[At(e,"textLineHeight")]={...gi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[At(e,"textLetterSpacing")]={...gi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[At(e,"textWordSpacing")]={...gi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[At(e,"textTextAlign")]={...gi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[At(e,"textTextAppearance")]={...gi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const Cv=Do.reduce((e,t)=>({...e,...$v(t)}),{});function Tv(e){return{verticalAlign:e===Dn?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===Dn?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Lv(e,t={}){var n;return{...Tv(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const ic=new Set(["textFontFamily","textFontSettings"]);function Rv(e,t,n){const i=r=>n===void 0?!0:n==="common"?ic.has(r):!ic.has(r),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=Qs(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[At(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[At(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[At(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[At(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[At(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[At(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[At(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[At(e,"textTextAppearance")]=t.textTextAppearance),o}function _r(e={},t){return Do.reduce((n,i)=>({...n,...Rv(i,Lv(i,e),t)}),{})}const Iv=_r(),Ev=tv();function ru(e){return[At(e,"textFontFamily"),At(e,"textFontSettings"),At(e,"textFontSize"),At(e,"textLineHeight"),At(e,"textLetterSpacing"),At(e,"textWordSpacing"),At(e,"textTextAlign"),At(e,"textTextAppearance"),`${e}VerticalAlign`]}function Mv(){const e=[];return Js.forEach((t,n)=>{const i=oi[n],o=ru(t);for(let r=1;r<oi.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 Pv=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];ru(Dn);const kv=[...fo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],hi=[{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"}],Av=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:hi[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:hi[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:hi[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:hi[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:hi[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:hi[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:hi[6],link:""}],Fv=[...fo.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],_v={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:{...wv(),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:Av},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"}},...Sv(),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"}},...Cv,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",...Iv,..._r({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:nc({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},..._r({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:nc({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},..._r({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...Mv(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...kv.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}},...fo.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",...Fv]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","name"]},"type",{type:"row",title:"",items:["columns","wrapperWidth"]},{type:"row",title:"Entries",items:["entriesCount","cellMinHeight"]},{type:"row",title:"",items:["imageOnHover","imageSize"]},{type:"row",title:"",items:["imagePosition","imageInterpolation"]},{type:"row",title:"Entry Hover",items:["entryHoverEffect","entryHoverShowOption"]},{type:"row",title:"Divider Settings",items:["dividerWidth","showVisibility"]}]},{id:"columnsOrder",icon:"layers",title:"Columns Order",tooltip:"Columns order",layout:["__componentName__","columnsOrder"]},{id:"cutSettings",icon:"cut",title:"Cut settings",tooltip:"Cut settings",layout:["__componentName__",{type:"row",title:"",items:["cut"]},{type:"row",title:"Cut Settings",items:["cutLabel","cutCellMinHeight"]},{type:"row",title:"",items:["showCut"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__",Ev]}],paletteBookmark:{items:[...Pv],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Wv={element:vv,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>pv(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:[...Do.map(e=>({path:`${At(e,"textFontFamily")}`}))]},fontRelations:{...Do.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${At(t,"textFontFamily")}`}),{})},schema:_v,sourceCode:xv},oc=300,qn=.004,Nv={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"},Hv=["hover","focus","filled","success","error"];function Ov(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function rc(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ac(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:D.scalingValue((o-t)/2,i)}}function Dv(e){return`
|
|
13382
13406
|
.${e}-wrapper {
|
|
13383
13407
|
box-sizing: border-box;
|
|
13384
13408
|
display: flex;
|
|
@@ -13440,7 +13464,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13440
13464
|
display: flex;
|
|
13441
13465
|
align-items: center;
|
|
13442
13466
|
justify-content: space-between;
|
|
13443
|
-
gap: ${
|
|
13467
|
+
gap: ${Ov(20)};
|
|
13444
13468
|
width: 100%;
|
|
13445
13469
|
min-width: 0;
|
|
13446
13470
|
min-height: var(--${e}-question-min-height, unset);
|
|
@@ -13468,7 +13492,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13468
13492
|
width: var(--${e}-icon-max-width);
|
|
13469
13493
|
height: var(--${e}-icon-max-width);
|
|
13470
13494
|
position: relative;
|
|
13471
|
-
transition: transform ${
|
|
13495
|
+
transition: transform ${oc}ms ease;
|
|
13472
13496
|
}
|
|
13473
13497
|
.${e}-icon-custom {
|
|
13474
13498
|
display: flex;
|
|
@@ -13505,7 +13529,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13505
13529
|
.${e}-panel {
|
|
13506
13530
|
display: grid;
|
|
13507
13531
|
grid-template-rows: 0fr;
|
|
13508
|
-
transition: grid-template-rows ${
|
|
13532
|
+
transition: grid-template-rows ${oc}ms ease;
|
|
13509
13533
|
}
|
|
13510
13534
|
.${e}-item-open .${e}-panel {
|
|
13511
13535
|
grid-template-rows: 1fr;
|
|
@@ -13543,7 +13567,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13543
13567
|
pointer-events: none;
|
|
13544
13568
|
z-index: 2;
|
|
13545
13569
|
}
|
|
13546
|
-
`}function
|
|
13570
|
+
`}function sc(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 jv({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:r}){const{prefix:l}=D.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:b="solid",entryHoverEffect:v="default",autoclose:g="off",icon:h,iconMaxWidth:f=.00833,iconPaddingRight:x=0,iconAnimation:S="rotate 45",questionColor:y="#000000",answerColor:w="#000000",dividerColor:H="#0000001F",iconColor:N="#000000",questionHoverColor:Y="#666666",iconHoverColor:O="#666666",iconActiveColor:C="#000000",dividerHoverColor:V="#000000",questionFontFamily:$,questionFontSettings:R,questionFontSize:k,questionLineHeight:T,questionLetterSpacing:m,questionWordSpacing:M,questionTextAppearance:E,answerFontFamily:z,answerFontSettings:ne,answerFontSize:I,answerLineHeight:W,answerLetterSpacing:K,answerWordSpacing:ae,answerTextAppearance:de,questionPaddingLeft:A=0,questionPaddingTop:he=0,questionPaddingBottom:q=0,answerPaddingLeft:ce=0,answerPaddingRight:Q=0,answerPaddingTop:be=0,answerPaddingBottom:He=0}=e,xe=t??[],[le,ee]=s.useState(()=>new Set),ue=!n||i;s.useEffect(()=>{ee(new Set)},[g]),s.useEffect(()=>{n&&!o&&!i&&ee(new Set)},[n,o,i]);const oe=Ze=>D.scalingValue(Ze,n??!1),Fe=Math.max(A,qn),Ce=Math.max(he,qn),P=Math.max(q,qn),U=Math.max(ce,qn),X=Math.max(Q,qn),ie=Math.max(be,qn),j=Math.max(He,qn),B=Math.max(0,(c??1)-x-f),J=Math.max(0,(c??1)-Q),te=Math.max(0,(c??1)-ce),$e=Math.max(x,qn),ye=Math.max(0,(c??1)-A-f),F=s.useMemo(()=>le.size===0?0:Math.min(...le),[le]),ve=s.useCallback(Ze=>le.has(Ze),[le]),pe=ue&&v==="default"?`${l}-entry-hover-default`:"",Z=h??"",me=Z!=="",De=S.replace(/^rotate /,""),ge=`${l}-icon-anim-${De}`,G=sn(Yt(sc($,R,k,T,m,M,E,y),n)),Me=sn(Yt(sc(z,ne,I,W,K,ae,de,w),n)),_e=rc(k,T,`${l}-question`,`${l}-text-tight-leading`),rt=rc(I,W,`${l}-answer-text`,`${l}-text-tight-leading`),Je=ac(k,T,l,n),at=ac(I,W,l,n),it=D.buildColorVars(l,{questionColor:y,answerColor:w,dividerColor:H,iconColor:N,questionHoverColor:Y,iconHoverColor:O,iconActiveColor:C,dividerHoverColor:V},Nv,Hv),je=r&&r!=="default"?`${l}-state-${r}`:"",Se=s.useCallback(Ze=>{ue&&ee(Le=>{if(Le.has(Ze)){const se=new Set(Le);return se.delete(Ze),se}if(g==="on")return new Set([Ze]);const Ve=new Set(Le);return Ve.add(Ze),Ve})},[ue,g]),We=s.useMemo(()=>Dv(l),[l]),Be={[`--${l}-divider-width`]:D.scalingValue(p,n??!1),[`--${l}-divider-style`]:b,[`--${l}-icon-max-width`]:D.scalingValue(f,n??!1),...u>0?{[`--${l}-question-min-height`]:D.scalingValue(u,n??!1)}:{}};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:We}}),a.jsx("div",{style:it,children:a.jsx("div",{className:yt(`${l}-wrapper`,n&&!i&&`${l}-editor`,pe,je),style:{width:D.scalingValue(c,n??!1),maxWidth:"100%",...Be},children:xe.map((Ze,Le)=>{var Re;const Ve=ve(Le),se=((Re=Ze.question)==null?void 0:Re.trim())??"",Te=Ze.answer,Xe=((Te==null?void 0:Te.length)??0)>0,ze=d&&Le===F;return a.jsxs("div",{className:yt(`${l}-item`,Ve&&`${l}-item-open`),"data-faq-item":"",children:[a.jsxs("div",{className:`${l}-question-controls`,children:[ze&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"questionPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(Ce)}}),a.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(B),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(Fe),height:"100%"}}),a.jsx("div",{"data-controls":"iconPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(ye),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe($e),height:"100%"}})]}),a.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ve,style:{...G,...Je,paddingLeft:oe(A),paddingRight:oe(x)},onClick:()=>Se(Le),children:[he>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(he)},"aria-hidden":"true"}),a.jsxs("span",{className:`${l}-question-row`,children:[a.jsx("span",{className:_e,children:se}),Xe&&(me?a.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ge}`,"aria-hidden":"true",children:a.jsx(ln,{url:Z,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"}))]}),q>0&&a.jsx("span",{className:`${l}-padding-handle`,style:{height:oe(q)},"aria-hidden":"true"})]}),ze&&a.jsx("div",{"data-controls":"questionPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(P)}})]}),Xe&&Te&&a.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ve,children:a.jsx("div",{className:`${l}-panel-inner`,children:a.jsxs("div",{className:`${l}-answer-controls`,children:[ze&&Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-controls":"answerPaddingTop","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{top:0,left:0,width:"100%",height:oe(ie)}}),a.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(J),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:oe(U),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(te),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:oe(X),height:"100%"}})]}),be>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(be)}}),a.jsx("div",{className:`${l}-answer`,style:{...Me,...at,paddingLeft:oe(ce),paddingRight:oe(Q)},children:a.jsx("div",{className:rt,children:a.jsx(Ri,{content:Te})})}),He>0&&a.jsx("div",{className:`${l}-padding-handle`,style:{height:oe(He)}}),ze&&Ve&&a.jsx("div",{"data-controls":"answerPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${l}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:oe(j)}})]})})})]},Le)})})})]})}const zv=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13547
13571
|
import cn from 'classnames';
|
|
13548
13572
|
import { CommonComponentProps } from '../props';
|
|
13549
13573
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14291,7 +14315,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14291
14315
|
</>
|
|
14292
14316
|
);
|
|
14293
14317
|
}
|
|
14294
|
-
`;function Xn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const sc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},jv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],zv={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:Xn("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:{...sc.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:{...sc.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:Xn("Question Padding Left"),questionPaddingTop:Xn("Question Padding Top"),questionPaddingBottom:Xn("Question Padding Bottom"),answerPaddingLeft:Xn("Answer Padding Left"),answerPaddingRight:Xn("Answer Padding Right"),answerPaddingTop:Xn("Answer Padding Top"),answerPaddingBottom:Xn("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:[...jv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Bv={element:Ov,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:zv,sourceCode:Dv},jn=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}`},lc=100,Vv=.2,cc=8,iu=({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"?lc:Math.max(lc,window.innerHeight*Vv),[]),b=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),y=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),g=s.useCallback($=>{const I=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/I*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),S=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),v=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const k=$.clientX-I.startX,T=$.clientY-I.startY;if(I.isLocked===null){if(Math.abs(k)<cc&&Math.abs(T)<cc)return;if(T>0&&T>Math.abs(k))I.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{I.isLocked=!1,h();return}}if(!I.isLocked)return;$.preventDefault();const m=Math.max(0,T);u.current=m,r(m)},[e,h]),w=s.useCallback($=>{const I=c.current;if(!e||!I||$.pointerType!=="touch"||I.pointerId!==$.pointerId)return;const k=I.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-I.startY>=p?x():f()},[p,x,e,h,f]),H=s.useCallback($=>{w($)},[w]),N=s.useCallback($=>{w($)},[w]),Y=o>0,D=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",V=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:g(o),transition:D,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:V?{opacity:y(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:S,onPointerMove:v,onPointerUp:H,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Gv="[data-lightbox-scrollable]",ou=()=>{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(Gv)||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"})}},[])},qv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Xv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Uv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Yv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Xv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const y=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,y(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-Uv(t),!1))}},Po=300,Kv=900,Zv=1500,Jv="cubic-bezier(0.16, 1, 0.3, 1)",Qv=3e3,e0=2,t0=16,n0=.05,i0=1,hr=.3,o0=50,r0=20,Ai=.004,ao=["title1","title2","title3"],a0={title1:"1",title2:"2",title3:"3"},s0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},l0={title1:.02,title2:.02,title3:.02},fr=e=>`max(${e}, ${r0}px)`,c0=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]}},d0=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=c0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Vt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,u0=e=>[Vt(e,"fontFamily"),Vt(e,"fontSettings"),{type:"row",items:[Vt(e,"fontSize"),Vt(e,"lineHeight"),Vt(e,"letterSpacing"),Vt(e,"wordSpacing")]},Vt(e,"textAlign"),Vt(e,"textAppearance")],p0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ao.map(e=>[a0[e],u0(e)]))}),nl=(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},ru=(e,t)=>nl(e,t),yr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},dc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:nl(e.length,n),effective:ru(e.length,n)}},m0=(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=Vt(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[s0[t]]}},g0=(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??l0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)},h0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:y,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:S,thumbnailObjectFit:v,thumbnailActive:w,thumbnailActiveColor:H,title1Width:N,title2Width:Y,title3Width:D,title1MarginLeft:C=0,title2MarginLeft:V=0,title3MarginLeft:$=0,titleRowMarginBottom:I=0,titleHeaderLayout:k="desktop",contentMarginTop:T,iconMarginLeft:m}=n,M=L=>O.scalingValue(L,i??!1),E=c??n.thumnailSize??.03,z=M(E),ne=M(u),R=M(p??.02),W=M(b??0),K=M(T??0),ae=fr(K),de=M(m??0),[A,he]=s.useState(0),q=s.useRef(A);q.current=A;const ce=t[A],{title1:Q,title2:be,title3:We}=d0(ce),xe=_a("title1",Fa(n,"title1"),i),le=_a("title2",Fa(n,"title2"),i),ee=_a("title3",Fa(n,"title3"),i),ue=k==="mobile",oe=!o&&(!i||r),Ne=oe,Te=oe,P=oe,U=jn(v),X=U?{"--image-aspect-ratio":ca(v)}:void 0,ie=!!(Q||be||We),j=s.useMemo(()=>m0(e,Q,be,We,xe,le,ee),[e,A,Q,be,We,xe,le,ee]),B=s.useMemo(()=>({title1Width:N,title2Width:Y,title3Width:D}),[N,Y,D]),J=s.useMemo(()=>j.map(L=>B[L.widthKey]),[j,B]),te=s.useMemo(()=>nl(j.length,J),[j.length,J]),Ce=s.useMemo(()=>ru(j.length,J),[j.length,J]),ye=s.useMemo(()=>j.filter(L=>L.prefix==="title1"),[j]),F=s.useMemo(()=>j.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[j]),ve=s.useMemo(()=>dc(ye,B),[ye,B]),pe=s.useMemo(()=>dc(F,B),[F,B]),Z=s.useCallback((L,re)=>{const fe=j.indexOf(L);if(!ue||re==="single-row")return{effectiveWidth:Ce[fe]??0,resolvedWidth:te[fe]??0,maxWidth:yr(fe,te)};if(re==="two-row-top"){const Xe=ye.indexOf(L);return{effectiveWidth:ve.effective[Xe]??0,resolvedWidth:ve.resolved[Xe]??0,maxWidth:yr(Xe,ve.resolved)}}const Pe=F.indexOf(L);return{effectiveWidth:pe.effective[Pe]??0,resolvedWidth:pe.resolved[Pe]??0,maxWidth:yr(Pe,pe.resolved)}},[F,pe,Ce,te,j,ye,ve,ue]),me=s.useCallback(L=>O.scalingValue(L,i??!1),[i]),De=me(I??0),ge=s.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:V,title3MarginLeft:$}),[C,V,$]),G=s.useCallback(L=>j.slice(0,L+1).reduce((re,fe,Pe)=>re+(fe!=null&&fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(te[Pe]??0),0)+(ue?0:C??0),[j,ge,te,ue,C]),ke=s.useCallback(()=>ue?0:C??0,[ue,C]),Fe=s.useCallback(L=>F.slice(0,L).reduce((re,fe,Pe)=>re+(fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(pe.resolved[Pe]??0),0),[F,pe.resolved,ge]),rt=s.useCallback(L=>{const re=F[L];return Fe(L)+(re.marginLeftKey?ge[re.marginLeftKey]??0:0)+(pe.resolved[L]??0)},[F,pe.resolved,Fe,ge]),Je=(L,re)=>{const fe=L.marginLeftKey?ge[L.marginLeftKey]??0:0,{effectiveWidth:Pe,resolvedWidth:Xe,maxWidth:ot}=Z(L,re),wt=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{...re==="single-row"?{gridArea:L.prefix}:{},width:me(Pe),...fe>0?{marginLeft:me(fe)}:{}},children:[a.jsx("p",{className:L.className,style:L.style,children:L.text}),wt&&L.marginLeftKey&&a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:me(-fe),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),wt&&a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:me(-Ai/2),width:me(Ai),height:"100%",pointerEvents:"auto"}})]},L.className)},at=()=>{const L=ue?-1:j.findIndex(Pe=>Pe.prefix==="title1"),re=!ue&&(o||(C??0)>0)?(()=>{const Pe=C??0,Xe=L>=0?te[L]:N??0;return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:0,width:`max(${me(Pe)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=j.flatMap((Pe,Xe)=>{if(!Pe.marginLeftKey)return[];const ot=ge[Pe.marginLeftKey]??0,wt=g0(j,te,ge,Xe)+ke();return a.jsx("div",{"data-controls":Pe.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Xe]),style:{position:"absolute",top:0,left:me(wt),width:`max(${me(ot)}, 10px)`,height:"100%",pointerEvents:"auto"}},Pe.marginLeftKey)});return re?[re,...fe]:fe},nt=()=>j.map((L,re)=>{const fe=yr(re,te),Xe=G(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Xe),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),je=()=>F.flatMap((L,re)=>{if(!L.marginLeftKey)return[];const fe=ge[L.marginLeftKey]??0,Pe=Fe(re),{resolvedWidth:Xe}=Z(L,"two-row-bottom");return a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Xe),style:{position:"absolute",top:0,left:me(Pe),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),$e=()=>F.map((L,re)=>{const{maxWidth:fe}=Z(L,"two-row-bottom"),Xe=rt(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Xe),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),Ae=s.useRef(null),Be=s.useRef(null),Ke=s.useRef(null),Ie=s.useRef(null),ze=s.useRef([]),se=s.useRef([]),Re=s.useRef(0),qe=s.useRef(null),we=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Le=s.useRef(null),Ze=s.useRef(null),Oe=s.useRef(0),Ue=s.useRef("forward"),He=s.useRef(0),Qe=s.useRef(null),it=s.useRef(!1),tt=t.length>1&&(!o||!!r),St=tt?3:1,$t=s.useMemo(()=>Array.from({length:St},()=>t).flat(),[t,St]),[Rt,yt]=s.useState(!1),[pt,kt]=s.useState(!1),[Wt,bt]=s.useState(!0),Nt=s.useRef(null),Gt=s.useRef(null),Zt=s.useRef(!1),en=s.useRef(!1),Lt=s.useRef(null),Ht=s.useRef(null),nn=Ne&&!Wt,ut=s.useCallback(()=>{Ne&&(bt(!0),Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{we.current.isActive||bt(!1)},Qv))},[Ne]),Me=s.useCallback(()=>{o||en.current||(en.current=!0,kt(!1),Lt.current=setTimeout(()=>{l()},Po))},[o,l]),Ge=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":nn?"true":"false",style:{width:O.scalingValue(g??0,i),height:O.scalingValue(g??0,i),marginRight:de,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Me,"aria-label":"Close",children:a.jsx(ln,{url:y,fill:h,hoverFill:i&&!r?h: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:de,height:"100%",pointerEvents:"auto"}})]}),st=(L="two-row")=>a.jsx("div",{...L==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:me(C??0),flexShrink:0,...L==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...L==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const L=j.find(Pe=>Pe.prefix==="title1"),re=j.filter(Pe=>Pe.prefix==="title2"||Pe.prefix==="title3"),fe=re.length>0||o||(I??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?st():null,L&&Je(L,"two-row-top"),y&&Ge()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(Pe=>Je(Pe,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),$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:De,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},vt=()=>a.jsxs(a.Fragment,{children:[(C??0)>0||o?st("single-row"):null,j.map(L=>Je(L,"single-row")),o?a.jsxs(a.Fragment,{children:[at(),nt()]}):null,y?Ge():null]}),It=s.useCallback(L=>!!(L.closest("[data-controls]")||L.closest(`.${e}-thumbnails`)||L.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ft,backdropStyle:Bt,mediaAreaStyle:_t,overlayContentStyle:Ft,swipeHandlers:qt,dismissAreaStyle:Xt}=iu({enabled:oe??!1,onClose:Me,animMs:Po,isBlockedTarget:It}),Dt=()=>{if(!tt||t.length===0)return Re.current=0,0;const L=se.current[0],re=se.current[t.length];if(!L||!re)return Re.current;const fe=re.offsetLeft-L.offsetLeft;return fe>0&&(Re.current=fe),Re.current},jt=(L=!1)=>{if(!tt)return;const re=Be.current,fe=Dt();!re||fe<=0||fe<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=fe,L&&(we.current.scrollLeft+=fe),it.current&&(He.current+=fe)):re.scrollLeft>=fe*2&&(re.scrollLeft-=fe,L&&(we.current.scrollLeft-=fe),it.current&&(He.current-=fe)))},Ot=(L,re=(fe=>(fe=Be.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!tt)return L;let Pe=t.length+L,Xe=1/0;for(let ot=0;ot<St;ot++){const wt=ot*t.length+L,Mt=se.current[wt];if(!Mt)continue;const tn=Math.abs(Mt.offsetLeft-re);tn<Xe&&(Xe=tn,Pe=wt)}return Pe},Ct=L=>{const re=Be.current;return!L||!re?!1:L.offsetWidth>re.clientWidth+1},_=L=>{const re=Be.current;if(!L||!re||!Ct(L))return!1;const fe=L.offsetLeft,Pe=fe+L.offsetWidth;return re.scrollLeft>=fe-1&&re.scrollLeft+re.clientWidth<=Pe+1},Ee=(L=(re=>(re=Be.current)==null?void 0:re.scrollLeft)()??0)=>{for(let Pe=0;Pe<se.current.length;Pe+=1){const Xe=se.current[Pe];if(Xe&&_(Xe))return Pe}let fe={flatIndex:0,distance:1/0};return se.current.forEach((Pe,Xe)=>{if(!Pe)return;const ot=Math.abs(Pe.offsetLeft-L);ot<fe.distance&&(fe={flatIndex:Xe,distance:ot})}),fe.flatIndex},_e=L=>{Be.current&&se.current.forEach(re=>{re&&(re.style.scrollSnapAlign=Ct(re)&&L==="backward"?"end":"start")})},Ve=(L,re,fe)=>{const Pe=L-re,Xe=Ee(re),ot=se.current[Xe];if(_(ot))return Ee(L)%t.length;const wt=se.current[Xe+1],Mt=ot?wt?wt.offsetLeft-ot.offsetLeft:ot.offsetWidth:0,tn=Mt>0?Pe>Mt*hr?1:Pe<-Mt*hr?-1:0:0;return tn===0?fe:tt?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},dt=s.useCallback((L=!1)=>{if(S!=="on"||o)return;const re=Ie.current,fe=q.current,Pe=ze.current[fe];if(!re||!Pe||re.scrollWidth<=re.clientWidth)return;const Xe=re.scrollLeft,ot=Xe+re.clientWidth,wt=Pe.offsetLeft,Mt=wt+Pe.offsetWidth;if(wt>=Xe&&Mt<=ot)return;const tn=re.scrollWidth-re.clientWidth;let Jt=Xe;if(!L&&Nt.current===null){const Mi=ze.current[fe-1],yo=ze.current[fe+1],rr=Mi?Pe.offsetLeft-Mi.offsetLeft:yo?yo.offsetLeft-Pe.offsetLeft:Pe.offsetWidth;Mt>ot?Jt+=rr:wt<Xe&&(Jt-=rr)}else Mt>ot?Jt=Mt-re.clientWidth:Jt=wt;re.scrollLeft=Math.max(0,Math.min(tn,Jt))},[o,S]),At=s.useCallback((L=!1)=>{L&&(Zt.current=!0),Gt.current===null&&(Gt.current=requestAnimationFrame(()=>{Gt.current=null;const re=Zt.current;Zt.current=!1,dt(re)}))},[dt]),lt=s.useCallback(L=>{if(L===q.current)return;const re=q.current;q.current=L;const fe=Math.abs(L-re)>1,Pe=tt&&t.length>1&&(re===t.length-1&&L===0||re===0&&L===t.length-1);he(L),At(fe||Pe)},[t.length,tt,At]),xt=()=>{if(!Be.current||t.length===0||Nt.current!==null||we.current.isActive&&we.current.hasMoved)return;const L=Be.current.scrollLeft,re=Ee(L)%t.length;re!==q.current&<(re)},zt=()=>{Nt.current=null},Et=L=>{const re=Be.current;re&&(re.style.scrollSnapType=L?"":"none")},on=()=>{var L;(L=Ze.current)==null||L.call(Ze),Ze.current=null},pn=()=>{Qe.current!==null&&(cancelAnimationFrame(Qe.current),Qe.current=null),it.current=!1},ci=()=>{const L=Be.current;if(!L){Qe.current=null,it.current=!1;return}const re=He.current-L.scrollLeft;if(Math.abs(re)<.5){L.scrollLeft=He.current,jt(),xt(),Qe.current=null,it.current=!1;return}L.scrollLeft+=re*n0,jt(),xt(),ut(),Qe.current=requestAnimationFrame(ci)},di=()=>{const L=Ke.current;L&&(L.style.transition="",L.style.transform="",L.style.willChange="")},tr=(L,re,fe,Pe)=>{di(),L.scrollLeft=re,Oe.current=L.scrollLeft,jt(),fe!==void 0?(q.current=fe,he(fe)):xt(),Et(!0),Pe==null||Pe()},nr=(L,{behavior:re="smooth",activeIndex:fe,onComplete:Pe}={})=>{const Xe=Be.current,ot=Ke.current;if(!Xe||!ot)return;if(pn(),on(),Et(!1),re==="auto"){tr(Xe,L,fe,Pe);return}const wt=Math.abs(L-Xe.scrollLeft),Mt=qv(wt,Kv,Zv,Xe.clientWidth*.55);Ze.current=Yv(Xe,ot,L,{duration:Mt,easing:Jv,onComplete:()=>{Ze.current=null,tr(Xe,L,fe,Pe)}})},ua=(L="smooth")=>{const re=Be.current;if(!re||t.length===0)return;const fe=Ee()%t.length,Pe=Ot(fe,re.scrollLeft),Xe=se.current[Pe];Xe&&nr(Xe.offsetLeft,{behavior:L,activeIndex:fe})},pa=(L,re="smooth",fe,Pe)=>{const Xe=Be.current;if(!Xe||t.length===0)return;const ot=(Pe??Xe.scrollLeft)-L,wt=Ee(L),Mt=se.current[wt];if(_(Mt)){Et(!0),xt();return}const tn=se.current[wt+1],Jt=Mt?tn?tn.offsetLeft-Mt.offsetLeft:Mt.offsetWidth:0;if((Jt>0?ot>Jt*hr?1:ot<-Jt*hr?-1:0:0)!==0){const Au=fe??wt%t.length,Fu=Ve(Pe??Xe.scrollLeft,L,Au);Tn(Fu,re);return}const yo=Pe??Xe.scrollLeft,rr=Ee(yo),al=se.current[rr];if(al&&Math.abs(al.offsetLeft-yo)<1){Et(!0),xt();return}ua("auto")},Tn=(L,re="smooth")=>{const fe=Be.current;if(!fe||t.length===0)return;const Pe=Ot(L,fe.scrollLeft),Xe=se.current[Pe];Xe&&(re==="smooth"?Nt.current=L:Nt.current=null,q.current=L,he(L),At(!0),nr(Xe.offsetLeft,{behavior:re,activeIndex:L,onComplete:re==="smooth"?zt:void 0}))},Ei=()=>{Le.current&&(window.removeEventListener("pointerup",Le.current),window.removeEventListener("pointercancel",Le.current),Le.current=null)},ir=(L,re,fe,Pe,Xe)=>{const ot=fe-L,wt=Pe-re,Mt=Math.abs(ot),tn=Math.abs(wt);if(Mt<o0||Mt<=tn)return!1;const Jt=ot<0?1:-1,Mi=tt?(Xe+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Xe+Jt));return Mi===Xe?!1:(Tn(Mi),!0)},ui=L=>{if(!we.current.isActive)return;Ei();const re=Be.current;if(!re)return;const{scrollLeft:fe,startActiveIndex:Pe,hasMoved:Xe}=we.current,ot=re.scrollLeft;jt(!0),we.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},yt(!1),L!==void 0&&re.hasPointerCapture(L)&&re.releasePointerCapture(L),Xe?pa(fe,"smooth",Pe,ot):(Et(!0),xt()),ut()},or=(L,re)=>{const fe=qe.current;qe.current=null,fe&&(ir(fe.startX,fe.startY,L,re,fe.startActiveIndex),ut())},ma=L=>{if(!Te)return;if(L.pointerType==="touch"){if(pn(),Et(!0),It(L.target))return;qe.current={startX:L.clientX,startY:L.clientY,startActiveIndex:q.current};return}if(L.pointerType!=="mouse"||L.button!==0||It(L.target))return;const re=Be.current;if(!re)return;pn(),on(),di(),Nt.current=null,we.current={isActive:!0,startX:L.clientX,scrollLeft:re.scrollLeft,startActiveIndex:q.current,hasMoved:!1},Et(!1),ut(),re.setPointerCapture(L.pointerId),Ei();const fe=Pe=>{Pe.pointerType==="mouse"&&ui(Pe.pointerId)};Le.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ga=L=>{if(!Te||L.pointerType!=="mouse")return;const re=Be.current;if(!re||!we.current.isActive)return;if(L.buttons===0){ui(L.pointerId);return}const fe=L.clientX-we.current.startX;Math.abs(fe)>i0&&(we.current.hasMoved=!0,yt(!0)),we.current.hasMoved&&(L.preventDefault(),re.scrollLeft=we.current.scrollLeft-fe,jt(!0),xt(),ut())},Se=L=>{if(Te){if(L.pointerType==="touch"){L.type==="pointerup"?or(L.clientX,L.clientY):qe.current=null;return}L.pointerType==="mouse"&&ui(L.pointerId)}},Ye=L=>{!Te||L.pointerType!=="mouse"||ui(L.pointerId)};return ou(),s.useEffect(()=>{const L=requestAnimationFrame(()=>kt(!0));return()=>{cancelAnimationFrame(L),on(),Ei(),Gt.current!==null&&(cancelAnimationFrame(Gt.current),Gt.current=null),Lt.current&&clearTimeout(Lt.current),Ht.current&&clearTimeout(Ht.current)}},[]),s.useEffect(()=>{if(!Ne){bt(!0);return}ut();const L=()=>ut();return document.addEventListener("pointermove",L,{passive:!0}),document.addEventListener("pointerdown",L,{passive:!0}),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerdown",L),Ht.current&&clearTimeout(Ht.current)}},[Ne,ut]),s.useEffect(()=>{const L=re=>{re.key==="Escape"&&Me()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Me]),s.useLayoutEffect(()=>{Dt()},[W,t.length,tt]),s.useLayoutEffect(()=>{o||Tn(q.current,"auto")},[W,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,tt]),s.useEffect(()=>{const L=Be.current;if(!L||o||!oe)return;const re=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const Pe=fe.deltaMode===1?t0:fe.deltaMode===2?L.clientHeight:1,Xe=fe.deltaY*Pe*e0;if(Xe!==0){if(on(),it.current||(it.current=!0,He.current=L.scrollLeft,Nt.current=null,Et(!1)),He.current+=Xe,!tt){const ot=L.scrollWidth-L.clientWidth;He.current=Math.max(0,Math.min(ot,He.current))}ut(),Qe.current===null&&(Qe.current=requestAnimationFrame(ci))}};return L.addEventListener("wheel",re,{passive:!1}),()=>{L.removeEventListener("wheel",re),pn()}},[o,oe,tt]),s.useEffect(()=>{const L=Be.current;if(!L)return;const re=()=>{jt(we.current.isActive);const Pe=L.scrollLeft,Xe=Pe-Oe.current;Oe.current=Pe;const ot=Re.current>0?Re.current*.5:1/0;if(Xe!==0&&Math.abs(Xe)<ot){const wt=Xe>0?"forward":"backward";wt!==Ue.current&&(Ue.current=wt,_e(wt))}we.current.isActive&&we.current.hasMoved||xt()};L.addEventListener("scroll",re,{passive:!0});const fe=new ResizeObserver(()=>{Dt(),jt(we.current.isActive),_e(Ue.current),xt()});return fe.observe(L),()=>{on(),L.removeEventListener("scroll",re),fe.disconnect()}},[t.length,tt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ft||Me()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:pt?1:0,transition:`opacity ${Po}ms ease`,pointerEvents:pt?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Bt}}),a.jsxs("div",{ref:Ae,className:`${e}-lightbox-dismiss-area`,style:Xt,...qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:_t,onClick:L=>L.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Te&&t.length>0?"true":"false","data-mouse-dragging":Rt?"true":"false",onPointerDown:ma,onPointerMove:ga,onPointerUp:Se,onPointerCancel:Se,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ke,className:`${e}-lightbox-strip-track`,style:{gap:W},children:$t.map((L,re)=>{const fe=L.image.objectFit??"contain",Pe=re%t.length,Xe=Math.floor(re/t.length),ot=fr(W),wt=`calc(-0.5 * (${ot} + ${W}))`;return a.jsxs("div",{ref:Mt=>se.current[re]=Mt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:L.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&Pe<t.length-1&&Xe===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:wt,width:ot,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Xe}-${L.image.url}-${Pe}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":nn?"true":"false",style:Ft,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ae,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${ue?` ${e}-lightbox-content-area-stacked`:""}`,children:(ie||y)&&a.jsx("div",{className:`${e}-header ${ue?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ue?gt():ie||y?vt():null})})})]}),t.length>1&&S==="on"&&(()=>{const L=fr(R),re=`calc(-0.5 * (${R} + ${L}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:R},children:a.jsx("div",{ref:Ie,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:ne,"--thumbnail-active-color":H},children:[t.map((fe,Pe)=>{const Xe=fr(ne),ot=`calc(-0.5 * (${Xe} + ${ne}))`;return a.jsxs("div",{ref:wt=>{ze.current[Pe]=wt},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===Pe?"true":"false",onClick:()=>oe&&x==="click"&&Tn(Pe),onMouseEnter:()=>P&&x==="hover"&&Tn(Pe),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${Pe+1}`,"aria-current":A===Pe?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${U?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...X,maxWidth:z,maxHeight:z,width:v.display==="cover"?"auto":"100%",height:"auto",objectFit:v.display==="cover"?"cover":"contain"}})}),o&&Pe<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ot,width:Xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${Pe}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:L,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function f0(e){return`
|
|
14318
|
+
`;function Xn(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const lc={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Bv=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],Vv={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:Xn("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:{...lc.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:{...lc.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:Xn("Question Padding Left"),questionPaddingTop:Xn("Question Padding Top"),questionPaddingBottom:Xn("Question Padding Bottom"),answerPaddingLeft:Xn("Answer Padding Left"),answerPaddingRight:Xn("Answer Padding Right"),answerPaddingTop:Xn("Answer Padding Top"),answerPaddingBottom:Xn("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:[...Bv],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},Gv={element:jv,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:Vv,sourceCode:zv},jn=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}`},cc=100,qv=.2,dc=8,au=({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"?cc:Math.max(cc,window.innerHeight*qv),[]),b=s.useCallback($=>Math.max(0,1-$/(p*1.5)),[p]),v=s.useCallback($=>Math.max(0,1-$/(p*.45)),[p]),g=s.useCallback($=>{const R=typeof window<"u"?window.innerHeight:800,k=Math.max(.88,1-$/R*.12);return`translateY(${$}px) scale(${k})`},[]),h=s.useCallback(()=>{c.current=null},[]),f=s.useCallback(()=>{d(!0),r(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),x=s.useCallback(()=>{const $=typeof window<"u"?window.innerHeight:800;d(!0),r($),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),S=s.useCallback($=>{!e||l||$.pointerType==="touch"&&(i!=null&&i($.target)||(c.current={startX:$.clientX,startY:$.clientY,isLocked:null,pointerId:$.pointerId}))},[e,l,i]),y=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=$.clientX-R.startX,T=$.clientY-R.startY;if(R.isLocked===null){if(Math.abs(k)<dc&&Math.abs(T)<dc)return;if(T>0&&T>Math.abs(k))R.isLocked=!0,$.currentTarget.setPointerCapture($.pointerId);else{R.isLocked=!1,h();return}}if(!R.isLocked)return;$.preventDefault();const m=Math.max(0,T);u.current=m,r(m)},[e,h]),w=s.useCallback($=>{const R=c.current;if(!e||!R||$.pointerType!=="touch"||R.pointerId!==$.pointerId)return;const k=R.isLocked===!0;if($.currentTarget.hasPointerCapture($.pointerId)&&$.currentTarget.releasePointerCapture($.pointerId),!k){h();return}$.clientY-R.startY>=p?x():f()},[p,x,e,h,f]),H=s.useCallback($=>{w($)},[w]),N=s.useCallback($=>{w($)},[w]),Y=o>0,O=l?`transform ${n}ms ease`:"none",C=l?`opacity ${n}ms ease`:"none",V=o>0||l;return{isSwipeDragging:Y,backdropStyle:{opacity:b(o),transition:C},mediaAreaStyle:{transform:g(o),transition:O,touchAction:Y?"none":void 0,willChange:Y?"transform":void 0},overlayContentStyle:V?{opacity:v(o),transition:C}:void 0,swipeHandlers:e?{onPointerDown:S,onPointerMove:y,onPointerUp:H,onPointerCancel:N}:{},dismissAreaStyle:e?{touchAction:Y?"none":"pan-x"}:void 0}},Xv="[data-lightbox-scrollable]",su=()=>{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(Xv)||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"})}},[])},Uv=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},Yv=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},Kv=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},Zv=(e,t,n,{duration:i,easing:o,onComplete:r})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,f)=>{Yv(t),e.scrollLeft=h,f&&(r==null||r())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,b=0;const v=()=>{t.removeEventListener("transitionend",g),clearTimeout(b)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,v(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,b=window.setTimeout(()=>{p||(p=!0,v(),u(n,!0))},i+64),()=>{p||(p=!0,v(),u(l-Kv(t),!1))}},Po=300,Jv=900,Qv=1500,e0="cubic-bezier(0.16, 1, 0.3, 1)",t0=3e3,n0=2,i0=16,o0=.05,r0=1,hr=.3,a0=50,s0=20,Ai=.004,ao=["title1","title2","title3"],l0={title1:"1",title2:"2",title3:"3"},c0={title1:"title1Color",title2:"title2Color",title3:"title3Color"},d0={title1:.02,title2:.02,title3:.02},fr=e=>`max(${e}, ${s0}px)`,u0=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]}},p0=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=u0(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},Gt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,m0=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")],g0=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(ao.map(e=>[l0[e],m0(e)]))}),nl=(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},lu=(e,t)=>nl(e,t),yr=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},uc=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:nl(e.length,n),effective:lu(e.length,n)}},h0=(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=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[c0[t]]}},f0=(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??d0[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Yt(i,n)},y0=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:b,closeIcon:v,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:f,thumbnailTrigger:x,thumbnailVisibility:S,thumbnailObjectFit:y,thumbnailActive:w,thumbnailActiveColor:H,title1Width:N,title2Width:Y,title3Width:O,title1MarginLeft:C=0,title2MarginLeft:V=0,title3MarginLeft:$=0,titleRowMarginBottom:R=0,titleHeaderLayout:k="desktop",contentMarginTop:T,iconMarginLeft:m}=n,M=L=>D.scalingValue(L,i??!1),E=c??n.thumnailSize??.03,z=M(E),ne=M(u),I=M(p??.02),W=M(b??0),K=M(T??0),ae=fr(K),de=M(m??0),[A,he]=s.useState(0),q=s.useRef(A);q.current=A;const ce=t[A],{title1:Q,title2:be,title3:He}=p0(ce),xe=_a("title1",Fa(n,"title1"),i),le=_a("title2",Fa(n,"title2"),i),ee=_a("title3",Fa(n,"title3"),i),ue=k==="mobile",oe=!o&&(!i||r),Fe=oe,Ce=oe,P=oe,U=jn(y),X=U?{"--image-aspect-ratio":ca(y)}:void 0,ie=!!(Q||be||He),j=s.useMemo(()=>h0(e,Q,be,He,xe,le,ee),[e,A,Q,be,He,xe,le,ee]),B=s.useMemo(()=>({title1Width:N,title2Width:Y,title3Width:O}),[N,Y,O]),J=s.useMemo(()=>j.map(L=>B[L.widthKey]),[j,B]),te=s.useMemo(()=>nl(j.length,J),[j.length,J]),$e=s.useMemo(()=>lu(j.length,J),[j.length,J]),ye=s.useMemo(()=>j.filter(L=>L.prefix==="title1"),[j]),F=s.useMemo(()=>j.filter(L=>L.prefix==="title2"||L.prefix==="title3"),[j]),ve=s.useMemo(()=>uc(ye,B),[ye,B]),pe=s.useMemo(()=>uc(F,B),[F,B]),Z=s.useCallback((L,re)=>{const fe=j.indexOf(L);if(!ue||re==="single-row")return{effectiveWidth:$e[fe]??0,resolvedWidth:te[fe]??0,maxWidth:yr(fe,te)};if(re==="two-row-top"){const Ue=ye.indexOf(L);return{effectiveWidth:ve.effective[Ue]??0,resolvedWidth:ve.resolved[Ue]??0,maxWidth:yr(Ue,ve.resolved)}}const ke=F.indexOf(L);return{effectiveWidth:pe.effective[ke]??0,resolvedWidth:pe.resolved[ke]??0,maxWidth:yr(ke,pe.resolved)}},[F,pe,$e,te,j,ye,ve,ue]),me=s.useCallback(L=>D.scalingValue(L,i??!1),[i]),De=me(R??0),ge=s.useMemo(()=>({title1MarginLeft:C,title2MarginLeft:V,title3MarginLeft:$}),[C,V,$]),G=s.useCallback(L=>j.slice(0,L+1).reduce((re,fe,ke)=>re+(fe!=null&&fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(te[ke]??0),0)+(ue?0:C??0),[j,ge,te,ue,C]),Me=s.useCallback(()=>ue?0:C??0,[ue,C]),_e=s.useCallback(L=>F.slice(0,L).reduce((re,fe,ke)=>re+(fe.marginLeftKey?ge[fe.marginLeftKey]??0:0)+(pe.resolved[ke]??0),0),[F,pe.resolved,ge]),rt=s.useCallback(L=>{const re=F[L];return _e(L)+(re.marginLeftKey?ge[re.marginLeftKey]??0:0)+(pe.resolved[L]??0)},[F,pe.resolved,_e,ge]),Je=(L,re)=>{const fe=L.marginLeftKey?ge[L.marginLeftKey]??0:0,{effectiveWidth:ke,resolvedWidth:Ue,maxWidth:ot}=Z(L,re),St=o&&re==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":L.prefix,style:{...re==="single-row"?{gridArea:L.prefix}:{},width:me(ke),...fe>0?{marginLeft:me(fe)}:{}},children:[a.jsx("p",{className:L.className,style:L.style,children:L.text}),St&&L.marginLeftKey&&a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(-fe),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}}),St&&a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(ot),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:me(-Ai/2),width:me(Ai),height:"100%",pointerEvents:"auto"}})]},L.className)},at=()=>{const L=ue?-1:j.findIndex(ke=>ke.prefix==="title1"),re=!ue&&(o||(C??0)>0)?(()=>{const ke=C??0,Ue=L>=0?te[L]:N??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(${me(ke)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,fe=j.flatMap((ke,Ue)=>{if(!ke.marginLeftKey)return[];const ot=ge[ke.marginLeftKey]??0,St=f0(j,te,ge,Ue)+Me();return a.jsx("div",{"data-controls":ke.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(te[Ue]),style:{position:"absolute",top:0,left:me(St),width:`max(${me(ot)}, 10px)`,height:"100%",pointerEvents:"auto"}},ke.marginLeftKey)});return re?[re,...fe]:fe},it=()=>j.map((L,re)=>{const fe=yr(re,te),Ue=G(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),je=()=>F.flatMap((L,re)=>{if(!L.marginLeftKey)return[];const fe=ge[L.marginLeftKey]??0,ke=_e(re),{resolvedWidth:Ue}=Z(L,"two-row-bottom");return a.jsx("div",{"data-controls":L.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ue),style:{position:"absolute",top:0,left:me(ke),width:`max(${me(fe)}, 10px)`,height:"100%",pointerEvents:"auto"}},L.marginLeftKey)}),Se=()=>F.map((L,re)=>{const{maxWidth:fe}=Z(L,"two-row-bottom"),Ue=rt(re)-Ai/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":L.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(fe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:me(Ue),width:me(Ai),height:"100%",pointerEvents:"auto"}})},`${L.widthKey}-junction`)}),We=s.useRef(null),Be=s.useRef(null),Ze=s.useRef(null),Le=s.useRef(null),Ve=s.useRef([]),se=s.useRef([]),Te=s.useRef(0),Xe=s.useRef(null),ze=s.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),Re=s.useRef(null),Pe=s.useRef(null),Ae=s.useRef(0),Ke=s.useRef("forward"),Oe=s.useRef(0),Qe=s.useRef(null),tt=s.useRef(!1),nt=t.length>1&&(!o||!!r),xt=nt?3:1,It=s.useMemo(()=>Array.from({length:xt},()=>t).flat(),[t,xt]),[Tt,ut]=s.useState(!1),[ft,Et]=s.useState(!1),[Lt,bt]=s.useState(!0),Nt=s.useRef(null),Bt=s.useRef(null),Zt=s.useRef(!1),en=s.useRef(!1),Rt=s.useRef(null),Ot=s.useRef(null),nn=Fe&&!Lt,pt=s.useCallback(()=>{Fe&&(bt(!0),Ot.current&&clearTimeout(Ot.current),Ot.current=setTimeout(()=>{ze.current.isActive||bt(!1)},t0))},[Fe]),Ee=s.useCallback(()=>{o||en.current||(en.current=!0,Et(!1),Rt.current=setTimeout(()=>{l()},Po))},[o,l]),qe=()=>a.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":nn?"true":"false",style:{width:D.scalingValue(g??0,i),height:D.scalingValue(g??0,i),marginRight:de,"--close-icon-hover-color":f},children:[a.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Ee,"aria-label":"Close",children:a.jsx(ln,{url:v,fill:h,hoverFill:i&&!r?h: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:de,height:"100%",pointerEvents:"auto"}})]}),st=(L="two-row")=>a.jsx("div",{...L==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:me(C??0),flexShrink:0,...L==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...L==="two-row"&&o?{pointerEvents:"auto"}:{}}}),mt=()=>{const L=j.find(ke=>ke.prefix==="title1"),re=j.filter(ke=>ke.prefix==="title2"||ke.prefix==="title3"),fe=re.length>0||o||(R??0)>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${e}-header-row-top`,children:[(C??0)>0||o?st():null,L&&Je(L,"two-row-top"),v&&qe()]}),fe?a.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-header-row-bottom`,children:[re.map(ke=>Je(ke,"two-row-bottom")),o&&a.jsxs(a.Fragment,{children:[je(),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:De,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},vt=()=>a.jsxs(a.Fragment,{children:[(C??0)>0||o?st("single-row"):null,j.map(L=>Je(L,"single-row")),o?a.jsxs(a.Fragment,{children:[at(),it()]}):null,v?qe():null]}),Mt=s.useCallback(L=>!!(L.closest("[data-controls]")||L.closest(`.${e}-thumbnails`)||L.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:gt,backdropStyle:Vt,mediaAreaStyle:Wt,overlayContentStyle:_t,swipeHandlers:qt,dismissAreaStyle:Xt}=au({enabled:oe??!1,onClose:Ee,animMs:Po,isBlockedTarget:Mt}),Dt=()=>{if(!nt||t.length===0)return Te.current=0,0;const L=se.current[0],re=se.current[t.length];if(!L||!re)return Te.current;const fe=re.offsetLeft-L.offsetLeft;return fe>0&&(Te.current=fe),Te.current},jt=(L=!1)=>{if(!nt)return;const re=Be.current,fe=Dt();!re||fe<=0||fe<re.clientWidth*.25||(re.scrollLeft<=0?(re.scrollLeft+=fe,L&&(ze.current.scrollLeft+=fe),tt.current&&(Oe.current+=fe)):re.scrollLeft>=fe*2&&(re.scrollLeft-=fe,L&&(ze.current.scrollLeft-=fe),tt.current&&(Oe.current-=fe)))},Ht=(L,re=(fe=>(fe=Be.current)==null?void 0:fe.scrollLeft)()??0)=>{if(!nt)return L;let ke=t.length+L,Ue=1/0;for(let ot=0;ot<xt;ot++){const St=ot*t.length+L,kt=se.current[St];if(!kt)continue;const tn=Math.abs(kt.offsetLeft-re);tn<Ue&&(Ue=tn,ke=St)}return ke},$t=L=>{const re=Be.current;return!L||!re?!1:L.offsetWidth>re.clientWidth+1},_=L=>{const re=Be.current;if(!L||!re||!$t(L))return!1;const fe=L.offsetLeft,ke=fe+L.offsetWidth;return re.scrollLeft>=fe-1&&re.scrollLeft+re.clientWidth<=ke+1},Ie=(L=(re=>(re=Be.current)==null?void 0:re.scrollLeft)()??0)=>{for(let ke=0;ke<se.current.length;ke+=1){const Ue=se.current[ke];if(Ue&&_(Ue))return ke}let fe={flatIndex:0,distance:1/0};return se.current.forEach((ke,Ue)=>{if(!ke)return;const ot=Math.abs(ke.offsetLeft-L);ot<fe.distance&&(fe={flatIndex:Ue,distance:ot})}),fe.flatIndex},Ne=L=>{Be.current&&se.current.forEach(re=>{re&&(re.style.scrollSnapAlign=$t(re)&&L==="backward"?"end":"start")})},Ge=(L,re,fe)=>{const ke=L-re,Ue=Ie(re),ot=se.current[Ue];if(_(ot))return Ie(L)%t.length;const St=se.current[Ue+1],kt=ot?St?St.offsetLeft-ot.offsetLeft:ot.offsetWidth:0,tn=kt>0?ke>kt*hr?1:ke<-kt*hr?-1:0:0;return tn===0?fe:nt?(fe+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,fe+tn))},dt=s.useCallback((L=!1)=>{if(S!=="on"||o)return;const re=Le.current,fe=q.current,ke=Ve.current[fe];if(!re||!ke||re.scrollWidth<=re.clientWidth)return;const Ue=re.scrollLeft,ot=Ue+re.clientWidth,St=ke.offsetLeft,kt=St+ke.offsetWidth;if(St>=Ue&&kt<=ot)return;const tn=re.scrollWidth-re.clientWidth;let Jt=Ue;if(!L&&Nt.current===null){const Mi=Ve.current[fe-1],yo=Ve.current[fe+1],rr=Mi?ke.offsetLeft-Mi.offsetLeft:yo?yo.offsetLeft-ke.offsetLeft:ke.offsetWidth;kt>ot?Jt+=rr:St<Ue&&(Jt-=rr)}else kt>ot?Jt=kt-re.clientWidth:Jt=St;re.scrollLeft=Math.max(0,Math.min(tn,Jt))},[o,S]),Ft=s.useCallback((L=!1)=>{L&&(Zt.current=!0),Bt.current===null&&(Bt.current=requestAnimationFrame(()=>{Bt.current=null;const re=Zt.current;Zt.current=!1,dt(re)}))},[dt]),lt=s.useCallback(L=>{if(L===q.current)return;const re=q.current;q.current=L;const fe=Math.abs(L-re)>1,ke=nt&&t.length>1&&(re===t.length-1&&L===0||re===0&&L===t.length-1);he(L),Ft(fe||ke)},[t.length,nt,Ft]),wt=()=>{if(!Be.current||t.length===0||Nt.current!==null||ze.current.isActive&&ze.current.hasMoved)return;const L=Be.current.scrollLeft,re=Ie(L)%t.length;re!==q.current&<(re)},zt=()=>{Nt.current=null},Pt=L=>{const re=Be.current;re&&(re.style.scrollSnapType=L?"":"none")},on=()=>{var L;(L=Pe.current)==null||L.call(Pe),Pe.current=null},pn=()=>{Qe.current!==null&&(cancelAnimationFrame(Qe.current),Qe.current=null),tt.current=!1},ci=()=>{const L=Be.current;if(!L){Qe.current=null,tt.current=!1;return}const re=Oe.current-L.scrollLeft;if(Math.abs(re)<.5){L.scrollLeft=Oe.current,jt(),wt(),Qe.current=null,tt.current=!1;return}L.scrollLeft+=re*o0,jt(),wt(),pt(),Qe.current=requestAnimationFrame(ci)},di=()=>{const L=Ze.current;L&&(L.style.transition="",L.style.transform="",L.style.willChange="")},tr=(L,re,fe,ke)=>{di(),L.scrollLeft=re,Ae.current=L.scrollLeft,jt(),fe!==void 0?(q.current=fe,he(fe)):wt(),Pt(!0),ke==null||ke()},nr=(L,{behavior:re="smooth",activeIndex:fe,onComplete:ke}={})=>{const Ue=Be.current,ot=Ze.current;if(!Ue||!ot)return;if(pn(),on(),Pt(!1),re==="auto"){tr(Ue,L,fe,ke);return}const St=Math.abs(L-Ue.scrollLeft),kt=Uv(St,Jv,Qv,Ue.clientWidth*.55);Pe.current=Zv(Ue,ot,L,{duration:kt,easing:e0,onComplete:()=>{Pe.current=null,tr(Ue,L,fe,ke)}})},ua=(L="smooth")=>{const re=Be.current;if(!re||t.length===0)return;const fe=Ie()%t.length,ke=Ht(fe,re.scrollLeft),Ue=se.current[ke];Ue&&nr(Ue.offsetLeft,{behavior:L,activeIndex:fe})},pa=(L,re="smooth",fe,ke)=>{const Ue=Be.current;if(!Ue||t.length===0)return;const ot=(ke??Ue.scrollLeft)-L,St=Ie(L),kt=se.current[St];if(_(kt)){Pt(!0),wt();return}const tn=se.current[St+1],Jt=kt?tn?tn.offsetLeft-kt.offsetLeft:kt.offsetWidth:0;if((Jt>0?ot>Jt*hr?1:ot<-Jt*hr?-1:0:0)!==0){const Wu=fe??St%t.length,Nu=Ge(ke??Ue.scrollLeft,L,Wu);Tn(Nu,re);return}const yo=ke??Ue.scrollLeft,rr=Ie(yo),al=se.current[rr];if(al&&Math.abs(al.offsetLeft-yo)<1){Pt(!0),wt();return}ua("auto")},Tn=(L,re="smooth")=>{const fe=Be.current;if(!fe||t.length===0)return;const ke=Ht(L,fe.scrollLeft),Ue=se.current[ke];Ue&&(re==="smooth"?Nt.current=L:Nt.current=null,q.current=L,he(L),Ft(!0),nr(Ue.offsetLeft,{behavior:re,activeIndex:L,onComplete:re==="smooth"?zt:void 0}))},Ei=()=>{Re.current&&(window.removeEventListener("pointerup",Re.current),window.removeEventListener("pointercancel",Re.current),Re.current=null)},ir=(L,re,fe,ke,Ue)=>{const ot=fe-L,St=ke-re,kt=Math.abs(ot),tn=Math.abs(St);if(kt<a0||kt<=tn)return!1;const Jt=ot<0?1:-1,Mi=nt?(Ue+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,Ue+Jt));return Mi===Ue?!1:(Tn(Mi),!0)},ui=L=>{if(!ze.current.isActive)return;Ei();const re=Be.current;if(!re)return;const{scrollLeft:fe,startActiveIndex:ke,hasMoved:Ue}=ze.current,ot=re.scrollLeft;jt(!0),ze.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},ut(!1),L!==void 0&&re.hasPointerCapture(L)&&re.releasePointerCapture(L),Ue?pa(fe,"smooth",ke,ot):(Pt(!0),wt()),pt()},or=(L,re)=>{const fe=Xe.current;Xe.current=null,fe&&(ir(fe.startX,fe.startY,L,re,fe.startActiveIndex),pt())},ma=L=>{if(!Ce)return;if(L.pointerType==="touch"){if(pn(),Pt(!0),Mt(L.target))return;Xe.current={startX:L.clientX,startY:L.clientY,startActiveIndex:q.current};return}if(L.pointerType!=="mouse"||L.button!==0||Mt(L.target))return;const re=Be.current;if(!re)return;pn(),on(),di(),Nt.current=null,ze.current={isActive:!0,startX:L.clientX,scrollLeft:re.scrollLeft,startActiveIndex:q.current,hasMoved:!1},Pt(!1),pt(),re.setPointerCapture(L.pointerId),Ei();const fe=ke=>{ke.pointerType==="mouse"&&ui(ke.pointerId)};Re.current=fe,window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)},ga=L=>{if(!Ce||L.pointerType!=="mouse")return;const re=Be.current;if(!re||!ze.current.isActive)return;if(L.buttons===0){ui(L.pointerId);return}const fe=L.clientX-ze.current.startX;Math.abs(fe)>r0&&(ze.current.hasMoved=!0,ut(!0)),ze.current.hasMoved&&(L.preventDefault(),re.scrollLeft=ze.current.scrollLeft-fe,jt(!0),wt(),pt())},we=L=>{if(Ce){if(L.pointerType==="touch"){L.type==="pointerup"?or(L.clientX,L.clientY):Xe.current=null;return}L.pointerType==="mouse"&&ui(L.pointerId)}},Ye=L=>{!Ce||L.pointerType!=="mouse"||ui(L.pointerId)};return su(),s.useEffect(()=>{const L=requestAnimationFrame(()=>Et(!0));return()=>{cancelAnimationFrame(L),on(),Ei(),Bt.current!==null&&(cancelAnimationFrame(Bt.current),Bt.current=null),Rt.current&&clearTimeout(Rt.current),Ot.current&&clearTimeout(Ot.current)}},[]),s.useEffect(()=>{if(!Fe){bt(!0);return}pt();const L=()=>pt();return document.addEventListener("pointermove",L,{passive:!0}),document.addEventListener("pointerdown",L,{passive:!0}),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerdown",L),Ot.current&&clearTimeout(Ot.current)}},[Fe,pt]),s.useEffect(()=>{const L=re=>{re.key==="Escape"&&Ee()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[Ee]),s.useLayoutEffect(()=>{Dt()},[W,t.length,nt]),s.useLayoutEffect(()=>{o||Tn(q.current,"auto")},[W,o]),s.useLayoutEffect(()=>{Tn(0,"auto")},[t.length,nt]),s.useEffect(()=>{const L=Be.current;if(!L||o||!oe)return;const re=fe=>{if(fe.preventDefault(),Math.abs(fe.deltaY)<=Math.abs(fe.deltaX))return;const ke=fe.deltaMode===1?i0:fe.deltaMode===2?L.clientHeight:1,Ue=fe.deltaY*ke*n0;if(Ue!==0){if(on(),tt.current||(tt.current=!0,Oe.current=L.scrollLeft,Nt.current=null,Pt(!1)),Oe.current+=Ue,!nt){const ot=L.scrollWidth-L.clientWidth;Oe.current=Math.max(0,Math.min(ot,Oe.current))}pt(),Qe.current===null&&(Qe.current=requestAnimationFrame(ci))}};return L.addEventListener("wheel",re,{passive:!1}),()=>{L.removeEventListener("wheel",re),pn()}},[o,oe,nt]),s.useEffect(()=>{const L=Be.current;if(!L)return;const re=()=>{jt(ze.current.isActive);const ke=L.scrollLeft,Ue=ke-Ae.current;Ae.current=ke;const ot=Te.current>0?Te.current*.5:1/0;if(Ue!==0&&Math.abs(Ue)<ot){const St=Ue>0?"forward":"backward";St!==Ke.current&&(Ke.current=St,Ne(St))}ze.current.isActive&&ze.current.hasMoved||wt()};L.addEventListener("scroll",re,{passive:!0});const fe=new ResizeObserver(()=>{Dt(),jt(ze.current.isActive),Ne(Ke.current),wt()});return fe.observe(L),()=>{on(),L.removeEventListener("scroll",re),fe.disconnect()}},[t.length,nt]),a.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{gt||Ee()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:ft?1:0,transition:`opacity ${Po}ms ease`,pointerEvents:ft?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Vt}}),a.jsxs("div",{ref:We,className:`${e}-lightbox-dismiss-area`,style:Xt,...qt,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Wt,onClick:L=>L.stopPropagation(),children:a.jsx("div",{ref:Be,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Ce&&t.length>0?"true":"false","data-mouse-dragging":Tt?"true":"false",onPointerDown:ma,onPointerMove:ga,onPointerUp:we,onPointerCancel:we,onLostPointerCapture:Ye,children:a.jsx("div",{ref:Ze,className:`${e}-lightbox-strip-track`,style:{gap:W},children:It.map((L,re)=>{const fe=L.image.objectFit??"contain",ke=re%t.length,Ue=Math.floor(re/t.length),ot=fr(W),St=`calc(-0.5 * (${ot} + ${W}))`;return a.jsxs("div",{ref:kt=>se.current[re]=kt,className:`${e}-strip-item`,style:{height:k==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[a.jsx("img",{src:L.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:fe}}),o&&ke<t.length-1&&Ue===0&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:St,width:ot,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${Ue}-${L.image.url}-${ke}`)})})})}),a.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":nn?"true":"false",style:_t,children:[a.jsx("div",{style:{position:"relative",width:"100%",height:K,flexShrink:0,pointerEvents:"none"},children:o&&a.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:ae,pointerEvents:"auto",zIndex:3}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:a.jsx("div",{className:`${e}-lightbox-content-area${ue?` ${e}-lightbox-content-area-stacked`:""}`,children:(ie||v)&&a.jsx("div",{className:`${e}-header ${ue?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ue?mt():ie||v?vt():null})})})]}),t.length>1&&S==="on"&&(()=>{const L=fr(I),re=`calc(-0.5 * (${I} + ${L}))`;return a.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:I},children:a.jsx("div",{ref:Le,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:fe=>fe.stopPropagation(),children:a.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":w,style:{gap:ne,"--thumbnail-active-color":H},children:[t.map((fe,ke)=>{const Ue=fr(ne),ot=`calc(-0.5 * (${Ue} + ${ne}))`;return a.jsxs("div",{ref:St=>{Ve.current[ke]=St},style:{position:"relative",flex:"0 0 auto"},children:[a.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":A===ke?"true":"false",onClick:()=>oe&&x==="click"&&Tn(ke),onMouseEnter:()=>P&&x==="hover"&&Tn(ke),"aria-label":fe.image.name?`View ${fe.image.name}`:`View image ${ke+1}`,"aria-current":A===ke?"true":void 0,children:a.jsx("img",{className:`${e}-thumb-image${U?` ${e}-thumb-image-cover`:""}`,src:fe.image.url,alt:"",draggable:!1,style:{...X,maxWidth:z,maxHeight:z,width:y.display==="cover"?"auto":"100%",height:"auto",objectFit:y.display==="cover"?"cover":"contain"}})}),o&&ke<t.length-1&&a.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:ot,width:Ue,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${fe.image.url}-${ke}`)}),o&&a.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:re,height:L,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function v0(e){return`
|
|
14295
14319
|
.${e}-wrapper {
|
|
14296
14320
|
position: relative;
|
|
14297
14321
|
width: 100%;
|
|
@@ -14676,7 +14700,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14676
14700
|
pointer-events: auto;
|
|
14677
14701
|
z-index: 10;
|
|
14678
14702
|
}
|
|
14679
|
-
`}const
|
|
14703
|
+
`}const x0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r})=>{const{prefix:l}=D.useScopedStyles(),{cover:d,coverFit:c}=e,u=s.useRef(null),[p,b]=s.useState(!1),v=t??[],g=p&&v.length>0,h=()=>{v.length!==0&&b(!0)};return s.useEffect(()=>{!n||i||o||b(!1)},[n,i,o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:v0(l)}}),d&&a.jsx("div",{className:`${l}-cover ${jn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...jn(c)?{"--image-aspect-ratio":ca(c)}:{}},"aria-label":"Open image gallery",children:a.jsx("img",{className:`${l}-cover-image ${jn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),g&&typeof document<"u"&&(()=>{const f=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx(y0,{prefix:l,images:v,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>b(!1)}),f)})()]})},b0=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14680
14704
|
import { createPortal } from 'react-dom';
|
|
14681
14705
|
import { CommonComponentProps } from '../props';
|
|
14682
14706
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15222,7 +15246,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15222
15246
|
</>
|
|
15223
15247
|
);
|
|
15224
15248
|
};
|
|
15225
|
-
`,x0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function b0(e){const t={};return t[Vt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Vt(e,"fontSettings")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Vt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Vt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Vt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Vt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Vt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Vt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const w0=ao.reduce((e,t)=>({...e,...b0(t)}),{}),S0=ao.reduce((e,t)=>({...e,[Vt(t,"fontFamily")]:"Goudy Bookletter 1911",[Vt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Vt(t,"letterSpacing")]:0,[Vt(t,"wordSpacing")]:0,[Vt(t,"textAlign")]:"left",[Vt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Wa(e){return ao.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Vt(n,"fontSize")]=i),o!==void 0&&(t[Vt(n,"lineHeight")]=o),t},{})}const $0=p0(),C0={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"}},...w0,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:x0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...S0},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,...Wa({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,...Wa({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,...Wa({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:[$0]}],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"}]}},T0={element:y0,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:C0,sourceCode:v0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ao.map(e=>({path:`${Vt(e,"fontFamily")}`}))]},fontRelations:{...ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Vt(t,"fontFamily")}`}),{})}},L0=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:y,backgroundColor:g,imageGap:h,maxWidth:f,maxHeight:x,textTransition:S,title1Width:v,title2Width:w,title3Width:H,title1MarginLeft:N=0,title2MarginLeft:Y=0,title3MarginLeft:D=0,titleRowMarginBottom:C=0,titleHeaderLayout:V="single-row",countCloseGap:$=0,closeIcon:I,closeIconMaxWidth:k,closeIconColor:T,closeIconHoverColor:m,contentMarginTop:M=0,iconMarginRight:E=0}=n,z=s.useCallback(Se=>O.scalingValue(Se,i??!1),[i]),ne=z(h??0),R=`${f}%`,W=`${x}%`,K=z($),ae=z(M),de=z(E),A=wi("title1",bi(n,"title1"),i),he=wi("title2",bi(n,"title2"),i),q=wi("title3",bi(n,"title3"),i),ce=wi("count",bi(n,"count"),i),Q=V==="mobile",be=!i||!!r,We=!o&&(!i||!!r),xe=s.useMemo(()=>Ar(t,b),[t,b]),[le,ee]=s.useState(l),ue=xe[le],oe=ue==null?void 0:ue.entry,[Ne,Te]=s.useState(!1),[P,U]=s.useState(null),[X,ie]=s.useState(!1),[j,B]=s.useState(null),[J,te]=s.useState(!1),[Ce,ye]=s.useState(0),[F,ve]=s.useState(),[pe,Z]=s.useState(),[me,De]=s.useState(null),ge=s.useRef(null),G=s.useRef(0),ke=s.useRef(0),Fe=s.useRef(0),rt=s.useRef(!1),Je=s.useRef(null),at=s.useRef(null),nt=s.useRef(null),je=s.useRef(null),$e=s.useRef(null),Ae=s.useRef(null),Be=s.useRef(null),Ke=s.useCallback(()=>{const Se=at.current;if(!Se)return;const Ye=Se.closest(`.${e}-lightbox-content-area`);if(!Ye)return Se.getBoundingClientRect().width;const L=Array.from(Ye.children).reduce((re,fe)=>!(fe instanceof HTMLElement)||fe.contains(Se)?re:re+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-L},[e]),Ie=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),ze=s.useCallback(Se=>{Se===G.current&&(B(null),te(!1))},[]),se=s.useCallback(()=>{o||rt.current||(rt.current=!0,u==null||u(),Te(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),Re=s.useCallback(Se=>!!(Se.closest("[data-controls]")||Se.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:qe,backdropStyle:we,mediaAreaStyle:Le,overlayContentStyle:Ze,swipeHandlers:Oe,dismissAreaStyle:Ue}=iu({enabled:We,onClose:se,animMs:300,isBlockedTarget:Re}),He=s.useCallback(Se=>{d&&Od(Se+1,c,!0)},[d,c]),Qe=s.useCallback(Se=>{if(Se)return Se.getBoundingClientRect().height},[]),it=s.useCallback(Se=>{if(xe.length===0)return;const Ye=(Se%xe.length+xe.length)%xe.length;if(Ye===le)return;const L=xe[le],re=xe[Ye];G.current+=1;const fe=G.current,Pe=S==="fade"&&Ol(L==null?void 0:L.entry)!==Ol(re==null?void 0:re.entry),Xe=Qe(nt.current),ot=Pe?(()=>{const Mt=Ke();Vn.flushSync(()=>{De(re.entry)}),nt.current&&Mt&&(nt.current.style.width=`${Mt}px`);const tn=Qe(nt.current);return nt.current&&(nt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Mt}})():void 0,wt=Math.max(Xe??0,(ot==null?void 0:ot.measuredIncomingTitlesHeight)??0)||void 0;ye(fe),B(le),te(!0),ee(Ye),He(Ye),Fe.current=Ye,Pe?(Ie(),wt&&ve(wt),ot!=null&&ot.incomingTitlesMeasureWidth&&Z(ot.incomingTitlesMeasureWidth),U((L==null?void 0:L.entryIndex)??null),ie(!0),ke.current=re.entryIndex,ge.current=setTimeout(()=>{U(null),ie(!1),ve(void 0),Z(void 0),De(null),ge.current=null},400)):(Ie(),U(null),ie(!1),ve(void 0),Z(void 0),De(null),ke.current=re.entryIndex)},[le,Ie,Ke,Qe,xe,He,S]),tt=s.useCallback(()=>{Be.current=null},[]),St=s.useCallback(Se=>{!be||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0||Se.target.closest("[data-controls]")||(Be.current={startX:Se.clientX,startY:Se.clientY,pointerId:Se.pointerId})},[be,xe.length]),$t=s.useCallback(Se=>{var Mt;if(!be||xe.length<=1||Se.pointerType==="mouse"&&Se.button!==0)return;if(qe){tt();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==Se.pointerId||(tt(),Se.target.closest("[data-controls]")))return;const re=Se.clientX-Ye.startX,fe=Se.clientY-Ye.startY,Pe=Math.abs(re),Xe=Math.abs(fe);if(Pe>=Hf&&Pe>Xe){it(re>0?le-1:le+1);return}if(Pe>_l||Xe>_l)return;const ot=(Mt=je.current)==null?void 0:Mt.getBoundingClientRect(),wt=ot?ot.left+ot.width/2:window.innerWidth/2;it(Se.clientX<wt?le-1:le+1)},[le,be,it,qe,tt,xe.length]),Rt=s.useCallback(Se=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===Se.pointerId&&tt()},[tt]);ou(),s.useEffect(()=>{Ae.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const Se=requestAnimationFrame(()=>{Te(!0),requestAnimationFrame(()=>{$e.current?$e.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(Se),Je.current&&clearTimeout(Je.current),ge.current&&clearTimeout(ge.current);const Ye=Ae.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var Se;S!=="fade"&&(ke.current=((Se=xe[le])==null?void 0:Se.entryIndex)??0,Ie(),U(null),ie(!1),ve(void 0),Z(void 0))},[le,Ie,xe,S]),s.useEffect(()=>{const Se=Ye=>{if(Ye.key==="Escape"){se();return}if(Ye.key==="ArrowLeft"&&xe.length>1){it(le-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){it(le+1);return}if(Ye.key==="Tab"&&je.current){const L=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(L).filter(ot=>!ot.closest('[aria-hidden="true"]'));if(re.length===0)return;const fe=re[0],Pe=re[re.length-1],Xe=document.activeElement;Ye.shiftKey?(Xe===fe||!je.current.contains(Xe))&&(Ye.preventDefault(),Pe.focus()):(Xe===Pe||!je.current.contains(Xe))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",Se),()=>window.removeEventListener("keydown",Se)},[it,se,le,xe.length]),s.useLayoutEffect(()=>{Ie(),G.current=0,ye(0),B(null),te(!1),U(null),ie(!1),ve(void 0),Z(void 0),De(null),ee(Se=>{const Ye=Math.max(0,xe.length-1);return Math.min(Se,Ye)})},[Ie,t.length,b,xe.length]),s.useLayoutEffect(()=>{var L;const Se=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),Se);Fe.current=Ye,ke.current=((L=xe[Ye])==null?void 0:L.entryIndex)??0,ee(Ye)},[l]);const yt=P!==null?t[P]:null,pt=j!==null?xe[j]:null,kt=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(yt==null?void 0:yt.title1)||(yt==null?void 0:yt.title2)||(yt==null?void 0:yt.title3),Wt=qf(b,xe,t),bt=I!==null,Nt=kt||Wt||bt,Gt=Wt&&bt?{gap:K}:void 0,Zt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,en=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,Lt=`${e}-titles-layer-out`,Ht=(N??0)>0||o,nn=z(C),ut=s.useMemo(()=>({title1Width:v??Xi.title1Width,title2Width:w??Xi.title2Width,title3Width:H??Xi.title3Width}),[v,w,H]),Me=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:D}),[Y,D]),Ge=s.useMemo(()=>oe?Jn(e,oe,A,he,q):[],[e,oe,A,he,q]),st=s.useMemo(()=>Ge.map(Se=>ut[Se.widthKey]),[Ge,ut]),gt=s.useMemo(()=>eo(Ge.length,st),[Ge.length,st]),vt=s.useMemo(()=>Oo(Ge.length,st),[Ge.length,st]),It=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title1"),[Ge]),ft=s.useMemo(()=>Ge.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),[Ge]),Bt=s.useMemo(()=>Qn(It,ut),[It,ut]),_t=s.useMemo(()=>Qn(ft,ut),[ft,ut]),Ft=s.useCallback((Se,Ye)=>{const L=Ge.findIndex(fe=>fe.prefix===Se.prefix);if(!Q||Ye==="single-row")return{effectiveWidth:vt[L]??0,resolvedWidth:gt[L]??0,maxWidth:dn(L,gt)};if(Ye==="two-row-top"){const fe=It.findIndex(Pe=>Pe.prefix===Se.prefix);return{effectiveWidth:Bt.effective[fe]??0,resolvedWidth:Bt.resolved[fe]??0,maxWidth:dn(fe,Bt.resolved)}}const re=ft.findIndex(fe=>fe.prefix===Se.prefix);return{effectiveWidth:_t.effective[re]??0,resolvedWidth:_t.resolved[re]??0,maxWidth:dn(re,_t.resolved)}},[Ge,ft,_t,vt,gt,It,Bt,Q]),qt=s.useCallback(Se=>Bd(Ge,gt,Me,Se)+(Q?0:N??0),[Ge,gt,Me,Q,N]),Xt=s.useCallback(()=>Q?0:N??0,[Q,N]),Dt=s.useCallback(Se=>ft.slice(0,Se).reduce((Ye,L,re)=>Ye+(L.marginLeftKey?Me[L.marginLeftKey]??0:0)+(_t.resolved[re]??0),0),[ft,_t.resolved,Me]),jt=s.useCallback(Se=>{const Ye=ft[Se];return Dt(Se)+(Ye.marginLeftKey?Me[Ye.marginLeftKey]??0:0)+(_t.resolved[Se]??0)},[ft,_t.resolved,Dt,Me]),Ot=s.useCallback((Se,Ye,L)=>{if(!Q||L==="single-row"){const ot=Se.findIndex(Jt=>Jt.prefix===Ye.prefix),wt=Se.map(Jt=>ut[Jt.widthKey]),Mt=eo(Se.length,wt);return{effectiveWidth:Oo(Se.length,wt)[ot]??0,resolvedWidth:Mt[ot]??0,maxWidth:dn(ot,Mt)}}if(L==="two-row-top"){const ot=Se.filter(Jt=>Jt.prefix==="title1"),wt=ot.findIndex(Jt=>Jt.prefix===Ye.prefix),{resolved:Mt,effective:tn}=Qn(ot,ut);return{effectiveWidth:tn[wt]??0,resolvedWidth:Mt[wt]??0,maxWidth:dn(wt,Mt)}}const re=Se.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),fe=re.findIndex(ot=>ot.prefix===Ye.prefix),{resolved:Pe,effective:Xe}=Qn(re,ut);return{effectiveWidth:Xe[fe]??0,resolvedWidth:Pe[fe]??0,maxWidth:dn(fe,Pe)}},[ut,Q]),Ct=(Se,Ye,L)=>{const re=Se.marginLeftKey?Me[Se.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:Pe,maxWidth:Xe}=L??Ft(Se,Ye),ot=Math.max(re,Zn),wt=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":Se.prefix,style:{width:z(fe),...re>0?{marginLeft:z(re)}:{}},children:[a.jsx("p",{className:Se.className,style:Se.style,children:Se.text}),wt&&Se.marginLeftKey?a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(-re),width:z(ot),height:"100%",pointerEvents:"auto"}}):null,wt?a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Xe),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:z(-yn/2),width:z(yn),height:"100%",pointerEvents:"auto"}}):null]},Se.className)},_=(Se="two-row")=>{const Ye=Ge.findIndex(fe=>fe.prefix==="title1"),L=Ye>=0?gt[Ye]:ut.title1Width,re=Se==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(L)}:{},style:{width:z(N??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Ee=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),_e=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Gf(xe,le,b,t)}),Ve=()=>Wt?o&&bt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[_e(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${La(K)} + ${K}))`,width:La(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):_e():null,dt=()=>!Wt&&!bt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Gt,children:[Ve(),bt?xt():null]}),At=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Wt||kt?Ee():null,Ht?_("single-row"):null,Et(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),dt(),Tn()]}),lt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Wt||kt?Ee():null,Ht?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:X&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(me||oe)}),a.jsxs("div",{ref:at,className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%",...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[yt&&X?a.jsx("div",{className:`${en} ${e}-titles-fade-out`,children:di(yt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(oe)})]})]}),dt(),Tn()]}),xt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:O.scalingValue(k??0,i),height:O.scalingValue(k??0,i),marginRight:de,"--close-icon-hover-color":m},children:[a.jsx("button",{ref:$e,type:"button",className:`${e}-close-icon-inner`,onClick:se,"aria-label":"Close",children:a.jsx(ln,{url:I??"",fill:T,hoverFill:i&&!r?T:m,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:de,height:"100%",pointerEvents:"auto"}})]}),zt=(Se,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Wt||kt?Ee():null,Ht?_("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:Se}):a.jsxs(a.Fragment,{children:[Se,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),dt()]}),Et=Se=>{if(!Se)return null;const Ye=Jn(e,Se,A,he,q);return a.jsx(a.Fragment,{children:Ye.map(L=>Ct(L,"single-row",Ot(Ye,L,"single-row")))})},on=Se=>{if(!Se)return null;const Ye=Jn(e,Se,A,he,q),L=Ye.find(re=>re.prefix==="title1");return L?Ct(L,"two-row-top",Ot(Ye,L,"two-row-top")):null},pn=(Se,Ye=!1)=>{const L=Se?Jn(e,Se,A,he,q):[],re=L.filter(Xe=>Xe.prefix==="title2"||Xe.prefix==="title3"),fe=o&&Ye;return re.length>0||fe||(C??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Xe=>Ct(Xe,"two-row-bottom",Ot(L,Xe,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[ua(),pa()]}):null]}):null,(C??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:nn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(Se,Ye=!1)=>a.jsxs(a.Fragment,{children:[zt(on(Se)),pn(Se,Ye)]}),di=Se=>Q?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(Se)}):Se?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Et(Se)}):null,tr=()=>{const Se=Q?-1:Ge.findIndex(re=>re.prefix==="title1"),Ye=!Q&&(o||(N??0)>0)?(()=>{const re=N??0,fe=Se>=0?gt[Se]:ut.title1Width,Pe=Math.max(re,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:z(Pe),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,L=Ge.flatMap((re,fe)=>{if(!re.marginLeftKey)return[];const Pe=Me[re.marginLeftKey]??0,Xe=zd(Ge,gt,Me,fe)+Xt(),ot=Math.max(Pe,Zn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[fe]),style:{position:"absolute",top:0,left:z(Xe),width:z(ot),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ye?[Ye,...L]:L},nr=()=>Ge.map((Se,Ye)=>{const L=dn(Ye,gt),fe=qt(Ye)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),ua=()=>ft.flatMap((Se,Ye)=>{if(!Se.marginLeftKey)return[];const L=Me[Se.marginLeftKey]??0,re=Dt(Ye),fe=Math.max(L,Zn),{resolvedWidth:Pe}=Ft(Se,"two-row-bottom");return a.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Pe),style:{position:"absolute",top:0,left:z(re),width:z(fe),height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)}),pa=()=>ft.map((Se,Ye)=>{const{maxWidth:L}=Ft(Se,"two-row-bottom"),fe=jt(Ye)-yn/2;return a.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:a.jsx("div",{"data-controls":Se.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${Se.widthKey}-junction`)}),Tn=()=>!o||Q?null:a.jsxs(a.Fragment,{children:[tr(),nr()]}),Ei=Se=>{const Ye=!Se.objectFit&&jn(y);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:R,maxHeight:W,...Ye?{"--image-aspect-ratio":ca(y)}:{}}}},ir=Se=>Se.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":Se.objectFit}}:jn(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=Se=>{if(Se.length===0)return null;const Ye=Se.length>1,L=La(ne),re=`calc(-0.5 * (${L} + ${ne}))`;if(Se.length===1){const fe=Se[0];return a.jsx("div",{...Ei(fe),children:a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ne}:void 0,children:Se.map((fe,Pe)=>a.jsxs("div",{...Ei(fe),children:[a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&Pe<Se.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:L,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${Pe}`))})},or=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||yt!=null&&yt.title2||yt!=null&&yt.title3||(C??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:nt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(me||oe)}),a.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...X&&F?{minHeight:F}:void 0,...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[zt(a.jsxs("div",{className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%"},children:[yt&&X?a.jsx("div",{className:`${Lt} ${e}-titles-fade-out`,children:on(yt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:on(oe)})]}),X&&F?F:void 0),or?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[yt&&X?a.jsx("div",{className:`${en} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(yt)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:pn(oe,!0)})]}):null]})]}),ga=()=>{const Se=or;return a.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...Se?{flex:1,height:"100%"}:{}},children:[a.jsx("div",{className:`${e}-titles-row-two-row`,style:Se?void 0:{flex:"0 0 auto",height:"auto"},children:ci(oe,!0)}),Tn()]})};return a.jsxs("div",{ref:je,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{qe||se()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:Ne?1:0,transition:"opacity 300ms ease",pointerEvents:Ne?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...we}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ue,...Oe,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Le,onClick:Se=>Se.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&xe.length>1?"true":"false",onPointerDown:be?St:void 0,onPointerUp:be?$t:void 0,onPointerCancel:be?Rt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[pt&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:Se=>{Se.target===Se.currentTarget&&ze(Ce)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(pt.images)})},`slide-out-${Ce}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ue?ui(ue.images):null})},`slide-in-${Ce}-${le}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Ze,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&a.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?S==="fade"?ma():ga():S==="fade"?lt():At()})})})]})]})]})};function R0(e){return`
|
|
15249
|
+
`,w0="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),fi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function S0(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")]={...fi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Gt(e,"fontSize")]={...fi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Gt(e,"lineHeight")]={...fi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Gt(e,"letterSpacing")]={...fi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Gt(e,"wordSpacing")]={...fi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Gt(e,"textAlign")]={...fi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Gt(e,"textAppearance")]={...fi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const $0=ao.reduce((e,t)=>({...e,...S0(t)}),{}),C0=ao.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 Wa(e){return ao.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 T0=g0(),L0={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"}},...$0,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:w0,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",...C0},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,...Wa({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,...Wa({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,...Wa({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:[T0]}],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"}]}},R0={element:x0,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:L0,sourceCode:b0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ao.map(e=>({path:`${Gt(e,"fontFamily")}`}))]},fontRelations:{...ao.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Gt(t,"fontFamily")}`}),{})}},I0=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:r,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:b,coverFit:v,backgroundColor:g,imageGap:h,maxWidth:f,maxHeight:x,textTransition:S,title1Width:y,title2Width:w,title3Width:H,title1MarginLeft:N=0,title2MarginLeft:Y=0,title3MarginLeft:O=0,titleRowMarginBottom:C=0,titleHeaderLayout:V="single-row",countCloseGap:$=0,closeIcon:R,closeIconMaxWidth:k,closeIconColor:T,closeIconHoverColor:m,contentMarginTop:M=0,iconMarginRight:E=0}=n,z=s.useCallback(we=>D.scalingValue(we,i??!1),[i]),ne=z(h??0),I=`${f}%`,W=`${x}%`,K=z($),ae=z(M),de=z(E),A=wi("title1",bi(n,"title1"),i),he=wi("title2",bi(n,"title2"),i),q=wi("title3",bi(n,"title3"),i),ce=wi("count",bi(n,"count"),i),Q=V==="mobile",be=!i||!!r,He=!o&&(!i||!!r),xe=s.useMemo(()=>Ar(t,b),[t,b]),[le,ee]=s.useState(l),ue=xe[le],oe=ue==null?void 0:ue.entry,[Fe,Ce]=s.useState(!1),[P,U]=s.useState(null),[X,ie]=s.useState(!1),[j,B]=s.useState(null),[J,te]=s.useState(!1),[$e,ye]=s.useState(0),[F,ve]=s.useState(),[pe,Z]=s.useState(),[me,De]=s.useState(null),ge=s.useRef(null),G=s.useRef(0),Me=s.useRef(0),_e=s.useRef(0),rt=s.useRef(!1),Je=s.useRef(null),at=s.useRef(null),it=s.useRef(null),je=s.useRef(null),Se=s.useRef(null),We=s.useRef(null),Be=s.useRef(null),Ze=s.useCallback(()=>{const we=at.current;if(!we)return;const Ye=we.closest(`.${e}-lightbox-content-area`);if(!Ye)return we.getBoundingClientRect().width;const L=Array.from(Ye.children).reduce((re,fe)=>!(fe instanceof HTMLElement)||fe.contains(we)?re:re+fe.getBoundingClientRect().width,0);return Ye.getBoundingClientRect().width-L},[e]),Le=s.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),Ve=s.useCallback(we=>{we===G.current&&(B(null),te(!1))},[]),se=s.useCallback(()=>{o||rt.current||(rt.current=!0,u==null||u(),Ce(!1),Je.current=setTimeout(()=>{p()},300))},[o,u,p]),Te=s.useCallback(we=>!!(we.closest("[data-controls]")||we.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Xe,backdropStyle:ze,mediaAreaStyle:Re,overlayContentStyle:Pe,swipeHandlers:Ae,dismissAreaStyle:Ke}=au({enabled:He,onClose:se,animMs:300,isBlockedTarget:Te}),Oe=s.useCallback(we=>{d&&zd(we+1,c,!0)},[d,c]),Qe=s.useCallback(we=>{if(we)return we.getBoundingClientRect().height},[]),tt=s.useCallback(we=>{if(xe.length===0)return;const Ye=(we%xe.length+xe.length)%xe.length;if(Ye===le)return;const L=xe[le],re=xe[Ye];G.current+=1;const fe=G.current,ke=S==="fade"&&Dl(L==null?void 0:L.entry)!==Dl(re==null?void 0:re.entry),Ue=Qe(it.current),ot=ke?(()=>{const kt=Ze();Vn.flushSync(()=>{De(re.entry)}),it.current&&kt&&(it.current.style.width=`${kt}px`);const tn=Qe(it.current);return it.current&&(it.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:kt}})():void 0,St=Math.max(Ue??0,(ot==null?void 0:ot.measuredIncomingTitlesHeight)??0)||void 0;ye(fe),B(le),te(!0),ee(Ye),Oe(Ye),_e.current=Ye,ke?(Le(),St&&ve(St),ot!=null&&ot.incomingTitlesMeasureWidth&&Z(ot.incomingTitlesMeasureWidth),U((L==null?void 0:L.entryIndex)??null),ie(!0),Me.current=re.entryIndex,ge.current=setTimeout(()=>{U(null),ie(!1),ve(void 0),Z(void 0),De(null),ge.current=null},400)):(Le(),U(null),ie(!1),ve(void 0),Z(void 0),De(null),Me.current=re.entryIndex)},[le,Le,Ze,Qe,xe,Oe,S]),nt=s.useCallback(()=>{Be.current=null},[]),xt=s.useCallback(we=>{!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0||we.target.closest("[data-controls]")||(Be.current={startX:we.clientX,startY:we.clientY,pointerId:we.pointerId})},[be,xe.length]),It=s.useCallback(we=>{var kt;if(!be||xe.length<=1||we.pointerType==="mouse"&&we.button!==0)return;if(Xe){nt();return}const Ye=Be.current;if(!Ye||Ye.pointerId!==we.pointerId||(nt(),we.target.closest("[data-controls]")))return;const re=we.clientX-Ye.startX,fe=we.clientY-Ye.startY,ke=Math.abs(re),Ue=Math.abs(fe);if(ke>=Df&&ke>Ue){tt(re>0?le-1:le+1);return}if(ke>Wl||Ue>Wl)return;const ot=(kt=je.current)==null?void 0:kt.getBoundingClientRect(),St=ot?ot.left+ot.width/2:window.innerWidth/2;tt(we.clientX<St?le-1:le+1)},[le,be,tt,Xe,nt,xe.length]),Tt=s.useCallback(we=>{const Ye=Be.current;(Ye==null?void 0:Ye.pointerId)===we.pointerId&&nt()},[nt]);su(),s.useEffect(()=>{We.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const we=requestAnimationFrame(()=>{Ce(!0),requestAnimationFrame(()=>{Se.current?Se.current.focus():je.current&&je.current.focus()})});return()=>{cancelAnimationFrame(we),Je.current&&clearTimeout(Je.current),ge.current&&clearTimeout(ge.current);const Ye=We.current;Ye&&document.contains(Ye)&&Ye.focus({preventScroll:!0})}},[]),s.useEffect(()=>{var we;S!=="fade"&&(Me.current=((we=xe[le])==null?void 0:we.entryIndex)??0,Le(),U(null),ie(!1),ve(void 0),Z(void 0))},[le,Le,xe,S]),s.useEffect(()=>{const we=Ye=>{if(Ye.key==="Escape"){se();return}if(Ye.key==="ArrowLeft"&&xe.length>1){tt(le-1);return}if(Ye.key==="ArrowRight"&&xe.length>1){tt(le+1);return}if(Ye.key==="Tab"&&je.current){const L=je.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),re=Array.from(L).filter(ot=>!ot.closest('[aria-hidden="true"]'));if(re.length===0)return;const fe=re[0],ke=re[re.length-1],Ue=document.activeElement;Ye.shiftKey?(Ue===fe||!je.current.contains(Ue))&&(Ye.preventDefault(),ke.focus()):(Ue===ke||!je.current.contains(Ue))&&(Ye.preventDefault(),fe.focus())}};return window.addEventListener("keydown",we),()=>window.removeEventListener("keydown",we)},[tt,se,le,xe.length]),s.useLayoutEffect(()=>{Le(),G.current=0,ye(0),B(null),te(!1),U(null),ie(!1),ve(void 0),Z(void 0),De(null),ee(we=>{const Ye=Math.max(0,xe.length-1);return Math.min(we,Ye)})},[Le,t.length,b,xe.length]),s.useLayoutEffect(()=>{var L;const we=Math.max(0,xe.length-1),Ye=Math.min(Math.max(0,l),we);_e.current=Ye,Me.current=((L=xe[Ye])==null?void 0:L.entryIndex)??0,ee(Ye)},[l]);const ut=P!==null?t[P]:null,ft=j!==null?xe[j]:null,Et=(oe==null?void 0:oe.title1)||(oe==null?void 0:oe.title2)||(oe==null?void 0:oe.title3)||(ut==null?void 0:ut.title1)||(ut==null?void 0:ut.title2)||(ut==null?void 0:ut.title3),Lt=Uf(b,xe,t),bt=R!==null,Nt=Et||Lt||bt,Bt=Lt&&bt?{gap:K}:void 0,Zt=`${e}-titles-stack${Q?` ${e}-titles-stack-stacked`:""}`,en=`${e}-titles-layer-out${Q?` ${e}-titles-layer-out-stacked`:""}`,Rt=`${e}-titles-layer-out`,Ot=(N??0)>0||o,nn=z(C),pt=s.useMemo(()=>({title1Width:y??Xi.title1Width,title2Width:w??Xi.title2Width,title3Width:H??Xi.title3Width}),[y,w,H]),Ee=s.useMemo(()=>({title2MarginLeft:Y,title3MarginLeft:O}),[Y,O]),qe=s.useMemo(()=>oe?Jn(e,oe,A,he,q):[],[e,oe,A,he,q]),st=s.useMemo(()=>qe.map(we=>pt[we.widthKey]),[qe,pt]),mt=s.useMemo(()=>eo(qe.length,st),[qe.length,st]),vt=s.useMemo(()=>Oo(qe.length,st),[qe.length,st]),Mt=s.useMemo(()=>qe.filter(we=>we.prefix==="title1"),[qe]),gt=s.useMemo(()=>qe.filter(we=>we.prefix==="title2"||we.prefix==="title3"),[qe]),Vt=s.useMemo(()=>Qn(Mt,pt),[Mt,pt]),Wt=s.useMemo(()=>Qn(gt,pt),[gt,pt]),_t=s.useCallback((we,Ye)=>{const L=qe.findIndex(fe=>fe.prefix===we.prefix);if(!Q||Ye==="single-row")return{effectiveWidth:vt[L]??0,resolvedWidth:mt[L]??0,maxWidth:dn(L,mt)};if(Ye==="two-row-top"){const fe=Mt.findIndex(ke=>ke.prefix===we.prefix);return{effectiveWidth:Vt.effective[fe]??0,resolvedWidth:Vt.resolved[fe]??0,maxWidth:dn(fe,Vt.resolved)}}const re=gt.findIndex(fe=>fe.prefix===we.prefix);return{effectiveWidth:Wt.effective[re]??0,resolvedWidth:Wt.resolved[re]??0,maxWidth:dn(re,Wt.resolved)}},[qe,gt,Wt,vt,mt,Mt,Vt,Q]),qt=s.useCallback(we=>qd(qe,mt,Ee,we)+(Q?0:N??0),[qe,mt,Ee,Q,N]),Xt=s.useCallback(()=>Q?0:N??0,[Q,N]),Dt=s.useCallback(we=>gt.slice(0,we).reduce((Ye,L,re)=>Ye+(L.marginLeftKey?Ee[L.marginLeftKey]??0:0)+(Wt.resolved[re]??0),0),[gt,Wt.resolved,Ee]),jt=s.useCallback(we=>{const Ye=gt[we];return Dt(we)+(Ye.marginLeftKey?Ee[Ye.marginLeftKey]??0:0)+(Wt.resolved[we]??0)},[gt,Wt.resolved,Dt,Ee]),Ht=s.useCallback((we,Ye,L)=>{if(!Q||L==="single-row"){const ot=we.findIndex(Jt=>Jt.prefix===Ye.prefix),St=we.map(Jt=>pt[Jt.widthKey]),kt=eo(we.length,St);return{effectiveWidth:Oo(we.length,St)[ot]??0,resolvedWidth:kt[ot]??0,maxWidth:dn(ot,kt)}}if(L==="two-row-top"){const ot=we.filter(Jt=>Jt.prefix==="title1"),St=ot.findIndex(Jt=>Jt.prefix===Ye.prefix),{resolved:kt,effective:tn}=Qn(ot,pt);return{effectiveWidth:tn[St]??0,resolvedWidth:kt[St]??0,maxWidth:dn(St,kt)}}const re=we.filter(ot=>ot.prefix==="title2"||ot.prefix==="title3"),fe=re.findIndex(ot=>ot.prefix===Ye.prefix),{resolved:ke,effective:Ue}=Qn(re,pt);return{effectiveWidth:Ue[fe]??0,resolvedWidth:ke[fe]??0,maxWidth:dn(fe,ke)}},[pt,Q]),$t=(we,Ye,L)=>{const re=we.marginLeftKey?Ee[we.marginLeftKey]??0:0,{effectiveWidth:fe,resolvedWidth:ke,maxWidth:Ue}=L??_t(we,Ye),ot=Math.max(re,Zn),St=o&&Ye==="two-row-top";return a.jsxs("div",{className:`${e}-title-cell`,"data-title":we.prefix,style:{width:z(fe),...re>0?{marginLeft:z(re)}:{}},children:[a.jsx("p",{className:we.className,style:we.style,children:we.text}),St&&we.marginLeftKey?a.jsx("div",{"data-controls":we.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ke),style:{position:"absolute",top:0,left:z(-re),width:z(ot),height:"100%",pointerEvents:"auto"}}):null,St?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:z(-yn/2),width:z(yn),height:"100%",pointerEvents:"auto"}}):null]},we.className)},_=(we="two-row")=>{const Ye=qe.findIndex(fe=>fe.prefix==="title1"),L=Ye>=0?mt[Ye]:pt.title1Width,re=we==="two-row"&&o;return a.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(L)}:{},style:{width:z(N??0),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},Ie=()=>a.jsx("span",{className:`${e}-titles-baseline-strut`,style:A,"aria-hidden":"true",children:" "}),Ne=()=>a.jsx("span",{className:`${e}-entry-counter`,style:ce,"aria-live":"polite","aria-atomic":"true",children:Xf(xe,le,b,t)}),Ge=()=>Lt?o&&bt?a.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ne(),a.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${La(K)} + ${K}))`,width:La(K),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ne():null,dt=()=>!Lt&&!bt?null:a.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Bt,children:[Ge(),bt?wt():null]}),Ft=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,Pt(oe),a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),dt(),Tn()]}),lt=()=>a.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[Lt||Et?Ie():null,Ot?_("single-row"):null,a.jsxs("div",{className:`${e}-titles-row-titles`,style:X&&F?{minHeight:F}:void 0,children:[a.jsx("div",{ref:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:di(me||oe)}),a.jsxs("div",{ref:at,className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%",...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-fade-out`,children:di(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:di(oe)})]})]}),dt(),Tn()]}),wt=()=>a.jsxs("div",{className:`${e}-close-icon`,style:{width:D.scalingValue(k??0,i),height:D.scalingValue(k??0,i),marginRight:de,"--close-icon-hover-color":m},children:[a.jsx("button",{ref:Se,type:"button",className:`${e}-close-icon-inner`,onClick:se,"aria-label":"Close",children:a.jsx(ln,{url:R??"",fill:T,hoverFill:i&&!r?T:m,className:`${e}-close-icon-img`})}),o&&a.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:de,height:"100%",pointerEvents:"auto"}})]}),zt=(we,Ye)=>a.jsxs("div",{className:`${e}-titles-row-top`,children:[Lt||Et?Ie():null,Ot?_("two-row"):null,Ye!==void 0?a.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ye},children:we}):a.jsxs(a.Fragment,{children:[we,a.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),dt()]}),Pt=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q);return a.jsx(a.Fragment,{children:Ye.map(L=>$t(L,"single-row",Ht(Ye,L,"single-row")))})},on=we=>{if(!we)return null;const Ye=Jn(e,we,A,he,q),L=Ye.find(re=>re.prefix==="title1");return L?$t(L,"two-row-top",Ht(Ye,L,"two-row-top")):null},pn=(we,Ye=!1)=>{const L=we?Jn(e,we,A,he,q):[],re=L.filter(Ue=>Ue.prefix==="title2"||Ue.prefix==="title3"),fe=o&&Ye;return re.length>0||fe||(C??0)>0?a.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?a.jsxs("div",{className:`${e}-titles-row-bottom`,children:[re.map(Ue=>$t(Ue,"two-row-bottom",Ht(L,Ue,"two-row-bottom"))),Ye&&o?a.jsxs(a.Fragment,{children:[ua(),pa()]}):null]}):null,(C??0)>0||fe?a.jsx("div",{"data-controls":fe?"titleRowMarginBottom":void 0,"data-controls-axis":fe?"y":void 0,"data-controls-reverse":fe?"":void 0,className:fe?`${e}-control`:void 0,style:{height:nn,width:"100%",flexShrink:0,pointerEvents:fe?"auto":"none"}}):null]}):null},ci=(we,Ye=!1)=>a.jsxs(a.Fragment,{children:[zt(on(we)),pn(we,Ye)]}),di=we=>Q?a.jsx("div",{className:`${e}-titles-row-two-row`,children:ci(we)}):we?a.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Pt(we)}):null,tr=()=>{const we=Q?-1:qe.findIndex(re=>re.prefix==="title1"),Ye=!Q&&(o||(N??0)>0)?(()=>{const re=N??0,fe=we>=0?mt[we]:pt.title1Width,ke=Math.max(re,Zn);return a.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(fe),style:{position:"absolute",top:0,left:0,width:z(ke),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,L=qe.flatMap((re,fe)=>{if(!re.marginLeftKey)return[];const ke=Ee[re.marginLeftKey]??0,Ue=Gd(qe,mt,Ee,fe)+Xt(),ot=Math.max(ke,Zn);return a.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(mt[fe]),style:{position:"absolute",top:0,left:z(Ue),width:z(ot),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Ye?[Ye,...L]:L},nr=()=>qe.map((we,Ye)=>{const L=dn(Ye,mt),fe=qt(Ye)-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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),ua=()=>gt.flatMap((we,Ye)=>{if(!we.marginLeftKey)return[];const L=Ee[we.marginLeftKey]??0,re=Dt(Ye),fe=Math.max(L,Zn),{resolvedWidth:ke}=_t(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(ke),style:{position:"absolute",top:0,left:z(re),width:z(fe),height:"100%",pointerEvents:"auto"}},we.marginLeftKey)}),pa=()=>gt.map((we,Ye)=>{const{maxWidth:L}=_t(we,"two-row-bottom"),fe=jt(Ye)-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(L),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:z(fe),width:z(yn),height:"100%",pointerEvents:"auto"}})},`${we.widthKey}-junction`)}),Tn=()=>!o||Q?null:a.jsxs(a.Fragment,{children:[tr(),nr()]}),Ei=we=>{const Ye=!we.objectFit&&jn(v);return{className:`${e}-slide-image-cell${Ye?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:I,maxHeight:W,...Ye?{"--image-aspect-ratio":ca(v)}:{}}}},ir=we=>we.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":we.objectFit}}:jn(v)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ui=we=>{if(we.length===0)return null;const Ye=we.length>1,L=La(ne),re=`calc(-0.5 * (${L} + ${ne}))`;if(we.length===1){const fe=we[0];return a.jsx("div",{...Ei(fe),children:a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1})})}return a.jsx("div",{className:`${e}-slide-inner`,style:Ye?{gap:ne}:void 0,children:we.map((fe,ke)=>a.jsxs("div",{...Ei(fe),children:[a.jsx("img",{...ir(fe),src:fe.url,alt:fe.name??"",draggable:!1}),o&&Ye&&ke<we.length-1&&a.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:re,width:L,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${fe.url}-${ke}`))})},or=!!(oe!=null&&oe.title2||oe!=null&&oe.title3||ut!=null&&ut.title2||ut!=null&&ut.title3||(C??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:it,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ci(me||oe)}),a.jsxs("div",{ref:at,className:`${e}-titles-row-two-row`,style:{...X&&F?{minHeight:F}:void 0,...X&&pe?{width:pe,maxWidth:"100%"}:void 0},children:[zt(a.jsxs("div",{className:Zt,style:{position:X?"absolute":"relative",inset:X?0:void 0,width:"100%"},children:[ut&&X?a.jsx("div",{className:`${Rt} ${e}-titles-fade-out`,children:on(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:on(oe)})]}),X&&F?F:void 0),or?a.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[ut&&X?a.jsx("div",{className:`${en} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:pn(ut)}):null,a.jsx("div",{className:`${e}-titles-layer-in${X?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Q?` ${e}-titles-layer-in-stacked`:""}`,children:pn(oe,!0)})]}):null]})]}),ga=()=>{const we=or;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:ci(oe,!0)}),Tn()]})};return a.jsxs("div",{ref:je,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Xe||se()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:bt?void 0:-1,style:{opacity:Fe?1:0,transition:"opacity 300ms ease",pointerEvents:Fe?"auto":"none"},children:[a.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...ze}}),a.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ke,...Ae,children:[a.jsx("div",{className:`${e}-lightbox-content`,style:Re,onClick:we=>we.stopPropagation(),children:a.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&xe.length>1?"true":"false",onPointerDown:be?xt:void 0,onPointerUp:be?It:void 0,onPointerCancel:be?Tt:void 0,children:a.jsxs("div",{className:`${e}-slide-stack`,children:[ft&&J?a.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:we=>{we.target===we.currentTarget&&Ve($e)},children:a.jsx("div",{className:`${e}-slide-area`,children:ui(ft.images)})},`slide-out-${$e}`):null,a.jsx("div",{className:`${e}-slide-layer-in${J?` ${e}-slide-fade-in`:""}`,children:a.jsx("div",{className:`${e}-slide-area`,children:ue?ui(ue.images):null})},`slide-in-${$e}-${le}`)]})})}),a.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:Pe,children:[a.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),a.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Q?{flex:1,minHeight:0}:{}},children:a.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:Nt&&a.jsx("div",{className:`${e}-text-bar-cell${Q?` ${e}-text-bar-cell-stacked`:""}`,style:Q?void 0:{flex:1,minWidth:0,width:"100%"},children:Q?S==="fade"?ma():ga():S==="fade"?lt():Ft()})})})]})]})]})};function E0(e){return`
|
|
15226
15250
|
.${e}-wrapper {
|
|
15227
15251
|
position: relative;
|
|
15228
15252
|
width: 100%;
|
|
@@ -15744,7 +15768,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15744
15768
|
pointer-events: auto;
|
|
15745
15769
|
z-index: 10;
|
|
15746
15770
|
}
|
|
15747
|
-
`}const
|
|
15771
|
+
`}const M0=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:r,metadata:l})=>{const{prefix:d}=D.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:b}=e,v=s.useRef(null),[g,h]=s.useState(!1),[f,x]=s.useState(0),S=s.useRef(!1),y=s.useRef(!1),w=s.useRef(!1),H=s.useMemo(()=>(t??[]).filter($=>Qi($).length>0),[t]),N=g&&H.length>0,Y=!n,O=s.useCallback(()=>{Y&&(w.current=!0,zf(y.current,c),y.current=!1)},[Y,c]),C=($=0)=>{if(H.length===0||n&&!i&&!o)return;const R=Ar(H,b),k=Math.max(0,Math.min($,R.length-1));if(x(k),Y){const T=Bd();zd(k+1,c,T),y.current=!T}h(!0)},V=s.useCallback(()=>{h(!1),w.current=!1},[]);return s.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),s.useEffect(()=>{if(!Y||S.current)return;S.current=!0;const $=Hl(c);if(!$)return;const R=Ol($,Ar(H,b).length);R<0||(x(R),h(!0))},[H,c,Y,b]),s.useEffect(()=>{if(!Y)return;const $=()=>{if(w.current){w.current=!1,h(!1);return}const R=Hl(c);if(!R){h(!1);return}const k=Ol(R,Ar(H,b).length);if(k<0){h(!1);return}y.current=!1,x(k),h(!0)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[H,c,Y,b]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:v,className:`${d}-wrapper`,children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:E0(d)}}),u?a.jsx("button",{type:"button",className:`${d}-cover ${jn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>C(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...jn(p)?{"--image-aspect-ratio":ca(p)}:{}},"aria-label":"Open journal gallery",children:a.jsx("img",{className:`${d}-cover-image ${jn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),N&&typeof document<"u"&&(()=>{const $=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx(I0,{prefix:d,entries:H,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:f,enableUrlSync:Y,journalItemId:c,onBeforeClose:O,onClose:V}),$)})()]})},P0=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15748
15772
|
import { createPortal } from 'react-dom';
|
|
15749
15773
|
import { CommonComponentProps } from '../props';
|
|
15750
15774
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16500,7 +16524,7 @@ export type LightboxJournalSettings = {
|
|
|
16500
16524
|
closeIconColor: string;
|
|
16501
16525
|
closeIconHoverColor: string;
|
|
16502
16526
|
};
|
|
16503
|
-
`,M0="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 P0(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const k0=ii.reduce((e,t)=>({...e,...P0(t)}),{}),A0=ii.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Goudy Bookletter 1911",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Na(e){return ii.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const F0=Xf(),_0={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"}},...k0,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:M0,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...A0,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:[F0]}],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"}]}]}},W0={element:I0,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:_0,sourceCode:E0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ii.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...ii.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})}},N0={sizeType:"custom",value:700,min:400,max:700};function Vr(e,t){return{widthPx:e,heightPx:e*t}}function ds(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 uc(e,t,n,i){const{heightPx:o}=Vr(n,i);return ds(e/2,t/2,e,t,n,o)}function au(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 H0(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":au(e,t,n)||r==="area"?l??"none":d??"none"}function pc(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 O0(e){return`
|
|
16527
|
+
`,k0="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 A0(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...yi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...yi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...yi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...yi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...yi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...yi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...yi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const F0=ii.reduce((e,t)=>({...e,...A0(t)}),{}),_0=ii.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Goudy Bookletter 1911",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Na(e){return ii.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const W0=Yf(),N0={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"}},...F0,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:k0,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",..._0,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:[W0]}],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"}]}]}},H0={element:M0,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:N0,sourceCode:P0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...ii.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{...ii.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})}},O0={sizeType:"custom",value:700,min:400,max:700};function Vr(e,t){return{widthPx:e,heightPx:e*t}}function ds(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 pc(e,t,n,i){const{heightPx:o}=Vr(n,i);return ds(e/2,t/2,e,t,n,o)}function cu(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 D0(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":cu(e,t,n)||r==="area"?l??"none":d??"none"}function mc(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 j0(e){return`
|
|
16504
16528
|
.${e}-root {
|
|
16505
16529
|
position: absolute;
|
|
16506
16530
|
top: 0;
|
|
@@ -16535,7 +16559,7 @@ export type LightboxJournalSettings = {
|
|
|
16535
16559
|
width: 32px;
|
|
16536
16560
|
height: 32px;
|
|
16537
16561
|
}
|
|
16538
|
-
`}function
|
|
16562
|
+
`}function z0(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 B0(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await z0(i)]));return new Map(n)}function V0({settings:e,content:t=[],isEditor:n}){const{prefix:i}=D.useScopedStyles(),[o,r]=s.useState(null),[l,d]=s.useState([]),[c,u]=s.useState(0),p=s.useRef(0),[b,v]=s.useState({x:0,y:0}),[g,h]=s.useState("none"),f=s.useRef({x:0,y:0}),[x,S]=s.useState(!1),[y,w]=s.useState(!1),H=s.useRef(new Map),{imageSize:N=O0,cursor:Y="system",target:O="area",position:C="random",visible:V="all",defaultCursor:$=null,hoverCursor:R=null}=e,k=t.filter(I=>{var W;return!!((W=I==null?void 0:I.image)!=null&&W.url)}),T=s.useMemo(()=>j0(i),[i]),m=s.useCallback((I,W,K=l)=>{if(!o)return;const ae=o.getBoundingClientRect(),de=I-ae.left,A=W-ae.top;v({x:de,y:A}),h(D0(de,A,K,o,Y,O,R,$))},[o,l,Y,O,R,$]);s.useEffect(()=>{const I=[...k.map(K=>K.image.url),$,R].filter(K=>!!K);if(I.length===0){H.current=new Map,w(!0);return}let W=!1;return w(!1),B0(I).then(K=>{W||(H.current=K,w(!0))}),()=>{W=!0}},[t,$,R]),s.useEffect(()=>{if(!o)return;const I=K=>{K.stopPropagation(),f.current={x:K.clientX,y:K.clientY},m(K.clientX,K.clientY)},W=()=>{x&&m(f.current.x,f.current.y)};return o.addEventListener("mousemove",I),window.addEventListener("scroll",W,!0),()=>{o.removeEventListener("mousemove",I),window.removeEventListener("scroll",W,!0)}},[o,x,m]),s.useEffect(()=>{!o||!x||m(f.current.x,f.current.y)},[l,o,x,m]),s.useEffect(()=>{x||h("none")},[x]);const M=(I,W,K,ae={})=>{var Q,be;if(!((Q=I==null?void 0:I.image)!=null&&Q.url))return null;const de=((be=H.current.get(I.image.url))==null?void 0:be.aspectRatio)??1,A=mc(I.image.url,N,H.current),{heightPx:he}=Vr(A,de);let q=0,ce=0;return C==="same"?{x:q,y:ce}=pc(W,K,A,de):(q=ae.x??Math.random()*W,ce=ae.y??Math.random()*K,{x:q,y:ce}=ds(q,ce,W,K,A,he)),{id:p.current++,url:I.image.url,link:I.link,name:I.image.name,x:q,y:ce,xRatio:q/W,yRatio:ce/K,aspectRatio:de,widthPx:A}},E=()=>{if(!o)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height;W===0||K===0||d(ae=>ae.length===0?ae:ae.map(de=>{const A=N.sizeType==="random"?de.widthPx:mc(de.url,N,H.current),{heightPx:he}=Vr(A,de.aspectRatio);if(C==="same"){const{x:Q,y:be}=pc(W,K,A,de.aspectRatio);return{...de,x:Q,y:be,widthPx:A}}const{x:q,y:ce}=ds(de.xRatio*W,de.yRatio*K,W,K,A,he);return{...de,x:q,y:ce,widthPx:A}}))};s.useEffect(()=>{if(!o||k.length===0||!y)return;const I=o.getBoundingClientRect(),W=I.width,K=I.height,ae=M(k[0],W,K);ae&&(d([ae]),u(k.length>1?1:0))},[N,C,o,t,y]),s.useEffect(()=>{if(!o)return;E();const I=new ResizeObserver(E);return I.observe(o),window.addEventListener("resize",E),()=>{I.disconnect(),window.removeEventListener("resize",E)}},[o,C,N,l.length]),s.useEffect(()=>{V==="last One"&&d(I=>I.length>0?[I[I.length-1]]:[])},[V]);const z=I=>{if(!o||k.length===0||!y)return;const W=o.getBoundingClientRect(),K=I.clientX-W.left,ae=I.clientY-W.top;if(O==="image"&&!cu(K,ae,l))return;let de=0,A=0;C==="on Click"?(de=K,A=ae):C==="same"?(de=W.width/2,A=W.height/2):(de=Math.random()*W.width,A=Math.random()*W.height);const he=k[c%k.length],q=M(he,W.width,W.height,{x:de,y:A});if(!q)return;const ce=V==="all"?[...l,q]:[q];d(ce),u(Q=>(Q+1)%k.length),m(I.clientX,I.clientY,ce)},ne=Y==="custom"&&g!=="none";return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:T}}),a.jsxs("div",{ref:r,onClick:z,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),className:`${i}-root`,style:{cursor:ne?"none":"default"},children:[l.map(I=>a.jsx("div",{className:`${i}-wrapper`,style:{top:`${I.y}px`,left:`${I.x}px`,width:`${I.widthPx}px`,cursor:ne?"none":"default"},children:O==="area"&&I.link?a.jsx("a",{href:I.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})}):a.jsx("img",{src:I.url,alt:I.name,className:`${i}-image`})},I.id)),x&&ne&&a.jsx("div",{className:`${i}-cursor`,style:{left:`${b.x}px`,top:`${b.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const G0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16539
16563
|
import { CommonComponentProps } from '../props';
|
|
16540
16564
|
import { useScopedStyles } from '../utils/index';
|
|
16541
16565
|
|
|
@@ -17065,7 +17089,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17065
17089
|
</>
|
|
17066
17090
|
);
|
|
17067
17091
|
}
|
|
17068
|
-
`,
|
|
17092
|
+
`,q0={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"}},required:["url","name"]},link:{label:"URL",placeholder:"Enter link...",display:{type:"text-input"}}},required:["image"]},default:[{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-1.jpg",name:"Slider-1.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-2.jpg",name:"Slider-2.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",name:"Slider-3.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-4.jpg",name:"Slider-4.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-5.jpg",name:"Slider-5.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",name:"Slider-6.png"},link:""},{image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",name:"Slider-7.png"},link:""}]},settings:{sizing:"manual",properties:{imageSize:{type:"object",scope:"layout",title:"Img Size",display:{type:"toggle-cycle-numeric-input",enum:["custom","as is","random"],inputs:{custom:"single","as is":"none",random:"range"},defaultValue:700,defaultMin:400,defaultMax:700},min:0,max:9999,properties:{sizeType:{type:"string"},value:{type:"number"},min:{type:"number"},max:{type:"number"}}},cursor:{type:"string",scope:"common",title:"Cursor",display:{type:"toggle-cycle",enum:["system","custom"]}},target:{type:"string",scope:"common",title:"Target",display:{type:"toggle-cycle",enum:["area","image"]}},position:{type:"string",scope:"common",title:"Position",display:{type:"toggle-cycle",enum:["random","same","on Click"]}},visible:{type:"string",scope:"common",title:"Visible",display:{type:"toggle-cycle",enum:["all","last One"]}},defaultCursor:{type:["string","null"],scope:"common",title:"Default",display:{type:"settings-image-input",visible:!1}},hoverCursor:{type:["string","null"],scope:"common",title:"Hover",display:{type:"settings-image-input",visible:!1}}},defaults:{imageSize:{sizeType:"custom",value:700,min:400,max:700},cursor:"system",target:"area",position:"random",visible:"all",defaultCursor:null,hoverCursor:null},layoutDefaults:{m:{imageSize:{sizeType:"custom",value:500,min:400,max:700}},t:{imageSize:{sizeType:"custom",value:600,min:400,max:700}},d:{imageSize:{sizeType:"custom",value:700,min:400,max:700}}},displayRules:[{if:{name:"cursor",value:"custom"},then:{name:"properties.defaultCursor.display.visible",value:!0}},{if:{name:"cursor",value:"custom"},then:{name:"properties.hoverCursor.display.visible",value:!0}}],layout:["__componentName__","imageSize","cursor","target","position","visible","defaultCursor","hoverCursor"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",title:"",items:["imageSize"]},{type:"row",title:"",items:["cursor","target"]},{type:"row",title:"",items:["position","visible"]},{type:"row",title:"Custom Cursor",items:["defaultCursor","hoverCursor"]}]}]},X0={element:V0,id:"click-gallerie",name:"Click",category:"galleries",version:1,defaultSize:{d:{width:"100%",height:"100%"},t:{width:"100%",height:"100%"},m:{width:"100%",height:"100%"}},preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Click_Gallery.mp4"},schema:q0,sourceCode:G0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"defaultCursor"},{path:"hoverCursor"}]},fontSettingsPaths:{content:[],parameters:[]}},U0=100,Y0=70,Un="cubic-bezier(0.86, 0, 0.07, 1)";function K0(e){return`
|
|
17069
17093
|
.${e}-wrapper {
|
|
17070
17094
|
position: relative;
|
|
17071
17095
|
width: 100%;
|
|
@@ -17175,7 +17199,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17175
17199
|
display: block;
|
|
17176
17200
|
pointer-events: none;
|
|
17177
17201
|
}
|
|
17178
|
-
`}function
|
|
17202
|
+
`}function Z0(e){return e==="blur"?Y0:e==="greyscale"?U0:0}function bo(e,t=1,n=1){const i=Z0(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 gc(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function J0(e,t){return t<=1?0:(e-1+t)%t}function Q0(e,t=1){return!e||e.height===0?t:e.width/e.height}function ex(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 hc(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 du(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function fc(e,t,n){return{...du(e),[`--${n}-stage-scale`]:t}}function tx(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 nx({settings:e,content:t,isEditor:n,isPreviewMode:i}){var ie,j,B,J,te,$e,ye;const{prefix:o}=D.useScopedStyles(),r=s.useMemo(()=>K0(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,b=t??[],v=gc(b.length),[g,h]=s.useState(v.activeIndex),[f,x]=s.useState(v.backgroundIndex),[S,y]=s.useState(!1),[w,H]=s.useState(!1),[N,Y]=s.useState(null),[O,C]=s.useState(null),[V,$]=s.useState(0),[R,k]=s.useState(1),[T,m]=s.useState("none"),[M,E]=s.useState("next"),[z,ne]=s.useState({}),[I,W]=s.useState({width:0,height:0}),K=s.useRef(null),ae=s.useRef(null),de=!n||!!i,A=l??60,he=Math.max(10,Math.min(100,d??A)),q=Math.max(10,Math.min(100,c??A)),ce=Math.max(100,u),Q=bo(p),be=s.useCallback(F=>{const ve=Q0(F?z[F]:void 0);return ex(I.width,I.height,ve,he,q)},[I.height,I.width,z,q,he]);s.useEffect(()=>{const F=ae.current;if(!F)return;const ve=new ResizeObserver(([pe])=>{const{width:Z,height:me}=pe.contentRect;W({width:Z,height:me})});return ve.observe(F),()=>ve.disconnect()},[]),s.useEffect(()=>{const F=(t??[]).map(ve=>{var pe;return(pe=ve.image)==null?void 0:pe.url}).filter(ve=>!!ve);tx(F,(ve,pe)=>{ne(Z=>{var me,De;return((me=Z[ve])==null?void 0:me.width)===pe.width&&((De=Z[ve])==null?void 0:De.height)===pe.height?Z:{...Z,[ve]:pe}})})},[t]),s.useEffect(()=>{const{backgroundIndex:F,activeIndex:ve}=gc(b.length);h(ve),x(F),y(!1),H(!1),Y(null),C(null),$(0),k(1),m("none"),E("next")},[b.length,t]),s.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]);const He=s.useCallback(F=>{var ge,G,Me,_e;if(!de||S||b.length<=1)return;const ve=F==="next"?(g+1)%b.length:(g-1+b.length)%b.length,pe=be((G=(ge=b[g])==null?void 0:ge.image)==null?void 0:G.url),Z=be((_e=(Me=b[ve])==null?void 0:Me.image)==null?void 0:_e.url),me=hc(I.width,I.height,pe),De=hc(I.width,I.height,Z);K.current&&clearTimeout(K.current),E(F),H(!0),y(!0),F==="next"?(Y(g),C(ve),$(0),k(1),m(bo(p,0,1))):(x(J0(ve,b.length)),Y(ve),C(g),$(1),k(De),m(bo(p,1,De))),requestAnimationFrame(()=>{H(!1),requestAnimationFrame(()=>{F==="next"?($(1),k(me),m(bo(p,1,me))):($(0),k(1),m(bo(p,0,1)))})}),K.current=setTimeout(()=>{F==="next"&&x(g),h(ve),Y(null),C(null),y(!1)},ce)},[g,p,I.height,I.width,be,S,de,b,ce]),xe=b[g],le=f!==null?b[f]:null,ee=N!==null?b[N]:null,ue=O!==null?b[O]:null,oe=b.length<=1?0:(g-1+b.length)%b.length,Fe=b.length<=1?0:(g+1)%b.length,Ce=be((ie=xe==null?void 0:xe.image)==null?void 0:ie.url),P=be((j=ee==null?void 0:ee.image)==null?void 0:j.url),U=be((B=ue==null?void 0:ue.image)==null?void 0:B.url),X={[`--${o}-transition-ms`]:`${ce}ms`};return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:r}}),a.jsxs("div",{ref:ae,className:yt(`${o}-wrapper`,w&&`${o}-snap`,n&&!i&&`${o}-editor`),style:X,"aria-label":"Zoom gallery",children:[((J=le==null?void 0:le.image)==null?void 0:J.url)&&a.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:le.image.url,alt:"",style:{filter:Q}})}),S&&((te=ee==null?void 0:ee.image)==null?void 0:te.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${M}`),style:fc(P,R,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-effect-image`,src:ee.image.url,alt:"",style:{filter:T}})}),S&&(($e=ue==null?void 0:ue.image)==null?void 0:$e.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${M}`),style:fc(U,V,o),"aria-hidden":"true",children:a.jsx("img",{className:`${o}-image`,src:ue.image.url,alt:""})}),!S&&((ye=xe==null?void 0:xe.image)==null?void 0:ye.url)&&a.jsx("div",{className:yt(`${o}-stage`,`${o}-foreground`),style:du(Ce),children:a.jsx("img",{className:`${o}-image`,src:xe.image.url,alt:xe.image.name??""})}),de&&b.length>1&&!S&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>He("prev"),"aria-label":`Show previous image (${oe+1} of ${b.length})`}),a.jsx("button",{type:"button",className:yt(`${o}-nav`,`${o}-nav-next`),onClick:()=>He("next"),"aria-label":`Show next image (${Fe+1} of ${b.length})`})]})]})]})}const ix=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17179
17203
|
import cn from 'classnames';
|
|
17180
17204
|
import { CommonComponentProps } from '../props';
|
|
17181
17205
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17694,7 +17718,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17694
17718
|
</>
|
|
17695
17719
|
);
|
|
17696
17720
|
}
|
|
17697
|
-
`,
|
|
17721
|
+
`,ox={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:""}}]}},rx={element:nx,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:ox,sourceCode:ix,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},ax={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},sx=["hover","active"],Ha={left:"flex-start",center:"center",right:"flex-end"};function lx(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 cx(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 dx(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}`,b=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,v=`.${e}-button:hover, ${b}`,g=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
|
|
17698
17722
|
.${e}-root {
|
|
17699
17723
|
line-height: 0;
|
|
17700
17724
|
}
|
|
@@ -17857,7 +17881,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17857
17881
|
transform: translateY(-50%);
|
|
17858
17882
|
opacity: 1;
|
|
17859
17883
|
}
|
|
17860
|
-
${
|
|
17884
|
+
${v} {
|
|
17861
17885
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17862
17886
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17863
17887
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -17936,7 +17960,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17936
17960
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17937
17961
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17938
17962
|
}
|
|
17939
|
-
`}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
|
|
17963
|
+
`}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 yc(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=D.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 ux({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:r}=D.useScopedStyles(),l=s.useMemo(()=>dx(r),[r]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:b,order:v="text-icon",gap:g=0,iconSize:h=0,iconWidthC:f=0,dimensions:x=!1,padding:S={top:0,right:0,bottom:0,left:0},cornerRadius:y=0,boxShadow:w={top:0,left:0,right:0,bottom:0},boxShadowColor:H="rgba(0, 0, 0, 0)",innerBoxShadow:N={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:Y="rgba(0, 0, 0, 0)",stroke:O=0,blur:C=0,backgroundColor:V="#000000",textColor:$="#ffffff",borderColor:R="#ffffff",iconColor:k="#ffffff",hoverEffect:T="none",fontFamily:m,fontSettings:M,fontSize:E,lineHeight:z,letterSpacing:ne=0,wordSpacing:I=0,textAppearance:W,stateOverrides:K,minWidth:ae=0,minHeight:de=0,width:A=0,height:he=0}=e,q=D.buildColorVars(r,{backgroundColor:V,textColor:$,borderColor:R,iconColor:k,boxShadowColor:H,innerBoxShadowColor:Y},ax,sx,K),ce=i&&i!=="default"?`${r}-state-${i}`:"",Q=t&&!n?`${r}-editing`:"",be=T!=="none"&&(!t||n||i==="hover")?`${r}-hover-effect-${T}`:"",He=T==="reveal"||T==="swipe",xe=T==="content-roll",le=T==="reveal"&&(!t||n),ee=x===!0,oe=d==="a"?b??p:p,Fe=d==="c",Ce=d!=="b",P={fontSettings:{fontFamily:m,fontWeight:(M==null?void 0:M.fontWeight)??400,fontStyle:(M==null?void 0:M.fontStyle)??"normal"},fontSize:E??.01,lineHeight:z,letterSpacing:ne,wordSpacing:I,textAppearance:W,color:$},X={...Ce?sn(Yt(P,t)):{},[`--${r}-box-shadow-x`]:D.scalingValue(w.left,t),[`--${r}-box-shadow-y`]:D.scalingValue(w.top,t),[`--${r}-box-shadow-blur`]:D.scalingValue(w.right,t),[`--${r}-box-shadow-spread`]:D.scalingValue(w.bottom,t),[`--${r}-inner-box-shadow-x`]:D.scalingValue(N.left,t),[`--${r}-inner-box-shadow-y`]:D.scalingValue(N.top,t),[`--${r}-inner-box-shadow-blur`]:D.scalingValue(N.right,t),[`--${r}-inner-box-shadow-spread`]:D.scalingValue(N.bottom,t),[`--${r}-backdrop-blur`]:C>0?`blur(${D.scalingValue(C,t)})`:void 0,paddingTop:D.scalingValue(S.top,t),paddingRight:D.scalingValue(S.right,t),paddingBottom:D.scalingValue(S.bottom,t),paddingLeft:D.scalingValue(S.left,t),borderRadius:D.scalingValue(y,t),borderWidth:D.scalingValue(O,t),...Fe?{}:{justifyContent:Ha[oe],textAlign:oe},...Fe&&!xe?{gap:D.scalingValue(g,t)}:{},...ee?{width:D.scalingValue(A,t),height:D.scalingValue(he,t)}:{minWidth:D.scalingValue(ae,t),minHeight:D.scalingValue(de,t),...Fe?{width:"100%"}:{}}};let ie;const j={display:"inline-flex",alignItems:"center",justifyContent:Fe?Ha[oe]:Ha[d==="a"?oe:"center"],gap:Fe?D.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:oe}:{}};if(d==="b"){const te=()=>yc(r,u,h>0?"fixed":"fill",100,h,t);ie=xe?Oa(r,te,`${r}-icon-roll`,void 0,j):te()}else if(d==="c"){const te=()=>{const $e=a.jsx("span",{className:`${r}-text`,style:{textAlign:oe},children:c}),ye=yc(r,u,f>0?"fixed":"fill",100,f,t);return v==="icon-text"?a.jsxs(a.Fragment,{children:[ye,$e]}):a.jsxs(a.Fragment,{children:[$e,ye]})};ie=xe?Oa(r,te,`${r}-icon-text-roll`,void 0,j):te()}else ie=xe?Oa(r,()=>c,`${r}-label-roll`,void 0,j):He?a.jsx("span",{className:`${r}-button-inner`,children:c}):c;const B=le?te=>lx(te,r):void 0,J=le?te=>cx(te,r):void 0;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),a.jsx("div",{className:`${r}-root`,style:q,children:a.jsx("div",{className:`${r}-wrapper ${ce} ${Q}`.trim(),children:a.jsx("div",{className:`${r}-button ${be}`.trim(),style:X,onMouseEnter:B,onMouseLeave:J,role:"button",tabIndex:o||t&&!n?void 0:0,children:ie})})})]})}const px=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17940
17964
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17941
17965
|
import { CommonComponentProps } from '../props';
|
|
17942
17966
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18568,7 +18592,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18568
18592
|
</>
|
|
18569
18593
|
);
|
|
18570
18594
|
}
|
|
18571
|
-
`,ux={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},px=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],mx={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"number",scope:"layout",title:"Blur",display:{type:"numeric-input"},min:0,max:100},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...ux.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},blur:0,stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","blur","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["blur"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...px],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},gx={element:cx,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:mx,sourceCode:dx,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function hx(e){return`
|
|
18595
|
+
`,mx={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},gx=["backgroundColor","textColor","borderColor","iconColor","boxShadowColor","innerBoxShadowColor"],hx={type:"object",version:1,settings:{sizing:"auto",hasLinkParameter:!0,properties:{type:{type:"string",scope:"layout",title:"",display:{type:"radio-group"},enum:["a","b","c"]},label:{type:"string",scope:"common",title:"Label",display:{type:"label-input"}},icon:{type:["string","null"],scope:"common",title:"Icon",display:{type:"settings-image-input",visible:!1}},alignment:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"]}},alignA:{type:"string",scope:"layout",title:"Alignment",display:{type:"toggle-cycle",enum:["left","center","right"],visible:!1}},order:{type:"string",scope:"layout",title:"Order",display:{type:"toggle-cycle",enum:["text-icon","icon-text"],visible:!1}},gap:{type:"number",scope:"layout",title:"Gap",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconSize:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},iconWidthC:{type:"number",scope:"layout",title:"Icon width",display:{type:"numeric-input",visible:!1},min:0,max:9999},dimensions:{type:"boolean",scope:"layout",title:"Dimensions",display:{type:"toggle",enum:["auto","fixed"]}},padding:{type:"object",scope:"layout",title:"Padding",display:{type:"padding-controls"}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",min:0,display:{type:"numeric-input"}},boxShadow:{type:"object",scope:"layout",title:"Shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},boxShadowColor:{type:"string",scope:"common",title:"Shadow Default",titleByState:{default:"Shadow Default",hover:"Shadow Hover",active:"Shadow Active"},display:{type:"palette-color-picker"}},innerBoxShadow:{type:"object",scope:"layout",title:"Inner shadow",display:{type:"padding-controls",step:.1,decimal:!0,allowNegative:!0,nonNegativeSides:["right"],sideLetters:{top:"Y",left:"X",right:"B",bottom:"S"}}},innerBoxShadowColor:{type:"string",scope:"common",title:"Inner Shadow Default",titleByState:{default:"Inner Shadow Default",hover:"Inner Shadow Hover",active:"Inner Shadow Active"},display:{type:"palette-color-picker"}},stroke:{type:"number",scope:"layout",title:"Stroke Width",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"number",scope:"layout",title:"Blur",display:{type:"numeric-input"},min:0,max:100},backgroundColor:{type:"string",scope:"common",title:"BG Default",titleByState:{default:"BG Default",hover:"BG Hover",active:"BG Active"},display:{type:"palette-color-picker"}},textColor:{type:"string",scope:"common",title:"Text Default",titleByState:{default:"Text Default",hover:"Text Hover",active:"Text Active"},display:{type:"palette-color-picker"}},borderColor:{type:"string",scope:"common",title:"Border Default",titleByState:{default:"Border Default",hover:"Border Hover",active:"Border Active"},display:{type:"palette-color-picker"}},iconColor:{type:"string",scope:"common",title:"Icon Default",titleByState:{default:"Icon Default",hover:"Icon Hover",active:"Icon Active"},display:{type:"palette-color-picker"}},stateOverrides:{type:"object",scope:"common"},hoverEffect:{type:"string",scope:"layout",title:"Hover effect",display:{type:"toggle-cycle",enum:["none","scale-up","lift","reveal","swipe","content-roll"]}},fontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},fontSettings:{...mx.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},fontSize:{type:"number",scope:"layout",title:"Font size",display:{type:"font-size"}},lineHeight:{type:"number",scope:"layout",title:"Line height",display:{type:"line-height-input"}},letterSpacing:{type:"number",scope:"layout",title:"Letter spacing",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",scope:"layout",title:"Word spacing",display:{type:"word-spacing-input"}},textAppearance:{type:"object",scope:"layout",title:"Text appearance",display:{type:"text-appearance"}},minWidth:{type:"number",scope:"layout",title:"Min width",display:{type:"numeric-input"},min:0,max:9999},minHeight:{type:"number",scope:"layout",title:"Min height",display:{type:"numeric-input"},min:0,max:9999},width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input",visible:!1},min:0,max:9999},height:{type:"number",scope:"layout",title:"Height",display:{type:"numeric-input",visible:!1},min:0,max:9999}},defaults:{label:"Button",icon:"https://cdn.cntrl.site/projects/01JJKT02AWY2FGN2QJ7A173RNZ/articles-assets/01KY78A0YVT403B042HVWWTHBC.svg",boxShadowColor:"#000000",innerBoxShadowColor:"#000000",backgroundColor:"#2E12F0",textColor:"#ffffff",borderColor:"#ffffff",iconColor:"#ffffff",fontFamily:"Arial",fontSettings:{fontWeight:400,fontStyle:"normal"},blur:0,stateOverrides:{hover:{backgroundColor:"#3642EF"},active:{backgroundColor:"#475FFF"}}},layoutDefaults:{m:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/375,right:20/375,bottom:10/375,left:20/375},minWidth:0/375,minHeight:0/375,width:100/375,height:100/375,cornerRadius:20/375,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/375,gap:10/375,iconWidthC:16/375,fontSize:16/375,lineHeight:16/375,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},t:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/768,right:20/768,bottom:10/768,left:20/768},minWidth:0/768,minHeight:0/768,width:100/768,height:100/768,cornerRadius:20/768,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/768,gap:10/768,iconWidthC:16/768,fontSize:16/768,lineHeight:16/768,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},d:{type:"a",alignment:"center",alignA:"center",order:"text-icon",dimensions:!1,padding:{top:10/1440,right:20/1440,bottom:10/1440,left:20/1440},minWidth:0/1440,minHeight:0/1440,width:100/1440,height:100/1440,cornerRadius:20/1440,boxShadow:{top:0,left:0,right:0,bottom:0},innerBoxShadow:{top:0,left:0,right:0,bottom:0},stroke:0,blur:0,hoverEffect:"none",iconSize:16/1440,gap:10/1440,iconWidthC:16/1440,fontSize:16/1440,lineHeight:16/1440,letterSpacing:0,wordSpacing:0,textAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}},layout:["__componentName__","type","label","icon","alignment","order","gap","iconSize","iconWidthC","hoverEffect",{type:"row",title:"",items:["dimensions","padding"]},"cornerRadius","blur","boxShadow","boxShadowColor","innerBoxShadow","innerBoxShadowColor",{type:"row",title:"",items:["stroke","borderColor"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]}],displayRules:[{if:{name:"type",value:"a"},then:{name:"properties.icon.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignment.display.visible",value:!1}},{if:{name:"type",value:"a"},then:{name:"properties.alignA.display.visible",value:!0}},{if:{name:"type",value:"a"},then:{name:"properties.iconColor.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"b"},then:{name:"properties.label.display.visible",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontFamily.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSettings.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.fontSize.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.lineHeight.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.letterSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.wordSpacing.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.textAppearance.display.enabled",value:!1}},{if:{name:"type",value:"b"},then:{name:"properties.iconSize.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.icon.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.order.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.iconWidthC.display.visible",value:!0}},{if:{name:"type",value:"c"},then:{name:"properties.gap.display.visible",value:!0}},{if:{name:"stroke",value:0},then:{name:"properties.borderColor.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minWidth.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.minHeight.display.visible",value:!1}},{if:{name:"dimensions",value:!0},then:{name:"properties.width.display.visible",value:!0}},{if:{name:"dimensions",value:!0},then:{name:"properties.height.display.visible",value:!0}}]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",title:"",items:["label","icon","iconSize","alignA"]},{type:"row",title:"",items:["alignment","order"]},{type:"row",title:"",items:["gap","iconWidthC"]},{type:"row",title:"",items:["dimensions","padding"]},{type:"row",title:"",items:["minWidth","minHeight","width","height"]},{type:"row",title:"",items:["hoverEffect","cornerRadius"]},{type:"row",title:"",items:["blur"]},{type:"row",title:"",items:["boxShadow"]},{type:"row",title:"",items:["innerBoxShadow"]},{type:"row",title:"",items:["stroke"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["__componentName__","fontFamily","fontSettings",{type:"row",title:"",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]},"textAppearance"]}],paletteBookmark:{items:[...gx],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],hover:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"],active:["textColor","backgroundColor","boxShadowColor","innerBoxShadowColor","borderColor","iconColor"]}},states:["default","hover","active"]},fx={element:ux,id:"simple-button",name:"Simple Button",category:"ui-elements",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/button-preview.png"},schema:hx,sourceCode:px,assetsPaths:{content:[],parameters:[{path:"icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]},fontRelations:{fontSettings:"fontFamily"}};function yx(e){return`
|
|
18572
18596
|
.${e}-titles-row {
|
|
18573
18597
|
position: relative;
|
|
18574
18598
|
flex: 0 1 auto;
|
|
@@ -18766,7 +18790,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18766
18790
|
pointer-events: auto;
|
|
18767
18791
|
flex-shrink: 0;
|
|
18768
18792
|
}
|
|
18769
|
-
`}const Rn=500,wo=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",fx=72,yx=50,vx=1e4,xx=650,bx=500;function wx(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 lu(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 Sx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?lu(i,n):null}function $x(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 Lo(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 yc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Lo(e,i,n)}const Cx=.03;function cu(e){return e.width*Cx}const Da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function vc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Tx(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 Lx(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:us(e,t.width,t.height)}function Rx(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 Ix(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 Ex({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 so(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=cu(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=so(e,t,n);return{...i,left:2*i.left-e.left}}function Mx(e,t,n){const{left:i,width:o}=n,r=cu(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 du(e,t,n,i){const o=so(e,"left",i),r=so(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 Px(e,t,n,i){const{start:o,end:r}=du(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function kx(e,t,n){const i=so(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 Ax({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 xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Fx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),v=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),D=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),I=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),R=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Da),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[We,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Ne,Te]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[Ce,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],ke=G?da(G):!1,Fe=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,nt=s.useCallback((_,Ee)=>t.length<=1?null:t[(_+Ee+t.length)%t.length]??null,[t]),je=at?Lo(u,p,-1):nt(n,-1),$e=at?Lo(u,p,1):nt(n,1),Ae=Ne===-1&&Fe?at&&P!==null?Lo(u,P,-1):X!==null?nt(X,-1):null:null,Be=Ne===1&&Fe?at&&P!==null?Lo(u,P,1):X!==null?nt(X,1):null:null,Ke=Ae&&Ae.url!==(je==null?void 0:je.url)?Ae:null,Ie=Be&&Be.url!==($e==null?void 0:$e.url)?Be:null,ze=je&&Je?(()=>{const _=at?yc(u,p,-1):t.length>2?nt((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=$e&&Je?(()=>{const _=at?yc(u,p,1):t.length>2?nt((n+1)%t.length,1):null;return _&&_.url!==$e.url?_:null})():null,Re=Ke??ze,qe=Ie??se,we=s.useCallback((_,Ee,_e)=>{if(!_||!Ee||!_e)return;const Ve=H.current,dt=Ve.get(_);(dt==null?void 0:dt.width)===Ee&&(dt==null?void 0:dt.height)===_e||(Ve.set(_,{width:Ee,height:_e}),Y(At=>At+1))},[]),Le=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ee=H.current.get(_.url);return Lx(v.current,Ee)},[N,q]),Ze=s.useCallback(()=>{if(!G)return;const _=Le(G);if(_){de(_);return}const Ee=v.current;Ee&&de(vc(Ee))},[G,Le]),Oe=s.useCallback(_=>{if(at){const Ee=u.length;U((p+_+Ee)%Ee),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ue=s.useCallback(_=>{T.current=_,oe(_)},[]),He=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{He(),m.current=window.setTimeout(()=>{He(),Ue(!1)},wo+32)},[He,Ue]),it=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Da.width,height:typeof window<"u"?window.innerHeight:Da.height});return}const Ee=_.getBoundingClientRect();he({left:Ee.left,top:Ee.top,width:Ee.width,height:Ee.height})},[]),tt=s.useCallback((_,Ee)=>{if(Fe){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Ne!==null){const _e=Le(_);if(!_e)return;const{x:Ve,y:dt}=Px(_e,Ee,Ne,A);return`translate(${Ve}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[Fe,ve,ue,le,Ne,A,Le]),St=s.useCallback(()=>{const _=M.current;M.current=null,He(),Ue(!1),Te(null),U(null),ie(null),ee(0),pe(!1),I.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[He,Ue,f,x]),$t=s.useCallback(()=>{He(),m.current=window.setTimeout(()=>{M.current!==null&&St()},wo+32)},[He,St]),Rt=s.useCallback(()=>{He(),M.current=null,Ue(!1),Te(null),U(null),ie(null),ee(0),pe(!1),I.current=!1,V.current=0,$.current="none"},[He,Ue]),yt=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,St();return}Rt()}He(),Oe(_),M.current=_,Te(_),Ue(!0),$t()}},[Je,ae,St,Rt,He,Oe,Ue,$t]);z.current=yt;const pt=s.useCallback(()=>{ne.current=null,K.current=!1,R.current!==null&&(window.clearInterval(R.current),R.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),kt=s.useCallback(_=>{R.current!==null&&window.clearInterval(R.current);const Ee=K.current?bx:xx;R.current=window.setInterval(()=>{z.current(_)},Ee)},[]),Wt=s.useCallback(_=>{ne.current!==_&&(pt(),ne.current=_,K.current=!1,z.current(_),kt(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,kt(_))},vx))},[pt,kt]),bt=s.useCallback(()=>{const _=v.current;if(!_)return;const Ee=G==null?void 0:G.url,_e=Ee?H.current.get(Ee):void 0;if(_e!=null&&_e.width&&(_e!=null&&_e.height)){de(us(_,_e.width,_e.height));return}const Ve=w.current;if(Ve&&Ee&&(Ve.src===Ee||Ve.currentSrc===Ee)){const{width:At,height:lt}=Tx(Ve);if(At&<){we(Ee,At,lt),de(us(_,At,lt));return}}const dt=vc(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,we]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Gt=s.useCallback(()=>{it(),bt(),ce(_=>_+1)},[it,bt]);s.useEffect(()=>{Gt();const _=v.current,Ee=S.current,_e=new ResizeObserver(()=>Gt());return _&&_e.observe(_),Ee&&_e.observe(Ee),window.addEventListener("resize",Gt),()=>{_e.disconnect(),window.removeEventListener("resize",Gt)}},[Gt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Ze()},[Ze,N]),s.useEffect(()=>{const _=new Set,Ee=[],_e=Ve=>{!(Ve!=null&&Ve.url)||_.has(Ve.url)||(_.add(Ve.url),Ee.push(Ve))};t.forEach(_e),u.forEach(Ve=>Ve.items.forEach(_e)),Ee.forEach(Ve=>{H.current.has(Ve.url)||Rx(Ve,we)})},[t,u,we]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!y){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,y]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Rn);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{He()},[He]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(He(),M.current=null,Te(null),U(null),ie(null),xe(0),ee(0),Ue(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",I.current=!1,D.current=null,k.current=!1,w.current=null,Ze(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ue,He,Ze]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!$e){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,$e==null?void 0:$e.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=xt=>{xt.stopPropagation(),xt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ee=lt=>{const xt=lt<0?1:-1;He(),Oe(xt),M.current=xt,Te(xt),Ue(!0),$t()},_e=lt=>{if(Math.abs(lt)>yx&&Je){Ee(lt);return}M.current=null,Te(null),U(null),ie(null),Ue(!0),ee(0),Qe()},Ve=lt=>{if(lt.touches.length!==1||T.current)return;const xt=lt.touches[0];k.current=!0,D.current={x:xt.clientX,y:xt.clientY},$.current="none",V.current=0,I.current=!1},dt=lt=>{if(!D.current||lt.touches.length!==1||T.current)return;const xt=lt.touches[0],zt=xt.clientX-D.current.x,Et=xt.clientY-D.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Et)<10)return;if(Math.abs(zt)>Math.abs(Et)){if(!Je)return;$.current="horizontal"}else if(Et>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){I.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(I.current=!0,pe(!0),C.current=Et,xe(Et),lt.preventDefault())},At=()=>{if(!D.current)return;const lt=$.current,xt=I.current;if(xt&<==="horizontal")_e(V.current),_();else if(xt&<==="vertical"){const zt=C.current;if(rt&&zt>fx){const Et=window.innerHeight;C.current=Et,me(!0),xe(Et),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(_e(V.current),_());D.current=null,$.current="none",V.current=0,I.current=!1,pe(!1)};return document.addEventListener("touchstart",Ve,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",At),document.addEventListener("touchcancel",At),()=>{document.removeEventListener("touchstart",Ve),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",At),document.removeEventListener("touchcancel",At)}},[Q,Je,Ue,Qe,He,rt,$t,Oe]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??y??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,y,ae]);s.useEffect(()=>{const _=Ve=>{if(Ve.key==="Escape"){if(r&&d||Q==="closing")return;pt(),Zt();return}if(Ve.key!=="ArrowLeft"&&Ve.key!=="ArrowRight"||Q!=="open"||!Je)return;Ve.preventDefault();const dt=Ve.key==="ArrowLeft"?-1:1;Ve.repeat&&ne.current===dt||Wt(dt)},Ee=Ve=>{if(Ve.key!=="ArrowLeft"&&Ve.key!=="ArrowRight")return;const dt=Ve.key==="ArrowLeft"?-1:1;ne.current===dt&&pt()},_e=()=>{pt()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ee),window.addEventListener("blur",_e),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ee),window.removeEventListener("blur",_e),pt()}},[Q,r,d,Zt,Je,Wt,pt]),s.useEffect(()=>{Q!=="open"&&pt()},[Q,pt]);const en=()=>{Q==="closing"||l||Zt()},Lt=Q==="open",Ht=Q==="closing",nn=We>0?Math.max(0,1-We/500):1,ut=We>0?Math.max(.35,1-We/500):1,Me=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){St();return}He(),Ue(!1)}},[He,Ue,St]),Ge=Q==="closing"?J??y:y,st=Ge&&ae&&(Q==="opening"||Ht)?wx(Ge,ae):void 0,gt=Fe&&G?tt(G,"center"):We>0?`translateY(${We}px)`:st,vt=ae?vr(ae,A):null,It=!!(Ge&&ae),ft=It&&(Q==="closing"||Q==="open"&&j),Bt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:We>0?ut:It?1:Q==="opening"||Ht?0:1,transition:ve&&!ue?"none":ue?`transform ${wo}ms ${gn}`:Z?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:ft?`transform ${Rn}ms ${gn}`:Q==="opening"||Ht?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:ke&&Lt&&!Fe?"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&&!Fe?"auto":"none"},Ft=(_,Ee,_e="adjacent")=>{const Ve=Le(_);if(!Ve)return{display:"none"};const dt=_e==="far"?Ee==="left"?"far-left":"far-right":Ee==="left"?"left-adjacent":"right-adjacent",{start:At}=Ne!==null?du(Ve,dt,Ne,A):{start:_e==="far"?Gr(Ve,Ee,A):so(Ve,Ee,A)},lt=vr(At,A),xt=tt(_,dt),zt=!Fe&&_e==="adjacent"&&Lt&&!Ce?kx(Ve,Ee,A):null,Et=_e==="far"&&Fe&&Ne===(Ee==="left"?-1:1),on=ve&&!ue?!1:ue,pn=_e==="adjacent"&&Lt&&Ce&&!Fe;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:xt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:_e==="far"?Lt&&Et?1:0:Lt?1:0,transition:on?_e==="far"?`transform ${wo}ms ${gn}`:`transform ${wo}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:Q==="opening"||Ht?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ee)=>{const _e=Le(_);return _e?Mx(so(_e,Ee,A),Ee,A):null},Xt=_=>Ee=>{if(!l){if(k.current){k.current=!1;return}Ee.stopPropagation(),yt(_)}},Dt=je?qt(je,"left"):null,jt=$e?qt($e,"right"):null,Ot=Dt?vr(Dt,A):null,Ct=jt?vr(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Lt?nn:0,transition:ve?"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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{height:"10%"}})]}),a.jsx("div",{style:{position:"absolute",inset:0,opacity:Lt?1:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Vd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Lt&&Re&&a.jsx(xr,{media:Re,style:Ft(Re,"left","far"),onMeasure:we,onTransitionEnd:Me},`far-prev-${Re.url}`),Lt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:je,style:Ft(je,"left"),onMeasure:we,onTransitionEnd:Me},`prev-${je.url}`),Ot&&a.jsx("div",{style:{position:"absolute",top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Lt&&$e&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:$e,style:Ft($e,"right"),onMeasure:we,onTransitionEnd:Me},`next-${$e.url}`),Ct&&a.jsx("div",{style:{position:"absolute",top:Ct.top,left:Ct.left,width:Ct.width,height:Ct.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Lt&&qe&&a.jsx(xr,{media:qe,style:Ft(qe,"right","far"),onMeasure:we,onTransitionEnd:Me},`far-next-${qe.url}`),ae&&G&&(ke?a.jsx(Ax,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Bt,videoStyle:_t,onLoadedMetadata:bt,onTransitionEnd:Me},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Me,style:Bt},`${n}-${G.url}`))]})}const _x=20,Wx=.18;function Nx(e){return`
|
|
18793
|
+
`}const Rn=500,wo=650,gn="cubic-bezier(0.22, 1, 0.36, 1)",vx=72,xx=50,bx=1e4,wx=650,Sx=500;function $x(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 uu(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 Cx(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?uu(i,n):null}function Tx(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 Lo(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 vc(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return Lo(e,i,n)}const Lx=.03;function pu(e){return e.width*Lx}const Da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function vr(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function xc(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Rx(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 Ix(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:us(e,t.width,t.height)}function Ex(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 Mx(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 Px({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 so(e,t,n){const{width:i,height:o,top:r}=e,{left:l,width:d}=n,c=pu(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=so(e,t,n);return{...i,left:2*i.left-e.left}}function kx(e,t,n){const{left:i,width:o}=n,r=pu(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 mu(e,t,n,i){const o=so(e,"left",i),r=so(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 Ax(e,t,n,i){const{start:o,end:r}=mu(e,t,n,i);return{x:r.left-o.left,y:r.top-o.top}}function Fx(e,t,n){const i=so(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 _x({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 xr({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return da(e)?a.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const r=o.currentTarget;r.videoWidth>0&&r.videoHeight>0&&(i==null||i(e.url,r.videoWidth,r.videoHeight))},onTransitionEnd:n}):a.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const r=o.currentTarget;r.naturalWidth>0&&r.naturalHeight>0&&(i==null||i(e.url,r.naturalWidth,r.naturalHeight))},onTransitionEnd:n})}function Wx({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:b,sourceRect:v,resolveCloseSourceRect:g,onClose:h,onPrev:f,onNext:x}){const S=s.useRef(null),y=s.useRef(null),w=s.useRef(null),H=s.useRef(new Map),[N,Y]=s.useState(0),O=s.useRef(null),C=s.useRef(0),V=s.useRef(0),$=s.useRef("none"),R=s.useRef(!1),k=s.useRef(!1),T=s.useRef(!1),m=s.useRef(null),M=s.useRef(null),E=s.useRef(null),z=s.useRef(()=>{}),ne=s.useRef(null),I=s.useRef(null),W=s.useRef(null),K=s.useRef(!1),[ae,de]=s.useState(null),[A,he]=s.useState(Da),[q,ce]=s.useState(0),[Q,be]=s.useState("opening"),[He,xe]=s.useState(0),[le,ee]=s.useState(0),[ue,oe]=s.useState(!1),[Fe,Ce]=s.useState(null),[P,U]=s.useState(null),[X,ie]=s.useState(null),[j,B]=s.useState(!1),[J,te]=s.useState(null),[$e,ye]=s.useState(!1),F=s.useRef(!1),[ve,pe]=s.useState(!1),[Z,me]=s.useState(!1),De=s.useRef(n),ge=s.useRef(void 0),G=t[n],Me=G?da(G):!1,_e=le!==0||ue,rt=!l&&(!r||!!d),Je=c&&!l,at=u.length>1,it=s.useCallback((_,Ie)=>t.length<=1?null:t[(_+Ie+t.length)%t.length]??null,[t]),je=at?Lo(u,p,-1):it(n,-1),Se=at?Lo(u,p,1):it(n,1),We=Fe===-1&&_e?at&&P!==null?Lo(u,P,-1):X!==null?it(X,-1):null:null,Be=Fe===1&&_e?at&&P!==null?Lo(u,P,1):X!==null?it(X,1):null:null,Ze=We&&We.url!==(je==null?void 0:je.url)?We:null,Le=Be&&Be.url!==(Se==null?void 0:Se.url)?Be:null,Ve=je&&Je?(()=>{const _=at?vc(u,p,-1):t.length>2?it((n-1+t.length)%t.length,-1):null;return _&&_.url!==je.url?_:null})():null,se=Se&&Je?(()=>{const _=at?vc(u,p,1):t.length>2?it((n+1)%t.length,1):null;return _&&_.url!==Se.url?_:null})():null,Te=Ze??Ve,Xe=Le??se,ze=s.useCallback((_,Ie,Ne)=>{if(!_||!Ie||!Ne)return;const Ge=H.current,dt=Ge.get(_);(dt==null?void 0:dt.width)===Ie&&(dt==null?void 0:dt.height)===Ne||(Ge.set(_,{width:Ie,height:Ne}),Y(Ft=>Ft+1))},[]),Re=s.useCallback(_=>{if(!(_!=null&&_.url))return null;const Ie=H.current.get(_.url);return Ix(y.current,Ie)},[N,q]),Pe=s.useCallback(()=>{if(!G)return;const _=Re(G);if(_){de(_);return}const Ie=y.current;Ie&&de(xc(Ie))},[G,Re]),Ae=s.useCallback(_=>{if(at){const Ie=u.length;U((p+_+Ie)%Ie),ie(null);return}t.length>1&&(ie((n+_+t.length)%t.length),U(null))},[at,u.length,p,t.length,n]),Ke=s.useCallback(_=>{T.current=_,oe(_)},[]),Oe=s.useCallback(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]),Qe=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{Oe(),Ke(!1)},wo+32)},[Oe,Ke]),tt=s.useCallback(()=>{const _=S.current;if(!_){he({left:0,top:0,width:typeof window<"u"?window.innerWidth:Da.width,height:typeof window<"u"?window.innerHeight:Da.height});return}const Ie=_.getBoundingClientRect();he({left:Ie.left,top:Ie.top,width:Ie.width,height:Ie.height})},[]),nt=s.useCallback((_,Ie)=>{if(_e){if(ve&&!ue)return`translate(${le}px, 0px)`;if(ue&&Fe!==null){const Ne=Re(_);if(!Ne)return;const{x:Ge,y:dt}=Ax(Ne,Ie,Fe,A);return`translate(${Ge}px, ${dt}px)`}if(ue)return"translate(0px, 0px)"}},[_e,ve,ue,le,Fe,A,Re]),xt=s.useCallback(()=>{const _=M.current;M.current=null,Oe(),Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none",_===-1?f():_===1&&x()},[Oe,Ke,f,x]),It=s.useCallback(()=>{Oe(),m.current=window.setTimeout(()=>{M.current!==null&&xt()},wo+32)},[Oe,xt]),Tt=s.useCallback(()=>{Oe(),M.current=null,Ke(!1),Ce(null),U(null),ie(null),ee(0),pe(!1),R.current=!1,V.current=0,$.current="none"},[Oe,Ke]),ut=s.useCallback(_=>{if(!(!Je||!ae)){if(T.current){if(M.current===_){E.current=_,xt();return}Tt()}Oe(),Ae(_),M.current=_,Ce(_),Ke(!0),It()}},[Je,ae,xt,Tt,Oe,Ae,Ke,It]);z.current=ut;const ft=s.useCallback(()=>{ne.current=null,K.current=!1,I.current!==null&&(window.clearInterval(I.current),I.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),Et=s.useCallback(_=>{I.current!==null&&window.clearInterval(I.current);const Ie=K.current?Sx:wx;I.current=window.setInterval(()=>{z.current(_)},Ie)},[]),Lt=s.useCallback(_=>{ne.current!==_&&(ft(),ne.current=_,K.current=!1,z.current(_),Et(_),W.current=window.setTimeout(()=>{W.current=null,ne.current===_&&(K.current=!0,Et(_))},bx))},[ft,Et]),bt=s.useCallback(()=>{const _=y.current;if(!_)return;const Ie=G==null?void 0:G.url,Ne=Ie?H.current.get(Ie):void 0;if(Ne!=null&&Ne.width&&(Ne!=null&&Ne.height)){de(us(_,Ne.width,Ne.height));return}const Ge=w.current;if(Ge&&Ie&&(Ge.src===Ie||Ge.currentSrc===Ie)){const{width:Ft,height:lt}=Rx(Ge);if(Ft&<){ze(Ie,Ft,lt),de(us(_,Ft,lt));return}}const dt=xc(_);!dt.width||!dt.height||de(dt)},[G==null?void 0:G.url,ze]),Nt=s.useCallback(_=>{if(w.current=_,!!_){if(_ instanceof HTMLVideoElement){_.readyState>=1&&_.videoWidth>0&&bt();return}_.complete&&_.naturalWidth>0&&bt()}},[bt]),Bt=s.useCallback(()=>{tt(),bt(),ce(_=>_+1)},[tt,bt]);s.useEffect(()=>{Bt();const _=y.current,Ie=S.current,Ne=new ResizeObserver(()=>Bt());return _&&Ne.observe(_),Ie&&Ne.observe(Ie),window.addEventListener("resize",Bt),()=>{Ne.disconnect(),window.removeEventListener("resize",Bt)}},[Bt,n,b]),s.useLayoutEffect(()=>{if(!G)return;const _=w.current;if(_){if(_ instanceof HTMLImageElement&&_.complete&&_.naturalWidth>0){bt();return}_ instanceof HTMLVideoElement&&_.readyState>=1&&_.videoWidth>0&&bt()}},[G==null?void 0:G.url,n,bt]),s.useEffect(()=>{Pe()},[Pe,N]),s.useEffect(()=>{const _=new Set,Ie=[],Ne=Ge=>{!(Ge!=null&&Ge.url)||_.has(Ge.url)||(_.add(Ge.url),Ie.push(Ge))};t.forEach(Ne),u.forEach(Ge=>Ge.items.forEach(Ne)),Ie.forEach(Ge=>{H.current.has(Ge.url)||Ex(Ge,ze)})},[t,u,ze]),s.useEffect(()=>{if(Q!=="opening"||!ae)return;if(!v){be("open");return}B(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{B(!0),be("open")})});return()=>cancelAnimationFrame(_)},[Q,ae,v]),s.useEffect(()=>{if(Q!=="closing")return;const _=setTimeout(()=>h(),Rn);return()=>clearTimeout(_)},[Q,h]),s.useEffect(()=>()=>{Oe()},[Oe]),s.useLayoutEffect(()=>{De.current===n&&ge.current===(G==null?void 0:G.url)||(Oe(),M.current=null,Ce(null),U(null),ie(null),xe(0),ee(0),Ke(!1),me(!1),pe(!1),C.current=0,V.current=0,$.current="none",R.current=!1,O.current=null,k.current=!1,w.current=null,Pe(),De.current=n,ge.current=G==null?void 0:G.url)},[n,G==null?void 0:G.url,Ke,Oe,Pe]),s.useLayoutEffect(()=>{const _=E.current;_!==null&&(E.current=null,requestAnimationFrame(()=>{z.current(_)}))},[n,p,G==null?void 0:G.url]),s.useLayoutEffect(()=>{if(Q==="opening"){F.current=!1,ye(!1);return}if(Q!=="open"||F.current)return;if(!je&&!Se){F.current=!0;return}ye(!1);const _=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(!0),F.current=!0})});return()=>cancelAnimationFrame(_)},[Q,je==null?void 0:je.url,Se==null?void 0:Se.url]),s.useEffect(()=>{if(Q!=="open")return;const _=()=>{const lt=wt=>{wt.stopPropagation(),wt.preventDefault(),document.removeEventListener("click",lt,!0)};document.addEventListener("click",lt,!0)},Ie=lt=>{const wt=lt<0?1:-1;Oe(),Ae(wt),M.current=wt,Ce(wt),Ke(!0),It()},Ne=lt=>{if(Math.abs(lt)>xx&&Je){Ie(lt);return}M.current=null,Ce(null),U(null),ie(null),Ke(!0),ee(0),Qe()},Ge=lt=>{if(lt.touches.length!==1||T.current)return;const wt=lt.touches[0];k.current=!0,O.current={x:wt.clientX,y:wt.clientY},$.current="none",V.current=0,R.current=!1},dt=lt=>{if(!O.current||lt.touches.length!==1||T.current)return;const wt=lt.touches[0],zt=wt.clientX-O.current.x,Pt=wt.clientY-O.current.y;if($.current==="none"){if(Math.abs(zt)<10&&Math.abs(Pt)<10)return;if(Math.abs(zt)>Math.abs(Pt)){if(!Je)return;$.current="horizontal"}else if(Pt>0){if(!rt)return;$.current="vertical"}else return}if($.current==="horizontal"){R.current=!0,pe(!0),V.current=zt,ee(zt),lt.preventDefault();return}$.current==="vertical"&&(R.current=!0,pe(!0),C.current=Pt,xe(Pt),lt.preventDefault())},Ft=()=>{if(!O.current)return;const lt=$.current,wt=R.current;if(wt&<==="horizontal")Ne(V.current),_();else if(wt&<==="vertical"){const zt=C.current;if(rt&&zt>vx){const Pt=window.innerHeight;C.current=Pt,me(!0),xe(Pt),be("closing")}else C.current=0,xe(0);_()}else lt==="horizontal"&&Math.abs(V.current)>0&&(Ne(V.current),_());O.current=null,$.current="none",V.current=0,R.current=!1,pe(!1)};return document.addEventListener("touchstart",Ge,{passive:!0}),document.addEventListener("touchmove",dt,{passive:!1}),document.addEventListener("touchend",Ft),document.addEventListener("touchcancel",Ft),()=>{document.removeEventListener("touchstart",Ge),document.removeEventListener("touchmove",dt),document.removeEventListener("touchend",Ft),document.removeEventListener("touchcancel",Ft)}},[Q,Je,Ke,Qe,Oe,rt,It,Ae]);const Zt=s.useCallback(()=>{const _=(g==null?void 0:g())??v??null;_&&ae&&(te(_),B(!0)),be("closing")},[g,v,ae]);s.useEffect(()=>{const _=Ge=>{if(Ge.key==="Escape"){if(r&&d||Q==="closing")return;ft(),Zt();return}if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight"||Q!=="open"||!Je)return;Ge.preventDefault();const dt=Ge.key==="ArrowLeft"?-1:1;Ge.repeat&&ne.current===dt||Lt(dt)},Ie=Ge=>{if(Ge.key!=="ArrowLeft"&&Ge.key!=="ArrowRight")return;const dt=Ge.key==="ArrowLeft"?-1:1;ne.current===dt&&ft()},Ne=()=>{ft()};return window.addEventListener("keydown",_),window.addEventListener("keyup",Ie),window.addEventListener("blur",Ne),()=>{window.removeEventListener("keydown",_),window.removeEventListener("keyup",Ie),window.removeEventListener("blur",Ne),ft()}},[Q,r,d,Zt,Je,Lt,ft]),s.useEffect(()=>{Q!=="open"&&ft()},[Q,ft]);const en=()=>{Q==="closing"||l||Zt()},Rt=Q==="open",Ot=Q==="closing",nn=He>0?Math.max(0,1-He/500):1,pt=He>0?Math.max(.35,1-He/500):1,Ee=s.useCallback(_=>{if(!(_.propertyName!=="transform"||!T.current)){if(M.current!==null){xt();return}Oe(),Ke(!1)}},[Oe,Ke,xt]),qe=Q==="closing"?J??v:v,st=qe&&ae&&(Q==="opening"||Ot)?$x(qe,ae):void 0,mt=_e&&G?nt(G,"center"):He>0?`translateY(${He}px)`:st,vt=ae?vr(ae,A):null,Mt=!!(qe&&ae),gt=Mt&&(Q==="closing"||Q==="open"&&j),Vt={position:"absolute",top:vt==null?void 0:vt.top,left:vt==null?void 0:vt.left,width:vt==null?void 0:vt.width,height:vt==null?void 0:vt.height,objectFit:"contain",transformOrigin:"top left",transform:mt,opacity:He>0?pt:Mt?1:Q==="opening"||Ot?0:1,transition:ve&&!ue?"none":ue?`transform ${wo}ms ${gn}`:Z?`transform ${Rn}ms ${gn}, opacity ${Rn}ms ${gn}`:gt?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:Me&&Rt&&!_e?"auto":"none",touchAction:Me&&Rt?"none":void 0,zIndex:1,overflow:Me?"hidden":void 0},Wt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Rt&&!_e?"auto":"none"},_t=(_,Ie,Ne="adjacent")=>{const Ge=Re(_);if(!Ge)return{display:"none"};const dt=Ne==="far"?Ie==="left"?"far-left":"far-right":Ie==="left"?"left-adjacent":"right-adjacent",{start:Ft}=Fe!==null?mu(Ge,dt,Fe,A):{start:Ne==="far"?Gr(Ge,Ie,A):so(Ge,Ie,A)},lt=vr(Ft,A),wt=nt(_,dt),zt=!_e&&Ne==="adjacent"&&Rt&&!$e?Fx(Ge,Ie,A):null,Pt=Ne==="far"&&_e&&Fe===(Ie==="left"?-1:1),on=ve&&!ue?!1:ue,pn=Ne==="adjacent"&&Rt&&$e&&!_e;return{position:"absolute",top:lt.top,left:lt.left,width:lt.width,height:lt.height,objectFit:"contain",transform:wt??(zt?`translate(${zt.x}px, ${zt.y}px)`:void 0),opacity:Ne==="far"?Rt&&Pt?1:0:Rt?1:0,transition:on?Ne==="far"?`transform ${wo}ms ${gn}`:`transform ${wo}ms ${gn}, opacity ${Rn}ms ${gn}`:pn?`transform ${Rn}ms ${gn}`:Q==="opening"||Ot?`opacity ${Rn}ms ${gn}`:"none",pointerEvents:"none",zIndex:1}},qt=(_,Ie)=>{const Ne=Re(_);return Ne?kx(so(Ne,Ie,A),Ie,A):null},Xt=_=>Ie=>{if(!l){if(k.current){k.current=!1;return}Ie.stopPropagation(),ut(_)}},Dt=je?qt(je,"left"):null,jt=Se?qt(Se,"right"):null,Ht=Dt?vr(Dt,A):null,$t=jt?vr(jt,A):null;return a.jsxs("div",{ref:S,className:[`${e}-lightbox`,r?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Q==="open"?"none":void 0},onClick:en,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Rt?nn:0,transition:ve?"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:Rt?1:0,transition:ve?"none":`opacity ${Rn}ms ${gn}`,pointerEvents:"none"},children:a.jsx(Xd,{prefix:e,entry:i,settings:o,isEditor:r,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Rt&&Te&&a.jsx(xr,{media:Te,style:_t(Te,"left","far"),onMeasure:ze,onTransitionEnd:Ee},`far-prev-${Te.url}`),Rt&&je&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:je,style:_t(je,"left"),onMeasure:ze,onTransitionEnd:Ee},`prev-${je.url}`),Ht&&a.jsx("div",{style:{position:"absolute",top:Ht.top,left:Ht.left,width:Ht.width,height:Ht.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(-1)})]}),Rt&&Se&&a.jsxs(a.Fragment,{children:[a.jsx(xr,{media:Se,style:_t(Se,"right"),onMeasure:ze,onTransitionEnd:Ee},`next-${Se.url}`),$t&&a.jsx("div",{style:{position:"absolute",top:$t.top,left:$t.left,width:$t.width,height:$t.height,cursor:l||ve?"default":"pointer",pointerEvents:l||ve?"none":"auto",zIndex:3},onClick:Xt(1)})]}),Rt&&Xe&&a.jsx(xr,{media:Xe,style:_t(Xe,"right","far"),onMeasure:ze,onTransitionEnd:Ee},`far-next-${Xe.url}`),ae&&G&&(Me?a.jsx(_x,{src:G.url,phase:Q,onMediaElement:Nt,wrapperStyle:Vt,videoStyle:Wt,onLoadedMetadata:bt,onTransitionEnd:Ee},`${n}-${G.url}`):a.jsx("img",{ref:Nt,src:G.url,alt:G.name,onLoad:bt,onTransitionEnd:Ee,style:Vt},`${n}-${G.url}`))]})}const Nx=20,Hx=.18;function Ox(e){return`
|
|
18770
18794
|
.${e}-wrapper {
|
|
18771
18795
|
box-sizing: border-box;
|
|
18772
18796
|
max-width: 100%;
|
|
@@ -18853,8 +18877,8 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18853
18877
|
z-index: 2;
|
|
18854
18878
|
pointer-events: auto;
|
|
18855
18879
|
}
|
|
18856
|
-
${
|
|
18857
|
-
`}function
|
|
18880
|
+
${yx(e)}
|
|
18881
|
+
`}function Dx(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 jx(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 zx(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:D.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:D.scalingValue(i*Hx,n??!1),[`--${t}-image-aspect`]:Dx(e)}}function Bx(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 Yt(n,t)}function Vx(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 Gx(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?uu(d,o):void 0)}}function qx({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:r,portalId:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>Ox(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",b=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,v=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=D.scalingValue(v,n??!1),h=`max(${g}, ${Nx}px)`,{objectFitMode:f,imageStyle:x}=Vx(e),S=Bx(e,n),y=s.useRef(null),[w,H]=s.useState(!1),[N,Y]=s.useState([]),[O,C]=s.useState(0),[V,$]=s.useState(0),[R,k]=s.useState(null),[T,m]=s.useState({title1:"",title2:"",title3:""}),M=(!n||i)&&!w,E=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},z=E.sizeType??"none",ne=M&&z!=="none"?`${d}-item-image-hover-${z}`:void 0,I=(E.value??120)/100,W=s.useCallback(le=>{!le||z!=="scale"||(le.style.transformOrigin=zg(le))},[z]),K=s.useCallback(le=>{if(le){if(f==="contain"){const ee=jx(le);if(ee){const ue=le.closest(`.${d}-item-image`);ue instanceof HTMLElement&&ue.style.setProperty(`--${d}-item-media-aspect`,String(ee))}}W(le)}},[d,W,f]),ae={width:D.scalingValue(b,n??!1),...S,...zx(e,d,n),[`--${d}-image-hover-scale`]:String(I)},de=(()=>{const le={},ee=y.current?getComputedStyle(y.current).getPropertyValue("--cntrl-article-width").trim():"";return ee&&(le["--cntrl-article-width"]=ee),le})(),A=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),he=s.useMemo(()=>Tx(u),[u]),q=s.useMemo(()=>Mx(u),[u]),ce=(le,ee)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const ue=he.findIndex(Fe=>Fe.gridIndex===le);if(ue<0)return;const oe=he[ue];$(ue),Y(oe.items),C(0),m(oe.entry),k(ee??null),H(!0)},Q=s.useCallback(()=>{H(!1),k(null)},[]),be=s.useCallback(()=>{const le=he[V];return!le||!y.current?R:Cx(y.current,le.gridIndex,f)??R},[he,V,R,f]),He=s.useCallback(le=>{if(he.length>1){const ee=he.length,ue=(V+le+ee)%ee,oe=he[ue];$(ue),Y(oe.items),C(0),m(oe.entry);return}C(ee=>(ee+le+N.length)%N.length)},[he,V,N.length]),xe=he.length>1||N.length>1;return s.useEffect(()=>{if(!w||typeof document>"u")return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[w]),s.useEffect(()=>{!n||o||i||H(!1)},[n,o,i]),s.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&H(!1)},[e==null?void 0:e.lightbox]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),a.jsx(Px,{mediaList:q}),a.jsx("div",{ref:y,className:`${d}-wrapper ${d}-type-${p}`,style:ae,children:u.map((le,ee)=>{var Fe,Ce;const ue=!!((Fe=le.image)!=null&&Fe.url),oe=Gx(!!A,ue,ee,d,f,ce);return a.jsxs("div",{className:`${d}-item`,children:[le.title?a.jsx("span",{className:`${d}-item-title`,onClick:oe,style:oe?{cursor:"pointer"}:void 0,children:le.title}):null,(Ce=le.image)!=null&&Ce.url?a.jsx("span",{className:[`${d}-item-image`,f==="contain"?`${d}-item-image-fit`:void 0,ne].filter(Boolean).join(" "),children:le.image.type==="video"?a.jsx("video",{ref:K,src:le.image.url,"data-waterfall-index":ee,style:x,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:oe,onLoadedData:P=>K(P.currentTarget)}):a.jsx("img",{ref:K,src:le.image.url,alt:le.image.name??"","data-waterfall-index":ee,style:x,onClick:oe,onLoad:P=>K(P.currentTarget)})}):null,ee<u.length-1&&a.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},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:h,height:"100%"}})})]},ee)})}),w&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const le=(l?document.getElementById(l):null)??document.body;return Vn.createPortal(a.jsx("div",{style:de,"data-selection":"none",children:a.jsx(Wx,{prefix:d,items:N,index:O,entry:T,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:xe,lightboxEntries:he,entryIdx:V,layoutId:r,sourceRect:R,resolveCloseSourceRect:be,onClose:Q,onPrev:()=>He(-1),onNext:()=>He(1)})}),le)})()]})}const Xx=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18858
18882
|
import type React from 'react';
|
|
18859
18883
|
import { createPortal } from 'react-dom';
|
|
18860
18884
|
import { CommonComponentProps } from '../props';
|
|
@@ -19368,7 +19392,7 @@ export function Waterfall({
|
|
|
19368
19392
|
</>
|
|
19369
19393
|
);
|
|
19370
19394
|
}
|
|
19371
|
-
`,qx="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>'),Yn={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 Xx(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const lo=ii.filter(e=>e!=="count"),Ux=lo.reduce((e,t)=>({...e,...Xx(t)}),{}),Yx=lo.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Arial",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ja(e){return lo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Kx={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(lo.map(e=>[Us[e],Ys(e)]))},br={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Zx=[{title:"Salton Sea from Above",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],Jx={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:Zx},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:{...Yn.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"]}}},...Ux},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:qx,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Yx},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:[Kx]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},Qx={element:Vx,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"},...lo.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...lo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})},schema:Jx,sourceCode:Gx},Ui=500,uu="cubic-bezier(0.25, 1, 0.5, 1)",eb=300,tb=5,nb=.15,ib=.4,ob=100,Fi=100,xc={color:"#000000",hover:"#cccccc"},So={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},rb={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"},bc={sizeType:"drag",value:3},ab="left";function sb(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:ab,color:(e==null?void 0:e.titleColor)??"#000000"};return Yt(n,t)}function _i(e,t,n){return`${e}: ${O.scalingValue(t/1440,n)};`}function Ro(e,t){return t<=0?0:(e%t+t)%t}function lb(e,t,n,i){if(!i)return{position:Ro(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 cb(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function db(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function ub(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 pb(e,t){return`
|
|
19395
|
+
`,Ux="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>'),Yn={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 Yx(e){const t={};return t[ct(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSettings")]={...Yn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[ct(e,"fontSize")]={...Yn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[ct(e,"lineHeight")]={...Yn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[ct(e,"letterSpacing")]={...Yn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[ct(e,"wordSpacing")]={...Yn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[ct(e,"textAlign")]={...Yn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[ct(e,"textAppearance")]={...Yn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const lo=ii.filter(e=>e!=="count"),Kx=lo.reduce((e,t)=>({...e,...Yx(t)}),{}),Zx=lo.reduce((e,t)=>({...e,[ct(t,"fontFamily")]:"Arial",[ct(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[ct(t,"letterSpacing")]:0,[ct(t,"wordSpacing")]:0,[ct(t,"textAlign")]:"left",[ct(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ja(e){return lo.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[ct(n,"fontSize")]=i),o!==void 0&&(t[ct(n,"lineHeight")]=o),t},{})}const Jx={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(lo.map(e=>[Us[e],Ys(e)]))},br={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},Qx=[{title:"Salton Sea from Above",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...br,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],eb={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:Qx},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:{...Yn.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"]}}},...Kx},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:Ux,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...Zx},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:[Jx]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},tb={element:qx,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"},...lo.map(e=>({path:`${ct(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...lo.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${ct(t,"fontFamily")}`}),{})},schema:eb,sourceCode:Xx},Ui=500,gu="cubic-bezier(0.25, 1, 0.5, 1)",nb=300,ib=5,ob=.15,rb=.4,ab=100,Fi=100,bc={color:"#000000",hover:"#cccccc"},So={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},sb={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"},wc={sizeType:"drag",value:3},lb="left";function cb(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:lb,color:(e==null?void 0:e.titleColor)??"#000000"};return Yt(n,t)}function _i(e,t,n){return`${e}: ${D.scalingValue(t/1440,n)};`}function Ro(e,t){return t<=0?0:(e%t+t)%t}function db(e,t,n,i){if(!i)return{position:Ro(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 ub(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function pb(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,b)=>{n.style.transform=`translate(${p}px, ${b}px)`;const v=n.getBoundingClientRect();return{x:v.left,y:v.top}},o=i(0,0),r=i(Fi,0),l=i(0,Fi);e.removeChild(n);const d={x:(r.x-o.x)/Fi,y:(r.y-o.y)/Fi},c={x:(l.x-o.x)/Fi,y:(l.y-o.y)/Fi},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function mb(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 gb(e,t){return`
|
|
19372
19396
|
.${e}-wrapper {
|
|
19373
19397
|
position: relative;
|
|
19374
19398
|
width: 100%;
|
|
@@ -19440,7 +19464,7 @@ export function Waterfall({
|
|
|
19440
19464
|
top: 0;
|
|
19441
19465
|
left: 0;
|
|
19442
19466
|
opacity: 0;
|
|
19443
|
-
transition: opacity ${Ui}ms ${
|
|
19467
|
+
transition: opacity ${Ui}ms ${gu};
|
|
19444
19468
|
}
|
|
19445
19469
|
.${e}-list-fade .${e}-slide.${e}-is-active {
|
|
19446
19470
|
opacity: 1;
|
|
@@ -19638,7 +19662,7 @@ export function Waterfall({
|
|
|
19638
19662
|
from { clip-path: inset(100% 0 0 0); }
|
|
19639
19663
|
to { clip-path: inset(0 0 0 0); }
|
|
19640
19664
|
}
|
|
19641
|
-
`}function mb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=O.useScopedStyles(),l=sb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??bc,p=u.sizeType??"drag",b=u.value??bc.value,y=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=rb[f],S=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,v=$e=>O.scalingValue($e*S,n),w=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,D=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??xc.color,V=(e==null?void 0:e.controlsHoverColor)??xc.hover,$=(e==null?void 0:e.navColor)??So.colors.inactive,I=(e==null?void 0:e.navPaginationColor)??So.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??So.colors.background,T=(e==null?void 0:e.linkColor)??za.linkColor,m=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,M=y==="horizontal",E=p==="click",z=p==="drag",ne=p==="auto"&&(!n||!!i),R=!n,W=g==="slide",K=h==="classic",ae=w!=="never"&&N>0,de=w==="on hover",A=O.scalingValue(N,n),he={width:A,height:A,maxWidth:A},q=W&&c>1,[ce,Q]=s.useState(0),[be,We]=s.useState(q?1:0),[xe,le]=s.useState(!1),[ee,ue]=s.useState(!1),[oe,Ne]=s.useState(!1),[Te,P]=s.useState(0),[U,X]=s.useState(!1),[ie,j]=s.useState(!1),B=s.useRef(!1),J=s.useRef(be);J.current=be;const te=s.useRef(null),Ce=s.useRef(0),ye=s.useRef(null),F=s.useRef(null),ve=s.useRef(null),pe=s.useRef(null),Z=s.useCallback($e=>{B.current=$e,le($e)},[]),me=s.useCallback($e=>{if(c<2||$e===0)return;const Ae=$e>0?1:-1,Be=Math.abs($e);if(X(!0),Z(!0),!W){Q(qe=>Ro(qe+$e,c));return}let Ke=J.current;const Ie=q&&(Ke===0||Ke===c+1),ze=Ie?ce+1:null;Ie&&(Ke=ce+1);let se=Be;for(;se>0;){const qe=lb(Ke,Ae,c,q);if(Ke=qe.position,se-=1,qe.hitBoundary){Ce.current=se*Ae;break}}const Re=Be-se;if(Re>0&&Q(qe=>Ro(qe+Re*Ae,c)),J.current=Ke,ze!==null){if(J.current=ze,Ke===ze){ue(!0),We(Ke);return}te.current=Ke,ue(!0),We(ze);return}ue(!1),We(Ke)},[ce,c,q,W,Z]),De=s.useCallback($e=>{me($e)},[me]),ge=s.useCallback($e=>{if(c<2)return;const Ae=Ro($e,c);if(!(Ae===ce&&!B.current)&&(X(!0),Z(!0),Q(Ae),W)){const Be=Ae+(q?1:0);te.current=null,Ce.current=0,J.current=Be,ue(!1),We(Be)}},[ce,c,q,W,Z]);s.useEffect(()=>{if(!xe)return;const $e=window.setTimeout(()=>{if(q&&(be===0||be===c+1)){te.current=null,ue(!0),We(ce+1);return}Z(!1)},Ui);return()=>window.clearTimeout($e)},[ce,c,q,xe,Z,be]),s.useEffect(()=>{if(!ee)return;let $e=0;const Ae=requestAnimationFrame(()=>{$e=requestAnimationFrame(()=>{const Be=te.current;te.current=null;const Ke=Ce.current;if(Ce.current=0,ue(!1),Be!==null){J.current=Be,We(Be);return}if(Ke!==0){me(Ke);return}Z(!1)})});return()=>{cancelAnimationFrame(Ae),cancelAnimationFrame($e)}},[me,Z,ee]);const G=`${q}:${c}`,ke=s.useRef(G);s.useEffect(()=>{if(ke.current===G)return;ke.current=G;const $e=c>0?Math.min(ce,c-1):0;ve.current=null,pe.current=null,Ne(!1),P(0),Q($e),ue(!0),We($e+(q?1:0))},[ce,c,q,G]),s.useEffect(()=>{if(!U)return;const $e=window.setTimeout(()=>X(!1),eb);return()=>window.clearTimeout($e)},[U,ce]),s.useEffect(()=>{if(!ne||c<2)return;const $e=Math.max(b,.1)*1e3,Ae=window.setInterval(()=>{R&&ie||De(1)},$e);return()=>window.clearInterval(Ae)},[b,c,De,ne,ie,R]);const Fe=s.useCallback($e=>{const Ae=ve.current;if(!Ae||Ae.pointerId!==$e.pointerId)return;ve.current=null,pe.current=null;const Be=ye.current;if(Be!=null&&Be.hasPointerCapture($e.pointerId)&&Be.releasePointerCapture($e.pointerId),!Ae.isActive){W&&P(0);return}const Ie=!($e.timeStamp-Ae.lastTime>ob)&&Math.abs(Ae.velocity)>ib,ze=Ae.size>0&&Math.abs(Ae.offset-Ae.baseOffset)>Ae.size*nb;if(Ne(!1),!Ie&&!ze){P(0);return}const se=ze?Ae.offset-Ae.baseOffset:Ae.velocity;let Re=1;ze&&Ae.size>0&&(Re=Math.max(1,Math.round(Math.abs(se)/Ae.size))),P(0),me(se<0?Re:-Re)},[me,W]);s.useEffect(()=>{const $e=Ae=>{pe.current===null||Ae.pointerId!==pe.current||Fe(Ae)};return window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",$e),()=>{window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",$e)}},[Fe]);const rt=$e=>{const Ae=ye.current;if(!z||c<2||!Ae||$e.pointerType==="mouse"&&$e.button!==0)return;te.current=null,Ce.current=0,B.current&&Z(!1);let Be=0;const Ke=F.current;if(W&&Ke){const Ie=M?Ke.offsetWidth:Ke.offsetHeight;if(Ie>0){const ze=cb(Ke,M);let se=J.current;q&&(se===0||se===c+1)?(se=ce+1,J.current=se,ue(!0),We(se),Be=0):Be=ze+se*Ie,P(Be)}}Ae.setPointerCapture($e.pointerId),pe.current=$e.pointerId,ve.current={pointerId:$e.pointerId,startClientX:$e.clientX,startClientY:$e.clientY,axes:db(Ae,`${r}-axis-probe`),size:M?Ae.offsetWidth:Ae.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:$e.timeStamp,velocity:0}},Je=$e=>{const Ae=ve.current;if(!Ae||Ae.pointerId!==$e.pointerId)return;if($e.pointerType==="mouse"&&$e.buttons===0){Fe($e);return}const Be=$e.clientX-Ae.startClientX,Ke=$e.clientY-Ae.startClientY,Ie=Ae.axes?ub(Ae.axes,Be,Ke):{x:Be,y:Ke},ze=M?Ie.x:Ie.y,se=M?Ie.y:Ie.x,Re=Ae.baseOffset+ze;if(!Ae.isActive){if(Math.max(Math.abs(ze),Math.abs(se))<tb)return;if(Math.abs(se)>Math.abs(ze)){const we=ye.current;we!=null&&we.hasPointerCapture(Ae.pointerId)&&we.releasePointerCapture(Ae.pointerId),ve.current=null,pe.current=null,W&&P(0);return}Ae.isActive=!0,Ne(!0)}const qe=$e.timeStamp-Ae.lastTime;qe>0&&(Ae.velocity=(Re-Ae.offset)/qe,Ae.lastTime=$e.timeStamp),Ae.offset=Re,W&&P(Re)},at=$e=>{Fe($e)},nt=M?`translate3d(calc(${-be*100}% + ${Te}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${Te}px), 0)`,je=q?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:pb(r,n)}}),a.jsxs("div",{className:ht(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!M}),onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:ye,className:ht(`${r}-track`,{[`${r}-track-draggable`]:z,[`${r}-track-draggable-vertical`]:z&&!M}),onPointerDown:rt,onPointerMove:Je,onPointerUp:at,onPointerCancel:at,onLostPointerCapture:$e=>{pe.current===$e.pointerId&&Fe($e)},children:a.jsx("div",{ref:F,className:ht(`${r}-list`,{[`${r}-list-slide`]:W,[`${r}-list-slide-vertical`]:W&&!M,[`${r}-list-fade`]:!W}),style:W?{transform:nt,transition:oe||ee?"none":`transform ${Ui}ms ${uu}`}:void 0,children:je.map(($e,Ae)=>{const Be=q?Ro(Ae-1,c):Ae,Ie=q&&(Ae===0||Ae===c+1)?`clone-${Ae===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:ht(`${r}-slide`,{[`${r}-is-active`]:!W&&Be===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:ht(`${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})})})},Ie)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ht(`${r}-arrow`,{[`${r}-arrow-prev`]:M,[`${r}-arrow-prev-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{onClick:$e=>{$e.stopPropagation(),De(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${O.scalingValue(Y,n)}, ${O.scalingValue(D*(M?1:-1),n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:ht(`${r}-arrow-img`,`${r}-mirror`),style:he}),!H&&a.jsx(wc,{color:C,className:ht(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:ht(`${r}-arrow`,{[`${r}-arrow-next`]:M,[`${r}-arrow-next-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:$e=>{$e.stopPropagation(),De(1)},style:{transform:`translate(${O.scalingValue(Y*(M?-1:1),n)}, ${O.scalingValue(D,n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:`${r}-arrow-img`,style:he}),!H&&a.jsx(wc,{color:C,className:ht(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),E&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>De(1)}),K&&a.jsx("div",{className:ht(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:M,[`${r}-pagination-inside-left`]:!M}),style:M?{bottom:v(x.inset)}:{left:v(x.inset)},children:a.jsx("div",{className:ht(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!M,[`${r}-animate-dots`]:U}),style:{backgroundColor:k,gap:v(x.gapInactive-x.activeDot+x.dot),...M?{height:v(x.activeDot+x.paddingY*2),paddingTop:v(x.paddingY),paddingBottom:v(x.paddingY),paddingLeft:v(x.paddingActive),paddingRight:v(x.paddingActive)}:{width:v(x.activeDot+x.paddingY*2),paddingLeft:v(x.paddingY),paddingRight:v(x.paddingY),paddingTop:v(x.paddingActive),paddingBottom:v(x.paddingActive)},borderRadius:v(x.borderRadius),transform:`translate(${O.scalingValue(So.offset.x,n)}, ${O.scalingValue(So.offset.y,n)})`},children:d.map(($e,Ae)=>{const Be=Ae===ce,Ke=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(Ae),className:`${r}-pagination-item`,style:{width:v(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?I:$,width:v(Ke)}})},Ae)})},`${f}-${y}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:O.scalingValue(m,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map(($e,Ae)=>a.jsx("div",{className:ht(`${r}-caption-text`,{[`${r}-with-pointer-events`]:Ae===ce&&n,[`${r}-active`]:Ae===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ui/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":T,"--link-hover-color":T,position:"relative",top:O.scalingValue(za.offset.y,n),left:O.scalingValue(za.offset.x,n)},children:a.jsx(Ri,{content:$e.imageCaption})})},Ae))})]})]})]})}function wc({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 gb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19665
|
+
`}function hb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:r}=D.useScopedStyles(),l=cb(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??wc,p=u.sizeType??"drag",b=u.value??wc.value,v=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",f=(e==null?void 0:e.navSize)??"m",x=sb[f],S=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,y=Se=>D.scalingValue(Se*S,n),w=(e==null?void 0:e.show)??"always",H=(e==null?void 0:e.controls)??null,N=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,Y=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,O=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,C=(e==null?void 0:e.controlsColor)??bc.color,V=(e==null?void 0:e.controlsHoverColor)??bc.hover,$=(e==null?void 0:e.navColor)??So.colors.inactive,R=(e==null?void 0:e.navPaginationColor)??So.colors.pagination,k=(e==null?void 0:e.navBackgroundColor)??So.colors.background,T=(e==null?void 0:e.linkColor)??za.linkColor,m=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,M=v==="horizontal",E=p==="click",z=p==="drag",ne=p==="auto"&&(!n||!!i),I=!n,W=g==="slide",K=h==="classic",ae=w!=="never"&&N>0,de=w==="on hover",A=D.scalingValue(N,n),he={width:A,height:A,maxWidth:A},q=W&&c>1,[ce,Q]=s.useState(0),[be,He]=s.useState(q?1:0),[xe,le]=s.useState(!1),[ee,ue]=s.useState(!1),[oe,Fe]=s.useState(!1),[Ce,P]=s.useState(0),[U,X]=s.useState(!1),[ie,j]=s.useState(!1),B=s.useRef(!1),J=s.useRef(be);J.current=be;const te=s.useRef(null),$e=s.useRef(0),ye=s.useRef(null),F=s.useRef(null),ve=s.useRef(null),pe=s.useRef(null),Z=s.useCallback(Se=>{B.current=Se,le(Se)},[]),me=s.useCallback(Se=>{if(c<2||Se===0)return;const We=Se>0?1:-1,Be=Math.abs(Se);if(X(!0),Z(!0),!W){Q(Xe=>Ro(Xe+Se,c));return}let Ze=J.current;const Le=q&&(Ze===0||Ze===c+1),Ve=Le?ce+1:null;Le&&(Ze=ce+1);let se=Be;for(;se>0;){const Xe=db(Ze,We,c,q);if(Ze=Xe.position,se-=1,Xe.hitBoundary){$e.current=se*We;break}}const Te=Be-se;if(Te>0&&Q(Xe=>Ro(Xe+Te*We,c)),J.current=Ze,Ve!==null){if(J.current=Ve,Ze===Ve){ue(!0),He(Ze);return}te.current=Ze,ue(!0),He(Ve);return}ue(!1),He(Ze)},[ce,c,q,W,Z]),De=s.useCallback(Se=>{me(Se)},[me]),ge=s.useCallback(Se=>{if(c<2)return;const We=Ro(Se,c);if(!(We===ce&&!B.current)&&(X(!0),Z(!0),Q(We),W)){const Be=We+(q?1:0);te.current=null,$e.current=0,J.current=Be,ue(!1),He(Be)}},[ce,c,q,W,Z]);s.useEffect(()=>{if(!xe)return;const Se=window.setTimeout(()=>{if(q&&(be===0||be===c+1)){te.current=null,ue(!0),He(ce+1);return}Z(!1)},Ui);return()=>window.clearTimeout(Se)},[ce,c,q,xe,Z,be]),s.useEffect(()=>{if(!ee)return;let Se=0;const We=requestAnimationFrame(()=>{Se=requestAnimationFrame(()=>{const Be=te.current;te.current=null;const Ze=$e.current;if($e.current=0,ue(!1),Be!==null){J.current=Be,He(Be);return}if(Ze!==0){me(Ze);return}Z(!1)})});return()=>{cancelAnimationFrame(We),cancelAnimationFrame(Se)}},[me,Z,ee]);const G=`${q}:${c}`,Me=s.useRef(G);s.useEffect(()=>{if(Me.current===G)return;Me.current=G;const Se=c>0?Math.min(ce,c-1):0;ve.current=null,pe.current=null,Fe(!1),P(0),Q(Se),ue(!0),He(Se+(q?1:0))},[ce,c,q,G]),s.useEffect(()=>{if(!U)return;const Se=window.setTimeout(()=>X(!1),nb);return()=>window.clearTimeout(Se)},[U,ce]),s.useEffect(()=>{if(!ne||c<2)return;const Se=Math.max(b,.1)*1e3,We=window.setInterval(()=>{I&&ie||De(1)},Se);return()=>window.clearInterval(We)},[b,c,De,ne,ie,I]);const _e=s.useCallback(Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;ve.current=null,pe.current=null;const Be=ye.current;if(Be!=null&&Be.hasPointerCapture(Se.pointerId)&&Be.releasePointerCapture(Se.pointerId),!We.isActive){W&&P(0);return}const Le=!(Se.timeStamp-We.lastTime>ab)&&Math.abs(We.velocity)>rb,Ve=We.size>0&&Math.abs(We.offset-We.baseOffset)>We.size*ob;if(Fe(!1),!Le&&!Ve){P(0);return}const se=Ve?We.offset-We.baseOffset:We.velocity;let Te=1;Ve&&We.size>0&&(Te=Math.max(1,Math.round(Math.abs(se)/We.size))),P(0),me(se<0?Te:-Te)},[me,W]);s.useEffect(()=>{const Se=We=>{pe.current===null||We.pointerId!==pe.current||_e(We)};return window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[_e]);const rt=Se=>{const We=ye.current;if(!z||c<2||!We||Se.pointerType==="mouse"&&Se.button!==0)return;te.current=null,$e.current=0,B.current&&Z(!1);let Be=0;const Ze=F.current;if(W&&Ze){const Le=M?Ze.offsetWidth:Ze.offsetHeight;if(Le>0){const Ve=ub(Ze,M);let se=J.current;q&&(se===0||se===c+1)?(se=ce+1,J.current=se,ue(!0),He(se),Be=0):Be=Ve+se*Le,P(Be)}}We.setPointerCapture(Se.pointerId),pe.current=Se.pointerId,ve.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,axes:pb(We,`${r}-axis-probe`),size:M?We.offsetWidth:We.offsetHeight,isActive:!1,baseOffset:Be,offset:Be,lastTime:Se.timeStamp,velocity:0}},Je=Se=>{const We=ve.current;if(!We||We.pointerId!==Se.pointerId)return;if(Se.pointerType==="mouse"&&Se.buttons===0){_e(Se);return}const Be=Se.clientX-We.startClientX,Ze=Se.clientY-We.startClientY,Le=We.axes?mb(We.axes,Be,Ze):{x:Be,y:Ze},Ve=M?Le.x:Le.y,se=M?Le.y:Le.x,Te=We.baseOffset+Ve;if(!We.isActive){if(Math.max(Math.abs(Ve),Math.abs(se))<ib)return;if(Math.abs(se)>Math.abs(Ve)){const ze=ye.current;ze!=null&&ze.hasPointerCapture(We.pointerId)&&ze.releasePointerCapture(We.pointerId),ve.current=null,pe.current=null,W&&P(0);return}We.isActive=!0,Fe(!0)}const Xe=Se.timeStamp-We.lastTime;Xe>0&&(We.velocity=(Te-We.offset)/Xe,We.lastTime=Se.timeStamp),We.offset=Te,W&&P(Te)},at=Se=>{_e(Se)},it=M?`translate3d(calc(${-be*100}% + ${Ce}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${Ce}px), 0)`,je=q?[d[c-1],...d,d[0]]:d;return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:gb(r,n)}}),a.jsxs("div",{className:yt(`${r}-wrapper`,{[`${r}-transition-reveal`]:g==="reveal",[`${r}-transition-reveal-vertical`]:g==="reveal"&&!M}),onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[a.jsxs("div",{className:`${r}-slider-inner`,style:{backgroundColor:"transparent"},children:[a.jsx("div",{ref:ye,className:yt(`${r}-track`,{[`${r}-track-draggable`]:z,[`${r}-track-draggable-vertical`]:z&&!M}),onPointerDown:rt,onPointerMove:Je,onPointerUp:at,onPointerCancel:at,onLostPointerCapture:Se=>{pe.current===Se.pointerId&&_e(Se)},children:a.jsx("div",{ref:F,className:yt(`${r}-list`,{[`${r}-list-slide`]:W,[`${r}-list-slide-vertical`]:W&&!M,[`${r}-list-fade`]:!W}),style:W?{transform:it,transition:oe||ee?"none":`transform ${Ui}ms ${gu}`}:void 0,children:je.map((Se,We)=>{const Be=q?Ro(We-1,c):We,Le=q&&(We===0||We===c+1)?`clone-${We===0?"start":"end"}`:`slide-${Be}`;return a.jsx("div",{className:yt(`${r}-slide`,{[`${r}-is-active`]:!W&&Be===ce}),children:a.jsx("div",{className:`${r}-slider-item`,children:a.jsx("div",{className:`${r}-img-wrapper`,children:a.jsx("img",{className:yt(`${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})})})},Le)})})}),ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-prev`]:M,[`${r}-arrow-prev-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{onClick:Se=>{Se.stopPropagation(),De(-1)},className:`${r}-arrow-inner`,style:{transform:`translate(${D.scalingValue(Y,n)}, ${D.scalingValue(O*(M?1:-1),n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:yt(`${r}-arrow-img`,`${r}-mirror`),style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`,`${r}-mirror`)})]})}),a.jsx("div",{className:yt(`${r}-arrow`,{[`${r}-arrow-next`]:M,[`${r}-arrow-next-vertical`]:!M,[`${r}-hover-arrow`]:de}),style:{color:C,"--arrow-hover-color":V,...he},children:a.jsxs("button",{className:`${r}-arrow-inner`,onClick:Se=>{Se.stopPropagation(),De(1)},style:{transform:`translate(${D.scalingValue(Y*(M?-1:1),n)}, ${D.scalingValue(O,n)}) rotate(${M?"0deg":"90deg"})`},children:[H&&a.jsx(ln,{url:H,fill:C,hoverFill:V,className:`${r}-arrow-img`,style:he}),!H&&a.jsx(Sc,{color:C,className:yt(`${r}-arrow-icon`,`${r}-arrow-img`)})]})})]}),E&&a.jsx("div",{className:`${r}-click-overlay`,onClick:()=>De(1)}),K&&a.jsx("div",{className:yt(`${r}-pagination`,{[`${r}-pagination-inside-bottom`]:M,[`${r}-pagination-inside-left`]:!M}),style:M?{bottom:y(x.inset)}:{left:y(x.inset)},children:a.jsx("div",{className:yt(`${r}-pagination-inner`,{[`${r}-pagination-vertical`]:!M,[`${r}-animate-dots`]:U}),style:{backgroundColor:k,gap:y(x.gapInactive-x.activeDot+x.dot),...M?{height:y(x.activeDot+x.paddingY*2),paddingTop:y(x.paddingY),paddingBottom:y(x.paddingY),paddingLeft:y(x.paddingActive),paddingRight:y(x.paddingActive)}:{width:y(x.activeDot+x.paddingY*2),paddingLeft:y(x.paddingY),paddingRight:y(x.paddingY),paddingTop:y(x.paddingActive),paddingBottom:y(x.paddingActive)},borderRadius:y(x.borderRadius),transform:`translate(${D.scalingValue(So.offset.x,n)}, ${D.scalingValue(So.offset.y,n)})`},children:d.map((Se,We)=>{const Be=We===ce,Ze=Be?x.activeDot:x.dot;return a.jsx("button",{onClick:()=>ge(We),className:`${r}-pagination-item`,style:{width:y(x.activeDot)},children:a.jsx("div",{className:`${r}-dot`,style:{backgroundColor:Be?R:$,width:y(Ze)}})},We)})},`${f}-${v}`)})]}),a.jsxs("div",{className:`${r}-caption-block`,children:[a.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${r}-control`:void 0,style:{height:D.scalingValue(m,n)}}),a.jsx("div",{className:`${r}-caption-text-wrapper`,children:d.map((Se,We)=>a.jsx("div",{className:yt(`${r}-caption-text`,{[`${r}-with-pointer-events`]:We===ce&&n,[`${r}-active`]:We===ce}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Ui/2)}ms`},children:a.jsx("div",{className:`${r}-caption-text-inner`,style:{"--link-color":T,"--link-hover-color":T,position:"relative",top:D.scalingValue(za.offset.y,n),left:D.scalingValue(za.offset.x,n)},children:a.jsx(Ri,{content:Se.imageCaption})})},We))})]})]})]})}function Sc({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 fb=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19642
19666
|
import cn from 'classnames';
|
|
19643
19667
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19644
19668
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20819,14 +20843,14 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20819
20843
|
</svg>
|
|
20820
20844
|
);
|
|
20821
20845
|
}
|
|
20822
|
-
`,
|
|
20846
|
+
`,yb={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"}]}]}]}},vb={element:hb,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:yb,sourceCode:fb,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Di=300/1440,xb=8/1440,xi=.004;function bb(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function $c(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}-title-leading-gap`]:D.scalingValue((o-t)/2,i)}}function wb(e){return`
|
|
20823
20847
|
.${e}-wrapper {
|
|
20824
20848
|
box-sizing: border-box;
|
|
20825
20849
|
display: flex;
|
|
20826
20850
|
flex-direction: column;
|
|
20827
20851
|
position: relative;
|
|
20828
20852
|
width: 100%;
|
|
20829
|
-
min-height: ${
|
|
20853
|
+
min-height: ${bb(48)};
|
|
20830
20854
|
}
|
|
20831
20855
|
.${e}-single-title-layer {
|
|
20832
20856
|
position: absolute;
|
|
@@ -21036,7 +21060,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
21036
21060
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
21037
21061
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
21038
21062
|
}
|
|
21039
|
-
`}const bb="rgba(28,31,34,0.9)",_n=500,vi="cubic-bezier(0.22, 1, 0.36, 1)",wb=72,Sb=50,$b={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Cb=[];function Tb(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 Lb(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Rb(e){const[t]=e.media;return t!=null&&t.url?t:null}function Ib(e){if(!Array.isArray(e)||e.length===0)return[];if(Tb(e)){const t=[];for(const n of e){const i=Lb(n);if(!i)continue;const o=Rb(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 ps(e){return e.type==="video"}function Eb(e){e.pause(),e.removeAttribute("src"),e.load()}function wr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Mb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Pb=1140/1440;function kb(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Ab(e){const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`}function Fb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function _b({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()=>{Eb(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 Wb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",y=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),v=s.useRef(!1),w=s.useRef(!1),H=s.useRef(!1),N=s.useRef(null),[Y,D]=s.useState(null),[C,V]=s.useState("opening"),[$,I]=s.useState(0),[k,T]=s.useState(0),[m,M]=s.useState(!1),[E,z]=s.useState(!1),[ne,R]=s.useState(!1),W=s.useRef(n),K=t[n],ae=K?ps(K):!1,de=k!==0||m,A=s.useCallback(U=>{H.current=U,M(U)},[]),he=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),q=s.useCallback(()=>{he(),N.current=window.setTimeout(()=>{he(),A(!1)},_n+32)},[he,A]),ce=s.useCallback(()=>{const U=y.current,X=g.current;if(!U)return;const ie=U.getBoundingClientRect(),j=ie.width,B=ie.height;if(!j||!B)return;if(i==="cover"){D({width:j,height:B,left:ie.left,top:ie.top});return}if(!X){D(wr(U));return}const{width:J,height:te}=Mb(X);if(!J||!te){D(wr(U));return}const Ce=J/te,ye=j/B;if(Ce>ye){const F=j/Ce;D({width:j,height:F,left:ie.left,top:ie.top+(B-F)/2})}else{const F=B*Ce;D({width:F,height:B,left:ie.left+(j-F)/2,top:ie.top})}},[i]);s.useEffect(()=>{ce();const U=y.current;if(!U)return;const X=new ResizeObserver(()=>ce());return X.observe(U),()=>X.disconnect()},[ce,n]),s.useEffect(()=>{C==="opening"&&Y&&V("open")},[C,Y]),s.useEffect(()=>{if(C!=="closing")return;const U=setTimeout(()=>r(),_n);return()=>clearTimeout(U)},[C,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{if(W.current===n)return;he(),I(0),T(0),A(!1),R(!1),z(!1),f.current=0,x.current=0,S.current="none",v.current=!1,h.current=null,w.current=!1;const U=y.current;U&&D(wr(U)),W.current=n},[n,A,he]),s.useEffect(()=>{if(C!=="open")return;let U=null;const X=()=>{U&&(document.removeEventListener("click",U,!0),U=null)},ie=()=>{X(),U=ye=>{ye.stopPropagation(),ye.preventDefault(),X()},document.addEventListener("click",U,!0)},j=ye=>{he(),H.current=!1,M(!1),T(0),z(!1),v.current=!1,x.current=0,S.current="none";const F=y.current;F&&D(wr(F)),ye<0?d():l()},B=ye=>{if(Math.abs(ye)>Sb&&t.length>1){j(ye);return}A(!0),T(0),q()},J=ye=>{if(ye.touches.length!==1||H.current)return;const F=ye.touches[0];w.current=!0,h.current={x:F.clientX,y:F.clientY},S.current="none",x.current=0,v.current=!1},te=ye=>{if(!h.current||ye.touches.length!==1||H.current)return;const F=ye.touches[0],ve=F.clientX-h.current.x,pe=F.clientY-h.current.y;if(S.current==="none"){if(Math.abs(ve)<10&&Math.abs(pe)<10)return;if(Math.abs(ve)>Math.abs(pe)){if(t.length<=1)return;S.current="horizontal"}else if(pe>0)S.current="vertical";else return}if(S.current==="horizontal"){v.current=!0,z(!0),x.current=ve,T(ve),ye.preventDefault();return}S.current==="vertical"&&(v.current=!0,z(!0),f.current=pe,I(pe),ye.preventDefault())},Ce=()=>{if(!h.current)return;const ye=S.current,F=v.current;if(F&&ye==="horizontal")B(x.current),ie();else if(F&&ye==="vertical")if(f.current>wb){const pe=window.innerHeight;f.current=pe,R(!0),I(pe),V("closing")}else f.current=0,I(0),ie();else ye==="horizontal"&&Math.abs(x.current)>0&&(B(x.current),ie());h.current=null,S.current="none",x.current=0,v.current=!1,z(!1)};return document.addEventListener("touchstart",J,{passive:!0}),document.addEventListener("touchmove",te,{passive:!1}),document.addEventListener("touchend",Ce),document.addEventListener("touchcancel",Ce),()=>{document.removeEventListener("touchstart",J),document.removeEventListener("touchmove",te),document.removeEventListener("touchend",Ce),document.removeEventListener("touchcancel",Ce),X()}},[C,t.length,d,l,A,q,he]),s.useEffect(()=>{const U=X=>{X.key==="Escape"&&(X.preventDefault(),X.stopPropagation(),C!=="closing"&&V("closing"))};return window.addEventListener("keydown",U,!0),()=>window.removeEventListener("keydown",U,!0)},[C]);const Q=()=>{C!=="closing"&&V("closing")},be=C==="open",We=C==="closing",xe=$>0?Math.max(0,1-$/500):1,le=$>0?Math.max(.35,1-$/500):1,ee=U=>{if(U.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientY-X.top,j=Math.min(52,X.height*.2);if(!(ie>X.height-j)){if(U.clientX-X.left<X.width/2){l();return}d()}},ue=U=>{if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientX-X.left,j=U.clientY-X.top,B=Math.min(52,X.height*.2);if(j>X.height-B){U.currentTarget.style.cursor="default";return}U.currentTarget.style.cursor=ie<X.width/2?"w-resize":"e-resize"},oe=s.useCallback(U=>{U.propertyName!=="transform"||!H.current||(he(),A(!1))},[he,A]),Ne=de?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Te={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:Ne,opacity:$>0?le:C==="opening"||We?0:1,transition:E&&!m?"none":m?`transform ${_n}ms ${vi}`:ne?`transform ${_n}ms ${vi}, opacity ${_n}ms ${vi}`:C==="opening"||We?`opacity ${_n}ms ${vi}`:"none",pointerEvents:ae&&be&&!de?"auto":"none",touchAction:ae&&be?"none":void 0,zIndex:9998},P=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:C==="open"?"none":void 0},onClick:Q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?xe:0,transition:E?"none":`opacity ${_n}ms ${vi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{height:"10%"}}),a.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&K&&(ae?a.jsx(_b,{src:K.url,phase:C,mediaRef:g,mediaStyle:Te,onLoadedMetadata:ce,onClick:ee,onMouseMove:ue,onTransitionEnd:oe},`${n}-${K.url}`):a.jsx("img",{ref:g,src:K.url,alt:K.name,onLoad:ce,onTransitionEnd:oe,style:Te},`${n}-${K.url}`)),be&&P&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...P,left:Y.left,cursor:"w-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),l()}}),a.jsx("div",{style:{...P,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),d()}})]})]})}function Cc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${ps(t)?"video":"image"}`,y=r.display==="cover",g=Ab(r),h=C=>O.scalingValue(C,l??!1),f=n??Di,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},S=i?{borderRadius:h(i)}:{},v={...x,...y?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...S},w={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:S},N={className:b,style:w,onClick:p?C=>{C.stopPropagation(),p()}:void 0},Y=Math.max(d,xi),D=ps(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[y?a.jsx("div",{style:v,children:D}):D,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(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:h(Y)}})]})}function Nb({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,y=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&y&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Hb(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Tc({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 Lc({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),[b,y]=s.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>y(f.offsetHeight);x();const S=new ResizeObserver(x);return S.observe(f),()=>S.disconnect()},[g,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Rc=45;function Ic(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 Ob(e){const t=Ic(e,"--cntrl-viewport-height",window.innerHeight),n=Ic(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function Db(e,t,n){const{top:i,centerY:o}=Ob(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 jb(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=Db(u,n,c);return Math.exp(-(p*p)/(2*Rc*Rc))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function zb(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(jb(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 Bb(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 Vb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var Qe;const{prefix:l}=O.useScopedStyles(),d=s.useMemo(()=>xb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Di,y=(e==null?void 0:e.titleWidth)??Pb,g=kb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??yb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleLeftPadding)??0,v=(e==null?void 0:e.titleRightPadding)??0,w=Hb(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",N=p==="b",Y=w==="fade"||w==="retype",{setTitleRef:D,dominantIndex:C}=zb(c.length,Y,f),V=((Qe=c[C])==null?void 0:Qe.title)??"",$=Bb(V,w==="retype"),I=w==="fade"||w==="retype",k=w==="retype"?$:V,T=N?void 0:{width:O.scalingValue(b,n??!1)},m=H==="on"&&(!n||i||o),M=o??!1,E=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,R=it=>O.scalingValue(it,n??!1),K={width:R(y)},ae=p==="a"?E:z,de=N?{width:"100%"}:{width:`calc(100% - ${R(b)} - ${R(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(E,xi),he=Math.max(z,xi),q=Math.max(ne,xi),ce=Math.max(x,xi),Q=Math.max(S,xi),be=Math.max(v,xi),We=Math.max(0,(u??1)-(b??Di)),xe=p==="a"?Math.max(0,(u??1)-(b??Di)-E):p==="c"?Math.max(0,(u??1)-(b??Di)-z):p==="b"?u??1:1,le=M&&(p==="a"||p==="b"||p==="c")&&f==="top",ee=M&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),ue=M&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),oe=c.length>1,Ne=N?void 0:R((p==="c"?z:E)+(b??Di)),Te=p==="c"&&Ne?{left:Ne}:void 0,P=p==="a"&&Ne?{right:Ne}:void 0,U=N?{left:0,width:"100%"}:p==="a"?{right:R(E),width:R(b)}:{left:R(z),width:R(b)},{titleColor:X,titleFontFamily:ie,titleFontSettings:j,titleFontSize:B,titleLineHeight:J,titleLetterSpacing:te,titleWordSpacing:Ce,titleAlign:ye,titleTextAppearance:F,lightboxCounterColor:ve,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:Z,lightboxCounterFontSize:me,lightboxCounterLineHeight:De,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:G,lightboxCounterTextAppearance:ke}=e??{},Fe={fontSettings:{fontFamily:ie,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:B??.01,lineHeight:J,letterSpacing:te??0,wordSpacing:Ce??0,textAlign:ye??"left",textAppearance:F,color:X??"#000000"},Je=sn(Yt(Fe,n)),at=K,nt=$c(B,J,l,n),je=Sc(B,J,`${l}-title`,`${l}-text-tight-leading`),$e={fontSettings:{fontFamily:pe,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:me??.01,lineHeight:De,letterSpacing:ge??0,wordSpacing:G??0,textAppearance:ke,color:ve??"#DEDDDD"},Be={...sn(Yt($e,n)),...$c(me,De,l,n)},Ke=Sc(me,De,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Ie=O.buildColorVars(l,{titleColor:X??"#000000",lightboxCounterColor:ve??"#DEDDDD"},$b,Cb),ze=s.useRef(null),[se,Re]=s.useState(!1),[qe,we]=s.useState([]),[Le,Ze]=s.useState(0),Oe=s.useCallback((it,tt)=>{m&&(we(it),Ze(tt),Re(!0))},[m]),Ue=s.useCallback(()=>{Re(!1)},[]),He=s.useMemo(()=>{const it={...Ie},tt=ze.current?getComputedStyle(ze.current).getPropertyValue("--cntrl-article-width").trim():"";return tt&&(it["--cntrl-article-width"]=tt),it},[Ie,se]);return s.useEffect(()=>{if(!se||H!=="on"||typeof document>"u")return;const it=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=it}},[se,H]),s.useEffect(()=>{!n||o||i||Re(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Re(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Ie,children:a.jsxs("div",{ref:ze,className:`${l}-wrapper`,style:{width:O.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?R(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?R(S):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?R(v):void 0},children:[I&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ba,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${je} ${l}-single-title`,titleContainerStyle:{...nt,...de},titleTextBoxStyle:at,titleStyle:Je,showTextBoxOutline:M,topPaddingControl:le?Tc({P:l,scaled:R,height:ce,paired:!1}):void 0})}),c.map((it,tt)=>{const St=Ib(it.gallery),$t=tt<c.length-1,Rt=St.filter(pt=>pt.lightboxMedia).map(pt=>pt.lightboxMedia),yt={P:l,position:f,titleRef:D(tt),titleClassName:je,titleContainerStyle:nt,titleTextBoxStyle:I?{maxWidth:"100%"}:at,titleStyle:Je,showTextBoxOutline:M&&!I,topPaddingControl:le&&!I?Tc({P:l,scaled:R,height:ce,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":tt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:$t?R(ne):void 0},children:[ee&&Lc({P:l,controlKey:"titleLeftPadding",scaled:R,width:Q,maxFraction:xe,side:"left",paired:oe,anchorStyle:Te}),ue&&Lc({P:l,controlKey:"titleRightPadding",scaled:R,width:be,maxFraction:xe,side:"right",paired:oe,anchorStyle:P}),M&&$t&&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:R(q),...U}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:St.map(({displayMedia:pt,lightboxMedia:kt},Wt)=>{const bt=kt?Rt.findIndex(Nt=>Nt.url===kt.url):-1;return a.jsx(Cc,{P:l,media:pt,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Wt<St.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Oe(Rt,bt):void 0},`${pt.url}-${Wt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ba,{...yt,title:I?"":it.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ba,{...yt,title:I?"":it.title}),St.length>0&&a.jsx(Nb,{P:l,layoutType:p,galleryWidthStyle:T,galleryPaddingRight:E,galleryPaddingLeft:z,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:he,galleryPaddingMaxFraction:We,showControls:M,scaled:R,children:St.map(({displayMedia:pt,lightboxMedia:kt},Wt)=>{const bt=kt?Rt.findIndex(Nt=>Nt.url===kt.url):-1;return a.jsx(Cc,{P:l,media:pt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Wt<St.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Oe(Rt,bt):void 0},`${pt.url}-${Wt}`)})})]})]},tt)})]})}),se&&H==="on"&&typeof document<"u"&&e&&(()=>{const it=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx("div",{style:He,"data-selection":"none",children:a.jsx(Wb,{prefix:l,items:qe,index:Le,imageDisplay:Fb(e.lightboxImageDisplay),isEditor:n,onClose:Ue,onPrev:()=>Ze(tt=>(tt-1+qe.length)%qe.length),onNext:()=>Ze(tt=>(tt+1)%qe.length),counterClassName:Ke,counterStyle:Be,backgroundColor:e.backgroundColor??bb})}),it)})()]})}const Gb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21063
|
+
`}const Sb="rgba(28,31,34,0.9)",_n=500,vi="cubic-bezier(0.22, 1, 0.36, 1)",$b=72,Cb=50,Tb={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},Lb=[];function Rb(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 Ib(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eb(e){const[t]=e.media;return t!=null&&t.url?t:null}function Mb(e){if(!Array.isArray(e)||e.length===0)return[];if(Rb(e)){const t=[];for(const n of e){const i=Ib(n);if(!i)continue;const o=Eb(n);t.push({displayMedia:i,lightboxMedia:o!=null&&o.url?o:null})}return t}return e.filter(t=>t==null?void 0:t.url).map(t=>({displayMedia:t,lightboxMedia:t}))}function ps(e){return e.type==="video"}function Pb(e){e.pause(),e.removeAttribute("src"),e.load()}function wr(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function kb(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const Ab=1140/1440;function Fb(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 _b(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 Wb(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Nb({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()=>{Pb(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 Hb({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:r,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const b=i==="cover",v=s.useRef(null),g=s.useRef(null),h=s.useRef(null),f=s.useRef(0),x=s.useRef(0),S=s.useRef("none"),y=s.useRef(!1),w=s.useRef(!1),H=s.useRef(!1),N=s.useRef(null),[Y,O]=s.useState(null),[C,V]=s.useState("opening"),[$,R]=s.useState(0),[k,T]=s.useState(0),[m,M]=s.useState(!1),[E,z]=s.useState(!1),[ne,I]=s.useState(!1),W=s.useRef(n),K=t[n],ae=K?ps(K):!1,de=k!==0||m,A=s.useCallback(U=>{H.current=U,M(U)},[]),he=s.useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null)},[]),q=s.useCallback(()=>{he(),N.current=window.setTimeout(()=>{he(),A(!1)},_n+32)},[he,A]),ce=s.useCallback(()=>{const U=v.current,X=g.current;if(!U)return;const ie=U.getBoundingClientRect(),j=ie.width,B=ie.height;if(!j||!B)return;if(i==="cover"){O({width:j,height:B,left:ie.left,top:ie.top});return}if(!X){O(wr(U));return}const{width:J,height:te}=kb(X);if(!J||!te){O(wr(U));return}const $e=J/te,ye=j/B;if($e>ye){const F=j/$e;O({width:j,height:F,left:ie.left,top:ie.top+(B-F)/2})}else{const F=B*$e;O({width:F,height:B,left:ie.left+(j-F)/2,top:ie.top})}},[i]);s.useEffect(()=>{ce();const U=v.current;if(!U)return;const X=new ResizeObserver(()=>ce());return X.observe(U),()=>X.disconnect()},[ce,n]),s.useEffect(()=>{C==="opening"&&Y&&V("open")},[C,Y]),s.useEffect(()=>{if(C!=="closing")return;const U=setTimeout(()=>r(),_n);return()=>clearTimeout(U)},[C,r]),s.useEffect(()=>()=>{he()},[he]),s.useLayoutEffect(()=>{if(W.current===n)return;he(),R(0),T(0),A(!1),I(!1),z(!1),f.current=0,x.current=0,S.current="none",y.current=!1,h.current=null,w.current=!1;const U=v.current;U&&O(wr(U)),W.current=n},[n,A,he]),s.useEffect(()=>{if(C!=="open")return;let U=null;const X=()=>{U&&(document.removeEventListener("click",U,!0),U=null)},ie=()=>{X(),U=ye=>{ye.stopPropagation(),ye.preventDefault(),X()},document.addEventListener("click",U,!0)},j=ye=>{he(),H.current=!1,M(!1),T(0),z(!1),y.current=!1,x.current=0,S.current="none";const F=v.current;F&&O(wr(F)),ye<0?d():l()},B=ye=>{if(Math.abs(ye)>Cb&&t.length>1){j(ye);return}A(!0),T(0),q()},J=ye=>{if(ye.touches.length!==1||H.current)return;const F=ye.touches[0];w.current=!0,h.current={x:F.clientX,y:F.clientY},S.current="none",x.current=0,y.current=!1},te=ye=>{if(!h.current||ye.touches.length!==1||H.current)return;const F=ye.touches[0],ve=F.clientX-h.current.x,pe=F.clientY-h.current.y;if(S.current==="none"){if(Math.abs(ve)<10&&Math.abs(pe)<10)return;if(Math.abs(ve)>Math.abs(pe)){if(t.length<=1)return;S.current="horizontal"}else if(pe>0)S.current="vertical";else return}if(S.current==="horizontal"){y.current=!0,z(!0),x.current=ve,T(ve),ye.preventDefault();return}S.current==="vertical"&&(y.current=!0,z(!0),f.current=pe,R(pe),ye.preventDefault())},$e=()=>{if(!h.current)return;const ye=S.current,F=y.current;if(F&&ye==="horizontal")B(x.current),ie();else if(F&&ye==="vertical")if(f.current>$b){const pe=window.innerHeight;f.current=pe,I(!0),R(pe),V("closing")}else f.current=0,R(0),ie();else ye==="horizontal"&&Math.abs(x.current)>0&&(B(x.current),ie());h.current=null,S.current="none",x.current=0,y.current=!1,z(!1)};return document.addEventListener("touchstart",J,{passive:!0}),document.addEventListener("touchmove",te,{passive:!1}),document.addEventListener("touchend",$e),document.addEventListener("touchcancel",$e),()=>{document.removeEventListener("touchstart",J),document.removeEventListener("touchmove",te),document.removeEventListener("touchend",$e),document.removeEventListener("touchcancel",$e),X()}},[C,t.length,d,l,A,q,he]),s.useEffect(()=>{const U=X=>{X.key==="Escape"&&(X.preventDefault(),X.stopPropagation(),C!=="closing"&&V("closing"))};return window.addEventListener("keydown",U,!0),()=>window.removeEventListener("keydown",U,!0)},[C]);const Q=()=>{C!=="closing"&&V("closing")},be=C==="open",He=C==="closing",xe=$>0?Math.max(0,1-$/500):1,le=$>0?Math.max(.35,1-$/500):1,ee=U=>{if(U.stopPropagation(),w.current){w.current=!1;return}if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientY-X.top,j=Math.min(52,X.height*.2);if(!(ie>X.height-j)){if(U.clientX-X.left<X.width/2){l();return}d()}},ue=U=>{if(t.length<=1)return;const X=U.currentTarget.getBoundingClientRect(),ie=U.clientX-X.left,j=U.clientY-X.top,B=Math.min(52,X.height*.2);if(j>X.height-B){U.currentTarget.style.cursor="default";return}U.currentTarget.style.cursor=ie<X.width/2?"w-resize":"e-resize"},oe=s.useCallback(U=>{U.propertyName!=="transform"||!H.current||(he(),A(!1))},[he,A]),Fe=de?`translateX(${k}px)`:$>0?`translateY(${$}px)`:void 0,Ce={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:Fe,opacity:$>0?le:C==="opening"||He?0:1,transition:E&&!m?"none":m?`transform ${_n}ms ${vi}`:ne?`transform ${_n}ms ${vi}, opacity ${_n}ms ${vi}`:C==="opening"||He?`opacity ${_n}ms ${vi}`:"none",pointerEvents:ae&&be&&!de?"auto":"none",touchAction:ae&&be?"none":void 0,zIndex:9998},P=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:C==="open"?"none":void 0},onClick:Q,children:[a.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?xe:0,transition:E?"none":`opacity ${_n}ms ${vi}`,pointerEvents:"none"}}),a.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`,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:v,style:{width:"100%",height:"100%"}})}),a.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${_n}ms ${vi}`},children:t.length>1&&a.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),Y&&K&&(ae?a.jsx(Nb,{src:K.url,phase:C,mediaRef:g,mediaStyle:Ce,onLoadedMetadata:ce,onClick:ee,onMouseMove:ue,onTransitionEnd:oe},`${n}-${K.url}`):a.jsx("img",{ref:g,src:K.url,alt:K.name,onLoad:ce,onTransitionEnd:oe,style:Ce},`${n}-${K.url}`)),be&&P&&t.length>1&&!ae&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{...P,left:Y.left,cursor:"w-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),l()}}),a.jsx("div",{style:{...P,left:Y.left+Y.width/2,cursor:"e-resize",pointerEvents:de?"none":"auto"},onClick:U=>{if(w.current){w.current=!1;return}U.stopPropagation(),d()}})]})]})}function Tc({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:r,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const b=`${e}-gallery-${ps(t)?"video":"image"}`,v=r.display==="cover",g=_b(r),h=C=>D.scalingValue(C,l??!1),f=n??Di,x=o?{width:"100%",maxWidth:"100%"}:{width:h(f),maxWidth:"100%"},S=i?{borderRadius:h(i)}:{},y={...x,...v?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...S},w={...v?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(f)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...v?{}:S},N={className:b,style:w,onClick:p?C=>{C.stopPropagation(),p()}:void 0},Y=Math.max(d,xi),O=ps(t)?a.jsx("video",{...N,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):a.jsx("img",{...N,src:t.url,alt:t.name??""});return a.jsxs("div",{className:`${e}-gallery-item`,children:[v?a.jsx("div",{style:y,children:O}):O,c&&d>0&&a.jsx("div",{className:`${e}-padding-handle`,style:{height:h(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:h(Y)}})]})}function Ob({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:r,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const b=t==="a"?i:t==="c"?o:0,v=b>0||c;return a.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="c"&&a.jsx("div",{"data-controls":"galleryPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,left:0,width:u(l),height:"100%"}}),a.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&v&&a.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(b)},"aria-hidden":"true"}),c&&t==="a"&&a.jsx("div",{"data-controls":"galleryPaddingRight","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(d),className:`${e}-control-anchor`,style:{top:0,right:0,width:u(r),height:"100%"}})]})}function Db(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Lc({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 Rc({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),[b,v]=s.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return s.useLayoutEffect(()=>{if(!h)return;const f=p.current;if(!f||typeof ResizeObserver>"u")return;const x=()=>v(f.offsetHeight);x();const S=new ResizeObserver(x);return S.observe(f),()=>S.disconnect()},[g,h]),a.jsx("div",{ref:f=>{p.current=f,i(f)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${b}px`}:{},...r},children:a.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,a.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:a.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Ic=45;function Ec(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 jb(e){const t=Ec(e,"--cntrl-viewport-height",window.innerHeight),n=Ec(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function zb(e,t,n){const{top:i,centerY:o}=jb(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 Bb(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=zb(u,n,c);return Math.exp(-(p*p)/(2*Ic*Ic))});let o=0,r=-1;return i.forEach((l,d)=>{l>r&&(r=l,o=d)}),{opacities:i,dominantIndex:o}}function Vb(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(Bb(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 Gb(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 qb({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:r}){var Qe;const{prefix:l}=D.useScopedStyles(),d=s.useMemo(()=>wb(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",b=(e==null?void 0:e.imgWidth)??Di,v=(e==null?void 0:e.titleWidth)??Ab,g=Fb(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??xb,f=(e==null?void 0:e.position)??"center",x=(e==null?void 0:e.titleTopPadding)??0,S=(e==null?void 0:e.titleLeftPadding)??0,y=(e==null?void 0:e.titleRightPadding)??0,w=Db(e==null?void 0:e.transition),H=(e==null?void 0:e.lightbox)??"on",N=p==="b",Y=w==="fade"||w==="retype",{setTitleRef:O,dominantIndex:C}=Vb(c.length,Y,f),V=((Qe=c[C])==null?void 0:Qe.title)??"",$=Gb(V,w==="retype"),R=w==="fade"||w==="retype",k=w==="retype"?$:V,T=N?void 0:{width:D.scalingValue(b,n??!1)},m=H==="on"&&(!n||i||o),M=o??!1,E=(e==null?void 0:e.galleryPaddingRight)??0,z=(e==null?void 0:e.galleryPaddingLeft)??0,ne=(e==null?void 0:e.galleryPaddingBetween)??0,I=tt=>D.scalingValue(tt,n??!1),K={width:I(v)},ae=p==="a"?E:z,de=N?{width:"100%"}:{width:`calc(100% - ${I(b)} - ${I(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},A=Math.max(E,xi),he=Math.max(z,xi),q=Math.max(ne,xi),ce=Math.max(x,xi),Q=Math.max(S,xi),be=Math.max(y,xi),He=Math.max(0,(u??1)-(b??Di)),xe=p==="a"?Math.max(0,(u??1)-(b??Di)-E):p==="c"?Math.max(0,(u??1)-(b??Di)-z):p==="b"?u??1:1,le=M&&(p==="a"||p==="b"||p==="c")&&f==="top",ee=M&&((p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")),ue=M&&((p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"),oe=c.length>1,Fe=N?void 0:I((p==="c"?z:E)+(b??Di)),Ce=p==="c"&&Fe?{left:Fe}:void 0,P=p==="a"&&Fe?{right:Fe}:void 0,U=N?{left:0,width:"100%"}:p==="a"?{right:I(E),width:I(b)}:{left:I(z),width:I(b)},{titleColor:X,titleFontFamily:ie,titleFontSettings:j,titleFontSize:B,titleLineHeight:J,titleLetterSpacing:te,titleWordSpacing:$e,titleAlign:ye,titleTextAppearance:F,lightboxCounterColor:ve,lightboxCounterFontFamily:pe,lightboxCounterFontSettings:Z,lightboxCounterFontSize:me,lightboxCounterLineHeight:De,lightboxCounterLetterSpacing:ge,lightboxCounterWordSpacing:G,lightboxCounterTextAppearance:Me}=e??{},_e={fontSettings:{fontFamily:ie,fontWeight:(j==null?void 0:j.fontWeight)??400,fontStyle:(j==null?void 0:j.fontStyle)??"normal"},fontSize:B??.01,lineHeight:J,letterSpacing:te??0,wordSpacing:$e??0,textAlign:ye??"left",textAppearance:F,color:X??"#000000"},Je=sn(Yt(_e,n)),at=K,it=Cc(B,J,l,n),je=$c(B,J,`${l}-title`,`${l}-text-tight-leading`),Se={fontSettings:{fontFamily:pe,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:me??.01,lineHeight:De,letterSpacing:ge??0,wordSpacing:G??0,textAppearance:Me,color:ve??"#DEDDDD"},Be={...sn(Yt(Se,n)),...Cc(me,De,l,n)},Ze=$c(me,De,`${l}-lightbox-counter`,`${l}-text-tight-leading`),Le=D.buildColorVars(l,{titleColor:X??"#000000",lightboxCounterColor:ve??"#DEDDDD"},Tb,Lb),Ve=s.useRef(null),[se,Te]=s.useState(!1),[Xe,ze]=s.useState([]),[Re,Pe]=s.useState(0),Ae=s.useCallback((tt,nt)=>{m&&(ze(tt),Pe(nt),Te(!0))},[m]),Ke=s.useCallback(()=>{Te(!1)},[]),Oe=s.useMemo(()=>{const tt={...Le},nt=Ve.current?getComputedStyle(Ve.current).getPropertyValue("--cntrl-article-width").trim():"";return nt&&(tt["--cntrl-article-width"]=nt),tt},[Le,se]);return s.useEffect(()=>{if(!se||H!=="on"||typeof document>"u")return;const tt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=tt}},[se,H]),s.useEffect(()=>{!n||o||i||Te(!1)},[n,o,i]),s.useEffect(()=>{H==="off"&&Te(!1)},[H]),a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),a.jsx("div",{style:Le,children:a.jsxs("div",{ref:Ve,className:`${l}-wrapper`,style:{width:D.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&f==="top"?I(x):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(f==="left"||f==="top")||p==="c"&&(f==="left"||f==="top")?I(S):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&f==="right"||p==="a"&&f==="right"?I(y):void 0},children:[R&&a.jsx("div",{className:`${l}-single-title-layer`,children:a.jsx(Ba,{P:l,title:k,position:f,titleRef:()=>{},titleClassName:`${je} ${l}-single-title`,titleContainerStyle:{...it,...de},titleTextBoxStyle:at,titleStyle:Je,showTextBoxOutline:M,topPaddingControl:le?Lc({P:l,scaled:I,height:ce,paired:!1}):void 0})}),c.map((tt,nt)=>{const xt=Mb(tt.gallery),It=nt<c.length-1,Tt=xt.filter(ft=>ft.lightboxMedia).map(ft=>ft.lightboxMedia),ut={P:l,position:f,titleRef:O(nt),titleClassName:je,titleContainerStyle:it,titleTextBoxStyle:R?{maxWidth:"100%"}:at,titleStyle:Je,showTextBoxOutline:M&&!R,topPaddingControl:le&&!R?Lc({P:l,scaled:I,height:ce,paired:oe}):void 0};return a.jsxs("div",{"data-item-index":nt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:It?I(ne):void 0},children:[ee&&Rc({P:l,controlKey:"titleLeftPadding",scaled:I,width:Q,maxFraction:xe,side:"left",paired:oe,anchorStyle:Ce}),ue&&Rc({P:l,controlKey:"titleRightPadding",scaled:I,width:be,maxFraction:xe,side:"right",paired:oe,anchorStyle:P}),M&&It&&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:I(q),...U}}),N?a.jsxs("div",{className:`${l}-gallery`,children:[a.jsx("div",{className:`${l}-gallery-media`,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,imgWidth:b||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})}),a.jsx("div",{className:`${l}-title-layer`,children:a.jsx(Ba,{...ut,title:R?"":tt.title})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Ba,{...ut,title:R?"":tt.title}),xt.length>0&&a.jsx(Ob,{P:l,layoutType:p,galleryWidthStyle:T,galleryPaddingRight:E,galleryPaddingLeft:z,galleryPaddingRightWidth:A,galleryPaddingLeftWidth:he,galleryPaddingMaxFraction:He,showControls:M,scaled:I,children:xt.map(({displayMedia:ft,lightboxMedia:Et},Lt)=>{const bt=Et?Tt.findIndex(Nt=>Nt.url===Et.url):-1;return a.jsx(Tc,{P:l,media:ft,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ne,showPaddingAfter:Lt<xt.length-1,showControls:M,onMediaClick:m&&bt>=0?()=>Ae(Tt,bt):void 0},`${ft.url}-${Lt}`)})})]})]},nt)})]})}),se&&H==="on"&&typeof document<"u"&&e&&(()=>{const tt=(r?document.getElementById(r):null)??document.body;return Vn.createPortal(a.jsx("div",{style:Oe,"data-selection":"none",children:a.jsx(Hb,{prefix:l,items:Xe,index:Re,imageDisplay:Wb(e.lightboxImageDisplay),isEditor:n,onClose:Ke,onPrev:()=>Pe(nt=>(nt-1+Xe.length)%Xe.length),onNext:()=>Pe(nt=>(nt+1)%Xe.length),counterClassName:Ze,counterStyle:Be,backgroundColor:e.backgroundColor??Sb})}),tt)})()]})}const Xb=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
21040
21064
|
import { createPortal } from 'react-dom';
|
|
21041
21065
|
import type React from 'react';
|
|
21042
21066
|
import { CommonComponentProps } from '../props';
|
|
@@ -23086,7 +23110,7 @@ export function Mercury({
|
|
|
23086
23110
|
</>
|
|
23087
23111
|
);
|
|
23088
23112
|
}
|
|
23089
|
-
`;function Wi(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"}}},qb={type:"object",version:1,content:{type:"array",settings:{addItemWithoutImage:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{title:{type:"string",label:"Title",placeholder:"Add Title...",display:{type:"text-input"}},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:Wi("Gallery Padding Right"),galleryPaddingLeft:Wi("Gallery Padding Left"),galleryPaddingBetween:Wi("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:Wi("Title Top Padding"),titleLeftPadding:Wi("Title Left Padding"),titleRightPadding:Wi("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"]}},Xb={element:Vb,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:qb,sourceCode:Gb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Ec=48,Ub=10,Yb=400,Kb=1,Zb=1120/1440,Jb=140/1440,Qb=550/1440,ew=13,tw=4,nw=38/100,iw=28/100,pu=2.8,ow=.9,mu=.22,rw=.5,aw=1,sw=1.5,lw=0,cw=.85;function dw(e,t){return`
|
|
23113
|
+
`;function Wi(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"}}},Ub={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:Wi("Gallery Padding Right"),galleryPaddingLeft:Wi("Gallery Padding Left"),galleryPaddingBetween:Wi("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:Wi("Title Top Padding"),titleLeftPadding:Wi("Title Left Padding"),titleRightPadding:Wi("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"]}},Yb={element:qb,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:Ub,sourceCode:Xb,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},Mc=48,Kb=10,Zb=400,Jb=1,Qb=1120/1440,ew=140/1440,tw=550/1440,nw=13,iw=4,ow=38/100,rw=28/100,hu=2.8,aw=.9,fu=.22,sw=.5,lw=1,cw=1.5,dw=0,uw=.85;function pw(e,t){return`
|
|
23090
23114
|
.${e}-wrapper {
|
|
23091
23115
|
position: relative;
|
|
23092
23116
|
box-sizing: border-box;
|
|
@@ -23131,10 +23155,10 @@ export function Mercury({
|
|
|
23131
23155
|
object-position: center;
|
|
23132
23156
|
}
|
|
23133
23157
|
${t}
|
|
23134
|
-
`}function Qo(e){return Number(e.toFixed(4))}function
|
|
23158
|
+
`}function Qo(e){return Number(e.toFixed(4))}function Pc(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 mw(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 gw(e){const[t,n]=e.ratioValue.split(":").map(Number),i=e.reversed?n:t;return(e.reversed?t:n)/i}function hw(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 yu(e,t){return(1-e)/(1-e*Math.cos(t))}function fw(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)*yu(e,i)))}return t||1}function yw(e,t){return e?1:1+fu*(.35+t)}function vw(e,t,n,i){const o=t*yw(n,i);return Math.max(0,(e-o)/2)}function vu(e,t,n){const i=yu(e,n);return{offset:Math.sin(n)*i/t,scale:i}}function xu(e,t,n){return e/2+t*n}function xw(e,t,n){return e(t-n/2)}function bw(e,t){return e*t}function bu(e){return Math.round(e*1e3)}function wu(e,t,n){const i=Math.cos(e),o=Math.cos(uw*Math.PI/2);if(i>=o)return n;const r=(i+1)/(o+1);return Qo(t+(n-t)*r)}function Su(e){return wu(e,sw,lw)}function ww(e){return wu(e,cw,dw)}function $u(e,t){if(!t)return"none";const n=ww(e);return n<=0?"none":`blur(${n}px)`}function Sw(e,t,n,i,o,r,l,d){const{offset:c,scale:u}=vu(i,o,r*Math.PI*2),p=r*Math.PI*2,b=xu(t,n,c),v=Qo(u),g=`calc(${e(b)} - var(--helix-base-w) * ${v} / 2)`,h=`calc(var(--helix-base-w) * ${v})`,f=l?`height: calc(var(--helix-base-h) * ${v});`:"";return`left: ${g}; width: ${h}; ${f} z-index: ${bu(u)}; transform: translateY(-50%); opacity: ${Su(p)}; filter: ${$u(p,d)};`}function $w(e,t,n,i,o,r,l,d){const c=[];for(let u=0;u<=Mc;u+=1){const p=u/Mc;c.push(` ${Qo(p*100)}% { ${Sw(t,n,i,o,r,p,l,d)} }`)}return`@keyframes ${e}-orbit {
|
|
23135
23159
|
${c.join(`
|
|
23136
23160
|
`)}
|
|
23137
|
-
}`}function
|
|
23161
|
+
}`}function Cu(e,t){return(e%t+t)%t}function Cw(e,t){return il(e,t)/t}function il(e,t){return Cu(e,t)}function Tw(e,t){return Math.floor(e/t)}function Lw(e,t,n,i){return Tw(e,t)*n+il(e,t)*i}function Rw(e,t,n){const i=n==="left"?1-e:e;return`${Qo(-i*t)}s`}function kc(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function Tu(e){const t=e%1;return t<0?t+1:t}function Iw(e,t,n){const i=t/hu,o=n==="left"?-e*i:e*i;return Tu(o)}function Ew({settings:e,content:t,isEditor:n,isPreviewMode:i}){const{prefix:o}=D.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),Qb),d=Ga(e==null?void 0:e.imageWidth,ew),c=Ga(e==null?void 0:e.turnHeight,tw),u=Pc(e==null?void 0:e.itemsPerTurn,nw,3,40),p=Pc(e==null?void 0:e.turns,iw,1,30),b=Math.min(aw,Math.max(0,ow)),v=Math.min(1,Math.max(0,rw)),g=Math.max(0,(e==null?void 0:e.speed)??hu),h=(e==null?void 0:e.direction)==="left"?"left":"right",f=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",x=(e==null?void 0:e.cornerRadius)??0,S=(e==null?void 0:e.blur)!=="off",y=s.useMemo(()=>mw(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),w=y.display==="cover",H=de=>D.scalingValue(de,n??!1),N=s.useMemo(()=>fw(b),[b]),Y=s.useMemo(()=>vw(l,d,w,v),[l,d,w,v]),O=s.useMemo(()=>pw(o,$w(o,H,l,Y,b,N,w,S)),[o,l,Y,b,N,w,S,n]),C=s.useMemo(()=>(t??[]).filter(de=>{var A;return!!((A=de.image)!=null&&A.url)}),[t]),V=c/u,$=d*gw(y),R=Math.min(Zb,p*u),k=Jb*u,T=R+k*2,M=Math.max(0,p-1)*c+(u-1)*V,E=g>0,z=f==="scroll"&&E,ne=f==="autoplay"&&E&&(n?!!i:!0),[I,W]=s.useState(0);s.useEffect(()=>{if(!z)return;const de=r.current;if(!de)return;const A=()=>{const q=de.getBoundingClientRect(),ce=window.innerHeight||document.documentElement.clientHeight,Q=ce+q.height;Q<=0||W(Math.min(1,Math.max(0,(ce-q.top)/Q)))};A(),window.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A);const he=new ResizeObserver(A);return he.observe(de),()=>{window.removeEventListener("scroll",A),window.removeEventListener("resize",A),he.disconnect()}},[z]);const K=z?Iw(I,g,h):0,ae=E&&f==="autoplay"?360/(g*Kb):0;return C.length===0?a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{className:`${o}-wrapper`,style:{width:H(l),marginInline:"auto"}})]}):a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:O}}),a.jsx("div",{ref:r,className:`${o}-wrapper`,style:{width:H(l),height:H(M),marginInline:"auto"},children:Array.from({length:T},(de,A)=>{const he=A-k,ce=C[Cu(he,C.length)].image,Q=il(he,u),be=Cw(he,u),He=z?Tu(be+K):be,xe=Lw(he,u,c,V),le=v===0?0:(kc(Q+7.3)-.5)*v*V,ee=w?1:1+(kc(Q+3.1)-.5)*2*fu*(.35+v),ue=He*Math.PI*2,{offset:oe,scale:Fe}=vu(b,N,ue),Ce=d*ee,P=bw(Ce,Fe),U=xu(l,Y,oe),X={"--helix-base-w":H(Ce),...w?{"--helix-base-h":H($)}:{}},ie={top:H(xe+le),transform:"translateY(-50%)",...X,...ne?{animationDuration:`${Qo(ae)}s`,animationDelay:Rw(be,ae,h),animationDirection:h==="left"?"reverse":"normal"}:{left:xw(H,U,P),width:H(P),...w?{height:H($*Fe)}:{},zIndex:bu(Fe),opacity:Su(ue),filter:$u(ue,S)}},j=x>0?{borderRadius:H(x)}:{},B=w?{...j,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:j,J=hw(ce)?a.jsx("video",{className:`${o}-media`,style:B,src:ce.url,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):a.jsx("img",{className:`${o}-media`,style:B,src:ce.url,alt:ce.name??"",loading:"lazy",decoding:"async"});return a.jsx("div",{className:ne?`${o}-item`:`${o}-item ${o}-item-static`,style:ie,children:w?a.jsx("div",{className:`${o}-cover`,style:j,children:J}):J},`${p}-${u}-${he}`)})})]})}const Mw=`import { useEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
23138
23162
|
import { CommonComponentProps } from '../props';
|
|
23139
23163
|
import { scalingValue } from '../utils/scalingValue';
|
|
23140
23164
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -23672,7 +23696,7 @@ export function Helix({
|
|
|
23672
23696
|
</>
|
|
23673
23697
|
);
|
|
23674
23698
|
}
|
|
23675
|
-
`,Ew=["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"],Mw={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:Ew.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"]}]}]},Pw={element:Rw,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:Mw,sourceCode:Iw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},kc=120,Ac=3,kw=.12,ol={x:0,y:0,width:100,height:100};function Yi(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 Fc(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 Aw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Fw(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 _w(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 Ww(i)}function Ww(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 Nw(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 Hw(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 Ow(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 Dw(e,t,n,i){let o=null;for(let r=0;r<Ac;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Ac-1)),d=_w(e,l),c=i==="avoid"?Hw(d):d;if(o=o===null?c:Nw(o,c),o.length===0)return[]}return o??[]}function _c(e,t="stretch",n=ol){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ri(i),d=Vo(l);if(d.length)return t==="viewbox"?Yi(d,n):qa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",b),u.appendChild(y);let g=0;try{g=y.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<kc;f+=1){const x=y.getPointAtLength(f/kc*g);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Yi(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"?Yi([r],n):qa([r])}const rl={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"},ms="0 0 100 100",Xr=100,gs=16,jw=12,zw=16,Xa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Bw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Wc=Math.PI/4,Vw=8,Gw=Math.PI/18,qw=8,zi=24,Bi=[];function Xw(){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 an(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Uw(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:an(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Yw(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 an(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Nc(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=ri(d);c.length&&(l=n==="viewbox"?Ua(c,i):Uw(c))}if(!l.length){const c=o!=="custom"?rl[o]:void 0;c?l=Ua(ri(c),ol):l=Xw()}}return o==="circle"?Yw(l,r):l}function Hc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":co(an(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function hs(e){const t=e==="rectangle"||e==="custom"?void 0:rl[e];return t?Yi(Vo(ri(t)),ol):[Fw([[0,0],[1,0],[1,1],[0,1]])]}function Kw(e){const t=e.match(Bw);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 fs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function rn(e){return{x:e.x,y:e.y}}function Zw(e){return{p:rn(e.p),in:e.in?rn(e.in):null,out:e.out?rn(e.out):null}}function Mn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Zw)}))}function an(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 Oc(e,t,n,i=n){return an(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Jw(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:rn(e),c2:rn(l),p:rn(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),y=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*y+b*g,f=-b*y+p*g,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ne=Math.sqrt(x);d*=ne,c*=ne}const S=o===r?-1:1,v=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-v),H=v===0?0:S*Math.sqrt(w/v),N=H*d*f/c,Y=-H*c*h/d,D=p*N-b*Y+(e.x+l.x)/2,C=b*N+p*Y+(e.y+l.y)/2,V=Math.atan2((f-Y)/c,(h-N)/d);let I=Math.atan2((-f-Y)/c,(-h-N)/d)-V;!r&&I>0&&(I-=Math.PI*2),r&&I<0&&(I+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(I)/(Math.PI/2))),T=I/k,m=4/3*Math.tan(T/4),M=(ne,R)=>({x:D+p*d*ne-b*c*R,y:C+b*d*ne+p*c*R}),E=[];let z=V;for(let ne=0;ne<k;ne+=1){const R=z+T,W=Math.cos(z),K=Math.sin(z),ae=Math.cos(R),de=Math.sin(R);E.push({c1:M(W-m*K,K+m*W),c2:M(ae+m*de,de-m*ae),p:ne===k-1?rn(l):M(ae,de)}),z=R}return E}function ri(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const g=i[0],h=i[i.length-1];Math.abs(g.p.x-h.p.x)<1e-6&&Math.abs(g.p.y-h.p.y)<1e-6&&(g.in=h.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,h)=>{i.push({p:g,in:An(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=An(g,h.p)};Xa.lastIndex=0;let y=Xa.exec(t);for(;y!==null;){const g=y[1],h=g.toUpperCase(),f=g!==h,x=Kw(y[2]),S=v=>f?{x:r.x+x[v],y:r.y+x[v+1]}:{x:x[v],y:x[v+1]};if(h==="Z")o=!0,u(),r=rn(l),d=null,c=null;else if(h==="M"){for(let v=0;v+1<x.length;v+=2){const w=S(v);v===0&&(u(),l=rn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let v=0;v+1<x.length;v+=2)p(S(v));d=null,c=null}else if(h==="H"){for(const v of x)p({x:f?r.x+v:v,y:r.y});d=null,c=null}else if(h==="V"){for(const v of x)p({x:r.x,y:f?r.y+v:v});d=null,c=null}else if(h==="C"){for(let v=0;v+5<x.length;v+=6){const w=S(v),H=S(v+2),N=S(v+4);b(w),p(N,H),d=H}c=null}else if(h==="S"){for(let v=0;v+3<x.length;v+=4){const w=d?fs(d,r):rn(r),H=S(v),N=S(v+2);b(w),p(N,H),d=H}c=null}else if(h==="Q")for(let v=0;v+3<x.length;v+=4){const w=S(v),H=S(v+2);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="T")for(let v=0;v+1<x.length;v+=2){const w=c?fs(c,r):rn(r),H=S(v);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="A")for(let v=0;v+6<x.length;v+=7){const w=f?{x:r.x+x[v+5],y:r.y+x[v+6]}:{x:x[v+5],y:x[v+6]};for(const H of Jw(r,x[v],x[v+1],x[v+2],x[v+3]!==0,x[v+4]!==0,w))b(H.c1),p(H.p,H.c2);d=null,c=null}y=Xa.exec(t)}return u(),n}function In(e){return`${Number(e.toFixed(2))}`}function An(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function $u(e){return!!(An(e.in,e.p)||An(e.out,e.p))}function er(e,t){return!An(e.out,e.p)&&!An(t.in,t.p)}function Dc(e,t){if(er(e,t))return`L${In(t.p.x)},${In(t.p.y)}`;const n=An(e.out,e.p)??e.p,i=An(t.in,t.p)??t.p;return`C${In(n.x)},${In(n.y)} ${In(i.x)},${In(i.y)} ${In(t.p.x)},${In(t.p.y)}`}function co(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${In(i.p.x)},${In(i.p.y)}`);let r=i;for(const l of o)t.push(Dc(r,l)),r=l;if(n.closed){const l=Dc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Cu(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 ys(e,t,n){if(er(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 Vo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Cu(n)){if(er(o.from,o.to)){i.push(rn(o.from.p));continue}for(let r=0;r<gs;r+=1)i.push(ys(o.from,o.to,r/gs))}n.closed||i.push(rn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Vo(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 Qw(e){const t=ei(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 Tu(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 Lu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=jw)return{closed:!0,nodes:t.map(r=>({p:rn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/zw)),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:rn(r),...Tu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Ru(e,t,n=1){if(!e.length)return!1;const i=ei(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 eS(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:an(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function tS(e,t){if(!e.length)return e;const n=ei(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 an(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Iu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?rl[e]:void 0,i=n?an(ri(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):an(Lu(hs("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=tS(i,t);return{shape:e,customPath:co(o),pathFit:"viewbox",pathViewBox:ms}}function Sr(e,t){return t>0?Math.round(e/t)*t:e}function nS(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=Mn(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 jc(e,t,n,i){var r;if(!t.length)return e;const o=Mn(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 iS(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=Eu(i,r,d)}),i}function oS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Mn(e),c=d[t].nodes[n];if(c[i]=rn(o),r){const p=i==="in"?"out":"in";c[p]=fs(o,c.p)}return d}function rS(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=Mn(e);return r[t].nodes[n][i]=null,r}function aS(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=Mn(e),c=d[t].nodes,u=n+1;if(er(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,b=l.in??l.p,y=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(y,g,i),x=hn(g,h,i),S=hn(f,x,i),v=(n+1)%o.nodes.length;return c[n].out=y,c[v].in=h,c.splice(u,0,{p:S,in:f,out:x}),{contours:d,nodeIndex:u}}function Eu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Mn(e);return o[t].nodes.splice(n,1),o}function zc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Mn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!An(l[u].out,l[u].p),y=!!An(l[p].in,l[p].p);if($u(d)||b||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Tu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function sS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function lS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Cu(i)){const l=er(r.from,r.to)?1:gs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=sS(t,ys(r.from,r.to,c),ys(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function cS(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 Bc(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 Vc(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 dS(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 uS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function vs(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 pS(e,t){const n=vs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function xs(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 Gc(e,t,n,i,o){if(e.axis===null)return pS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function mS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(Gc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(Gc(n,"y",l,i,o)),r}function gS(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 vs(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 vs(i(p),r)}function hS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Bi};const y=Math.atan2(p,u),g=Math.round(y/Wc)*Wc;let h=o?g:null,f=!1;if(!o){const Y=[];n&&Y.push({angle:Math.atan2(n.y,n.x),smooth:!0}),Y.push({angle:g,smooth:!1});for(const D of Y){const C=uS(D.angle-y);if(!(Math.abs(C)>Gw)&&!(Math.abs(Math.sin(C))*b>Vw)){h=D.angle,f=D.smooth;break}}}const x=i!==null&&i>0&&Math.abs(b-i)<=qw;if(h===null&&!x)return{point:e,guides:Bi};const S=h??y,v=x?i:b,w={x:Math.cos(S),y:Math.sin(S)},H=v+(h===null?0:zi),N=x?v:f?zi:0;return{point:l({x:d.x+w.x*v,y:d.y+w.y*v}),guides:[{kind:"angle",a:{x:d.x-w.x*N,y:d.y-w.y*N},b:{x:d.x+w.x*H,y:d.y+w.y*H}}]}}const bs=.1,ws=8,fS=4,qc=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}}},Mu=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ss=(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*qc,y:n.y+o*qc}},$s=(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),Si=(e,t,n)=>{const i=$s(e,t)*n;return{width:t.width*i,height:t.height*i}},En=(e,t,n)=>(e-t)*n,Vi=(e,t,n)=>{const i=e-t;return Math.abs(i)<fS?.5:qr(n/i)},yS=(e,t,n,i,o,r)=>{const l=Si(e,n,r),d=e.x+En(e.width,l.width,i),c=e.y+En(e.height,l.height,o),u=$s(e,n),p=$s(t,n),b=Math.min(ws,Math.max(bs,p>0?r*(u/p):r)),y=Si(t,n,b);return{focalX:Vi(t.width,y.width,d-t.x),focalY:Vi(t.height,y.height,c-t.y),scale:b}},Xc=1.08,$r=14,Cr=8;function vS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:b,onCommit:y}){const g=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),S=s.useRef({focalX:c,focalY:u,scale:p});S.current={focalX:c,focalY:u,scale:p};const v=l==="image";s.useEffect(()=>{var T;v&&((T=g.current)==null||T.focus({preventScroll:!0}))},[v]);const w=s.useCallback((T,m)=>{var E;const M=(E=g.current)==null?void 0:E.getBoundingClientRect();return!M||M.width<=0||M.height<=0?{x:0,y:0}:{x:(T-M.left)/M.width*t.width,y:(m-M.top)/M.height*t.height}},[t.width,t.height]),H=T=>{var M,E;if(!i)return;T.stopPropagation(),T.preventDefault(),(M=g.current)==null||M.focus({preventScroll:!0});const m=Si(n,i,p);f.current={pointerId:T.pointerId,origin:w(T.clientX,T.clientY),startX:En(n.width,m.width,c),startY:En(n.height,m.height,u),width:m.width,height:m.height,moved:!1},(E=g.current)==null||E.setPointerCapture(T.pointerId)},N=(T,m)=>{var ae,de;if(!i)return;T.stopPropagation(),T.preventDefault(),(ae=g.current)==null||ae.focus({preventScroll:!0});const M=Si(n,i,p),E=En(n.width,M.width,c),z=En(n.height,M.height,u),ne={minX:E,minY:z,maxX:E+M.width,maxY:z+M.height},R=Ur(ne,Mu(m)),W=Ur(ne,m),K=Math.hypot(W.x-R.x,W.y-R.y);!isFinite(K)||K<=0||(x.current={pointerId:T.pointerId,anchor:R,startDistance:K,startScale:p,startX:E,startY:z,moved:!1},(de=g.current)==null||de.setPointerCapture(T.pointerId))},Y=T=>{if(!i)return;const m=x.current;if(m&&T.pointerId===m.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z={x:E.x-n.x,y:E.y-n.y},ne=Math.hypot(z.x-m.anchor.x,z.y-m.anchor.y),R=Math.min(ws,Math.max(bs,m.startScale*(ne/m.startDistance)));if(!m.moved&&Math.abs(R-m.startScale)<1e-4)return;m.moved=!0;const W=R/m.startScale,K=m.anchor.x+(m.startX-m.anchor.x)*W,ae=m.anchor.y+(m.startY-m.anchor.y)*W,de=Si(n,i,R);b({focalX:Vi(n.width,de.width,K),focalY:Vi(n.height,de.height,ae),scale:R});return}const M=f.current;if(M&&T.pointerId===M.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z=E.x-M.origin.x,ne=E.y-M.origin.y;if(!M.moved&&z===0&&ne===0)return;M.moved=!0,b({focalX:Vi(n.width,M.width,M.startX+z),focalY:Vi(n.height,M.height,M.startY+ne),scale:p})}},D=T=>{var E,z;const m=f.current;if(m&&T.pointerId===m.pointerId){f.current=null,T.stopPropagation(),(E=g.current)!=null&&E.hasPointerCapture(m.pointerId)&&g.current.releasePointerCapture(m.pointerId),m.moved&&y(S.current);return}const M=x.current;M&&T.pointerId===M.pointerId&&(x.current=null,T.stopPropagation(),(z=g.current)!=null&&z.hasPointerCapture(M.pointerId)&&g.current.releasePointerCapture(M.pointerId),M.moved&&y(S.current))},C=T=>{if(T.key==="Escape"){T.stopPropagation(),d("none");return}if(T.key==="="||T.key==="+"||T.key==="-"||T.key==="_"){T.preventDefault(),T.stopPropagation();const m=T.key==="="||T.key==="+",M=Math.min(ws,Math.max(bs,p*(m?Xc:1/Xc))),E={focalX:c,focalY:u,scale:M};b(E),y(E)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},I=s.useMemo(()=>{const T=i??{width:n.width,height:n.height},m=Si(n,T,p);return!(m.width>0)||!(m.height>0)?null:{x:n.x+En(n.width,m.width,c),y:n.y+En(n.height,m.height,u),width:m.width,height:m.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=I?{minX:I.x,minY:I.y,maxX:I.x+I.width,maxY:I.y+I.height}:$;return a.jsxs("svg",{ref:g,className:`${e}-editor${v?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:C,onPointerMove:Y,onPointerUp:D,onPointerCancel:D,onLostPointerCapture:D,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),v&&o&&I&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:I.x,y:I.y,width:I.width,height:I.height,children:[a.jsx("rect",{x:I.x,y:I.y,width:I.width,height:I.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:I.x,y:I.y,width:I.width,height:I.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:I.x,y:I.y,width:I.width,height:I.height})]}),v&&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:H}),V.map(T=>{const m=Ss(k,T),M=T==="ne"||T==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:m.x-Cr/2,y:m.y-Cr/2,width:Cr,height:Cr}),a.jsx("rect",{className:`${e}-editor-scale-grab${M?` ${e}-editor-scale-grab-nesw`:""}`,x:m.x-$r/2,y:m.y-$r/2,width:$r,height:$r,onPointerDown:E=>N(E,T)})]},T)})]})]})}const xS=36,$o=7,bS=4,Co=9,wS=3.5,Uc=1.08,SS=.05,Tr=14,$S=1,Lr=14,Rr=8;function CS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:b}){const y=s.useRef(null),g=s.useRef(null),h=s.useRef(i);h.current=i;const f=s.useRef(null),x=s.useRef(null),S=s.useRef(null),v=s.useRef(null),[w,H]=s.useState([]),[N,Y]=s.useState(Bi),D=s.useCallback(P=>{Y(U=>dS(U,P)?U:P)},[]),C=d==="shape";s.useEffect(()=>{var P;C&&((P=y.current)==null||P.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||H(P=>P.length?[]:P)},[C]);const V=w.length>0;s.useEffect(()=>{u==null||u(V)},[V,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const $=n.width>0?t.width/n.width:1,I=n.height>0?t.height/n.height:1,k=Math.min($,I),T=r&&l?k:$,m=r&&l?k:I,M=r&&l?(t.width-n.width*k)/2:0,E=r&&l?(t.height-n.height*k)/2:0,z=s.useCallback(P=>r?{x:M+(P.x-n.x)*T,y:E+(P.y-n.y)*m}:{x:P.x-n.x,y:P.y-n.y},[r,n,T,m,M,E]),ne=s.useCallback(P=>r?{x:n.x+(T>0?(P.x-M)/T:0),y:n.y+(m>0?(P.y-E)/m:0)}:{x:n.x+P.x,y:n.y+P.y},[r,n,T,m,M,E]),R=s.useMemo(()=>ne({x:t.width/2,y:t.height/2}),[ne,t.width,t.height]),W=s.useCallback((P,U)=>{var ie;const X=(ie=y.current)==null?void 0:ie.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const j=(P-X.left)/X.width*t.width,B=(U-X.top)/X.height*t.height;return{x:n.x+(T>0?(j-M)/T:0),y:n.y+(m>0?(B-E)/m:0)}}return{x:n.x+(P-X.left),y:n.y+(U-X.top)}},[r,n,t.width,t.height,T,m,M,E]),K=s.useCallback((P,U)=>{var ie;const X=(ie=y.current)==null?void 0:ie.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(P-X.left)/X.width*t.width,y:(U-X.top)/X.height*t.height}},[t.width,t.height]),ae=s.useCallback((P,U)=>{const X=l&&!(U!=null&&U.preserveShape)?eS(P,n,t,M,E,T,m):P;b(X,U)},[b,l,n,t,M,E,T,m]),de=P=>{var De;const U=P.metaKey||P.ctrlKey,X=S.current;if(X&&P.pointerId===X.pointerId){if(P.stopPropagation(),P.preventDefault(),X.startDistance<=0)return;const ge=W(P.clientX,P.clientY),G=Math.hypot(ge.x-X.origin.x,ge.y-X.origin.y),ke=Math.max(SS,G/X.startDistance);if(!X.moved&&Math.abs(ke-1)<1e-4)return;X.moved=!0,p(Oc(X.startContours,X.origin,ke));return}const ie=x.current;if(ie&&P.pointerId===ie.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY),{bbox:G}=ie,ke=G.maxX-G.minX,Fe=G.maxY-G.minY,rt=ge.x-ie.origin.x,Je=ge.y-ie.origin.y;let at=rt,nt=Je;if(isFinite(ke)&&isFinite(Fe))if(r){let $e=n.x,Ae=n.x+n.width,Be=n.y,Ke=n.y+n.height;l&&(T>0&&($e=n.x+(0-M)/T,Ae=n.x+(t.width-M)/T),m>0&&(Be=n.y+(0-E)/m,Ke=n.y+(t.height-E)/m));const Ie=Math.min($e,Ae-ke),ze=Math.max($e,Ae-ke),se=Math.min(Be,Ke-Fe),Re=Math.max(Be,Ke-Fe),qe=Math.min(ze,Math.max(Ie,G.minX+rt)),we=Math.min(Re,Math.max(se,G.minY+Je));at=qe-G.minX,nt=we-G.minY}else{const $e=G.minX-n.x,Ae=G.minY-n.y,Be=Math.min(0,t.width-ke),Ke=Math.max(0,t.width-ke),Ie=Math.min(0,t.height-Fe),ze=Math.max(0,t.height-Fe),se=Math.min(Ke,Math.max(Be,$e+rt)),Re=Math.min(ze,Math.max(Ie,Ae+Je));at=se-$e,nt=Re-Ae}const je=[];if(!U&&isFinite(ke)&&isFinite(Fe)){const $e=z({x:G.minX+ke/2+at,y:G.minY+Fe/2+nt}),Ae={x:t.width/2,y:t.height/2};Math.abs($e.x-Ae.x)<=Tr&&(at=R.x-G.minX-ke/2,je.push(xs(Ae.x,"x",t))),Math.abs($e.y-Ae.y)<=Tr&&(nt=R.y-G.minY-Fe/2,je.push(xs(Ae.y,"y",t)))}if(!ie.moved&&at===0&&nt===0)return;ie.moved=!0,D(je.length?je:Bi),p(an(ie.startContours,$e=>({x:$e.x+at,y:$e.y+nt})),{carryImage:!0});return}const j=v.current;if(j&&P.pointerId===j.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY);let G=ge.x-j.origin.x,ke=ge.y-j.origin.y;if(P.shiftKey&&(Math.abs(G)>Math.abs(ke)?ke=0:G=0),!j.moved&&G===0&&ke===0)return;j.moved=!0,p(jc(j.startContours,j.selection,G,ke));return}const B=f.current;if(!B||P.pointerId!==B.pointerId)return;P.stopPropagation(),P.preventDefault();const J=W(P.clientX,P.clientY);if(B.kind==="anchor"){const ge={x:B.anchor.x+(J.x-B.origin.x),y:B.anchor.y+(J.y-B.origin.y)},G=U?[]:cS(h.current,{contour:B.contour,node:B.node}),ke=U||!B.center?[]:[B.center],Fe=Vc(Bc(G,ke.map(at=>at.x),"x"),ge,"x",z,Tr),rt=Vc(Bc(G,ke.map(at=>at.y),"y"),ge,"y",z,Tr),Je=U?ge:{x:(Fe==null?void 0:Fe.value)??Sr(ge.x,o),y:(rt==null?void 0:rt.value)??Sr(ge.y,o)};if(P.shiftKey&&(Math.abs(Je.x-B.anchor.x)>Math.abs(Je.y-B.anchor.y)?Je.y=B.anchor.y:Je.x=B.anchor.x),!B.moved&&Je.x===B.anchor.x&&Je.y===B.anchor.y)return;B.moved=!0,D(mS(Je,Fe,rt,t,z)),p(nS(h.current,B.contour,B.node,Je));return}const te=(De=h.current[B.contour])==null?void 0:De.nodes[B.node],Ce=B.mirror&&!P.altKey,ye=Ce||U?null:B.kind==="in"?te==null?void 0:te.out:te==null?void 0:te.in,F=te?z(te.p):null,ve=ye?z(ye):null,pe=te&&(!U||P.shiftKey)?hS(J,te.p,Ce||U?null:gS(h.current[B.contour],B.node,B.kind,z),F&&ve?Math.hypot(ve.x-F.x,ve.y-F.y):null,P.shiftKey,z,ne):{point:J,guides:Bi},Z=pe.guides.length?pe.point:U?J:{x:Sr(J.x,o),y:Sr(J.y,o)},me=B.kind==="in"?te==null?void 0:te.in:te==null?void 0:te.out;!B.moved&&me&&Z.x===me.x&&Z.y===me.y||(B.moved=!0,D(pe.guides),p(oS(h.current,B.contour,B.node,B.kind,Z,Ce)))},A=P=>{D(Bi);const U=S.current;if(U&&P.pointerId===U.pointerId){S.current=null,P.stopPropagation();const ye=y.current;ye!=null&&ye.hasPointerCapture(U.pointerId)&&ye.releasePointerCapture(U.pointerId),U.moved&&ae(h.current,{preserveShape:!0});return}const X=x.current;if(X&&P.pointerId===X.pointerId){x.current=null,P.stopPropagation();const ye=y.current;ye!=null&&ye.hasPointerCapture(X.pointerId)&&ye.releasePointerCapture(X.pointerId),X.moved?ae(h.current,{preserveShape:!0}):H([]);return}const ie=v.current;if(ie&&P.pointerId===ie.pointerId){v.current=null,P.stopPropagation();const ye=y.current;ye!=null&&ye.hasPointerCapture(ie.pointerId)&&ye.releasePointerCapture(ie.pointerId),ie.moved&&ae(h.current);return}const j=f.current;if(!j||P.pointerId!==j.pointerId)return;f.current=null,P.stopPropagation();const B=y.current;B!=null&&B.hasPointerCapture(j.pointerId)&&B.releasePointerCapture(j.pointerId);const J=Math.hypot(P.clientX-j.clientOrigin.x,P.clientY-j.clientOrigin.y);if(j.moved||J>bS){j.moved&&ae(h.current);return}if(!j.toggleOnRelease||P.type!=="pointerup")return;const Ce=zc(h.current,j.contour,j.node);Ce!==h.current&&(p(Ce),ae(Ce))},he=P=>{P.stopPropagation()},q=P=>{var U,X;P.stopPropagation(),P.preventDefault(),(U=y.current)==null||U.focus({preventScroll:!0}),x.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),bbox:ei(i),moved:!1},(X=y.current)==null||X.setPointerCapture(P.pointerId)},ce=(P,U)=>{var J,te;P.stopPropagation(),P.preventDefault(),(J=y.current)==null||J.focus({preventScroll:!0}),H([]),c("shape");const X=ei(i),ie=Ur(X,Mu(U)),j=Ss(X,U),B=Math.hypot(j.x-ie.x,j.y-ie.y);!isFinite(B)||B<=0||(S.current={pointerId:P.pointerId,corner:U,origin:ie,startDistance:B,startContours:Mn(i),moved:!1},(te=y.current)==null||te.setPointerCapture(P.pointerId))},Q=(P,U,X,ie)=>{var J,te,Ce,ye;P.stopPropagation(),P.preventDefault(),(J=y.current)==null||J.focus({preventScroll:!0});const j=(te=i[X])==null?void 0:te.nodes[ie];if(!j)return;if(P.altKey){const F=U==="anchor"?Eu(i,X,ie):rS(i,X,ie,U);if(F===i)return;H(U==="anchor"?[]:[{contour:X,node:ie}]),p(F),ae(F);return}const B=P.metaKey||P.ctrlKey;if(U==="anchor"&&P.shiftKey&&!B){H(F=>F.some(ve=>ve.contour===X&&ve.node===ie)?F.filter(ve=>!(ve.contour===X&&ve.node===ie)):[...F,{contour:X,node:ie}]);return}if(U==="anchor"&&!B&&w.length>1&&w.some(F=>F.contour===X&&F.node===ie)){v.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),selection:w,moved:!1},(Ce=y.current)==null||Ce.setPointerCapture(P.pointerId);return}H([{contour:X,node:ie}]),f.current={kind:U,contour:X,node:ie,pointerId:P.pointerId,origin:W(P.clientX,P.clientY),clientOrigin:{x:P.clientX,y:P.clientY},anchor:j.p,center:Qw(i),mirror:U!=="anchor"&&!!(j.in&&j.out),toggleOnRelease:B,moved:!1},(ye=y.current)==null||ye.setPointerCapture(P.pointerId)},be=P=>{P.stopPropagation(),P.preventDefault();const U=an(i,z),X=lS(U,K(P.clientX,P.clientY));if(!X||X.distance>xS)return;const{contours:ie,nodeIndex:j}=aS(i,X.contour,X.segment,X.t);j<0||(H([{contour:X.contour,node:j}]),p(ie),ae(ie))},We=P=>{if(P.key==="="||P.key==="+"||P.key==="-"||P.key==="_"){P.preventDefault(),P.stopPropagation();const B=ei(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const J={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},Ce=P.key==="="||P.key==="+"?Uc:1/Uc,ye=Oc(i,J,Ce);p(ye),ae(ye,{preserveShape:!0});return}if(P.key==="Escape"){P.stopPropagation(),H([]),c("none");return}if(!w.length)return;if(P.key==="Backspace"||P.key==="Delete"){P.preventDefault(),P.stopPropagation();const B=iS(i,w);if(B===i)return;H([]),p(B),ae(B);return}const U=o>0?o:$S,X=P.shiftKey?U*10:U,ie={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[P.key];if(!ie)return;P.preventDefault(),P.stopPropagation();const j=jc(i,w,ie[0],ie[1]);p(j),ae(j)},xe=s.useMemo(()=>co(an(i,z)),[i,z]),le=s.useMemo(()=>ei(i),[i]),ee=z({x:le.minX,y:le.minY}),ue={width:z({x:le.maxX,y:le.minY}).x-ee.x,height:z({x:le.minX,y:le.maxY}).y-ee.y},oe=C&&w.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Ne=w.length>0||C,Te=Ne;return a.jsxs("svg",{ref:y,className:`${e}-editor${Ne?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:We,onPointerDown:()=>{var P;return(P=y.current)==null?void 0:P.focus({preventScroll:!0})},onPointerMove:de,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:A,onContextMenu:P=>{P.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{H([]),c("none")},onClick:be}),Te&&a.jsx("path",{className:`${e}-editor-hit`,d:xe,onClick:be}),Te&&a.jsx("path",{className:`${e}-editor-outline`,d:xe}),Te&&N.map((P,U)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${P.kind}`,x1:P.a.x,y1:P.a.y,x2:P.b.x,y2:P.b.y},`${P.kind}-${U}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:xe,fillRule:"evenodd",onPointerDown:q,onClick:be}),Te&&i.map((P,U)=>P.nodes.map((X,ie)=>{const j=w.some(J=>J.contour===U&&J.node===ie),B=z(X.p);return a.jsxs("g",{children:[j&&w.length===1&&["in","out"].map(J=>{const te=X[J];if(!te)return null;const Ce=z(te);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:Ce.x,y2:Ce.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:Ce.x,cy:Ce.y,r:wS}),a.jsx("circle",{className:`${e}-editor-grab`,cx:Ce.x,cy:Ce.y,r:Co,onPointerDown:ye=>Q(ye,J,U,ie),onClick:he})]},J)}),a.jsx("rect",{className:`${e}-editor-anchor${j?` ${e}-editor-anchor-selected`:""}`,x:B.x-$o/2,y:B.y-$o/2,width:$o,height:$o,rx:$u(X)?$o/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-Co,y:B.y-Co,width:Co*2,height:Co*2,onPointerDown:J=>Q(J,"anchor",U,ie),onClick:he,onDoubleClick:J=>{J.stopPropagation(),J.preventDefault();const te=zc(i,U,ie);p(te),ae(te)}})]},`${U}-${ie}`)})),oe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ee.x,y:ee.y,width:ue.width,height:ue.height}),["nw","ne","se","sw"].map(P=>{const U=z(Ss(le,P)),X=P==="ne"||P==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:U.x-Rr/2,y:U.y-Rr/2,width:Rr,height:Rr}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:U.x-Lr/2,y:U.y-Lr/2,width:Lr,height:Lr,onPointerDown:ie=>ce(ie,P),onClick:he})]},P)})]})]})}const TS=4e3,LS=/^(?:https?:|mailto:|tel:)/i;function Pu(e){return!!e&&typeof e=="object"&&e.type==="link"}function RS(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!LS.test(t)))return t}function IS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Pu(c)){o(c.children??[],RS(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Yc(e){return{...e.fontFamily&&{fontFamily:go(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 ES(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Pu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Kc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,y=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||y<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),x=y*kw;let S=0,v=0,w=0,H=t[0].para,N=0,Y=0,D=null;for(;S<t.length&&w<TS;){const C=v+y>c;if(C&&!u)break;const V=t[S].para;if(V>H+1){v+=y*(V-H-1),H=V-1,w+=1;continue}let $=C?[{x0:0,x1:d}]:Dw(i,(v+x)/c,(v+y-x)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!C&&$.length&&(D===null&&(D=w,N=$[0].x0,Y=v),w-D<b&&($=Ow($,{x0:N,x1:N+p})));const I=$.reduce((k,T)=>Math.max(k,T.x1-T.x0),0);for(const k of $){const T=k.x1-k.x0;if(T<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>T&&!(S===m&&T>=I-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:v,left:k.x0,width:T,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}H=V,v+=y,w+=1}return{segments:h,placed:S,height:h.length?v:0,capLeft:N,capTop:Y}}const MS=.12,PS=2,kS=10,Ya=.25,AS=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},FS=(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,_S=(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=AS(e);(!r||!FS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ka=(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})))},Ir=typeof window>"u"?s.useEffect:s.useLayoutEffect;function WS(){return typeof document>"u"?null:document.body}function NS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:y,dropCapSize:g,showGuides:h,typography:f,imageUrl:x,imageFocalX:S,imageFocalY:v,imageScale:w,imageCustomPath:H,pathDragActive:N,pathCarryImage:Y,onCarryImageConsumed:D,pathEditor:C,imageEditor:V}){var Ie,ze;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[I,k]=s.useState(null),T=s.useRef(null),[m,M]=s.useState({width:0,height:0}),[E,z]=s.useState(null),[ne,R]=s.useState(0),[W,K]=s.useState("none");s.useEffect(()=>{!C&&!V&&K("none")},[C,V]);const[ae,de]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){de(null);return}let se=!1;const Re=new Image;return Re.onload=()=>{se||de({width:Re.naturalWidth,height:Re.naturalHeight})},Re.src=x,()=>{se=!0}},[x]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),he=s.useMemo(()=>IS(A),[A]),q=s.useMemo(()=>ES(A),[A]),ce=y>0&&g>1?((ze=(Ie=he[0])==null?void 0:Ie.text)==null?void 0:ze.charAt(0))??"":"",Q=(C==null?void 0:C.contours)??null,be=s.useMemo(()=>{let se=[];if(Q){const Re=Vo(Q);Re.length&&(se=Yi(Re,r))}if(!se.length){const Re=i.trim(),qe=Re?_c(Re,o,r):null;qe&&qe.length?se=qe:se=hs(n==="custom"?"rectangle":n)}return n==="circle"?Ka(se,m):se},[Q,n,i,o,r,m.width,m.height]),We=C==null?void 0:C.onConvert,xe=(C==null?void 0:C.needsConversion)??!1,le=s.useMemo(()=>{if(n==="circle")return!1;const se=Q??(i.trim()?ri(i):null);return!!(se&&Ru(se,r))},[Q,i,r,n]),[ee,ue]=s.useState(null);Ir(()=>{if(!le){ee&&ue(null);return}!ee&&m.width>0&&m.height>0&&ue({width:m.width,height:m.height})},[le,m.width,m.height,ee]);const oe=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return be;const se=ee??m,Re=r.width/se.width,qe=r.height/se.height;return be.map(we=>we.map(Le=>({x:Le.x*Re,y:Le.y*qe})))},[be,le,ee,r.width,r.height,m.width,m.height]),Ne=s.useMemo(()=>{if(Q){const we=Vo(Q);if(we.length){const Le=Yi(we,r);return n==="circle"?Ka(Le,m):Le}}const se=H.trim(),Re=se?_c(se,o,r):null,qe=Re&&Re.length?Re:hs(n==="custom"?"rectangle":n);return n==="circle"?Ka(qe,m):qe},[Q,n,H,o,r,m.width,m.height]),Te=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return Ne;const se=ee??m,Re=r.width/se.width,qe=r.height/se.height;return Ne.map(we=>we.map(Le=>({x:Le.x*Re,y:Le.y*qe})))},[Ne,le,ee,r.width,r.height,m.width,m.height]),P=s.useRef(null),U=s.useRef(!1);s.useEffect(()=>{if(!(!We||m.width<=0||m.height<=0)){if(le){if(P.current===i)return;const se=Q??(i.trim()?ri(i):null);if(!(se!=null&&se.length))return;const Re=an(se,qe=>({x:r.x+(qe.x-r.x)/m.width*r.width,y:r.y+(qe.y-r.y)/m.height*r.height}));P.current=co(Re),We(Re);return}!xe||!be.length||U.current||(U.current=!0,We(an(Lu(be),se=>({x:se.x*Xr,y:se.y*Xr}))))}},[xe,le,We,be,Q,i,r,m.width,m.height]),Ir(()=>{const se=I;if(!se||typeof ResizeObserver>"u")return;const Re=()=>{const we=se.getBoundingClientRect();M(Le=>Math.abs(Le.width-we.width)<.5&&Math.abs(Le.height-we.height)<.5?Le:{width:we.width,height:we.height})};Re();const qe=new ResizeObserver(Re);return qe.observe(se),()=>qe.disconnect()},[I]),s.useEffect(()=>{const se=typeof document<"u"?document.fonts:void 0;se!=null&&se.ready&&se.ready.then(()=>{R(Re=>Re+1)})},[]),Ir(()=>{const se=T.current;if(!se)return;if(!he.length){z(null);return}const Re=[],qe=document.createDocumentFragment();for(const $t of he){const Rt=document.createElement("span");Object.assign(Rt.style,Yc($t.leaf)),Rt.textContent=$t.text,qe.appendChild(Rt),Re.push(Rt)}const we=document.createElement("span");we.textContent=" ",qe.appendChild(we);const Le=document.createElement("span");Le.textContent=ce||"H",Le.style.lineHeight="1",qe.appendChild(Le),se.replaceChildren(qe);const Ze=window.getComputedStyle(se),Oe=parseFloat(Ze.fontSize)||16,Ue=parseFloat(Ze.lineHeight),He=Number.isNaN(Ue)?Oe*1.2:Ue,Qe=Math.max(He,Oe);Le.style.fontSize=`${Qe*g}px`;const it=Re.map($t=>$t.getBoundingClientRect().width),tt=we.getBoundingClientRect().width,St=ce?Le.getBoundingClientRect().width:0;se.replaceChildren(),z({widths:it,spaceWidth:tt,lineHeight:Qe,capWidth:St})},[he,f,ce,y,g,ne,m.width]);const X=E&&ce?E.capWidth+E.lineHeight*MS:0,ie=Math.max(y,Math.ceil(g)),j=s.useMemo(()=>{if(!E||!he.length||m.width<=0||m.height<=0||!u)return 1;const se=we=>Kc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:we,allowOverflow:!1,capInset:X*we,capLines:ce?ie:0});if(se(1).placed>=he.length)return 1;if(se(Ya).placed<he.length)return Ya;let Re=Ya,qe=1;for(let we=0;we<kS;we+=1){const Le=(Re+qe)/2;se(Le).placed>=he.length?Re=Le:qe=Le}return Re},[E,he,m.width,m.height,oe,l,d,u,X,ce,ie]);s.useEffect(()=>{b(j)},[j,b]);const B=u?Math.min(p,j):1,J=s.useMemo(()=>!E||!he.length||m.width<=0||m.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Kc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:B,allowOverflow:c,capInset:X*B,capLines:ce?ie:0}),[E,he,m.width,m.height,oe,l,d,B,c,X,ce,ie]),te=E?E.lineHeight*B:0,Ce=d==="justify"?"left":d,ye=!!(C&&Q&&m.width>0&&m.height>0),F=!!V,ve=(ye||F)&&m.width>0&&m.height>0,pe=_S(I,ve),Z=ve&&pe?WS():null,me=s.useRef(!1),De=s.useCallback(se=>{me.current=se},[]);s.useEffect(()=>{if(!ye&&!F)return;const se=Re=>{const qe=I;if(!qe)return;const we=qe.getBoundingClientRect();Re.clientX>=we.left&&Re.clientX<=we.right&&Re.clientY>=we.top&&Re.clientY<=we.bottom&&(Re.preventDefault(),Re.stopPropagation(),K(Ze=>Ze==="shape"&&me.current?Ze:Ze==="shape"&&F?"image":ye?"shape":"image"))};return document.addEventListener("dblclick",se,!0),()=>document.removeEventListener("dblclick",se,!0)},[ye,F,I]);const ge=s.useMemo(()=>x&&m.width>0&&m.height>0?Aw(Te,m):null,[x,Te,m.width,m.height]),G=s.useRef(null),ke=(()=>{const se=G.current;return N||Y||!V||!ae||!ge||!se||H===se.customPath||se.shape!==n&&!(se.shape==="circle"&&n==="custom")?null:yS(se.bounds,ge,ae,se.focalX,se.focalY,se.scale)})();Ir(()=>{if(N||!V||!ae||!ge)return;const se=G.current,Re=!!(se&&H!==se.customPath);Re&&ke&&V.onCommit(ke),Re&&Y&&(D==null||D()),G.current={rings:Te,bounds:ge,focalX:(ke==null?void 0:ke.focalX)??S,focalY:(ke==null?void 0:ke.focalY)??v,scale:(ke==null?void 0:ke.scale)??w,customPath:H,shape:n}},[N,Y,H,n,Te,ge,V,ae,S,v,w,ke,D]);const Fe=G.current,rt=!!(N&&!Y&&Fe),Je=rt&&Fe?Fe.focalX:(ke==null?void 0:ke.focalX)??S,at=rt&&Fe?Fe.focalY:(ke==null?void 0:ke.focalY)??v,nt=rt&&Fe?Fe.scale:(ke==null?void 0:ke.scale)??w,je=rt&&Fe?Fe.bounds:ge,$e=s.useMemo(()=>{if(!(m.width>0)||!(m.height>0))return"";let se=Nc(i,Q,o,r,n,m);if(le){const Re=ee??m,qe=r.width/Re.width,we=r.height/Re.height;se=an(se,Le=>({x:Le.x*qe,y:Le.y*we}))}return Hc(se,m)||Fc(oe,m)},[i,Q,o,r,n,m.width,m.height,le,ee,oe]),Ae=s.useMemo(()=>{if(!x||!(m.width>0)||!(m.height>0))return"";let se=Nc(H,Q,o,r,n,m);if(le){const Re=ee??m,qe=r.width/Re.width,we=r.height/Re.height;se=an(se,Le=>({x:Le.x*qe,y:Le.y*we}))}return Hc(se,m)||Fc(Te,m)},[x,H,Q,o,r,n,m.width,m.height,le,ee,Te]),Be=`${$}-clip`,Ke=s.useMemo(()=>{if(!je)return null;const se=ae??{width:je.width,height:je.height},Re=Si(je,se,nt);return{x:En(je.width,Re.width,Je),y:En(je.height,Re.height,at),width:Re.width,height:Re.height}},[je,ae,Je,at,nt]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[$e?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${m.width} ${m.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:$e,fillRule:"evenodd"}),x&&Ae&&je&&Ke?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Be,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:Ae,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:je.x+Ke.x,y:je.y+Ke.y,width:Ke.width,height:Ke.height,preserveAspectRatio:"none",clipPath:`url(#${Be})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:B},children:[a.jsx("div",{className:`${e}-measure`,ref:T,style:f,"aria-hidden":!0}),J.segments.map((se,Re)=>{const qe=he.slice(se.from,se.to),we=Re===0;return a.jsx("div",{className:`${e}-line${se.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${se.top}px`,left:`${se.left}px`,width:`${se.width}px`,textAlign:se.justify?void 0:Ce},children:qe.map((Le,Ze)=>{const Ue=ce&&we&&se.from===0&&Ze===0?Le.text.slice(1):Le.text,He=Yc(Le.leaf),Qe=Le.href?a.jsx("a",{className:`${e}-link`,href:Le.href,target:Le.target,rel:Le.target?"noopener noreferrer":void 0,style:He,children:Ue}):a.jsx("span",{style:He,children:Ue});return a.jsxs("span",{children:[!se.justify&&Ze>0?" ":null,Qe]},Ze)})},`${se.from}-${se.to}-${Re}`)}),h&&!Q&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:oe.map((se,Re)=>a.jsx("polygon",{points:se.map(qe=>`${qe.x},${qe.y}`).join(" ")},Re))})]}),ce&&E&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${J.capTop}px`,left:`${J.capLeft}px`,fontSize:`${te*g}px`,lineHeight:`${te*g}px`},children:ce}),Z&&pe&&(Q&&C||V)&&Vn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:pe.top,left:pe.left,width:pe.width,height:pe.height,zIndex:PS,pointerEvents:"none"},children:[Q&&C&&a.jsx(CS,{P:e,box:{width:pe.width,height:pe.height},viewBox:r,contours:Q,snap:C.snap,stretchToBox:!le,uniformStretch:n==="circle",stage:W,onStageChange:K,onSelectionChange:De,onChange:C.onChange,onCommit:C.onCommit}),V&&je&&a.jsx(vS,{P:e,box:{width:pe.width,height:pe.height},bounds:je,natural:ae,imageUrl:x,maskPath:Ae,stage:W,onStageChange:K,focalX:Je,focalY:at,scale:nt,onChange:V.onChange,onCommit:V.onCommit})]}),Z),a.jsx("div",{className:`${e}-a11y`,children:q.map((se,Re)=>a.jsx("p",{children:se},Re))})]})}const ku=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],HS={x:0,y:0,width:100,height:100},OS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?HS:{x:t[0],y:t[1],width:t[2],height:t[3]}},DS=e=>`
|
|
23699
|
+
`,Pw=["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"],kw={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:Pw.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"]}]}]},Aw={element:Ew,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:kw,sourceCode:Mw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Ac=120,Fc=3,Fw=.12,ol={x:0,y:0,width:100,height:100};function Yi(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 _c(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 _w(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Ww(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 Nw(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 Hw(i)}function Hw(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 Ow(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 Dw(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 jw(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 zw(e,t,n,i){let o=null;for(let r=0;r<Fc;r+=1){const l=qr(t+(n-t)*r/Math.max(1,Fc-1)),d=Nw(e,l),c=i==="avoid"?Dw(d):d;if(o=o===null?c:Ow(o,c),o.length===0)return[]}return o??[]}function Wc(e,t="stretch",n=ol){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=ri(i),d=Vo(l);if(d.length)return t==="viewbox"?Yi(d,n):qa(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",b),u.appendChild(v);let g=0;try{g=v.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<Ac;f+=1){const x=v.getPointAtLength(f/Ac*g);h.push({x:x.x,y:x.y})}p.push(h)}return p.length?t==="viewbox"?Yi(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"?Yi([r],n):qa([r])}const rl={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"},ms="0 0 100 100",Xr=100,gs=16,Bw=12,Vw=16,Xa=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Gw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g,Nc=Math.PI/4,qw=8,Xw=Math.PI/18,Uw=8,zi=24,Bi=[];function Yw(){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 an(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Kw(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:an(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Zw(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 an(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function Hc(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=ri(d);c.length&&(l=n==="viewbox"?Ua(c,i):Kw(c))}if(!l.length){const c=o!=="custom"?rl[o]:void 0;c?l=Ua(ri(c),ol):l=Yw()}}return o==="circle"?Zw(l,r):l}function Oc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":co(an(e,n=>({x:n.x*t.width,y:n.y*t.height})))}function hs(e){const t=e==="rectangle"||e==="custom"?void 0:rl[e];return t?Yi(Vo(ri(t)),ol):[Ww([[0,0],[1,0],[1,1],[0,1]])]}function Jw(e){const t=e.match(Gw);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 fs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function rn(e){return{x:e.x,y:e.y}}function Qw(e){return{p:rn(e.p),in:e.in?rn(e.in):null,out:e.out?rn(e.out):null}}function Mn(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Qw)}))}function an(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 Dc(e,t,n,i=n){return an(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function eS(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:rn(e),c2:rn(l),p:rn(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),v=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*v+b*g,f=-b*v+p*g,x=h*h/(d*d)+f*f/(c*c);if(x>1){const ne=Math.sqrt(x);d*=ne,c*=ne}const S=o===r?-1:1,y=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-y),H=y===0?0:S*Math.sqrt(w/y),N=H*d*f/c,Y=-H*c*h/d,O=p*N-b*Y+(e.x+l.x)/2,C=b*N+p*Y+(e.y+l.y)/2,V=Math.atan2((f-Y)/c,(h-N)/d);let R=Math.atan2((-f-Y)/c,(-h-N)/d)-V;!r&&R>0&&(R-=Math.PI*2),r&&R<0&&(R+=Math.PI*2);const k=Math.max(1,Math.ceil(Math.abs(R)/(Math.PI/2))),T=R/k,m=4/3*Math.tan(T/4),M=(ne,I)=>({x:O+p*d*ne-b*c*I,y:C+b*d*ne+p*c*I}),E=[];let z=V;for(let ne=0;ne<k;ne+=1){const I=z+T,W=Math.cos(z),K=Math.sin(z),ae=Math.cos(I),de=Math.sin(I);E.push({c1:M(W-m*K,K+m*W),c2:M(ae+m*de,de-m*ae),p:ne===k-1?rn(l):M(ae,de)}),z=I}return E}function ri(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const g=i[0],h=i[i.length-1];Math.abs(g.p.x-h.p.x)<1e-6&&Math.abs(g.p.y-h.p.y)<1e-6&&(g.in=h.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,h)=>{i.push({p:g,in:An(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=An(g,h.p)};Xa.lastIndex=0;let v=Xa.exec(t);for(;v!==null;){const g=v[1],h=g.toUpperCase(),f=g!==h,x=Jw(v[2]),S=y=>f?{x:r.x+x[y],y:r.y+x[y+1]}:{x:x[y],y:x[y+1]};if(h==="Z")o=!0,u(),r=rn(l),d=null,c=null;else if(h==="M"){for(let y=0;y+1<x.length;y+=2){const w=S(y);y===0&&(u(),l=rn(w)),p(w)}d=null,c=null}else if(h==="L"){for(let y=0;y+1<x.length;y+=2)p(S(y));d=null,c=null}else if(h==="H"){for(const y of x)p({x:f?r.x+y:y,y:r.y});d=null,c=null}else if(h==="V"){for(const y of x)p({x:r.x,y:f?r.y+y:y});d=null,c=null}else if(h==="C"){for(let y=0;y+5<x.length;y+=6){const w=S(y),H=S(y+2),N=S(y+4);b(w),p(N,H),d=H}c=null}else if(h==="S"){for(let y=0;y+3<x.length;y+=4){const w=d?fs(d,r):rn(r),H=S(y),N=S(y+2);b(w),p(N,H),d=H}c=null}else if(h==="Q")for(let y=0;y+3<x.length;y+=4){const w=S(y),H=S(y+2);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="T")for(let y=0;y+1<x.length;y+=2){const w=c?fs(c,r):rn(r),H=S(y);b(hn(r,w,2/3)),p(H,hn(H,w,2/3)),c=w,d=null}else if(h==="A")for(let y=0;y+6<x.length;y+=7){const w=f?{x:r.x+x[y+5],y:r.y+x[y+6]}:{x:x[y+5],y:x[y+6]};for(const H of eS(r,x[y],x[y+1],x[y+2],x[y+3]!==0,x[y+4]!==0,w))b(H.c1),p(H.p,H.c2);d=null,c=null}v=Xa.exec(t)}return u(),n}function In(e){return`${Number(e.toFixed(2))}`}function An(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function Lu(e){return!!(An(e.in,e.p)||An(e.out,e.p))}function er(e,t){return!An(e.out,e.p)&&!An(t.in,t.p)}function jc(e,t){if(er(e,t))return`L${In(t.p.x)},${In(t.p.y)}`;const n=An(e.out,e.p)??e.p,i=An(t.in,t.p)??t.p;return`C${In(n.x)},${In(n.y)} ${In(i.x)},${In(i.y)} ${In(t.p.x)},${In(t.p.y)}`}function co(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${In(i.p.x)},${In(i.p.y)}`);let r=i;for(const l of o)t.push(jc(r,l)),r=l;if(n.closed){const l=jc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Ru(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 ys(e,t,n){if(er(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 Vo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Ru(n)){if(er(o.from,o.to)){i.push(rn(o.from.p));continue}for(let r=0;r<gs;r+=1)i.push(ys(o.from,o.to,r/gs))}n.closed||i.push(rn(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of Vo(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 tS(e){const t=ei(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 Iu(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 Eu(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=Bw)return{closed:!0,nodes:t.map(r=>({p:rn(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/Vw)),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:rn(r),...Iu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Mu(e,t,n=1){if(!e.length)return!1;const i=ei(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 nS(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:an(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function iS(e,t){if(!e.length)return e;const n=ei(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 an(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Pu(e){const t={x:0,y:0,width:Xr,height:Xr},n=e!=="custom"?rl[e]:void 0,i=n?an(ri(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):an(Eu(hs("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=iS(i,t);return{shape:e,customPath:co(o),pathFit:"viewbox",pathViewBox:ms}}function Sr(e,t){return t>0?Math.round(e/t)*t:e}function oS(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=Mn(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 zc(e,t,n,i){var r;if(!t.length)return e;const o=Mn(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 rS(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=ku(i,r,d)}),i}function aS(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=Mn(e),c=d[t].nodes[n];if(c[i]=rn(o),r){const p=i==="in"?"out":"in";c[p]=fs(o,c.p)}return d}function sS(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=Mn(e);return r[t].nodes[n][i]=null,r}function lS(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=Mn(e),c=d[t].nodes,u=n+1;if(er(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,b=l.in??l.p,v=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(v,g,i),x=hn(g,h,i),S=hn(f,x,i),y=(n+1)%o.nodes.length;return c[n].out=v,c[y].in=h,c.splice(u,0,{p:S,in:f,out:x}),{contours:d,nodeIndex:u}}function ku(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=Mn(e);return o[t].nodes.splice(n,1),o}function Bc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=Mn(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!An(l[u].out,l[u].p),v=!!An(l[p].in,l[p].p);if(Lu(d)||b||v)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Iu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function cS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function dS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Ru(i)){const l=er(r.from,r.to)?1:gs;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=cS(t,ys(r.from,r.to,c),ys(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function uS(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 Vc(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 Gc(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 pS(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 mS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function vs(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 gS(e,t){const n=vs(e,t);return n?{kind:"align",a:{x:e.x-n.x*zi,y:e.y-n.y*zi},b:{x:t.x+n.x*zi,y:t.y+n.y*zi}}:{kind:"align",a:e,b:t}}function xs(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 qc(e,t,n,i,o){if(e.axis===null)return gS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function hS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(qc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(qc(n,"y",l,i,o)),r}function fS(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 vs(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 vs(i(p),r)}function yS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Bi};const v=Math.atan2(p,u),g=Math.round(v/Nc)*Nc;let h=o?g:null,f=!1;if(!o){const Y=[];n&&Y.push({angle:Math.atan2(n.y,n.x),smooth:!0}),Y.push({angle:g,smooth:!1});for(const O of Y){const C=mS(O.angle-v);if(!(Math.abs(C)>Xw)&&!(Math.abs(Math.sin(C))*b>qw)){h=O.angle,f=O.smooth;break}}}const x=i!==null&&i>0&&Math.abs(b-i)<=Uw;if(h===null&&!x)return{point:e,guides:Bi};const S=h??v,y=x?i:b,w={x:Math.cos(S),y:Math.sin(S)},H=y+(h===null?0:zi),N=x?y:f?zi: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*N,y:d.y-w.y*N},b:{x:d.x+w.x*H,y:d.y+w.y*H}}]}}const bs=.1,ws=8,vS=4,Xc=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}}},Au=e=>{switch(e){case"nw":return"se";case"ne":return"sw";case"se":return"nw";case"sw":return"ne"}},Ss=(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*Xc,y:n.y+o*Xc}},$s=(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),Si=(e,t,n)=>{const i=$s(e,t)*n;return{width:t.width*i,height:t.height*i}},En=(e,t,n)=>(e-t)*n,Vi=(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)<vS?.5:qr(r)},xS=(e,t,n,i,o,r)=>{const l=Si(e,n,r),d=e.x+En(e.width,l.width,i),c=e.y+En(e.height,l.height,o),u=$s(e,n),p=$s(t,n),b=Math.min(ws,Math.max(bs,p>0?r*(u/p):r)),v=Si(t,n,b);return{focalX:Vi(t.width,v.width,d-t.x,{clamp:!1}),focalY:Vi(t.height,v.height,c-t.y,{clamp:!1}),scale:b}},Uc=1.08,$r=14,Cr=8;function bS({P:e,box:t,bounds:n,natural:i,imageUrl:o,maskPath:r,stage:l,onStageChange:d,focalX:c,focalY:u,scale:p,onChange:b,onCommit:v}){const g=s.useRef(null),h=`pretext-image-ghost-${s.useId().replace(/:/g,"")}`,f=s.useRef(null),x=s.useRef(null),S=s.useRef({focalX:c,focalY:u,scale:p});S.current={focalX:c,focalY:u,scale:p};const y=l==="image";s.useEffect(()=>{var T;y&&((T=g.current)==null||T.focus({preventScroll:!0}))},[y]);const w=s.useCallback((T,m)=>{var E;const M=(E=g.current)==null?void 0:E.getBoundingClientRect();return!M||M.width<=0||M.height<=0?{x:0,y:0}:{x:(T-M.left)/M.width*t.width,y:(m-M.top)/M.height*t.height}},[t.width,t.height]),H=T=>{var M,E;if(!i)return;T.stopPropagation(),T.preventDefault(),(M=g.current)==null||M.focus({preventScroll:!0});const m=Si(n,i,p);f.current={pointerId:T.pointerId,origin:w(T.clientX,T.clientY),startX:En(n.width,m.width,c),startY:En(n.height,m.height,u),width:m.width,height:m.height,moved:!1},(E=g.current)==null||E.setPointerCapture(T.pointerId)},N=(T,m)=>{var ae,de;if(!i)return;T.stopPropagation(),T.preventDefault(),(ae=g.current)==null||ae.focus({preventScroll:!0});const M=Si(n,i,p),E=En(n.width,M.width,c),z=En(n.height,M.height,u),ne={minX:E,minY:z,maxX:E+M.width,maxY:z+M.height},I=Ur(ne,Au(m)),W=Ur(ne,m),K=Math.hypot(W.x-I.x,W.y-I.y);!isFinite(K)||K<=0||(x.current={pointerId:T.pointerId,anchor:I,startDistance:K,startScale:p,startX:E,startY:z,moved:!1},(de=g.current)==null||de.setPointerCapture(T.pointerId))},Y=T=>{if(!i)return;const m=x.current;if(m&&T.pointerId===m.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z={x:E.x-n.x,y:E.y-n.y},ne=Math.hypot(z.x-m.anchor.x,z.y-m.anchor.y),I=Math.min(ws,Math.max(bs,m.startScale*(ne/m.startDistance)));if(!m.moved&&Math.abs(I-m.startScale)<1e-4)return;m.moved=!0;const W=I/m.startScale,K=m.anchor.x+(m.startX-m.anchor.x)*W,ae=m.anchor.y+(m.startY-m.anchor.y)*W,de=Si(n,i,I);b({focalX:Vi(n.width,de.width,K),focalY:Vi(n.height,de.height,ae),scale:I});return}const M=f.current;if(M&&T.pointerId===M.pointerId){T.stopPropagation(),T.preventDefault();const E=w(T.clientX,T.clientY),z=E.x-M.origin.x,ne=E.y-M.origin.y;if(!M.moved&&z===0&&ne===0)return;M.moved=!0,b({focalX:Vi(n.width,M.width,M.startX+z),focalY:Vi(n.height,M.height,M.startY+ne),scale:p})}},O=T=>{var E,z;const m=f.current;if(m&&T.pointerId===m.pointerId){f.current=null,T.stopPropagation(),(E=g.current)!=null&&E.hasPointerCapture(m.pointerId)&&g.current.releasePointerCapture(m.pointerId),m.moved&&v(S.current);return}const M=x.current;M&&T.pointerId===M.pointerId&&(x.current=null,T.stopPropagation(),(z=g.current)!=null&&z.hasPointerCapture(M.pointerId)&&g.current.releasePointerCapture(M.pointerId),M.moved&&v(S.current))},C=T=>{if(T.key==="Escape"){T.stopPropagation(),d("none");return}if(T.key==="="||T.key==="+"||T.key==="-"||T.key==="_"){T.preventDefault(),T.stopPropagation();const m=T.key==="="||T.key==="+",M=Math.min(ws,Math.max(bs,p*(m?Uc:1/Uc))),E={focalX:c,focalY:u,scale:M};b(E),v(E)}},V=["nw","ne","se","sw"],$={minX:n.x,minY:n.y,maxX:n.x+n.width,maxY:n.y+n.height},R=s.useMemo(()=>{const T=i??{width:n.width,height:n.height},m=Si(n,T,p);return!(m.width>0)||!(m.height>0)?null:{x:n.x+En(n.width,m.width,c),y:n.y+En(n.height,m.height,u),width:m.width,height:m.height}},[i,n.x,n.y,n.width,n.height,c,u,p]),k=R?{minX:R.x,minY:R.y,maxX:R.x+R.width,maxY:R.y+R.height}:$;return a.jsxs("svg",{ref:g,className:`${e}-editor${y?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:C,onPointerMove:Y,onPointerUp:O,onPointerCancel:O,onLostPointerCapture:O,"data-pretext-image-editor":!0,children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>d("none")}),y&&o&&R&&r&&a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsxs("mask",{id:h,maskUnits:"userSpaceOnUse",x:R.x,y:R.y,width:R.width,height:R.height,children:[a.jsx("rect",{x:R.x,y:R.y,width:R.width,height:R.height,fill:"#FFFFFF"}),a.jsx("path",{d:r,fillRule:"evenodd",fill:"#000000"})]})}),a.jsx("image",{className:`${e}-editor-ghost`,href:o??void 0,x:R.x,y:R.y,width:R.width,height:R.height,preserveAspectRatio:"none",mask:`url(#${h})`}),a.jsx("rect",{className:`${e}-editor-image-bounds`,x:R.x,y:R.y,width:R.width,height:R.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:H}),V.map(T=>{const m=Ss(k,T),M=T==="ne"||T==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:m.x-Cr/2,y:m.y-Cr/2,width:Cr,height:Cr}),a.jsx("rect",{className:`${e}-editor-scale-grab${M?` ${e}-editor-scale-grab-nesw`:""}`,x:m.x-$r/2,y:m.y-$r/2,width:$r,height:$r,onPointerDown:E=>N(E,T)})]},T)})]})]})}const wS=36,$o=7,SS=4,Co=9,$S=3.5,Yc=1.08,CS=.05,Tr=14,TS=1,Lr=14,Rr=8;function LS({P:e,box:t,viewBox:n,contours:i,snap:o,stretchToBox:r,uniformStretch:l=!1,stage:d,onStageChange:c,onSelectionChange:u,onChange:p,onCommit:b}){const v=s.useRef(null),g=s.useRef(null),h=s.useRef(i);h.current=i;const f=s.useRef(null),x=s.useRef(null),S=s.useRef(null),y=s.useRef(null),[w,H]=s.useState([]),[N,Y]=s.useState(Bi),O=s.useCallback(P=>{Y(U=>pS(U,P)?U:P)},[]),C=d==="shape";s.useEffect(()=>{var P;C&&((P=v.current)==null||P.focus({preventScroll:!0}))},[C]),s.useEffect(()=>{C||H(P=>P.length?[]:P)},[C]);const V=w.length>0;s.useEffect(()=>{u==null||u(V)},[V,u]),s.useEffect(()=>()=>u==null?void 0:u(!1),[u]);const $=n.width>0?t.width/n.width:1,R=n.height>0?t.height/n.height:1,k=Math.min($,R),T=r&&l?k:$,m=r&&l?k:R,M=r&&l?(t.width-n.width*k)/2:0,E=r&&l?(t.height-n.height*k)/2:0,z=s.useCallback(P=>r?{x:M+(P.x-n.x)*T,y:E+(P.y-n.y)*m}:{x:P.x-n.x,y:P.y-n.y},[r,n,T,m,M,E]),ne=s.useCallback(P=>r?{x:n.x+(T>0?(P.x-M)/T:0),y:n.y+(m>0?(P.y-E)/m:0)}:{x:n.x+P.x,y:n.y+P.y},[r,n,T,m,M,E]),I=s.useMemo(()=>ne({x:t.width/2,y:t.height/2}),[ne,t.width,t.height]),W=s.useCallback((P,U)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();if(!X||X.width<=0||X.height<=0)return{x:0,y:0};if(r){const j=(P-X.left)/X.width*t.width,B=(U-X.top)/X.height*t.height;return{x:n.x+(T>0?(j-M)/T:0),y:n.y+(m>0?(B-E)/m:0)}}return{x:n.x+(P-X.left),y:n.y+(U-X.top)}},[r,n,t.width,t.height,T,m,M,E]),K=s.useCallback((P,U)=>{var ie;const X=(ie=v.current)==null?void 0:ie.getBoundingClientRect();return!X||X.width<=0||X.height<=0?{x:0,y:0}:{x:(P-X.left)/X.width*t.width,y:(U-X.top)/X.height*t.height}},[t.width,t.height]),ae=s.useCallback((P,U)=>{const X=l&&!(U!=null&&U.preserveShape)?nS(P,n,t,M,E,T,m):P;b(X,U)},[b,l,n,t,M,E,T,m]),de=P=>{var De;const U=P.metaKey||P.ctrlKey,X=S.current;if(X&&P.pointerId===X.pointerId){if(P.stopPropagation(),P.preventDefault(),X.startDistance<=0)return;const ge=W(P.clientX,P.clientY),G=Math.hypot(ge.x-X.origin.x,ge.y-X.origin.y),Me=Math.max(CS,G/X.startDistance);if(!X.moved&&Math.abs(Me-1)<1e-4)return;X.moved=!0,p(Dc(X.startContours,X.origin,Me));return}const ie=x.current;if(ie&&P.pointerId===ie.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY),{bbox:G}=ie,Me=G.maxX-G.minX,_e=G.maxY-G.minY,rt=ge.x-ie.origin.x,Je=ge.y-ie.origin.y;let at=rt,it=Je;if(isFinite(Me)&&isFinite(_e))if(r){let Se=n.x,We=n.x+n.width,Be=n.y,Ze=n.y+n.height;l&&(T>0&&(Se=n.x+(0-M)/T,We=n.x+(t.width-M)/T),m>0&&(Be=n.y+(0-E)/m,Ze=n.y+(t.height-E)/m));const Le=Math.min(Se,We-Me),Ve=Math.max(Se,We-Me),se=Math.min(Be,Ze-_e),Te=Math.max(Be,Ze-_e),Xe=Math.min(Ve,Math.max(Le,G.minX+rt)),ze=Math.min(Te,Math.max(se,G.minY+Je));at=Xe-G.minX,it=ze-G.minY}else{const Se=G.minX-n.x,We=G.minY-n.y,Be=Math.min(0,t.width-Me),Ze=Math.max(0,t.width-Me),Le=Math.min(0,t.height-_e),Ve=Math.max(0,t.height-_e),se=Math.min(Ze,Math.max(Be,Se+rt)),Te=Math.min(Ve,Math.max(Le,We+Je));at=se-Se,it=Te-We}const je=[];if(!U&&isFinite(Me)&&isFinite(_e)){const Se=z({x:G.minX+Me/2+at,y:G.minY+_e/2+it}),We={x:t.width/2,y:t.height/2};Math.abs(Se.x-We.x)<=Tr&&(at=I.x-G.minX-Me/2,je.push(xs(We.x,"x",t))),Math.abs(Se.y-We.y)<=Tr&&(it=I.y-G.minY-_e/2,je.push(xs(We.y,"y",t)))}if(!ie.moved&&at===0&&it===0)return;ie.moved=!0,O(je.length?je:Bi),p(an(ie.startContours,Se=>({x:Se.x+at,y:Se.y+it})),{carryImage:!0});return}const j=y.current;if(j&&P.pointerId===j.pointerId){P.stopPropagation(),P.preventDefault();const ge=W(P.clientX,P.clientY);let G=ge.x-j.origin.x,Me=ge.y-j.origin.y;if(P.shiftKey&&(Math.abs(G)>Math.abs(Me)?Me=0:G=0),!j.moved&&G===0&&Me===0)return;j.moved=!0,p(zc(j.startContours,j.selection,G,Me));return}const B=f.current;if(!B||P.pointerId!==B.pointerId)return;P.stopPropagation(),P.preventDefault();const J=W(P.clientX,P.clientY);if(B.kind==="anchor"){const ge={x:B.anchor.x+(J.x-B.origin.x),y:B.anchor.y+(J.y-B.origin.y)},G=U?[]:uS(h.current,{contour:B.contour,node:B.node}),Me=U||!B.center?[]:[B.center],_e=Gc(Vc(G,Me.map(at=>at.x),"x"),ge,"x",z,Tr),rt=Gc(Vc(G,Me.map(at=>at.y),"y"),ge,"y",z,Tr),Je=U?ge:{x:(_e==null?void 0:_e.value)??Sr(ge.x,o),y:(rt==null?void 0:rt.value)??Sr(ge.y,o)};if(P.shiftKey&&(Math.abs(Je.x-B.anchor.x)>Math.abs(Je.y-B.anchor.y)?Je.y=B.anchor.y:Je.x=B.anchor.x),!B.moved&&Je.x===B.anchor.x&&Je.y===B.anchor.y)return;B.moved=!0,O(hS(Je,_e,rt,t,z)),p(oS(h.current,B.contour,B.node,Je));return}const te=(De=h.current[B.contour])==null?void 0:De.nodes[B.node],$e=B.mirror&&!P.altKey,ye=$e||U?null:B.kind==="in"?te==null?void 0:te.out:te==null?void 0:te.in,F=te?z(te.p):null,ve=ye?z(ye):null,pe=te&&(!U||P.shiftKey)?yS(J,te.p,$e||U?null:fS(h.current[B.contour],B.node,B.kind,z),F&&ve?Math.hypot(ve.x-F.x,ve.y-F.y):null,P.shiftKey,z,ne):{point:J,guides:Bi},Z=pe.guides.length?pe.point:U?J:{x:Sr(J.x,o),y:Sr(J.y,o)},me=B.kind==="in"?te==null?void 0:te.in:te==null?void 0:te.out;!B.moved&&me&&Z.x===me.x&&Z.y===me.y||(B.moved=!0,O(pe.guides),p(aS(h.current,B.contour,B.node,B.kind,Z,$e)))},A=P=>{O(Bi);const U=S.current;if(U&&P.pointerId===U.pointerId){S.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(U.pointerId)&&ye.releasePointerCapture(U.pointerId),U.moved&&ae(h.current,{preserveShape:!0});return}const X=x.current;if(X&&P.pointerId===X.pointerId){x.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(X.pointerId)&&ye.releasePointerCapture(X.pointerId),X.moved?ae(h.current,{preserveShape:!0}):H([]);return}const ie=y.current;if(ie&&P.pointerId===ie.pointerId){y.current=null,P.stopPropagation();const ye=v.current;ye!=null&&ye.hasPointerCapture(ie.pointerId)&&ye.releasePointerCapture(ie.pointerId),ie.moved&&ae(h.current);return}const j=f.current;if(!j||P.pointerId!==j.pointerId)return;f.current=null,P.stopPropagation();const B=v.current;B!=null&&B.hasPointerCapture(j.pointerId)&&B.releasePointerCapture(j.pointerId);const J=Math.hypot(P.clientX-j.clientOrigin.x,P.clientY-j.clientOrigin.y);if(j.moved||J>SS){j.moved&&ae(h.current);return}if(!j.toggleOnRelease||P.type!=="pointerup")return;const $e=Bc(h.current,j.contour,j.node);$e!==h.current&&(p($e),ae($e))},he=P=>{P.stopPropagation()},q=P=>{var U,X;P.stopPropagation(),P.preventDefault(),(U=v.current)==null||U.focus({preventScroll:!0}),x.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),bbox:ei(i),moved:!1},(X=v.current)==null||X.setPointerCapture(P.pointerId)},ce=(P,U)=>{var J,te;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0}),H([]),c("shape");const X=ei(i),ie=Ur(X,Au(U)),j=Ss(X,U),B=Math.hypot(j.x-ie.x,j.y-ie.y);!isFinite(B)||B<=0||(S.current={pointerId:P.pointerId,corner:U,origin:ie,startDistance:B,startContours:Mn(i),moved:!1},(te=v.current)==null||te.setPointerCapture(P.pointerId))},Q=(P,U,X,ie)=>{var J,te,$e,ye;P.stopPropagation(),P.preventDefault(),(J=v.current)==null||J.focus({preventScroll:!0});const j=(te=i[X])==null?void 0:te.nodes[ie];if(!j)return;if(P.altKey){const F=U==="anchor"?ku(i,X,ie):sS(i,X,ie,U);if(F===i)return;H(U==="anchor"?[]:[{contour:X,node:ie}]),p(F),ae(F);return}const B=P.metaKey||P.ctrlKey;if(U==="anchor"&&P.shiftKey&&!B){H(F=>F.some(ve=>ve.contour===X&&ve.node===ie)?F.filter(ve=>!(ve.contour===X&&ve.node===ie)):[...F,{contour:X,node:ie}]);return}if(U==="anchor"&&!B&&w.length>1&&w.some(F=>F.contour===X&&F.node===ie)){y.current={pointerId:P.pointerId,origin:W(P.clientX,P.clientY),startContours:Mn(i),selection:w,moved:!1},($e=v.current)==null||$e.setPointerCapture(P.pointerId);return}H([{contour:X,node:ie}]),f.current={kind:U,contour:X,node:ie,pointerId:P.pointerId,origin:W(P.clientX,P.clientY),clientOrigin:{x:P.clientX,y:P.clientY},anchor:j.p,center:tS(i),mirror:U!=="anchor"&&!!(j.in&&j.out),toggleOnRelease:B,moved:!1},(ye=v.current)==null||ye.setPointerCapture(P.pointerId)},be=P=>{P.stopPropagation(),P.preventDefault();const U=an(i,z),X=dS(U,K(P.clientX,P.clientY));if(!X||X.distance>wS)return;const{contours:ie,nodeIndex:j}=lS(i,X.contour,X.segment,X.t);j<0||(H([{contour:X.contour,node:j}]),p(ie),ae(ie))},He=P=>{if(P.key==="="||P.key==="+"||P.key==="-"||P.key==="_"){P.preventDefault(),P.stopPropagation();const B=ei(i);if(!isFinite(B.minX)||!isFinite(B.maxX))return;const J={x:(B.minX+B.maxX)/2,y:(B.minY+B.maxY)/2},$e=P.key==="="||P.key==="+"?Yc:1/Yc,ye=Dc(i,J,$e);p(ye),ae(ye,{preserveShape:!0});return}if(P.key==="Escape"){P.stopPropagation(),H([]),c("none");return}if(!w.length)return;if(P.key==="Backspace"||P.key==="Delete"){P.preventDefault(),P.stopPropagation();const B=rS(i,w);if(B===i)return;H([]),p(B),ae(B);return}const U=o>0?o:TS,X=P.shiftKey?U*10:U,ie={ArrowLeft:[-X,0],ArrowRight:[X,0],ArrowUp:[0,-X],ArrowDown:[0,X]}[P.key];if(!ie)return;P.preventDefault(),P.stopPropagation();const j=zc(i,w,ie[0],ie[1]);p(j),ae(j)},xe=s.useMemo(()=>co(an(i,z)),[i,z]),le=s.useMemo(()=>ei(i),[i]),ee=z({x:le.minX,y:le.minY}),ue={width:z({x:le.maxX,y:le.minY}).x-ee.x,height:z({x:le.minX,y:le.maxY}).y-ee.y},oe=C&&w.length===0&&isFinite(le.minX)&&isFinite(le.maxX)&&le.maxX>le.minX&&le.maxY>le.minY,Fe=w.length>0||C,Ce=Fe;return a.jsxs("svg",{ref:v,className:`${e}-editor${Fe?` ${e}-editor-armed`:""}`,width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,tabIndex:0,onKeyDown:He,onPointerDown:()=>{var P;return(P=v.current)==null?void 0:P.focus({preventScroll:!0})},onPointerMove:de,onPointerUp:A,onPointerCancel:A,onLostPointerCapture:A,onContextMenu:P=>{P.preventDefault()},"data-pretext-path-editor":!0,"data-selection":"none",children:[a.jsx("rect",{className:`${e}-editor-surface`,width:t.width,height:t.height,onPointerDown:()=>{H([]),c("none")},onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-hit`,d:xe,onClick:be}),Ce&&a.jsx("path",{className:`${e}-editor-outline`,d:xe}),Ce&&N.map((P,U)=>a.jsx("line",{className:`${e}-editor-snap ${e}-editor-snap-${P.kind}`,x1:P.a.x,y1:P.a.y,x2:P.b.x,y2:P.b.y},`${P.kind}-${U}`)),a.jsx("path",{ref:g,className:`${e}-editor-body`,d:xe,fillRule:"evenodd",onPointerDown:q,onClick:be}),Ce&&i.map((P,U)=>P.nodes.map((X,ie)=>{const j=w.some(J=>J.contour===U&&J.node===ie),B=z(X.p);return a.jsxs("g",{children:[j&&w.length===1&&["in","out"].map(J=>{const te=X[J];if(!te)return null;const $e=z(te);return a.jsxs("g",{children:[a.jsx("line",{className:`${e}-editor-handle-line`,x1:B.x,y1:B.y,x2:$e.x,y2:$e.y}),a.jsx("circle",{className:`${e}-editor-handle`,cx:$e.x,cy:$e.y,r:$S}),a.jsx("circle",{className:`${e}-editor-grab`,cx:$e.x,cy:$e.y,r:Co,onPointerDown:ye=>Q(ye,J,U,ie),onClick:he})]},J)}),a.jsx("rect",{className:`${e}-editor-anchor${j?` ${e}-editor-anchor-selected`:""}`,x:B.x-$o/2,y:B.y-$o/2,width:$o,height:$o,rx:Lu(X)?$o/2:0}),a.jsx("rect",{className:`${e}-editor-grab`,x:B.x-Co,y:B.y-Co,width:Co*2,height:Co*2,onPointerDown:J=>Q(J,"anchor",U,ie),onClick:he,onDoubleClick:J=>{J.stopPropagation(),J.preventDefault();const te=Bc(i,U,ie);p(te),ae(te)}})]},`${U}-${ie}`)})),oe&&a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-bbox`,x:ee.x,y:ee.y,width:ue.width,height:ue.height}),["nw","ne","se","sw"].map(P=>{const U=z(Ss(le,P)),X=P==="ne"||P==="sw";return a.jsxs("g",{children:[a.jsx("rect",{className:`${e}-editor-scale`,x:U.x-Rr/2,y:U.y-Rr/2,width:Rr,height:Rr}),a.jsx("rect",{className:`${e}-editor-scale-grab${X?` ${e}-editor-scale-grab-nesw`:""}`,x:U.x-Lr/2,y:U.y-Lr/2,width:Lr,height:Lr,onPointerDown:ie=>ce(ie,P),onClick:he})]},P)})]})]})}const RS=4e3,IS=/^(?:https?:|mailto:|tel:)/i;function Fu(e){return!!e&&typeof e=="object"&&e.type==="link"}function ES(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!IS.test(t)))return t}function MS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Fu(c)){o(c.children??[],ES(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Kc(e){return{...e.fontFamily&&{fontFamily:go(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 PS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Fu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Zc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,v=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||v<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),x=v*Fw;let S=0,y=0,w=0,H=t[0].para,N=0,Y=0,O=null;for(;S<t.length&&w<RS;){const C=y+v>c;if(C&&!u)break;const V=t[S].para;if(V>H+1){y+=v*(V-H-1),H=V-1,w+=1;continue}let $=C?[{x0:0,x1:d}]:zw(i,(y+x)/c,(y+v-x)/c,o).map(k=>({x0:k.x0*d,x1:k.x1*d}));p>0&&b>0&&!C&&$.length&&(O===null&&(O=w,N=$[0].x0,Y=y),w-O<b&&($=jw($,{x0:N,x1:N+p})));const R=$.reduce((k,T)=>Math.max(k,T.x1-T.x0),0);for(const k of $){const T=k.x1-k.x0;if(T<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>T&&!(S===m&&T>=R-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:y,left:k.x0,width:T,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}H=V,y+=v,w+=1}return{segments:h,placed:S,height:h.length?y:0,capLeft:N,capTop:Y}}const kS=.12,AS=2,FS=10,Ya=.25,_S=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},WS=(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,NS=(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=_S(e);(!r||!WS(r,d))&&(r=d,i(d)),o=requestAnimationFrame(l)};return l(),()=>cancelAnimationFrame(o)},[e,t]),n},Ka=(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})))},Ir=typeof window>"u"?s.useEffect:s.useLayoutEffect;function HS(){return typeof document>"u"?null:document.body}function OS({P:e,item:t,shape:n,customPath:i,pathFit:o,viewBox:r,mode:l,align:d,allowOverflow:c,fitEnabled:u,scale:p,onFitScale:b,dropCapLines:v,dropCapSize:g,showGuides:h,typography:f,imageUrl:x,imageFocalX:S,imageFocalY:y,imageScale:w,imageCustomPath:H,pathDragActive:N,pathCarryImage:Y,onCarryImageConsumed:O,pathEditor:C,imageEditor:V}){var Le,Ve;const $=`pretext-shape-image-${s.useId().replace(/:/g,"")}`,[R,k]=s.useState(null),T=s.useRef(null),[m,M]=s.useState({width:0,height:0}),[E,z]=s.useState(null),[ne,I]=s.useState(0),[W,K]=s.useState("none");s.useEffect(()=>{!C&&!V&&K("none")},[C,V]);const[ae,de]=s.useState(null);s.useEffect(()=>{if(!x||typeof Image>"u"){de(null);return}let se=!1;const Te=new Image;return Te.onload=()=>{se||de({width:Te.naturalWidth,height:Te.naturalHeight})},Te.src=x,()=>{se=!0}},[x]);const A=s.useMemo(()=>Array.isArray(t==null?void 0:t.text)?t.text:[],[t]),he=s.useMemo(()=>MS(A),[A]),q=s.useMemo(()=>PS(A),[A]),ce=v>0&&g>1?((Ve=(Le=he[0])==null?void 0:Le.text)==null?void 0:Ve.charAt(0))??"":"",Q=(C==null?void 0:C.contours)??null,be=s.useMemo(()=>{let se=[];if(Q){const Te=Vo(Q);Te.length&&(se=Yi(Te,r))}if(!se.length){const Te=i.trim(),Xe=Te?Wc(Te,o,r):null;Xe&&Xe.length?se=Xe:se=hs(n==="custom"?"rectangle":n)}return n==="circle"?Ka(se,m):se},[Q,n,i,o,r,m.width,m.height]),He=C==null?void 0:C.onConvert,xe=(C==null?void 0:C.needsConversion)??!1,le=s.useMemo(()=>{if(n==="circle")return!1;const se=Q??(i.trim()?ri(i):null);return!!(se&&Mu(se,r))},[Q,i,r,n]),[ee,ue]=s.useState(null);Ir(()=>{if(!le){ee&&ue(null);return}!ee&&m.width>0&&m.height>0&&ue({width:m.width,height:m.height})},[le,m.width,m.height,ee]);const oe=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return be;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return be.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[be,le,ee,r.width,r.height,m.width,m.height]),Fe=s.useMemo(()=>{if(Q){const ze=Vo(Q);if(ze.length){const Re=Yi(ze,r);return n==="circle"?Ka(Re,m):Re}}const se=H.trim(),Te=se?Wc(se,o,r):null,Xe=Te&&Te.length?Te:hs(n==="custom"?"rectangle":n);return n==="circle"?Ka(Xe,m):Xe},[Q,n,H,o,r,m.width,m.height]),Ce=s.useMemo(()=>{if(!le||m.width<=0||m.height<=0)return Fe;const se=ee??m,Te=r.width/se.width,Xe=r.height/se.height;return Fe.map(ze=>ze.map(Re=>({x:Re.x*Te,y:Re.y*Xe})))},[Fe,le,ee,r.width,r.height,m.width,m.height]),P=s.useRef(null),U=s.useRef(!1);s.useEffect(()=>{if(!(!He||m.width<=0||m.height<=0)){if(le){if(P.current===i)return;const se=Q??(i.trim()?ri(i):null);if(!(se!=null&&se.length))return;const Te=an(se,Xe=>({x:r.x+(Xe.x-r.x)/m.width*r.width,y:r.y+(Xe.y-r.y)/m.height*r.height}));P.current=co(Te),He(Te);return}!xe||!be.length||U.current||(U.current=!0,He(an(Eu(be),se=>({x:se.x*Xr,y:se.y*Xr}))))}},[xe,le,He,be,Q,i,r,m.width,m.height]),Ir(()=>{const se=R;if(!se||typeof ResizeObserver>"u")return;const Te=()=>{const ze=se.getBoundingClientRect();M(Re=>Math.abs(Re.width-ze.width)<.5&&Math.abs(Re.height-ze.height)<.5?Re:{width:ze.width,height:ze.height})};Te();const Xe=new ResizeObserver(Te);return Xe.observe(se),()=>Xe.disconnect()},[R]),s.useEffect(()=>{const se=typeof document<"u"?document.fonts:void 0;se!=null&&se.ready&&se.ready.then(()=>{I(Te=>Te+1)})},[]),Ir(()=>{const se=T.current;if(!se)return;if(!he.length){z(null);return}const Te=[],Xe=document.createDocumentFragment();for(const It of he){const Tt=document.createElement("span");Object.assign(Tt.style,Kc(It.leaf)),Tt.textContent=It.text,Xe.appendChild(Tt),Te.push(Tt)}const ze=document.createElement("span");ze.textContent=" ",Xe.appendChild(ze);const Re=document.createElement("span");Re.textContent=ce||"H",Re.style.lineHeight="1",Xe.appendChild(Re),se.replaceChildren(Xe);const Pe=window.getComputedStyle(se),Ae=parseFloat(Pe.fontSize)||16,Ke=parseFloat(Pe.lineHeight),Oe=Number.isNaN(Ke)?Ae*1.2:Ke,Qe=Math.max(Oe,Ae);Re.style.fontSize=`${Qe*g}px`;const tt=Te.map(It=>It.getBoundingClientRect().width),nt=ze.getBoundingClientRect().width,xt=ce?Re.getBoundingClientRect().width:0;se.replaceChildren(),z({widths:tt,spaceWidth:nt,lineHeight:Qe,capWidth:xt})},[he,f,ce,v,g,ne,m.width]);const X=E&&ce?E.capWidth+E.lineHeight*kS:0,ie=Math.max(v,Math.ceil(g)),j=s.useMemo(()=>{if(!E||!he.length||m.width<=0||m.height<=0||!u)return 1;const se=ze=>Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:ze,allowOverflow:!1,capInset:X*ze,capLines:ce?ie:0});if(se(1).placed>=he.length)return 1;if(se(Ya).placed<he.length)return Ya;let Te=Ya,Xe=1;for(let ze=0;ze<FS;ze+=1){const Re=(Te+Xe)/2;se(Re).placed>=he.length?Te=Re:Xe=Re}return Te},[E,he,m.width,m.height,oe,l,d,u,X,ce,ie]);s.useEffect(()=>{b(j)},[j,b]);const B=u?Math.min(p,j):1,J=s.useMemo(()=>!E||!he.length||m.width<=0||m.height<=0?{segments:[],placed:0,height:0,capLeft:0,capTop:0}:Zc({tokens:he,widths:E.widths,spaceWidth:E.spaceWidth,lineHeight:E.lineHeight,width:m.width,height:m.height,rings:oe,mode:l,align:d,scale:B,allowOverflow:c,capInset:X*B,capLines:ce?ie:0}),[E,he,m.width,m.height,oe,l,d,B,c,X,ce,ie]),te=E?E.lineHeight*B:0,$e=d==="justify"?"left":d,ye=!!(C&&Q&&m.width>0&&m.height>0),F=!!V,ve=(ye||F)&&m.width>0&&m.height>0,pe=NS(R,ve),Z=ve&&pe?HS():null,me=s.useRef(!1),De=s.useCallback(se=>{me.current=se},[]);s.useEffect(()=>{if(!ye&&!F)return;const se=Te=>{const Xe=R;if(!Xe)return;const ze=Xe.getBoundingClientRect();Te.clientX>=ze.left&&Te.clientX<=ze.right&&Te.clientY>=ze.top&&Te.clientY<=ze.bottom&&(Te.preventDefault(),Te.stopPropagation(),K(Pe=>Pe==="shape"&&me.current?Pe:Pe==="shape"&&F?"image":ye?"shape":"image"))};return document.addEventListener("dblclick",se,!0),()=>document.removeEventListener("dblclick",se,!0)},[ye,F,R]);const ge=s.useMemo(()=>x&&m.width>0&&m.height>0?_w(Ce,m):null,[x,Ce,m.width,m.height]),G=s.useRef(null),Me=(()=>{const se=G.current;return Y||!V||!ae||!ge||!se||H===se.customPath||se.shape!==n&&n!=="custom"?null:xS(se.bounds,ge,ae,se.focalX,se.focalY,se.scale)})();Ir(()=>{if(N||!V||!ae||!ge)return;const se=G.current,Te=!!(se&&H!==se.customPath);Te&&Me&&V.onCommit(Me),Te&&Y&&(O==null||O()),G.current={rings:Ce,bounds:ge,focalX:(Me==null?void 0:Me.focalX)??S,focalY:(Me==null?void 0:Me.focalY)??y,scale:(Me==null?void 0:Me.scale)??w,customPath:H,shape:n}},[N,Y,H,n,Ce,ge,V,ae,S,y,w,Me,O]);const _e=G.current,rt=!!(N&&!Y&&_e&&!Me),Je=rt&&_e?_e.focalX:(Me==null?void 0:Me.focalX)??S,at=rt&&_e?_e.focalY:(Me==null?void 0:Me.focalY)??y,it=rt&&_e?_e.scale:(Me==null?void 0:Me.scale)??w,je=rt&&_e?_e.bounds:ge,Se=s.useMemo(()=>{if(!(m.width>0)||!(m.height>0))return"";let se=Hc(i,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(oe,m)},[i,Q,o,r,n,m.width,m.height,le,ee,oe]),We=s.useMemo(()=>{if(!x||!(m.width>0)||!(m.height>0))return"";let se=Hc(H,Q,o,r,n,m);if(le){const Te=ee??m,Xe=r.width/Te.width,ze=r.height/Te.height;se=an(se,Re=>({x:Re.x*Xe,y:Re.y*ze}))}return Oc(se,m)||_c(Ce,m)},[x,H,Q,o,r,n,m.width,m.height,le,ee,Ce]),Be=`${$}-clip`,Ze=s.useMemo(()=>{if(!je)return null;const se=ae??{width:je.width,height:je.height},Te=Si(je,se,it);return{x:En(je.width,Te.width,Je),y:En(je.height,Te.height,at),width:Te.width,height:Te.height}},[je,ae,Je,at,it]);return a.jsxs("div",{className:`${e}-column`,ref:k,children:[Se?a.jsxs("svg",{className:`${e}-shape-fill`,viewBox:`0 0 ${m.width} ${m.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[a.jsx("path",{className:`${e}-shape-fill-path`,d:Se,fillRule:"evenodd"}),x&&We&&je&&Ze?a.jsxs(a.Fragment,{children:[a.jsx("defs",{children:a.jsx("clipPath",{id:Be,clipPathUnits:"userSpaceOnUse",children:a.jsx("path",{d:We,fillRule:"evenodd"})})}),a.jsx("image",{href:x,x:je.x+Ze.x,y:je.y+Ze.y,width:Ze.width,height:Ze.height,preserveAspectRatio:"none",clipPath:`url(#${Be})`})]}):null]}):null,a.jsxs("div",{className:`${e}-flow${c?"":` ${e}-clip`}`,style:{...f,["--"+e+"-fit"]:B},children:[a.jsx("div",{className:`${e}-measure`,ref:T,style:f,"aria-hidden":!0}),J.segments.map((se,Te)=>{const Xe=he.slice(se.from,se.to),ze=Te===0;return a.jsx("div",{className:`${e}-line${se.justify?` ${e}-line-justify`:""}`,"aria-hidden":!0,style:{top:`${se.top}px`,left:`${se.left}px`,width:`${se.width}px`,textAlign:se.justify?void 0:$e},children:Xe.map((Re,Pe)=>{const Ke=ce&&ze&&se.from===0&&Pe===0?Re.text.slice(1):Re.text,Oe=Kc(Re.leaf),Qe=Re.href?a.jsx("a",{className:`${e}-link`,href:Re.href,target:Re.target,rel:Re.target?"noopener noreferrer":void 0,style:Oe,children:Ke}):a.jsx("span",{style:Oe,children:Ke});return a.jsxs("span",{children:[!se.justify&&Pe>0?" ":null,Qe]},Pe)})},`${se.from}-${se.to}-${Te}`)}),h&&!Q&&a.jsx("svg",{className:`${e}-guides`,viewBox:"0 0 1 1",preserveAspectRatio:"none","aria-hidden":!0,children:oe.map((se,Te)=>a.jsx("polygon",{points:se.map(Xe=>`${Xe.x},${Xe.y}`).join(" ")},Te))})]}),ce&&E&&a.jsx("div",{className:`${e}-drop-cap`,"aria-hidden":!0,style:{...f,top:`${J.capTop}px`,left:`${J.capLeft}px`,fontSize:`${te*g}px`,lineHeight:`${te*g}px`},children:ce}),Z&&pe&&(Q&&C||V)&&Vn.createPortal(a.jsxs("div",{"data-selection":"none",style:{position:"fixed",top:pe.top,left:pe.left,width:pe.width,height:pe.height,zIndex:AS,pointerEvents:"none"},children:[Q&&C&&a.jsx(LS,{P:e,box:{width:pe.width,height:pe.height},viewBox:r,contours:Q,snap:C.snap,stretchToBox:!le,uniformStretch:n==="circle",stage:W,onStageChange:K,onSelectionChange:De,onChange:C.onChange,onCommit:C.onCommit}),V&&je&&a.jsx(bS,{P:e,box:{width:pe.width,height:pe.height},bounds:je,natural:ae,imageUrl:x,maskPath:We,stage:W,onStageChange:K,focalX:Je,focalY:at,scale:it,onChange:V.onChange,onCommit:V.onCommit})]}),Z),a.jsx("div",{className:`${e}-a11y`,children:q.map((se,Te)=>a.jsx("p",{children:se},Te))})]})}const _u=["diamond","parallelogram","vase","circle","shield","bobbin","custom"],DS={x:0,y:0,width:100,height:100},jS=e=>{const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?DS:{x:t[0],y:t[1],width:t[2],height:t[3]}},zS=e=>`
|
|
23676
23700
|
.${e}-wrapper {
|
|
23677
23701
|
box-sizing: border-box;
|
|
23678
23702
|
display: flex;
|
|
@@ -23893,7 +23917,7 @@ export function Helix({
|
|
|
23893
23917
|
clip-path: inset(50%);
|
|
23894
23918
|
white-space: nowrap;
|
|
23895
23919
|
}
|
|
23896
|
-
`,
|
|
23920
|
+
`,BS=1;function VS({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,isSelected:r,onUpdateSettings:l}){const{prefix:d}=D.useScopedStyles(),c=s.useMemo(()=>zS(d),[d]),u=n??!1,p=!!r||!!o,b=s.useMemo(()=>Array.isArray(t)?t[0]??{}:{},[t]),v=(e==null?void 0:e.shape)??"custom",g=(e==null?void 0:e.customPath)??"",h=(e==null?void 0:e.pathFit)??"stretch",f=s.useMemo(()=>jS(e==null?void 0:e.pathViewBox),[e==null?void 0:e.pathViewBox]),x=(e==null?void 0:e.shapeMode)==="B"?"avoid":"contain",S=(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",H=(e==null?void 0:e.dropCapSize)??BS,N=Math.max(1,Math.round((e==null?void 0:e.dropCapLines)??H)),Y=u&&p&&!i,[O,C]=s.useState(!1);s.useEffect(()=>{if(!u||!p){C(!1);return}const J=()=>C(!0),te=()=>C(!1),$e=["ArticleEditor.Item:drag-start","ArticleEditor.Selection:resize-start","ArticleEditor.Selection:move-start"],ye=["ArticleEditor.Item:drag-end","ArticleEditor.Selection:resize-end","ArticleEditor.Selection:move-end"];for(const F of $e)window.addEventListener(F,J);for(const F of ye)window.addEventListener(F,te);return()=>{for(const F of $e)window.removeEventListener(F,J);for(const F of ye)window.removeEventListener(F,te)}},[u,p]);const V=u&&p&&!i&&typeof l=="function",$=!O,R=Math.max(0,(e==null?void 0:e.pathSnap)??0),k=s.useRef(e??{}),T=s.useRef(""),m=[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(m!==T.current)T.current=m,k.current=e??{};else if(e){const{customPath:J,shape:te,pathFit:$e,pathViewBox:ye,imageScale:F,imageFocalX:ve,imageFocalY:pe,image:Z,...me}=e,De=k.current;for(const ge of Object.keys(me))if(De[ge]!==me[ge]){k.current={...De,...me};break}}const[M,E]=s.useState(null),[z,ne]=s.useState(!1),[I,W]=s.useState(!1),K=s.useCallback(()=>W(!1),[]),ae=k.current.shape??v,de=s.useMemo(()=>!M||M.serialized===g?g:M.serialized,[M,g]);s.useEffect(()=>{V||(ne(!1),W(!1))},[V]),s.useEffect(()=>{!M||z||M.serialized===g&&E(null)},[M,g,z]);const A=s.useMemo(()=>{if(!V)return null;if(M&&(M.base===g||M.serialized===g))return M.contours;const J=ri(g);return J.length?J:null},[V,M,g]),he=!!(h==="viewbox"&&((e==null?void 0:e.pathViewBox)??"")===ms&&A&&(v==="circle"||!Mu(A,f))),q=s.useCallback((J,te,$e)=>{const ye=co(J);if(E(F=>({base:F&&(F.base===g||F.serialized===g)?F.base:g,serialized:ye,contours:J})),te){const F=k.current,ve=$e!=null&&$e.preserveShape?F.shape:"custom",pe={...F,shape:ve,customPath:ye};k.current=pe,l==null||l(pe)}},[g,l]),ce=s.useMemo(()=>V?{contours:he?A:null,snap:R,needsConversion:!he,onConvert:J=>{const te=co(J);E({base:te,serialized:te,contours:J});const $e={...k.current,pathFit:"viewbox",pathViewBox:ms,customPath:te};k.current=$e,l==null||l($e)},onChange:(J,te)=>{ne(!0),W(!!(te!=null&&te.carryImage)),q(J,!1)},onCommit:(J,te)=>{q(J,!0,te),ne(!1)}}:null,[V,he,A,R,l,q]),Q=x==="avoid"&&!!(e!=null&&e.image),be=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]),[He,xe]=s.useState(null),le=He??be,ee=s.useCallback(J=>xe(J),[]),ue=s.useCallback(J=>{xe(J);const te={...k.current,imageFocalX:J.focalX,imageFocalY:J.focalY,imageScale:J.scale};k.current=te,l==null||l(te)},[l]);s.useEffect(()=>{He&&Math.abs(He.focalX-be.focalX)<1e-9&&Math.abs(He.focalY-be.focalY)<1e-9&&Math.abs(He.scale-be.scale)<1e-9&&xe(null)},[He,be]);const oe=s.useMemo(()=>!V||!Q?null:{onChange:ee,onCommit:ue},[V,Q,ee,ue]),[Fe,Ce]=s.useState(void 0),P=s.useRef(void 0),U=s.useCallback(J=>{const te=P.current;te!==void 0&&Math.abs(te-J)<.005||(P.current=J,Ce(J))},[]),X=s.useMemo(()=>w&&typeof Fe=="number"?Fe:1,[Fe,w]),ie=J=>`calc(${J} * var(--${d}-fit, 1))`,j=s.useMemo(()=>{var $e,ye,F,ve,pe;const J=(e==null?void 0:e.textFontSize)??.012,te=Math.max((e==null?void 0:e.textLineHeight)??J,J);return{fontFamily:go(e==null?void 0:e.textFontFamily),fontWeight:($e=e==null?void 0:e.textFontSettings)==null?void 0:$e.fontWeight,fontStyle:(ye=e==null?void 0:e.textFontSettings)==null?void 0:ye.fontStyle,fontSize:ie(D.scalingValue(J,u)),lineHeight:ie(D.scalingValue(te,u)),letterSpacing:ie(D.scalingValue((e==null?void 0:e.textLetterSpacing)??0,u)),wordSpacing:ie(D.scalingValue((e==null?void 0:e.textWordSpacing)??0,u)),textTransform:(F=e==null?void 0:e.textTextAppearance)==null?void 0:F.textTransform,textDecoration:(ve=e==null?void 0:e.textTextAppearance)==null?void 0:ve.textDecoration,fontVariant:(pe=e==null?void 0:e.textTextAppearance)==null?void 0:pe.fontVariant}},[e,u,d]),B={[`--${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:{...B},children:a.jsx(OS,{P:d,item:b,shape:ae,customPath:g,pathFit:h,viewBox:f,mode:x,align:S,allowOverflow:y,fitEnabled:w,scale:X,onFitScale:U,dropCapLines:N,dropCapSize:H,showGuides:(Y||V)&&$,typography:j,imageUrl:x==="avoid"?e==null?void 0:e.image:null,imageFocalX:le.focalX,imageFocalY:le.focalY,imageScale:le.scale,imageCustomPath:de,pathDragActive:z,pathCarryImage:I,onCarryImageConsumed:K,pathEditor:$?ce:null,imageEditor:$?oe:null})})]})}const GS=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
23897
23921
|
import type React from 'react';
|
|
23898
23922
|
import { CommonComponentProps } from '../props';
|
|
23899
23923
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -24697,4 +24721,4 @@ export function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode
|
|
|
24697
24721
|
</>
|
|
24698
24722
|
);
|
|
24699
24723
|
}
|
|
24700
|
-
`,
|
|
24724
|
+
`,Jc=[..._u],qS={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},XS={type:"object",version:1,settings:{sizing:"manual",properties:{shape:{type:"string",scope:"layout",display:{type:"shape-select",isFilled:!0,enum:Jc},enum:Jc},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"]}},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:.5,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:{...qS.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:{...Pu("circle"),pathSnap:0,shapeMode:"A",fitText:"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},t:{textFontSize:.018,textLineHeight:.024,textLetterSpacing:0,textWordSpacing:0},d:{textFontSize:.032,textLineHeight:.0155,textLetterSpacing:-.001,textWordSpacing:0}},layout:["__componentName__","shape","customPath","pathSnap","pathFit","shapeMode","fitText","dropCapLines","dropCapSize","image"],displayRules:[{if:{name:"shapeMode",value:"B",isNotEqual:!0},then:{name:"properties.image.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","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."}]}]}]}},US={element:VS,id:"pretext",name:"Shaped Type",category:"typography",version:1,normalizeLayoutSettingsUpdate:(e,t)=>{const n=e.shape;return typeof n!="string"||n==="custom"||_u.indexOf(n)===-1||(t==null?void 0:t.shape)===n?e:{...e,...Pu(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:XS,sourceCode:GS,assetsPaths:{content:[],parameters:[{path:"image",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}},YS=[Xm,eg,X0,qg,th,uh,Mh,Qh,sf,gf,Of,ky,Wv,Gv,R0,H0,rx,tb,fx,vb,Yb,Aw,US];exports.components=YS;exports.isSchemaV1=Hu;
|