@cntrl-site/components 1.0.62-alpha.3 → 1.0.62-alpha.4
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/MarqueeText/MarqueeText.d.ts +1 -1
- package/dist/Components/MarqueeText/MarqueeTextComponent.d.ts +1 -1
- package/dist/index.js +210 -158
- package/dist/index.mjs +6139 -6090
- 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 r=require("react/jsx-runtime"),a=require("react"),lt=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Xc(e){return e.type==="object"&&e.version===1}const Yc="ControlSlider-module__wrapper___sHEkd",Zc="ControlSlider-module__hoverArrow___A-dOH",Jc="ControlSlider-module__sliderItem___QQSkR",Qc="ControlSlider-module__sliderImage___9hRl-",ed="ControlSlider-module__arrow___05ghY",td="ControlSlider-module__arrowVertical___tBfVN",nd="ControlSlider-module__nextArrow___-30Yc",id="ControlSlider-module__arrowInner___aEra3",od="ControlSlider-module__arrowIcon___S4ztF",rd="ControlSlider-module__arrowImg___2dwJW",ad="ControlSlider-module__mirror___brd6U",sd="ControlSlider-module__pagination___bicLF",ld="ControlSlider-module__paginationInner___bT-P-",cd="ControlSlider-module__paginationVertical___zYqKw",dd="ControlSlider-module__paginationItem___nTRbk",ud="ControlSlider-module__dot___p1Qun",pd="ControlSlider-module__activeDot___LHFaj",md="ControlSlider-module__paginationInsideBottom___R3FWn",gd="ControlSlider-module__paginationInsideTop___V-qb-",hd="ControlSlider-module__paginationOutsideBottom___14w8D",fd="ControlSlider-module__paginationOutsideTop___SCLqB",yd="ControlSlider-module__paginationInsideLeft___yOBRZ",vd="ControlSlider-module__paginationInsideRight___Rtt3o",xd="ControlSlider-module__paginationOutsideLeft___lahaw",bd="ControlSlider-module__paginationOutsideRight___EtuQa",wd="ControlSlider-module__imgWrapper___UjEgB",Sd="ControlSlider-module__captionBlock___dJ6-j",$d="ControlSlider-module__captionTextWrapper___HFlpf",Cd="ControlSlider-module__captionText___uGBVc",Td="ControlSlider-module__active___WZK4G",Ld="ControlSlider-module__withPointerEvents___t-18M",Rd="ControlSlider-module__topLeftAlignment___zjnGM",Id="ControlSlider-module__topCenterAlignment___gD1xW",Ed="ControlSlider-module__topRightAlignment___NMapS",Md="ControlSlider-module__middleLeftAlignment___OnUrY",Pd="ControlSlider-module__middleCenterAlignment___Tdkl0",kd="ControlSlider-module__middleRightAlignment___wEbfX",Ad="ControlSlider-module__bottomLeftAlignment___cTP2-",Fd="ControlSlider-module__bottomCenterAlignment___c54fB",Wd="ControlSlider-module__bottomRightAlignment___kEwrz",_d="ControlSlider-module__clickOverlay___DZA28",Hd="ControlSlider-module__contain___pLyq7",Nd="ControlSlider-module__cover___KdDat",rt={wrapper:Yc,hoverArrow:Zc,sliderItem:Jc,sliderImage:Qc,arrow:ed,arrowVertical:td,nextArrow:nd,arrowInner:id,arrowIcon:od,arrowImg:rd,mirror:ad,pagination:sd,paginationInner:ld,paginationVertical:cd,paginationItem:dd,dot:ud,activeDot:pd,paginationInsideBottom:md,paginationInsideTop:gd,paginationOutsideBottom:hd,paginationOutsideTop:fd,paginationInsideLeft:yd,paginationInsideRight:vd,paginationOutsideLeft:xd,paginationOutsideRight:bd,imgWrapper:wd,captionBlock:Sd,captionTextWrapper:$d,captionText:Cd,active:Td,withPointerEvents:Ld,topLeftAlignment:Rd,topCenterAlignment:Id,topRightAlignment:Ed,middleLeftAlignment:Md,middleCenterAlignment:Pd,middleRightAlignment:kd,bottomLeftAlignment:Ad,bottomCenterAlignment:Fd,bottomRightAlignment:Wd,clickOverlay:_d,contain:Hd,cover:Nd};function Od(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 Dd(e,t,n){return t&&Od(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var us="(prefers-reduced-motion: reduce)",Pi=1,jd=2,_i=3,Xi=4,Lo=5,tr=6,lr=7,zd={CREATED:Pi,MOUNTED:jd,IDLE:_i,MOVING:Xi,SCROLLING:Lo,DRAGGING:tr,DESTROYED:lr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var Al=setTimeout,ha=function(){};function ps(e){return requestAnimationFrame(e)}function vr(e,t){return typeof t===e}function go(e){return!ka(e)&&vr("object",e)}var Pa=Array.isArray,Fl=qt(vr,"function"),qn=qt(vr,"string"),Ro=qt(vr,"undefined");function ka(e){return e===null}function Wl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Io(e){return Pa(e)?e:[e]}function yn(e,t){Io(e).forEach(t)}function Aa(e,t){return e.indexOf(t)>-1}function nr(e,t){return e.push.apply(e,Io(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function Eo(e,t){yn(t,e.appendChild.bind(e))}function Fa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ho(e,t){return Wl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function _l(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return ho(i,t)}):n}function Mo(e,t){return t?_l(e,t)[0]:e.firstElementChild}var fo=Object.keys;function mi(e,t,n){return e&&(n?fo(e).reverse():fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function yo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Pa(n)?e[i]=n.slice():go(n)?e[i]=zn({},go(e[i])?e[i]:{},n):e[i]=n})}),e}function ms(e,t){yn(t||fo(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){go(t)?mi(t,function(i,o){$t(e,o,i)}):yn(e,function(i){ka(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function ki(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):$t(i,t)),n&&Eo(n,i),i}function xn(e,t,n){if(Ro(n))return getComputedStyle(e)[t];ka(n)||(e.style[t]=""+n)}function vo(e,t){xn(e,"display",t)}function Hl(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function gs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Nl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Ol(e,t){return e&&e.querySelector(t)}function Wa(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function fa(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Po="splide",_a="data-"+Po;function co(e,t){if(!e)throw new Error("["+Po+"] "+(t||""))}var Un=Math.min,cr=Math.max,dr=Math.floor,xo=Math.ceil,ln=Math.abs;function Dl(e,t,n){return ln(e-t)<n}function ir(e,t,n,i){var o=Un(t,n),s=cr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Ri(e,t,n){var i=Un(t,n),o=cr(t,n);return Un(cr(i,e),o)}function ya(e){return+(e>0)-+(e<0)}function va(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Ha(e){return e<10?"0"+e:""+e}var hs={};function Bd(e){return""+e+Ha(hs[e]=(hs[e]||0)+1)}function jl(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,y){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);g?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,y,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(y){return y[0]===u&&y[1]===p&&y[2]===v&&(!c||y[3]===c)?(y[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(v){var y=v.split(".");c(u,y[0],y[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",xa="ready",_n="move",Yi="moved",Na="click",zl="active",Bl="inactive",Vl="visible",Gl="hidden",Qt="refresh",an="updated",Hi="resize",xr="resized",ql="drag",Ul="dragging",Kl="dragged",br="scroll",vi="scrolled",Vd="overflow",Oa="destroy",Xl="arrows:mounted",Yl="arrows:updated",Zl="pagination:mounted",Jl="pagination:updated",Da="navigation:mounted",ja="autoplay:play",Ql="autoplay:playing",za="autoplay:pause",Ba="lazyload:loaded",ec="sk",tc="sh",ur="ei";function Yt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=jl();function i(s,l){n.bind(t,Io(s).join(" "),function(d){l.apply(l,Pa(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Oa,n.destroy),yo(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function wr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return y();d=ps(p)}}function v(E){E||h(),s=o()-(E?l*e:0),c=!1,d=ps(p)}function y(){c=!0}function g(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(E){e=E}function b(){return c}return{start:v,rewind:g,pause:y,cancel:h,set:m,isPaused:b}}function Gd(e){var t=e;function n(o){t=o}function i(o){return Aa(Io(o),t)}return{set:n,is:i}}function qd(e,t){var n=wr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function Ud(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=jl(),d=[];function c(){var h=n.mediaQuery==="min";fo(o).sort(function(m,b){return h?+m-+b:+b-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,us),v()}function u(h){h&&l.destroy()}function p(h,m){var b=matchMedia(m);l.bind(b,"change",v),d.push([h,b])}function v(){var h=i.is(lr),m=n.direction,b=d.reduce(function(E,L){return zn(E,L[1].matches?L[0]:{})},{});ms(n),g(b),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function y(h){matchMedia(us).matches&&(h?zn(n,s):ms(n,fo(s)))}function g(h,m,b){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(b||!i.is(Pi))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:y,set:g}}var Sr="Arrow",$r=Sr+"Left",Cr=Sr+"Right",nc=Sr+"Up",ic=Sr+"Down",fs="rtl",Tr="ttb",Or={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[nc,Cr],ArrowRight:[ic,$r]};function Kd(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===fs&&!l?1:d===Tr?0:-1;return Or[s]&&Or[s][c]||s.replace(/width|left|right/i,function(u,p){var v=Or[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(s){return s*(n.direction===fs?1:-1)}return{resolve:i,orient:o}}var kn="role",Ai="tabindex",Xd="disabled",wn="aria-",ko=wn+"controls",oc=wn+"current",ys=wn+"selected",hn=wn+"label",Va=wn+"labelledby",rc=wn+"hidden",Ga=wn+"orientation",bo=wn+"roledescription",vs=wn+"live",xs=wn+"busy",bs=wn+"atomic",qa=[kn,Ai,Xd,ko,oc,hn,Va,rc,Ga,bo],Rn=Po+"__",Qn="is-",Dr=Po,ws=Rn+"track",Yd=Rn+"list",Lr=Rn+"slide",ac=Lr+"--clone",Zd=Lr+"__container",Ua=Rn+"arrows",Rr=Rn+"arrow",sc=Rr+"--prev",lc=Rr+"--next",Ir=Rn+"pagination",cc=Ir+"__page",Jd=Rn+"progress",Qd=Jd+"__bar",eu=Rn+"toggle",tu=Rn+"spinner",nu=Rn+"sr",iu=Qn+"initialized",fi=Qn+"active",dc=Qn+"prev",uc=Qn+"next",ba=Qn+"visible",wa=Qn+"loading",pc=Qn+"focus-in",mc=Qn+"overflow",ou=[fi,ba,dc,uc,wa,pc,mc],ru={slide:Lr,clone:ac,arrows:Ua,arrow:Rr,prev:sc,next:lc,pagination:Ir,page:cc,spinner:tu};function au(e,t){if(Fl(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ho(n,t);)n=n.parentElement;return n}var su=5,Ss=200,gc="touchstart mousedown",jr="touchmove mousemove",zr="touchend touchcancel mouseup click";function lu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],y,g,h;function m(){C(),K(),L()}function b(){o(Qt,E),o(Qt,m),o(an,L),s(document,gc+" keydown",function(A){h=A.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,pc,!!h)})}function E(A){var T=qa.concat("style");Wn(u),Pn(l,p),Pn(y,v),Ln([y,g],T),Ln(l,A?T:["style",bo])}function L(){Pn(l,p),Pn(y,v),p=B(Dr),v=B(ws),Tn(l,p),Tn(y,v),$t(l,hn,n.label),$t(l,Va,n.labelledby)}function C(){y=W("."+ws),g=Mo(y,"."+Yd),co(y&&g,"A track/list element is missing."),nr(u,_l(g,"."+Lr+":not(."+ac+")")),mi({arrows:Ua,pagination:Ir,prev:sc,next:lc,bar:Qd,toggle:eu},function(A,T){c[T]=W("."+A)}),yo(c,{root:l,track:y,list:g,slides:u})}function K(){var A=l.id||Bd(Po),T=n.role;l.id=A,y.id=y.id||A+"-track",g.id=g.id||A+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&T&&$t(l,kn,T),$t(l,bo,d.carousel),$t(g,kn,"presentation")}function W(A){var T=Ol(l,A);return T&&au(T,"."+Dr)===l?T:void 0}function B(A){return[A+"--"+n.type,A+"--"+n.direction,n.drag&&A+"--draggable",n.isNavigation&&A+"--nav",A===Dr&&fi]}return yo(c,{setup:m,mount:b,destroy:E})}var Ni="slide",Zi="loop",Ao="fade";function cu(e,t,n,i){var o=Yt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,y=p.updateOnMove,g=p.i18n,h=p.pagination,m=p.slideFocus,b=c.Direction.resolve,E=bn(i,"style"),L=bn(i,hn),C=n>-1,K=Mo(i,"."+Zd),W;function B(){C||(i.id=u.id+"-slide"+Ha(t+1),$t(i,kn,h?"tabpanel":"group"),$t(i,bo,g.slide),$t(i,hn,L||va(g.slideLabel,[t+1,e.length]))),A()}function A(){d(i,"click",qt(l,Na,ie)),d(i,"keydown",qt(l,ec,ie)),s([Yi,tc,vi],P),s(Da,j),y&&s(_n,w)}function T(){W=!0,o.destroy(),Pn(i,ou),Ln(i,qa),$t(i,"style",E),$t(i,hn,L||"")}function j(){var S=e.splides.map(function(R){var O=R.splide.Components.Slides.getAt(t);return O?O.slide.id:""}).join(" ");$t(i,hn,va(g.slideX,(C?n:t)+1)),$t(i,ko,S),$t(i,kn,m?"button":""),m&&Ln(i,bo)}function w(){W||P()}function P(){if(!W){var S=e.index;M(),X(),Mn(i,dc,t===S-1),Mn(i,uc,t===S+1)}}function M(){var S=q();S!==gs(i,fi)&&(Mn(i,fi,S),$t(i,oc,v&&S||""),l(S?zl:Bl,ie))}function X(){var S=V(),R=!S&&(!q()||C);if(e.state.is([Xi,Lo])||$t(i,rc,R||""),$t(Wa(i,p.focusableNodes||""),Ai,R?-1:""),m&&$t(i,Ai,R?-1:0),S!==gs(i,ba)&&(Mn(i,ba,S),l(S?Vl:Gl,ie)),!S&&document.activeElement===i){var O=c.Slides.getAt(e.index);O&&Hl(O.slide)}}function k(S,R,O){xn(O&&K||i,S,R)}function q(){var S=e.index;return S===t||p.cloneStatus&&S===n}function V(){if(e.is(Ao))return q();var S=mn(c.Elements.track),R=mn(i),O=b("left",!0),ae=b("right",!0);return dr(S[O])<=xo(R[O])&&dr(R[ae])<=xo(S[ae])}function G(S,R){var O=ln(S-t);return!C&&(p.rewind||e.is(Zi))&&(O=Un(O,e.length-O)),O<=R}var ie={index:t,slideIndex:n,slide:i,container:K,isClone:C,mount:B,destroy:T,update:P,style:k,isWithin:G};return ie}function du(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){y(),o(Qt,g),o(Qt,y)}function y(){c.forEach(function(P,M){m(P,M,-1)})}function g(){W(function(P){P.destroy()}),Wn(p)}function h(){W(function(P){P.update()})}function m(P,M,X){var k=cu(e,M,X,P);k.mount(),p.push(k),p.sort(function(q,V){return q.index-V.index})}function b(P){return P?B(function(M){return!M.isClone}):p}function E(P){var M=t.Controller,X=M.toIndex(P),k=M.hasFocus()?1:n.perPage;return B(function(q){return ir(q.index,X,X+k-1)})}function L(P){return B(P)[0]}function C(P,M){yn(P,function(X){if(qn(X)&&(X=Nl(X)),Wl(X)){var k=c[M];k?Fa(X,k):Eo(u,X),Tn(X,n.classes.slide),T(X,qt(s,Hi))}}),s(Qt)}function K(P){hi(B(P).map(function(M){return M.slide})),s(Qt)}function W(P,M){b(M).forEach(P)}function B(P){return p.filter(Fl(P)?P:function(M){return qn(P)?ho(M.slide,P):Aa(Io(P),M.index)})}function A(P,M,X){W(function(k){k.style(P,M,X)})}function T(P,M){var X=Wa(P,"img"),k=X.length;k?X.forEach(function(q){l(q,"load error",function(){--k||M()})}):M()}function j(P){return P?c.length:p.length}function w(){return p.length>n.perPage}return{mount:v,destroy:g,update:h,register:m,get:b,getIn:E,getAt:L,add:C,remove:K,forEach:W,filter:B,style:A,getLength:j,isEnough:w}}function uu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,y=u.list,g=d.getAt,h=d.style,m,b,E;function L(){C(),s(window,"resize load",qd(qt(l,Hi))),o([an,Qt],C),o(Hi,K)}function C(){m=n.direction===Tr,xn(p,"maxWidth",ii(n.width)),xn(v,c("paddingLeft"),W(!1)),xn(v,c("paddingRight"),W(!0)),K(!0)}function K(ie){var S=mn(p);(ie||b.width!==S.width||b.height!==S.height)&&(xn(v,"height",B()),h(c("marginRight"),ii(n.gap)),h("width",T()),h("height",j(),!0),b=S,l(xr),E!==(E=G())&&(Mn(p,mc,E),l(Vd,E)))}function W(ie){var S=n.padding,R=c(ie?"right":"left");return S&&ii(S[R]||(go(S)?0:S))||"0px"}function B(){var ie="";return m&&(ie=A(),co(ie,"height or heightRatio is missing."),ie="calc("+ie+" - "+W(!1)+" - "+W(!0)+")"),ie}function A(){return ii(n.height||mn(y).width*n.heightRatio)}function T(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":w())}function j(){return ii(n.fixedHeight)||(m?n.autoHeight?null:w():A())}function w(){var ie=ii(n.gap);return"calc((100%"+(ie&&" + "+ie)+")/"+(n.perPage||1)+(ie&&" - "+ie)+")"}function P(){return mn(y)[c("width")]}function M(ie,S){var R=g(ie||0);return R?mn(R.slide)[c("width")]+(S?0:q()):0}function X(ie,S){var R=g(ie);if(R){var O=mn(R.slide)[c("right")],ae=mn(y)[c("left")];return ln(O-ae)+(S?0:q())}return 0}function k(ie){return X(e.length-1)-X(0)+M(0,ie)}function q(){var ie=g(0);return ie&&parseFloat(xn(ie.slide,c("marginRight")))||0}function V(ie){return parseFloat(xn(v,c("padding"+(ie?"Right":"Left"))))||0}function G(){return e.is(Ao)||k(!0)>P()}return{mount:L,resize:K,listSize:P,slideSize:M,sliderSize:k,totalSize:X,getPadding:V,isOverflow:G}}var pu=2;function mu(e,t,n){var i=Yt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,v),o([an,Hi],g),(u=b())&&(h(u),t.Layout.resize(!0))}function v(){y(),p()}function y(){hi(c),Wn(c),i.destroy()}function g(){var E=b();u!==E&&(u<E||!E)&&i.emit(Qt)}function h(E){var L=l.get().slice(),C=L.length;if(C){for(;L.length<E;)nr(L,L);nr(L.slice(-E),L.slice(0,E)).forEach(function(K,W){var B=W<E,A=m(K.slide,W);B?Fa(A,L[0].slide):Eo(s.list,A),nr(c,A),l.register(A,W-E+(B?0:C),K.index)})}}function m(E,L){var C=E.cloneNode(!0);return Tn(C,n.classes.clone),C.id=e.root.id+"-clone"+Ha(L+1),C}function b(){var E=n.clones;if(!e.is(Zi))E=0;else if(Ro(E)){var L=n[d("fixedWidth")]&&t.Layout.slideSize(0),C=L&&xo(mn(s.track)[d("width")]/L);E=C||n[d("autoWidth")]&&e.length||n.perPage*pu}return E}return{mount:p,destroy:y}}function gu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,y=d.sliderSize,g=t.Direction,h=g.resolve,m=g.orient,b=t.Elements,E=b.list,L=b.track,C;function K(){C=t.Transition,o([Jn,xr,an,Qt],W)}function W(){t.Controller.isBusy()||(t.Scroll.cancel(),A(e.index),t.Slides.update())}function B(R,O,ae,se){R!==O&&ie(R>ae)&&(P(),T(w(k(),R>ae),!0)),l(Xi),s(_n,O,ae,R),C.start(O,function(){l(_i),s(Yi,O,ae,R),se&&se()})}function A(R){T(X(R,!0))}function T(R,O){if(!e.is(Ao)){var ae=O?R:j(R);xn(E,"transform","translate"+h("X")+"("+ae+"px)"),R!==ae&&s(tc)}}function j(R){if(e.is(Zi)){var O=M(R),ae=O>t.Controller.getEnd(),se=O<0;(se||ae)&&(R=w(R,ae))}return R}function w(R,O){var ae=R-G(O),se=y();return R-=m(se*(xo(ln(ae)/se)||1))*(O?1:-1),R}function P(){T(k(),!0),C.cancel()}function M(R){for(var O=t.Slides.get(),ae=0,se=1/0,I=0;I<O.length;I++){var de=O[I].index,F=ln(X(de,!0)-R);if(F<=se)se=F,ae=de;else break}return ae}function X(R,O){var ae=m(p(R-1)-V(R));return O?q(ae):ae}function k(){var R=h("left");return mn(E)[R]-mn(L)[R]+m(u(!1))}function q(R){return n.trimSpace&&e.is(Ni)&&(R=Ri(R,0,m(y(!0)-v()))),R}function V(R){var O=n.focus;return O==="center"?(v()-c(R,!0))/2:+O*c(R)||0}function G(R){return X(R?t.Controller.getEnd():0,!!n.trimSpace)}function ie(R){var O=m(w(k(),R));return R?O>=0:O<=E[h("scrollWidth")]-mn(L)[h("width")]}function S(R,O){O=Ro(O)?k():O;var ae=R!==!0&&m(O)<m(G(!1)),se=R!==!1&&m(O)>m(G(!0));return ae||se}return{mount:K,move:B,jump:A,translate:T,shift:w,cancel:P,toIndex:M,toPosition:X,getPosition:k,getLimit:G,exceededLimit:S,reposition:W}}function hu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,y=p.getLength,g=n.omitEnd,h=e.is(Zi),m=e.is(Ni),b=qt(k,!1),E=qt(k,!0),L=n.start||0,C,K=L,W,B,A;function T(){j(),o([an,Qt,ur],j),o(xr,w)}function j(){W=y(!0),B=n.perMove,A=n.perPage,C=ie();var F=Ri(L,0,g?C:W-1);F!==L&&(L=F,l.reposition())}function w(){C!==ie()&&s(ur)}function P(F,te,Z){if(!de()){var ve=X(F),Ae=G(ve);Ae>-1&&(te||Ae!==L)&&(ae(Ae),l.move(ve,Ae,K,Z))}}function M(F,te,Z,ve){t.Scroll.scroll(F,te,Z,function(){var Ae=G(l.toIndex(d()));ae(g?Un(Ae,C):Ae),ve&&ve()})}function X(F){var te=L;if(qn(F)){var Z=F.match(/([+\-<>])(\d+)?/)||[],ve=Z[1],Ae=Z[2];ve==="+"||ve==="-"?te=q(L+ +(""+ve+(+Ae||1)),L):ve===">"?te=Ae?S(+Ae):b(!0):ve==="<"&&(te=E(!0))}else te=h?F:Ri(F,0,C);return te}function k(F,te){var Z=B||(I()?1:A),ve=q(L+Z*(F?-1:1),L,!(B||I()));return ve===-1&&m&&!Dl(d(),c(!F),1)?F?0:C:te?ve:G(ve)}function q(F,te,Z){if(v()||I()){var ve=V(F);ve!==F&&(te=F,F=ve,Z=!1),F<0||F>C?!B&&(ir(0,F,te,!0)||ir(C,te,F,!0))?F=S(R(F)):h?F=Z?F<0?-(W%A||A):W:F:n.rewind?F=F<0?C:0:F=-1:Z&&F!==te&&(F=S(R(te)+(F<te?-1:1)))}else F=-1;return F}function V(F){if(m&&n.trimSpace==="move"&&F!==L)for(var te=d();te===u(F,!0)&&ir(F,0,e.length-1,!n.rewind);)F<L?--F:++F;return F}function G(F){return h?(F+W)%W||0:F}function ie(){for(var F=W-(I()||h&&B?1:A);g&&F-- >0;)if(u(W-1,!0)!==u(F,!0)){F++;break}return Ri(F,0,W-1)}function S(F){return Ri(I()?F:A*F,0,C)}function R(F){return I()?Un(F,C):dr((F>=C?W-1:F)/A)}function O(F){var te=l.toIndex(F);return m?Ri(te,0,C):te}function ae(F){F!==L&&(K=L,L=F)}function se(F){return F?K:L}function I(){return!Ro(n.focus)||n.isNavigation}function de(){return e.state.is([Xi,Lo])&&!!n.waitForTransition}return{mount:T,go:P,scroll:M,getNext:b,getPrev:E,getAdjacent:k,getEnd:ie,setIndex:ae,getIndex:se,toIndex:S,toPage:R,toDest:O,hasFocus:I,isBusy:de}}var fu="http://www.w3.org/2000/svg",yu="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",Oo=40;function vu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,y=u.track,g=v,h=u.prev,m=u.next,b,E,L={};function C(){W(),o(an,K)}function K(){B(),C()}function W(){var M=n.arrows;M&&!(h&&m)&&j(),h&&m&&(yo(L,{prev:h,next:m}),vo(g,M?"":"none"),Tn(g,E=Ua+"--"+n.direction),M&&(A(),P(),$t([h,m],ko,y.id),l(Xl,h,m)))}function B(){i.destroy(),Pn(g,E),b?(hi(v?[h,m]:g),h=m=null):Ln([h,m],qa)}function A(){o([Jn,Yi,Qt,vi,ur],P),s(m,"click",qt(T,">")),s(h,"click",qt(T,"<"))}function T(M){p.go(M,!0)}function j(){g=v||ki("div",d.arrows),h=w(!0),m=w(!1),b=!0,Eo(g,[h,m]),!v&&Fa(g,y)}function w(M){var X='<button class="'+d.arrow+" "+(M?d.prev:d.next)+'" type="button"><svg xmlns="'+fu+'" viewBox="0 0 '+Oo+" "+Oo+'" width="'+Oo+'" height="'+Oo+'" focusable="false"><path d="'+(n.arrowPath||yu)+'" />';return Nl(X)}function P(){if(h&&m){var M=e.index,X=p.getPrev(),k=p.getNext(),q=X>-1&&M<X?c.last:c.prev,V=k>-1&&M>k?c.first:c.next;h.disabled=X<0,m.disabled=k<0,$t(h,hn,q),$t(m,hn,V),l(Yl,h,m,X,k)}}return{arrows:L,mount:C,destroy:B,update:P}}var xu=_a+"-interval";function bu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.emit,d=wr(n.interval,e.go.bind(e,">"),A),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,y=p.toggle,g=n.autoplay,h,m,b=g==="pause";function E(){g&&(L(),y&&$t(y,ko,u.track.id),b||C(),B())}function L(){n.pauseOnHover&&s(v,"mouseenter mouseleave",function(j){h=j.type==="mouseenter",W()}),n.pauseOnFocus&&s(v,"focusin focusout",function(j){m=j.type==="focusin",W()}),y&&s(y,"click",function(){b?C():K(!0)}),o([_n,br,Qt],d.rewind),o(_n,T)}function C(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=b=!1,B(),l(ja))}function K(j){j===void 0&&(j=!0),b=!!j,B(),c()||(d.pause(),l(za))}function W(){b||(h||m?K(!1):C())}function B(){y&&(Mn(y,fi,!b),$t(y,hn,n.i18n[b?"play":"pause"]))}function A(j){var w=u.bar;w&&xn(w,"width",j*100+"%"),l(Ql,j)}function T(j){var w=t.Slides.getAt(j);d.set(w&&+bn(w.slide,xu)||n.interval)}return{mount:E,destroy:d.cancel,play:C,pause:K,isPaused:c}}function wu(e,t,n){var i=Yt(e),o=i.on;function s(){n.cover&&(o(Ba,qt(d,!0)),o([Jn,an,Qt],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(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),vo(u,c?"none":"")}return{mount:s,destroy:qt(l,!1)}}var Su=10,$u=600,Cu=.6,Tu=1.5,Lu=800;function Ru(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,y=e.is(Ni),g,h,m=1;function b(){o(_n,K),o([an,Qt],W)}function E(A,T,j,w,P){var M=c();if(K(),j&&(!y||!p())){var X=t.Layout.sliderSize(),k=ya(A)*X*dr(ln(A)/X)||0;A=d.toPosition(t.Controller.toDest(A%X))+k}var q=Dl(M,A,1);m=1,T=q?0:T||cr(ln(A-M)/Tu,Lu),h=w,g=wr(T,L,qt(C,M,A,P),1),l(Lo),s(br),g.start()}function L(){l(_i),h&&h(),s(vi)}function C(A,T,j,w){var P=c(),M=A+(T-A)*B(w),X=(M-P)*m;v(P+X),y&&!j&&p()&&(m*=Cu,ln(X)<Su&&E(u(p(!0)),$u,!1,h,!0))}function K(){g&&g.cancel()}function W(){g&&!g.isPaused()&&(K(),L())}function B(A){var T=n.easingFunc;return T?T(A):1-Math.pow(1-A,4)}return{mount:b,destroy:K,scroll:E,cancel:W}}var Ii={passive:!1,capture:!0};function Iu(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,y=t.Elements.track,g=t.Media.reduce,h=t.Direction,m=h.resolve,b=h.orient,E=u.getPosition,L=u.exceededLimit,C,K,W,B,A,T=!1,j,w,P;function M(){l(y,jr,ha,Ii),l(y,zr,ha,Ii),l(y,gc,k,Ii),l(y,"click",G,{capture:!0}),l(y,"dragstart",En),o([Jn,an],X)}function X(){var U=n.drag;pe(!U),B=U==="free"}function k(U){if(j=!1,!w){var ee=Ae(U);ve(U.target)&&(ee||!U.button)&&(v.isBusy()?En(U,!0):(P=ee?y:window,A=c.is([Xi,Lo]),W=null,l(P,jr,q,Ii),l(P,zr,V,Ii),u.cancel(),p.cancel(),ie(U)))}}function q(U){if(c.is(tr)||(c.set(tr),s(ql)),U.cancelable)if(A){u.translate(C+Z(I(U)));var ee=de(U)>Ss,Y=T!==(T=L());(ee||Y)&&ie(U),j=!0,s(Ul),En(U)}else O(U)&&(A=R(U),En(U))}function V(U){c.is(tr)&&(c.set(_i),s(Kl)),A&&(S(U),En(U)),d(P,jr,q),d(P,zr,V),A=!1}function G(U){!w&&j&&En(U,!0)}function ie(U){W=K,K=U,C=E()}function S(U){var ee=ae(U),Y=se(ee),Oe=n.rewind&&n.rewindByDrag;g(!1),B?v.scroll(Y,0,n.snap):e.is(Ao)?v.go(b(ya(ee))<0?Oe?"<":"-":Oe?">":"+"):e.is(Ni)&&T&&Oe?v.go(L(!0)?">":"<"):v.go(v.toDest(Y),!0),g(!0)}function R(U){var ee=n.dragMinThreshold,Y=go(ee),Oe=Y&&ee.mouse||0,$e=(Y?ee.touch:+ee)||10;return ln(I(U))>(Ae(U)?$e:Oe)}function O(U){return ln(I(U))>ln(I(U,!0))}function ae(U){if(e.is(Zi)||!T){var ee=de(U);if(ee&&ee<Ss)return I(U)/ee}return 0}function se(U){return E()+ya(U)*Un(ln(U)*(n.flickPower||600),B?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function I(U,ee){return te(U,ee)-te(F(U),ee)}function de(U){return fa(U)-fa(F(U))}function F(U){return K===U&&W||K}function te(U,ee){return(Ae(U)?U.changedTouches[0]:U)["page"+m(ee?"Y":"X")]}function Z(U){return U/(T&&e.is(Ni)?su:1)}function ve(U){var ee=n.noDrag;return!ho(U,"."+cc+", ."+Rr)&&(!ee||!ho(U,ee))}function Ae(U){return typeof TouchEvent<"u"&&U instanceof TouchEvent}function he(){return A}function pe(U){w=U}return{mount:M,disable:pe,isDragging:he}}var Eu={Spacebar:" ",Right:Cr,Left:$r,Up:nc,Down:ic};function Ka(e){return e=qn(e)?e:e.key,Eu[e]||e}var $s="keydown";function Mu(e,t,n){var i=Yt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){y(),o(an,g),o(an,y),o(_n,m)}function y(){var E=n.keyboard;E&&(u=E==="global"?window:d,s(u,$s,b))}function g(){l(u,$s)}function h(E){p=E}function m(){var E=p;p=!0,Al(function(){p=E})}function b(E){if(!p){var L=Ka(E);L===c($r)?e.go("<"):L===c(Cr)&&e.go(">")}}return{mount:v,destroy:g,disable:h}}var uo=_a+"-lazy",or=uo+"-srcset",Pu="["+uo+"], ["+or+"]";function ku(e,t,n){var i=Yt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Yi,vi],p=[];function v(){n.lazyLoad&&(y(),o(Qt,y))}function y(){Wn(p),g(),c?E():(s(u),o(u,h),h())}function g(){t.Slides.forEach(function(L){Wa(L.slide,Pu).forEach(function(C){var K=bn(C,uo),W=bn(C,or);if(K!==C.src||W!==C.srcset){var B=n.classes.spinner,A=C.parentElement,T=Mo(A,"."+B)||ki("span",B,A);p.push([C,L,T]),C.src||vo(C,"none")}})})}function h(){p=p.filter(function(L){var C=n.perPage*((n.preloadPages||1)+1)-1;return L[1].isWithin(e.index,C)?m(L):!0}),p.length||s(u)}function m(L){var C=L[0];Tn(L[1].slide,wa),l(C,"load error",qt(b,L)),$t(C,"src",bn(C,uo)),$t(C,"srcset",bn(C,or)),Ln(C,uo),Ln(C,or)}function b(L,C){var K=L[0],W=L[1];Pn(W.slide,wa),C.type!=="error"&&(hi(L[2]),vo(K,""),d(Ba,K,W),d(Hi)),c&&E()}function E(){p.length&&m(p.shift())}return{mount:v,destroy:qt(Wn,p),check:h}}function Au(e,t,n){var i=Yt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,y=u.go,g=t.Direction.resolve,h=c.pagination,m=[],b,E;function L(){C(),o([an,Qt,ur],L);var w=n.pagination;h&&vo(h,w?"":"none"),w&&(o([_n,br,vi],j),K(),j(),s(Zl,{list:b,items:m},T(e.index)))}function C(){b&&(hi(h?Zn(b.children):b),Pn(b,E),Wn(m),b=null),i.destroy()}function K(){var w=e.length,P=n.classes,M=n.i18n,X=n.perPage,k=p()?u.getEnd()+1:xo(w/X);b=h||ki("ul",P.pagination,c.track.parentElement),Tn(b,E=Ir+"--"+A()),$t(b,kn,"tablist"),$t(b,hn,M.select),$t(b,Ga,A()===Tr?"vertical":"");for(var q=0;q<k;q++){var V=ki("li",null,b),G=ki("button",{class:P.page,type:"button"},V),ie=d.getIn(q).map(function(R){return R.slide.id}),S=!p()&&X>1?M.pageX:M.slideX;l(G,"click",qt(W,q)),n.paginationKeyboard&&l(G,"keydown",qt(B,q)),$t(V,kn,"presentation"),$t(G,kn,"tab"),$t(G,ko,ie.join(" ")),$t(G,hn,va(S,q+1)),$t(G,Ai,-1),m.push({li:V,button:G,page:q})}}function W(w){y(">"+w,!0)}function B(w,P){var M=m.length,X=Ka(P),k=A(),q=-1;X===g(Cr,!1,k)?q=++w%M:X===g($r,!1,k)?q=(--w+M)%M:X==="Home"?q=0:X==="End"&&(q=M-1);var V=m[q];V&&(Hl(V.button),y(">"+q),En(P,!0))}function A(){return n.paginationDirection||n.direction}function T(w){return m[u.toPage(w)]}function j(){var w=T(v(!0)),P=T(v());if(w){var M=w.button;Pn(M,fi),Ln(M,ys),$t(M,Ai,-1)}if(P){var X=P.button;Tn(X,fi),$t(X,ys,!0),$t(X,Ai,"")}s(Jl,{list:b,items:m},w,P)}return{items:m,mount:L,destroy:C,getAt:T,update:j}}var Fu=[" ","Enter"];function Wu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var b=Yt(h);b.on(_n,function(E,L,C){m.go(m.is(Zi)?C:E)}),s.push(b)}function p(){var h=Yt(e),m=h.on;m(Na,y),m(ec,g),m([Jn,an],v),s.push(h),h.emit(Da,e.splides)}function v(){$t(t.Elements.list,Ga,n.direction===Tr?"vertical":"")}function y(h){e.go(h.index)}function g(h,m){Aa(Fu,Ka(m))&&(y(h),En(m))}return{setup:qt(t.Media.set,{slideFocus:Ro(o)?i:o},!0),mount:l,destroy:d,remount:c}}function _u(e,t,n){var i=Yt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,y=fa(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>g&&y-s>h&&(e.go(v?"<":">"),s=y),c(v)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Xi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var Hu=90;function Nu(e,t,n){var i=Yt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=ki("span",nu),c=wr(Hu,qt(p,!1));function u(){l&&(y(!t.Autoplay.isPaused()),$t(s,bs,!0),d.textContent="…",o(ja,qt(y,!0)),o(za,qt(y,!1)),o([Yi,vi],qt(p,!0)))}function p(g){$t(s,xs,g),g?(Eo(s,d),c.start()):(hi(d),c.cancel())}function v(){Ln(s,[vs,bs,xs]),hi(d)}function y(g){l&&$t(s,vs,g?"off":"polite")}return{mount:u,disable:y,destroy:v}}var Ou=Object.freeze({__proto__:null,Media:Ud,Direction:Kd,Elements:lu,Slides:du,Layout:uu,Clones:mu,Move:gu,Controller:hu,Arrows:vu,Autoplay:bu,Cover:wu,Scroll:Ru,Drag:Iu,Keyboard:Mu,LazyLoad:ku,Pagination:Au,Sync:Wu,Wheel:_u,Live:Nu}),Du={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"},ju={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:ru,i18n:Du,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function zu(e,t,n){var i=t.Slides;function o(){Yt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),Al(c)}return{mount:o,start:l,cancel:ha}}function Bu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=qt(xn,l,"transition"),c;function u(){Yt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(v(),c())})}function p(g,h){var m=i.toPosition(g,!0),b=i.getPosition(),E=y(g);ln(m-b)>=1&&E>=1?n.useScroll?s.scroll(m,E,!1,h):(d("transform "+E+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(g),h())}function v(){d(""),s.cancel()}function y(g){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),b=o.getEnd();if(m===0&&g>=b||m>=b&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var Vu=(function(){function e(n,i){this.event=Yt(),this.Components={},this.state=Gd(Pi),this.splides=[],this._o={},this._E={};var o=qn(n)?Ol(document,n):n;co(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,Va)||""},ju,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,_a)))}catch{co(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;co(l.is([Pi,lr]),"Already mounted!"),l.set(Pi),this._C=d,this._T=o||this._T||(this.is(Ao)?zu:Bu),this._E=i||this._E;var c=yo({},Ou,this._E,{Transition:this._T});return mi(c,function(u,p){var v=u(s,d,s._o);d[p]=v,v.setup&&v.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,iu),l.set(_i),this.emit(xa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(_i)&&(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(Zn(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,s=this.state;return s.is(Pi)?Yt(this).on(xa,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Oa),o.destroy(),i&&Wn(this.splides),s.set(lr)),this},Dd(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})(),Xa=Vu;Xa.defaults={};Xa.STATES=zd;var Cs=[[Jn,"onMounted"],[xa,"onReady"],[_n,"onMove"],[Yi,"onMoved"],[Na,"onClick"],[zl,"onActive"],[Bl,"onInactive"],[Vl,"onVisible"],[Gl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[Hi,"onResize"],[xr,"onResized"],[ql,"onDrag"],[Ul,"onDragging"],[Kl,"onDragged"],[br,"onScroll"],[vi,"onScrolled"],[Oa,"onDestroy"],[Xl,"onArrowsMounted"],[Yl,"onArrowsUpdated"],[Zl,"onPaginationMounted"],[Jl,"onPaginationUpdated"],[Da,"onNavigationMounted"],[ja,"onAutoplayPlay"],[Ql,"onAutoplayPlaying"],[za,"onAutoplayPause"],[Ba,"onLazyLoadLoaded"]];function Ya(...e){return e.filter(Boolean).join(" ")}function pr(e){return e!==null&&typeof e=="object"}function Sa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Sa(n,t[i]));if(pr(e)&&pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Sa(e[o],t[o]))}return e===t}function Gu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function qu(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 $a(e,t){const n=e;return qu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():pr(i)?n[o]=$a(pr(n[o])?n[o]:{},i):n[o]=i}),n}var Uu=({children:e,className:t,...n})=>a.createElement("div",{className:Ya("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Za=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Xa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=$a({},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&&!Sa(this.options,e)&&(this.splide.options=e,this.options=$a({},e));const t=this.getSlides();Gu(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){Cs.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 a.createElement(t,{className:Ya("splide",e),ref:this.splideRef,...this.omit(o,["options",...Cs.map(s=>s[1])])},n?a.createElement(Uu,null,i):i)}},Ja=({children:e,className:t,...n})=>a.createElement("li",{className:Ya("splide__slide",t),...n},e);/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),dt=require("classnames"),$=require("./readTestimonialTextMeasure-CB_Uq-fO.js"),Yn=require("react-dom");function Kc(e){return e.type==="object"&&e.version===1}const Xc="ControlSlider-module__wrapper___sHEkd",Yc="ControlSlider-module__hoverArrow___A-dOH",Zc="ControlSlider-module__sliderItem___QQSkR",Jc="ControlSlider-module__sliderImage___9hRl-",Qc="ControlSlider-module__arrow___05ghY",ed="ControlSlider-module__arrowVertical___tBfVN",td="ControlSlider-module__nextArrow___-30Yc",nd="ControlSlider-module__arrowInner___aEra3",id="ControlSlider-module__arrowIcon___S4ztF",od="ControlSlider-module__arrowImg___2dwJW",rd="ControlSlider-module__mirror___brd6U",ad="ControlSlider-module__pagination___bicLF",sd="ControlSlider-module__paginationInner___bT-P-",ld="ControlSlider-module__paginationVertical___zYqKw",cd="ControlSlider-module__paginationItem___nTRbk",dd="ControlSlider-module__dot___p1Qun",ud="ControlSlider-module__activeDot___LHFaj",pd="ControlSlider-module__paginationInsideBottom___R3FWn",md="ControlSlider-module__paginationInsideTop___V-qb-",gd="ControlSlider-module__paginationOutsideBottom___14w8D",hd="ControlSlider-module__paginationOutsideTop___SCLqB",fd="ControlSlider-module__paginationInsideLeft___yOBRZ",yd="ControlSlider-module__paginationInsideRight___Rtt3o",vd="ControlSlider-module__paginationOutsideLeft___lahaw",xd="ControlSlider-module__paginationOutsideRight___EtuQa",bd="ControlSlider-module__imgWrapper___UjEgB",wd="ControlSlider-module__captionBlock___dJ6-j",Sd="ControlSlider-module__captionTextWrapper___HFlpf",$d="ControlSlider-module__captionText___uGBVc",Cd="ControlSlider-module__active___WZK4G",Td="ControlSlider-module__withPointerEvents___t-18M",Ld="ControlSlider-module__topLeftAlignment___zjnGM",Rd="ControlSlider-module__topCenterAlignment___gD1xW",Id="ControlSlider-module__topRightAlignment___NMapS",Ed="ControlSlider-module__middleLeftAlignment___OnUrY",Md="ControlSlider-module__middleCenterAlignment___Tdkl0",Pd="ControlSlider-module__middleRightAlignment___wEbfX",kd="ControlSlider-module__bottomLeftAlignment___cTP2-",Ad="ControlSlider-module__bottomCenterAlignment___c54fB",Fd="ControlSlider-module__bottomRightAlignment___kEwrz",Wd="ControlSlider-module__clickOverlay___DZA28",_d="ControlSlider-module__contain___pLyq7",Hd="ControlSlider-module__cover___KdDat",at={wrapper:Xc,hoverArrow:Yc,sliderItem:Zc,sliderImage:Jc,arrow:Qc,arrowVertical:ed,nextArrow:td,arrowInner:nd,arrowIcon:id,arrowImg:od,mirror:rd,pagination:ad,paginationInner:sd,paginationVertical:ld,paginationItem:cd,dot:dd,activeDot:ud,paginationInsideBottom:pd,paginationInsideTop:md,paginationOutsideBottom:gd,paginationOutsideTop:hd,paginationInsideLeft:fd,paginationInsideRight:yd,paginationOutsideLeft:vd,paginationOutsideRight:xd,imgWrapper:bd,captionBlock:wd,captionTextWrapper:Sd,captionText:$d,active:Cd,withPointerEvents:Td,topLeftAlignment:Ld,topCenterAlignment:Rd,topRightAlignment:Id,middleLeftAlignment:Ed,middleCenterAlignment:Md,middleRightAlignment:Pd,bottomLeftAlignment:kd,bottomCenterAlignment:Ad,bottomRightAlignment:Fd,clickOverlay:Wd,contain:_d,cover:Hd};function Nd(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 Od(e,t,n){return t&&Nd(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var us="(prefers-reduced-motion: reduce)",Pi=1,Dd=2,_i=3,Xi=4,Lo=5,tr=6,lr=7,jd={CREATED:Pi,MOUNTED:Dd,IDLE:_i,MOVING:Xi,SCROLLING:Lo,DRAGGING:tr,DESTROYED:lr};function Wn(e){e.length=0}function Zn(e,t,n){return Array.prototype.slice.call(e,t,n)}function qt(e){return e.bind.apply(e,[null].concat(Zn(arguments,1)))}var kl=setTimeout,ha=function(){};function ps(e){return requestAnimationFrame(e)}function vr(e,t){return typeof t===e}function go(e){return!ka(e)&&vr("object",e)}var Pa=Array.isArray,Al=qt(vr,"function"),qn=qt(vr,"string"),Ro=qt(vr,"undefined");function ka(e){return e===null}function Fl(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch{return!1}}function Io(e){return Pa(e)?e:[e]}function yn(e,t){Io(e).forEach(t)}function Aa(e,t){return e.indexOf(t)>-1}function nr(e,t){return e.push.apply(e,Io(t)),e}function Mn(e,t,n){e&&yn(t,function(i){i&&e.classList[n?"add":"remove"](i)})}function Tn(e,t){Mn(e,qn(t)?t.split(" "):t,!0)}function Eo(e,t){yn(t,e.appendChild.bind(e))}function Fa(e,t){yn(e,function(n){var i=(t||n).parentNode;i&&i.insertBefore(n,t)})}function ho(e,t){return Fl(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function Wl(e,t){var n=e?Zn(e.children):[];return t?n.filter(function(i){return ho(i,t)}):n}function Mo(e,t){return t?Wl(e,t)[0]:e.firstElementChild}var fo=Object.keys;function mi(e,t,n){return e&&(n?fo(e).reverse():fo(e)).forEach(function(i){i!=="__proto__"&&t(e[i],i)}),e}function yo(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){e[i]=t[i]})}),e}function zn(e){return Zn(arguments,1).forEach(function(t){mi(t,function(n,i){Pa(n)?e[i]=n.slice():go(n)?e[i]=zn({},go(e[i])?e[i]:{},n):e[i]=n})}),e}function ms(e,t){yn(t||fo(e),function(n){delete e[n]})}function Ln(e,t){yn(e,function(n){yn(t,function(i){n&&n.removeAttribute(i)})})}function $t(e,t,n){go(t)?mi(t,function(i,o){$t(e,o,i)}):yn(e,function(i){ka(n)||n===""?Ln(i,t):i.setAttribute(t,String(n))})}function ki(e,t,n){var i=document.createElement(e);return t&&(qn(t)?Tn(i,t):$t(i,t)),n&&Eo(n,i),i}function xn(e,t,n){if(Ro(n))return getComputedStyle(e)[t];ka(n)||(e.style[t]=""+n)}function vo(e,t){xn(e,"display",t)}function _l(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function bn(e,t){return e.getAttribute(t)}function gs(e,t){return e&&e.classList.contains(t)}function mn(e){return e.getBoundingClientRect()}function hi(e){yn(e,function(t){t&&t.parentNode&&t.parentNode.removeChild(t)})}function Hl(e){return Mo(new DOMParser().parseFromString(e,"text/html").body)}function En(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function Nl(e,t){return e&&e.querySelector(t)}function Wa(e,t){return t?Zn(e.querySelectorAll(t)):[]}function Pn(e,t){Mn(e,t,!1)}function fa(e){return e.timeStamp}function ii(e){return qn(e)?e:e?e+"px":""}var Po="splide",_a="data-"+Po;function co(e,t){if(!e)throw new Error("["+Po+"] "+(t||""))}var Un=Math.min,cr=Math.max,dr=Math.floor,xo=Math.ceil,ln=Math.abs;function Ol(e,t,n){return ln(e-t)<n}function ir(e,t,n,i){var o=Un(t,n),s=cr(t,n);return i?o<e&&e<s:o<=e&&e<=s}function Ri(e,t,n){var i=Un(t,n),o=cr(t,n);return Un(cr(i,e),o)}function ya(e){return+(e>0)-+(e<0)}function va(e,t){return yn(t,function(n){e=e.replace("%s",""+n)}),e}function Ha(e){return e<10?"0"+e:""+e}var hs={};function zd(e){return""+e+Ha(hs[e]=(hs[e]||0)+1)}function Dl(){var e=[];function t(l,d,c,u){o(l,d,function(p,v,x){var g="addEventListener"in p,h=g?p.removeEventListener.bind(p,v,c,u):p.removeListener.bind(p,c);g?p.addEventListener(v,c,u):p.addListener(c),e.push([p,v,x,c,h])})}function n(l,d,c){o(l,d,function(u,p,v){e=e.filter(function(x){return x[0]===u&&x[1]===p&&x[2]===v&&(!c||x[3]===c)?(x[4](),!1):!0})})}function i(l,d,c){var u,p=!0;return typeof CustomEvent=="function"?u=new CustomEvent(d,{bubbles:p,detail:c}):(u=document.createEvent("CustomEvent"),u.initCustomEvent(d,p,!1,c)),l.dispatchEvent(u),u}function o(l,d,c){yn(l,function(u){u&&yn(d,function(p){p.split(" ").forEach(function(v){var x=v.split(".");c(u,x[0],x[1])})})})}function s(){e.forEach(function(l){l[4]()}),Wn(e)}return{bind:t,unbind:n,dispatch:i,destroy:s}}var Jn="mounted",xa="ready",_n="move",Yi="moved",Na="click",jl="active",zl="inactive",Bl="visible",Vl="hidden",Qt="refresh",an="updated",Hi="resize",xr="resized",Gl="drag",ql="dragging",Ul="dragged",br="scroll",vi="scrolled",Bd="overflow",Oa="destroy",Kl="arrows:mounted",Xl="arrows:updated",Yl="pagination:mounted",Zl="pagination:updated",Da="navigation:mounted",ja="autoplay:play",Jl="autoplay:playing",za="autoplay:pause",Ba="lazyload:loaded",Ql="sk",ec="sh",ur="ei";function Xt(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Dl();function i(s,l){n.bind(t,Io(s).join(" "),function(d){l.apply(l,Pa(d.detail)?d.detail:[])})}function o(s){n.dispatch(t,s,Zn(arguments,1))}return e&&e.event.on(Oa,n.destroy),yo(n,{bus:t,on:i,off:qt(n.unbind,t),emit:o})}function wr(e,t,n,i){var o=Date.now,s,l=0,d,c=!0,u=0;function p(){if(!c){if(l=e?Un((o()-s)/e,1):1,n&&n(l),l>=1&&(t(),s=o(),i&&++u>=i))return x();d=ps(p)}}function v(I){I||h(),s=o()-(I?l*e:0),c=!1,d=ps(p)}function x(){c=!0}function g(){s=o(),l=0,n&&n(l)}function h(){d&&cancelAnimationFrame(d),l=0,d=0,c=!0}function m(I){e=I}function b(){return c}return{start:v,rewind:g,pause:x,cancel:h,set:m,isPaused:b}}function Vd(e){var t=e;function n(o){t=o}function i(o){return Aa(Io(o),t)}return{set:n,is:i}}function Gd(e,t){var n=wr(0,e,null,1);return function(){n.isPaused()&&n.start()}}function qd(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},l=Dl(),d=[];function c(){var h=n.mediaQuery==="min";fo(o).sort(function(m,b){return h?+m-+b:+b-+m}).forEach(function(m){p(o[m],"("+(h?"min":"max")+"-width:"+m+"px)")}),p(s,us),v()}function u(h){h&&l.destroy()}function p(h,m){var b=matchMedia(m);l.bind(b,"change",v),d.push([h,b])}function v(){var h=i.is(lr),m=n.direction,b=d.reduce(function(I,C){return zn(I,C[1].matches?C[0]:{})},{});ms(n),g(b),n.destroy?e.destroy(n.destroy==="completely"):h?(u(!0),e.mount()):m!==n.direction&&e.refresh()}function x(h){matchMedia(us).matches&&(h?zn(n,s):ms(n,fo(s)))}function g(h,m,b){zn(n,h),m&&zn(Object.getPrototypeOf(n),h),(b||!i.is(Pi))&&e.emit(an,n)}return{setup:c,destroy:u,reduce:x,set:g}}var Sr="Arrow",$r=Sr+"Left",Cr=Sr+"Right",tc=Sr+"Up",nc=Sr+"Down",fs="rtl",Tr="ttb",Or={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[tc,Cr],ArrowRight:[nc,$r]};function Ud(e,t,n){function i(s,l,d){d=d||n.direction;var c=d===fs&&!l?1:d===Tr?0:-1;return Or[s]&&Or[s][c]||s.replace(/width|left|right/i,function(u,p){var v=Or[u.toLowerCase()][c]||u;return p>0?v.charAt(0).toUpperCase()+v.slice(1):v})}function o(s){return s*(n.direction===fs?1:-1)}return{resolve:i,orient:o}}var kn="role",Ai="tabindex",Kd="disabled",wn="aria-",ko=wn+"controls",ic=wn+"current",ys=wn+"selected",hn=wn+"label",Va=wn+"labelledby",oc=wn+"hidden",Ga=wn+"orientation",bo=wn+"roledescription",vs=wn+"live",xs=wn+"busy",bs=wn+"atomic",qa=[kn,Ai,Kd,ko,ic,hn,Va,oc,Ga,bo],Rn=Po+"__",Qn="is-",Dr=Po,ws=Rn+"track",Xd=Rn+"list",Lr=Rn+"slide",rc=Lr+"--clone",Yd=Lr+"__container",Ua=Rn+"arrows",Rr=Rn+"arrow",ac=Rr+"--prev",sc=Rr+"--next",Ir=Rn+"pagination",lc=Ir+"__page",Zd=Rn+"progress",Jd=Zd+"__bar",Qd=Rn+"toggle",eu=Rn+"spinner",tu=Rn+"sr",nu=Qn+"initialized",fi=Qn+"active",cc=Qn+"prev",dc=Qn+"next",ba=Qn+"visible",wa=Qn+"loading",uc=Qn+"focus-in",pc=Qn+"overflow",iu=[fi,ba,cc,dc,wa,uc,pc],ou={slide:Lr,clone:rc,arrows:Ua,arrow:Rr,prev:ac,next:sc,pagination:Ir,page:lc,spinner:eu};function ru(e,t){if(Al(e.closest))return e.closest(t);for(var n=e;n&&n.nodeType===1&&!ho(n,t);)n=n.parentElement;return n}var au=5,Ss=200,mc="touchstart mousedown",jr="touchmove mousemove",zr="touchend touchcancel mouseup click";function su(e,t,n){var i=Xt(e),o=i.on,s=i.bind,l=e.root,d=n.i18n,c={},u=[],p=[],v=[],x,g,h;function m(){R(),K(),C()}function b(){o(Qt,I),o(Qt,m),o(an,C),s(document,mc+" keydown",function(A){h=A.type==="keydown"},{capture:!0}),s(l,"focusin",function(){Mn(l,uc,!!h)})}function I(A){var T=qa.concat("style");Wn(u),Pn(l,p),Pn(x,v),Ln([x,g],T),Ln(l,A?T:["style",bo])}function C(){Pn(l,p),Pn(x,v),p=V(Dr),v=V(ws),Tn(l,p),Tn(x,v),$t(l,hn,n.label),$t(l,Va,n.labelledby)}function R(){x=F("."+ws),g=Mo(x,"."+Xd),co(x&&g,"A track/list element is missing."),nr(u,Wl(g,"."+Lr+":not(."+rc+")")),mi({arrows:Ua,pagination:Ir,prev:ac,next:sc,bar:Jd,toggle:Qd},function(A,T){c[T]=F("."+A)}),yo(c,{root:l,track:x,list:g,slides:u})}function K(){var A=l.id||zd(Po),T=n.role;l.id=A,x.id=x.id||A+"-track",g.id=g.id||A+"-list",!bn(l,kn)&&l.tagName!=="SECTION"&&T&&$t(l,kn,T),$t(l,bo,d.carousel),$t(g,kn,"presentation")}function F(A){var T=Nl(l,A);return T&&ru(T,"."+Dr)===l?T:void 0}function V(A){return[A+"--"+n.type,A+"--"+n.direction,n.drag&&A+"--draggable",n.isNavigation&&A+"--nav",A===Dr&&fi]}return yo(c,{setup:m,mount:b,destroy:I})}var Ni="slide",Zi="loop",Ao="fade";function lu(e,t,n,i){var o=Xt(e),s=o.on,l=o.emit,d=o.bind,c=e.Components,u=e.root,p=e.options,v=p.isNavigation,x=p.updateOnMove,g=p.i18n,h=p.pagination,m=p.slideFocus,b=c.Direction.resolve,I=bn(i,"style"),C=bn(i,hn),R=n>-1,K=Mo(i,"."+Yd),F;function V(){R||(i.id=u.id+"-slide"+Ha(t+1),$t(i,kn,h?"tabpanel":"group"),$t(i,bo,g.slide),$t(i,hn,C||va(g.slideLabel,[t+1,e.length]))),A()}function A(){d(i,"click",qt(l,Na,te)),d(i,"keydown",qt(l,Ql,te)),s([Yi,ec,vi],W),s(Da,j),x&&s(_n,y)}function T(){F=!0,o.destroy(),Pn(i,iu),Ln(i,qa),$t(i,"style",I),$t(i,hn,C||"")}function j(){var S=e.splides.map(function(E){var D=E.splide.Components.Slides.getAt(t);return D?D.slide.id:""}).join(" ");$t(i,hn,va(g.slideX,(R?n:t)+1)),$t(i,ko,S),$t(i,kn,m?"button":""),m&&Ln(i,bo)}function y(){F||W()}function W(){if(!F){var S=e.index;M(),Y(),Mn(i,cc,t===S-1),Mn(i,dc,t===S+1)}}function M(){var S=U();S!==gs(i,fi)&&(Mn(i,fi,S),$t(i,ic,v&&S||""),l(S?jl:zl,te))}function Y(){var S=z(),E=!S&&(!U()||R);if(e.state.is([Xi,Lo])||$t(i,oc,E||""),$t(Wa(i,p.focusableNodes||""),Ai,E?-1:""),m&&$t(i,Ai,E?-1:0),S!==gs(i,ba)&&(Mn(i,ba,S),l(S?Bl:Vl,te)),!S&&document.activeElement===i){var D=c.Slides.getAt(e.index);D&&_l(D.slide)}}function P(S,E,D){xn(D&&K||i,S,E)}function U(){var S=e.index;return S===t||p.cloneStatus&&S===n}function z(){if(e.is(Ao))return U();var S=mn(c.Elements.track),E=mn(i),D=b("left",!0),se=b("right",!0);return dr(S[D])<=xo(E[D])&&dr(E[se])<=xo(S[se])}function B(S,E){var D=ln(S-t);return!R&&(p.rewind||e.is(Zi))&&(D=Un(D,e.length-D)),D<=E}var te={index:t,slideIndex:n,slide:i,container:K,isClone:R,mount:V,destroy:T,update:W,style:P,isWithin:B};return te}function cu(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=i.bind,d=t.Elements,c=d.slides,u=d.list,p=[];function v(){x(),o(Qt,g),o(Qt,x)}function x(){c.forEach(function(W,M){m(W,M,-1)})}function g(){F(function(W){W.destroy()}),Wn(p)}function h(){F(function(W){W.update()})}function m(W,M,Y){var P=lu(e,M,Y,W);P.mount(),p.push(P),p.sort(function(U,z){return U.index-z.index})}function b(W){return W?V(function(M){return!M.isClone}):p}function I(W){var M=t.Controller,Y=M.toIndex(W),P=M.hasFocus()?1:n.perPage;return V(function(U){return ir(U.index,Y,Y+P-1)})}function C(W){return V(W)[0]}function R(W,M){yn(W,function(Y){if(qn(Y)&&(Y=Hl(Y)),Fl(Y)){var P=c[M];P?Fa(Y,P):Eo(u,Y),Tn(Y,n.classes.slide),T(Y,qt(s,Hi))}}),s(Qt)}function K(W){hi(V(W).map(function(M){return M.slide})),s(Qt)}function F(W,M){b(M).forEach(W)}function V(W){return p.filter(Al(W)?W:function(M){return qn(W)?ho(M.slide,W):Aa(Io(W),M.index)})}function A(W,M,Y){F(function(P){P.style(W,M,Y)})}function T(W,M){var Y=Wa(W,"img"),P=Y.length;P?Y.forEach(function(U){l(U,"load error",function(){--P||M()})}):M()}function j(W){return W?c.length:p.length}function y(){return p.length>n.perPage}return{mount:v,destroy:g,update:h,register:m,get:b,getIn:I,getAt:C,add:R,remove:K,forEach:F,filter:V,style:A,getLength:j,isEnough:y}}function du(e,t,n){var i=Xt(e),o=i.on,s=i.bind,l=i.emit,d=t.Slides,c=t.Direction.resolve,u=t.Elements,p=u.root,v=u.track,x=u.list,g=d.getAt,h=d.style,m,b,I;function C(){R(),s(window,"resize load",Gd(qt(l,Hi))),o([an,Qt],R),o(Hi,K)}function R(){m=n.direction===Tr,xn(p,"maxWidth",ii(n.width)),xn(v,c("paddingLeft"),F(!1)),xn(v,c("paddingRight"),F(!0)),K(!0)}function K(te){var S=mn(p);(te||b.width!==S.width||b.height!==S.height)&&(xn(v,"height",V()),h(c("marginRight"),ii(n.gap)),h("width",T()),h("height",j(),!0),b=S,l(xr),I!==(I=B())&&(Mn(p,pc,I),l(Bd,I)))}function F(te){var S=n.padding,E=c(te?"right":"left");return S&&ii(S[E]||(go(S)?0:S))||"0px"}function V(){var te="";return m&&(te=A(),co(te,"height or heightRatio is missing."),te="calc("+te+" - "+F(!1)+" - "+F(!0)+")"),te}function A(){return ii(n.height||mn(x).width*n.heightRatio)}function T(){return n.autoWidth?null:ii(n.fixedWidth)||(m?"":y())}function j(){return ii(n.fixedHeight)||(m?n.autoHeight?null:y():A())}function y(){var te=ii(n.gap);return"calc((100%"+(te&&" + "+te)+")/"+(n.perPage||1)+(te&&" - "+te)+")"}function W(){return mn(x)[c("width")]}function M(te,S){var E=g(te||0);return E?mn(E.slide)[c("width")]+(S?0:U()):0}function Y(te,S){var E=g(te);if(E){var D=mn(E.slide)[c("right")],se=mn(x)[c("left")];return ln(D-se)+(S?0:U())}return 0}function P(te){return Y(e.length-1)-Y(0)+M(0,te)}function U(){var te=g(0);return te&&parseFloat(xn(te.slide,c("marginRight")))||0}function z(te){return parseFloat(xn(v,c("padding"+(te?"Right":"Left"))))||0}function B(){return e.is(Ao)||P(!0)>W()}return{mount:C,resize:K,listSize:W,slideSize:M,sliderSize:P,totalSize:Y,getPadding:z,isOverflow:B}}var uu=2;function pu(e,t,n){var i=Xt(e),o=i.on,s=t.Elements,l=t.Slides,d=t.Direction.resolve,c=[],u;function p(){o(Qt,v),o([an,Hi],g),(u=b())&&(h(u),t.Layout.resize(!0))}function v(){x(),p()}function x(){hi(c),Wn(c),i.destroy()}function g(){var I=b();u!==I&&(u<I||!I)&&i.emit(Qt)}function h(I){var C=l.get().slice(),R=C.length;if(R){for(;C.length<I;)nr(C,C);nr(C.slice(-I),C.slice(0,I)).forEach(function(K,F){var V=F<I,A=m(K.slide,F);V?Fa(A,C[0].slide):Eo(s.list,A),nr(c,A),l.register(A,F-I+(V?0:R),K.index)})}}function m(I,C){var R=I.cloneNode(!0);return Tn(R,n.classes.clone),R.id=e.root.id+"-clone"+Ha(C+1),R}function b(){var I=n.clones;if(!e.is(Zi))I=0;else if(Ro(I)){var C=n[d("fixedWidth")]&&t.Layout.slideSize(0),R=C&&xo(mn(s.track)[d("width")]/C);I=R||n[d("autoWidth")]&&e.length||n.perPage*uu}return I}return{mount:p,destroy:x}}function mu(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Layout,c=d.slideSize,u=d.getPadding,p=d.totalSize,v=d.listSize,x=d.sliderSize,g=t.Direction,h=g.resolve,m=g.orient,b=t.Elements,I=b.list,C=b.track,R;function K(){R=t.Transition,o([Jn,xr,an,Qt],F)}function F(){t.Controller.isBusy()||(t.Scroll.cancel(),A(e.index),t.Slides.update())}function V(E,D,se,oe){E!==D&&te(E>se)&&(W(),T(y(P(),E>se),!0)),l(Xi),s(_n,D,se,E),R.start(D,function(){l(_i),s(Yi,D,se,E),oe&&oe()})}function A(E){T(Y(E,!0))}function T(E,D){if(!e.is(Ao)){var se=D?E:j(E);xn(I,"transform","translate"+h("X")+"("+se+"px)"),E!==se&&s(ec)}}function j(E){if(e.is(Zi)){var D=M(E),se=D>t.Controller.getEnd(),oe=D<0;(oe||se)&&(E=y(E,se))}return E}function y(E,D){var se=E-B(D),oe=x();return E-=m(oe*(xo(ln(se)/oe)||1))*(D?1:-1),E}function W(){T(P(),!0),R.cancel()}function M(E){for(var D=t.Slides.get(),se=0,oe=1/0,L=0;L<D.length;L++){var ue=D[L].index,k=ln(Y(ue,!0)-E);if(k<=oe)oe=k,se=ue;else break}return se}function Y(E,D){var se=m(p(E-1)-z(E));return D?U(se):se}function P(){var E=h("left");return mn(I)[E]-mn(C)[E]+m(u(!1))}function U(E){return n.trimSpace&&e.is(Ni)&&(E=Ri(E,0,m(x(!0)-v()))),E}function z(E){var D=n.focus;return D==="center"?(v()-c(E,!0))/2:+D*c(E)||0}function B(E){return Y(E?t.Controller.getEnd():0,!!n.trimSpace)}function te(E){var D=m(y(P(),E));return E?D>=0:D<=I[h("scrollWidth")]-mn(C)[h("width")]}function S(E,D){D=Ro(D)?P():D;var se=E!==!0&&m(D)<m(B(!1)),oe=E!==!1&&m(D)>m(B(!0));return se||oe}return{mount:K,move:V,jump:A,translate:T,shift:y,cancel:W,toIndex:M,toPosition:Y,getPosition:P,getLimit:B,exceededLimit:S,reposition:F}}function gu(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=t.Move,d=l.getPosition,c=l.getLimit,u=l.toPosition,p=t.Slides,v=p.isEnough,x=p.getLength,g=n.omitEnd,h=e.is(Zi),m=e.is(Ni),b=qt(P,!1),I=qt(P,!0),C=n.start||0,R,K=C,F,V,A;function T(){j(),o([an,Qt,ur],j),o(xr,y)}function j(){F=x(!0),V=n.perMove,A=n.perPage,R=te();var k=Ri(C,0,g?R:F-1);k!==C&&(C=k,l.reposition())}function y(){R!==te()&&s(ur)}function W(k,ne,X){if(!ue()){var be=Y(k),Ae=B(be);Ae>-1&&(ne||Ae!==C)&&(se(Ae),l.move(be,Ae,K,X))}}function M(k,ne,X,be){t.Scroll.scroll(k,ne,X,function(){var Ae=B(l.toIndex(d()));se(g?Un(Ae,R):Ae),be&&be()})}function Y(k){var ne=C;if(qn(k)){var X=k.match(/([+\-<>])(\d+)?/)||[],be=X[1],Ae=X[2];be==="+"||be==="-"?ne=U(C+ +(""+be+(+Ae||1)),C):be===">"?ne=Ae?S(+Ae):b(!0):be==="<"&&(ne=I(!0))}else ne=h?k:Ri(k,0,R);return ne}function P(k,ne){var X=V||(L()?1:A),be=U(C+X*(k?-1:1),C,!(V||L()));return be===-1&&m&&!Ol(d(),c(!k),1)?k?0:R:ne?be:B(be)}function U(k,ne,X){if(v()||L()){var be=z(k);be!==k&&(ne=k,k=be,X=!1),k<0||k>R?!V&&(ir(0,k,ne,!0)||ir(R,ne,k,!0))?k=S(E(k)):h?k=X?k<0?-(F%A||A):F:k:n.rewind?k=k<0?R:0:k=-1:X&&k!==ne&&(k=S(E(ne)+(k<ne?-1:1)))}else k=-1;return k}function z(k){if(m&&n.trimSpace==="move"&&k!==C)for(var ne=d();ne===u(k,!0)&&ir(k,0,e.length-1,!n.rewind);)k<C?--k:++k;return k}function B(k){return h?(k+F)%F||0:k}function te(){for(var k=F-(L()||h&&V?1:A);g&&k-- >0;)if(u(F-1,!0)!==u(k,!0)){k++;break}return Ri(k,0,F-1)}function S(k){return Ri(L()?k:A*k,0,R)}function E(k){return L()?Un(k,R):dr((k>=R?F-1:k)/A)}function D(k){var ne=l.toIndex(k);return m?Ri(ne,0,R):ne}function se(k){k!==C&&(K=C,C=k)}function oe(k){return k?K:C}function L(){return!Ro(n.focus)||n.isNavigation}function ue(){return e.state.is([Xi,Lo])&&!!n.waitForTransition}return{mount:T,go:W,scroll:M,getNext:b,getPrev:I,getAdjacent:P,getEnd:te,setIndex:se,getIndex:oe,toIndex:S,toPage:E,toDest:D,hasFocus:L,isBusy:ue}}var hu="http://www.w3.org/2000/svg",fu="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",Oo=40;function yu(e,t,n){var i=Xt(e),o=i.on,s=i.bind,l=i.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,v=u.arrows,x=u.track,g=v,h=u.prev,m=u.next,b,I,C={};function R(){F(),o(an,K)}function K(){V(),R()}function F(){var M=n.arrows;M&&!(h&&m)&&j(),h&&m&&(yo(C,{prev:h,next:m}),vo(g,M?"":"none"),Tn(g,I=Ua+"--"+n.direction),M&&(A(),W(),$t([h,m],ko,x.id),l(Kl,h,m)))}function V(){i.destroy(),Pn(g,I),b?(hi(v?[h,m]:g),h=m=null):Ln([h,m],qa)}function A(){o([Jn,Yi,Qt,vi,ur],W),s(m,"click",qt(T,">")),s(h,"click",qt(T,"<"))}function T(M){p.go(M,!0)}function j(){g=v||ki("div",d.arrows),h=y(!0),m=y(!1),b=!0,Eo(g,[h,m]),!v&&Fa(g,x)}function y(M){var Y='<button class="'+d.arrow+" "+(M?d.prev:d.next)+'" type="button"><svg xmlns="'+hu+'" viewBox="0 0 '+Oo+" "+Oo+'" width="'+Oo+'" height="'+Oo+'" focusable="false"><path d="'+(n.arrowPath||fu)+'" />';return Hl(Y)}function W(){if(h&&m){var M=e.index,Y=p.getPrev(),P=p.getNext(),U=Y>-1&&M<Y?c.last:c.prev,z=P>-1&&M>P?c.first:c.next;h.disabled=Y<0,m.disabled=P<0,$t(h,hn,U),$t(m,hn,z),l(Xl,h,m,Y,P)}}return{arrows:C,mount:R,destroy:V,update:W}}var vu=_a+"-interval";function xu(e,t,n){var i=Xt(e),o=i.on,s=i.bind,l=i.emit,d=wr(n.interval,e.go.bind(e,">"),A),c=d.isPaused,u=t.Elements,p=t.Elements,v=p.root,x=p.toggle,g=n.autoplay,h,m,b=g==="pause";function I(){g&&(C(),x&&$t(x,ko,u.track.id),b||R(),V())}function C(){n.pauseOnHover&&s(v,"mouseenter mouseleave",function(j){h=j.type==="mouseenter",F()}),n.pauseOnFocus&&s(v,"focusin focusout",function(j){m=j.type==="focusin",F()}),x&&s(x,"click",function(){b?R():K(!0)}),o([_n,br,Qt],d.rewind),o(_n,T)}function R(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),m=h=b=!1,V(),l(ja))}function K(j){j===void 0&&(j=!0),b=!!j,V(),c()||(d.pause(),l(za))}function F(){b||(h||m?K(!1):R())}function V(){x&&(Mn(x,fi,!b),$t(x,hn,n.i18n[b?"play":"pause"]))}function A(j){var y=u.bar;y&&xn(y,"width",j*100+"%"),l(Jl,j)}function T(j){var y=t.Slides.getAt(j);d.set(y&&+bn(y.slide,vu)||n.interval)}return{mount:I,destroy:d.cancel,play:R,pause:K,isPaused:c}}function bu(e,t,n){var i=Xt(e),o=i.on;function s(){n.cover&&(o(Ba,qt(d,!0)),o([Jn,an,Qt],qt(l,!0)))}function l(c){t.Slides.forEach(function(u){var p=Mo(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),vo(u,c?"none":"")}return{mount:s,destroy:qt(l,!1)}}var wu=10,Su=600,$u=.6,Cu=1.5,Tu=800;function Lu(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,v=d.translate,x=e.is(Ni),g,h,m=1;function b(){o(_n,K),o([an,Qt],F)}function I(A,T,j,y,W){var M=c();if(K(),j&&(!x||!p())){var Y=t.Layout.sliderSize(),P=ya(A)*Y*dr(ln(A)/Y)||0;A=d.toPosition(t.Controller.toDest(A%Y))+P}var U=Ol(M,A,1);m=1,T=U?0:T||cr(ln(A-M)/Cu,Tu),h=y,g=wr(T,C,qt(R,M,A,W),1),l(Lo),s(br),g.start()}function C(){l(_i),h&&h(),s(vi)}function R(A,T,j,y){var W=c(),M=A+(T-A)*V(y),Y=(M-W)*m;v(W+Y),x&&!j&&p()&&(m*=$u,ln(Y)<wu&&I(u(p(!0)),Su,!1,h,!0))}function K(){g&&g.cancel()}function F(){g&&!g.isPaused()&&(K(),C())}function V(A){var T=n.easingFunc;return T?T(A):1-Math.pow(1-A,4)}return{mount:b,destroy:K,scroll:I,cancel:F}}var Ii={passive:!1,capture:!0};function Ru(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=i.bind,d=i.unbind,c=e.state,u=t.Move,p=t.Scroll,v=t.Controller,x=t.Elements.track,g=t.Media.reduce,h=t.Direction,m=h.resolve,b=h.orient,I=u.getPosition,C=u.exceededLimit,R,K,F,V,A,T=!1,j,y,W;function M(){l(x,jr,ha,Ii),l(x,zr,ha,Ii),l(x,mc,P,Ii),l(x,"click",B,{capture:!0}),l(x,"dragstart",En),o([Jn,an],Y)}function Y(){var q=n.drag;le(!q),V=q==="free"}function P(q){if(j=!1,!y){var Q=Ae(q);be(q.target)&&(Q||!q.button)&&(v.isBusy()?En(q,!0):(W=Q?x:window,A=c.is([Xi,Lo]),F=null,l(W,jr,U,Ii),l(W,zr,z,Ii),u.cancel(),p.cancel(),te(q)))}}function U(q){if(c.is(tr)||(c.set(tr),s(Gl)),q.cancelable)if(A){u.translate(R+X(L(q)));var Q=ue(q)>Ss,Z=T!==(T=C());(Q||Z)&&te(q),j=!0,s(ql),En(q)}else D(q)&&(A=E(q),En(q))}function z(q){c.is(tr)&&(c.set(_i),s(Ul)),A&&(S(q),En(q)),d(W,jr,U),d(W,zr,z),A=!1}function B(q){!y&&j&&En(q,!0)}function te(q){F=K,K=q,R=I()}function S(q){var Q=se(q),Z=oe(Q),Ne=n.rewind&&n.rewindByDrag;g(!1),V?v.scroll(Z,0,n.snap):e.is(Ao)?v.go(b(ya(Q))<0?Ne?"<":"-":Ne?">":"+"):e.is(Ni)&&T&&Ne?v.go(C(!0)?">":"<"):v.go(v.toDest(Z),!0),g(!0)}function E(q){var Q=n.dragMinThreshold,Z=go(Q),Ne=Z&&Q.mouse||0,Te=(Z?Q.touch:+Q)||10;return ln(L(q))>(Ae(q)?Te:Ne)}function D(q){return ln(L(q))>ln(L(q,!0))}function se(q){if(e.is(Zi)||!T){var Q=ue(q);if(Q&&Q<Ss)return L(q)/Q}return 0}function oe(q){return I()+ya(q)*Un(ln(q)*(n.flickPower||600),V?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}function L(q,Q){return ne(q,Q)-ne(k(q),Q)}function ue(q){return fa(q)-fa(k(q))}function k(q){return K===q&&F||K}function ne(q,Q){return(Ae(q)?q.changedTouches[0]:q)["page"+m(Q?"Y":"X")]}function X(q){return q/(T&&e.is(Ni)?au:1)}function be(q){var Q=n.noDrag;return!ho(q,"."+lc+", ."+Rr)&&(!Q||!ho(q,Q))}function Ae(q){return typeof TouchEvent<"u"&&q instanceof TouchEvent}function fe(){return A}function le(q){y=q}return{mount:M,disable:le,isDragging:fe}}var Iu={Spacebar:" ",Right:Cr,Left:$r,Up:tc,Down:nc};function Ka(e){return e=qn(e)?e:e.key,Iu[e]||e}var $s="keydown";function Eu(e,t,n){var i=Xt(e),o=i.on,s=i.bind,l=i.unbind,d=e.root,c=t.Direction.resolve,u,p;function v(){x(),o(an,g),o(an,x),o(_n,m)}function x(){var I=n.keyboard;I&&(u=I==="global"?window:d,s(u,$s,b))}function g(){l(u,$s)}function h(I){p=I}function m(){var I=p;p=!0,kl(function(){p=I})}function b(I){if(!p){var C=Ka(I);C===c($r)?e.go("<"):C===c(Cr)&&e.go(">")}}return{mount:v,destroy:g,disable:h}}var uo=_a+"-lazy",or=uo+"-srcset",Mu="["+uo+"], ["+or+"]";function Pu(e,t,n){var i=Xt(e),o=i.on,s=i.off,l=i.bind,d=i.emit,c=n.lazyLoad==="sequential",u=[Yi,vi],p=[];function v(){n.lazyLoad&&(x(),o(Qt,x))}function x(){Wn(p),g(),c?I():(s(u),o(u,h),h())}function g(){t.Slides.forEach(function(C){Wa(C.slide,Mu).forEach(function(R){var K=bn(R,uo),F=bn(R,or);if(K!==R.src||F!==R.srcset){var V=n.classes.spinner,A=R.parentElement,T=Mo(A,"."+V)||ki("span",V,A);p.push([R,C,T]),R.src||vo(R,"none")}})})}function h(){p=p.filter(function(C){var R=n.perPage*((n.preloadPages||1)+1)-1;return C[1].isWithin(e.index,R)?m(C):!0}),p.length||s(u)}function m(C){var R=C[0];Tn(C[1].slide,wa),l(R,"load error",qt(b,C)),$t(R,"src",bn(R,uo)),$t(R,"srcset",bn(R,or)),Ln(R,uo),Ln(R,or)}function b(C,R){var K=C[0],F=C[1];Pn(F.slide,wa),R.type!=="error"&&(hi(C[2]),vo(K,""),d(Ba,K,F),d(Hi)),c&&I()}function I(){p.length&&m(p.shift())}return{mount:v,destroy:qt(Wn,p),check:h}}function ku(e,t,n){var i=Xt(e),o=i.on,s=i.emit,l=i.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,v=u.getIndex,x=u.go,g=t.Direction.resolve,h=c.pagination,m=[],b,I;function C(){R(),o([an,Qt,ur],C);var y=n.pagination;h&&vo(h,y?"":"none"),y&&(o([_n,br,vi],j),K(),j(),s(Yl,{list:b,items:m},T(e.index)))}function R(){b&&(hi(h?Zn(b.children):b),Pn(b,I),Wn(m),b=null),i.destroy()}function K(){var y=e.length,W=n.classes,M=n.i18n,Y=n.perPage,P=p()?u.getEnd()+1:xo(y/Y);b=h||ki("ul",W.pagination,c.track.parentElement),Tn(b,I=Ir+"--"+A()),$t(b,kn,"tablist"),$t(b,hn,M.select),$t(b,Ga,A()===Tr?"vertical":"");for(var U=0;U<P;U++){var z=ki("li",null,b),B=ki("button",{class:W.page,type:"button"},z),te=d.getIn(U).map(function(E){return E.slide.id}),S=!p()&&Y>1?M.pageX:M.slideX;l(B,"click",qt(F,U)),n.paginationKeyboard&&l(B,"keydown",qt(V,U)),$t(z,kn,"presentation"),$t(B,kn,"tab"),$t(B,ko,te.join(" ")),$t(B,hn,va(S,U+1)),$t(B,Ai,-1),m.push({li:z,button:B,page:U})}}function F(y){x(">"+y,!0)}function V(y,W){var M=m.length,Y=Ka(W),P=A(),U=-1;Y===g(Cr,!1,P)?U=++y%M:Y===g($r,!1,P)?U=(--y+M)%M:Y==="Home"?U=0:Y==="End"&&(U=M-1);var z=m[U];z&&(_l(z.button),x(">"+U),En(W,!0))}function A(){return n.paginationDirection||n.direction}function T(y){return m[u.toPage(y)]}function j(){var y=T(v(!0)),W=T(v());if(y){var M=y.button;Pn(M,fi),Ln(M,ys),$t(M,Ai,-1)}if(W){var Y=W.button;Tn(Y,fi),$t(Y,ys,!0),$t(Y,Ai,"")}s(Zl,{list:b,items:m},y,W)}return{items:m,mount:C,destroy:R,getAt:T,update:j}}var Au=[" ","Enter"];function Fu(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function l(){e.splides.forEach(function(h){h.isParent||(u(e,h.splide),u(h.splide,e))}),i&&p()}function d(){s.forEach(function(h){h.destroy()}),Wn(s)}function c(){d(),l()}function u(h,m){var b=Xt(h);b.on(_n,function(I,C,R){m.go(m.is(Zi)?R:I)}),s.push(b)}function p(){var h=Xt(e),m=h.on;m(Na,x),m(Ql,g),m([Jn,an],v),s.push(h),h.emit(Da,e.splides)}function v(){$t(t.Elements.list,Ga,n.direction===Tr?"vertical":"")}function x(h){e.go(h.index)}function g(h,m){Aa(Au,Ka(m))&&(x(h),En(m))}return{setup:qt(t.Media.set,{slideFocus:Ro(o)?i:o},!0),mount:l,destroy:d,remount:c}}function Wu(e,t,n){var i=Xt(e),o=i.bind,s=0;function l(){n.wheel&&o(t.Elements.track,"wheel",d,Ii)}function d(u){if(u.cancelable){var p=u.deltaY,v=p<0,x=fa(u),g=n.wheelMinThreshold||0,h=n.wheelSleep||0;ln(p)>g&&x-s>h&&(e.go(v?"<":">"),s=x),c(v)&&En(u)}}function c(u){return!n.releaseWheel||e.state.is(Xi)||t.Controller.getAdjacent(u)!==-1}return{mount:l}}var _u=90;function Hu(e,t,n){var i=Xt(e),o=i.on,s=t.Elements.track,l=n.live&&!n.isNavigation,d=ki("span",tu),c=wr(_u,qt(p,!1));function u(){l&&(x(!t.Autoplay.isPaused()),$t(s,bs,!0),d.textContent="…",o(ja,qt(x,!0)),o(za,qt(x,!1)),o([Yi,vi],qt(p,!0)))}function p(g){$t(s,xs,g),g?(Eo(s,d),c.start()):(hi(d),c.cancel())}function v(){Ln(s,[vs,bs,xs]),hi(d)}function x(g){l&&$t(s,vs,g?"off":"polite")}return{mount:u,disable:x,destroy:v}}var Nu=Object.freeze({__proto__:null,Media:qd,Direction:Ud,Elements:su,Slides:cu,Layout:du,Clones:pu,Move:mu,Controller:gu,Arrows:yu,Autoplay:xu,Cover:bu,Scroll:Lu,Drag:Ru,Keyboard:Eu,LazyLoad:Pu,Pagination:ku,Sync:Fu,Wheel:Wu,Live:Hu}),Ou={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"},Du={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:ou,i18n:Ou,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ju(e,t,n){var i=t.Slides;function o(){Xt(e).on([Jn,Qt],s)}function s(){i.forEach(function(d){d.style("transform","translateX(-"+100*d.index+"%)")})}function l(d,c){i.style("transition","opacity "+n.speed+"ms "+n.easing),kl(c)}return{mount:o,start:l,cancel:ha}}function zu(e,t,n){var i=t.Move,o=t.Controller,s=t.Scroll,l=t.Elements.list,d=qt(xn,l,"transition"),c;function u(){Xt(e).bind(l,"transitionend",function(g){g.target===l&&c&&(v(),c())})}function p(g,h){var m=i.toPosition(g,!0),b=i.getPosition(),I=x(g);ln(m-b)>=1&&I>=1?n.useScroll?s.scroll(m,I,!1,h):(d("transform "+I+"ms "+n.easing),i.translate(m,!0),c=h):(i.jump(g),h())}function v(){d(""),s.cancel()}function x(g){var h=n.rewindSpeed;if(e.is(Ni)&&h){var m=o.getIndex(!0),b=o.getEnd();if(m===0&&g>=b||m>=b&&g===0)return h}return n.speed}return{mount:u,start:p,cancel:v}}var Bu=(function(){function e(n,i){this.event=Xt(),this.Components={},this.state=Vd(Pi),this.splides=[],this._o={},this._E={};var o=qn(n)?Nl(document,n):n;co(o,o+" is invalid."),this.root=o,i=zn({label:bn(o,hn)||"",labelledby:bn(o,Va)||""},Du,e.defaults,i||{});try{zn(i,JSON.parse(bn(o,_a)))}catch{co(!1,"Invalid JSON")}this._o=Object.create(zn({},i))}var t=e.prototype;return t.mount=function(i,o){var s=this,l=this.state,d=this.Components;co(l.is([Pi,lr]),"Already mounted!"),l.set(Pi),this._C=d,this._T=o||this._T||(this.is(Ao)?ju:zu),this._E=i||this._E;var c=yo({},Nu,this._E,{Transition:this._T});return mi(c,function(u,p){var v=u(s,d,s._o);d[p]=v,v.setup&&v.setup()}),mi(d,function(u){u.mount&&u.mount()}),this.emit(Jn),Tn(this.root,nu),l.set(_i),this.emit(xa),this},t.sync=function(i){return this.splides.push({splide:i}),i.splides.push({splide:this,isParent:!0}),this.state.is(_i)&&(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(Zn(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,s=this.state;return s.is(Pi)?Xt(this).on(xa,this.destroy.bind(this,i)):(mi(this._C,function(l){l.destroy&&l.destroy(i)},!0),o.emit(Oa),o.destroy(),i&&Wn(this.splides),s.set(lr)),this},Od(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})(),Xa=Bu;Xa.defaults={};Xa.STATES=jd;var Cs=[[Jn,"onMounted"],[xa,"onReady"],[_n,"onMove"],[Yi,"onMoved"],[Na,"onClick"],[jl,"onActive"],[zl,"onInactive"],[Bl,"onVisible"],[Vl,"onHidden"],[Qt,"onRefresh"],[an,"onUpdated"],[Hi,"onResize"],[xr,"onResized"],[Gl,"onDrag"],[ql,"onDragging"],[Ul,"onDragged"],[br,"onScroll"],[vi,"onScrolled"],[Oa,"onDestroy"],[Kl,"onArrowsMounted"],[Xl,"onArrowsUpdated"],[Yl,"onPaginationMounted"],[Zl,"onPaginationUpdated"],[Da,"onNavigationMounted"],[ja,"onAutoplayPlay"],[Jl,"onAutoplayPlaying"],[za,"onAutoplayPause"],[Ba,"onLazyLoadLoaded"]];function Ya(...e){return e.filter(Boolean).join(" ")}function pr(e){return e!==null&&typeof e=="object"}function Sa(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&!e.some((n,i)=>!Sa(n,t[i]));if(pr(e)&&pr(t)){const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&!n.some(o=>!Object.prototype.hasOwnProperty.call(t,o)||!Sa(e[o],t[o]))}return e===t}function Vu(e,t){return e.length===t.length&&!e.some((n,i)=>n!==t[i])}function Gu(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 $a(e,t){const n=e;return Gu(t,(i,o)=>{Array.isArray(i)?n[o]=i.slice():pr(i)?n[o]=$a(pr(n[o])?n[o]:{},i):n[o]=i}),n}var qu=({children:e,className:t,...n})=>a.createElement("div",{className:Ya("splide__track",t),...n},a.createElement("ul",{className:"splide__list"},e)),Za=class extends a.Component{constructor(){super(...arguments),this.splideRef=a.createRef(),this.slides=[]}componentDidMount(){const{options:e,extensions:t,transition:n}=this.props,{current:i}=this.splideRef;i&&(this.splide=new Xa(i,e),this.bind(this.splide),this.splide.mount(t,n),this.options=$a({},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&&!Sa(this.options,e)&&(this.splide.options=e,this.options=$a({},e));const t=this.getSlides();Vu(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){Cs.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 a.createElement(t,{className:Ya("splide",e),ref:this.splideRef,...this.omit(o,["options",...Cs.map(s=>s[1])])},n?a.createElement(qu,null,i):i)}},Ja=({children:e,className:t,...n})=>a.createElement("li",{className:Ya("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 Ku="RichTextRenderer-module__link___BWeZ2",Xu={link:Ku},Yu=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))},Er=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Yu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Kt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Er(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(n,t),lineHeight:i!==void 0?$.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Xu.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Zu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Zu(e){return{...e.fontFamily&&{fontFamily:Er(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 Ju="SvgImage-module__svg___q3xE-",Qu="SvgImage-module__img___VsTm-",Ts={svg:Ju,img:Qu},ep=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},tp=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!ep(e)||!s?r.jsx("img",{src:e,alt:"",className:lt(Ts.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:lt(Ts.svg,i),style:{"--svg":tp(e),"--fill":t,"--hover-fill":n,...o??{}}})},np={"top-left":rt.topLeftAlignment,"top-center":rt.topCenterAlignment,"top-right":rt.topRightAlignment,"middle-left":rt.middleLeftAlignment,"middle-center":rt.middleCenterAlignment,"middle-right":rt.middleRightAlignment,"bottom-left":rt.bottomLeftAlignment,"bottom-center":rt.bottomCenterAlignment,"bottom-right":rt.bottomRightAlignment};function ip({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:y,color:g}=n.imageCaption??{},[h,m]=a.useState(void 0),[b,E]=a.useState(null),[L,C]=a.useState(0),[K,W]=a.useState(0),{direction:B,transition:A,controls:T,pagination:j,imageCaption:w,triggers:P}=e,M=a.useRef(A.type),{x:X,y:k}=e.controls.offset,q=V=>{o&&o.go(V)};return a.useEffect(()=>{if(!b)return;const V=new ResizeObserver(G=>{if(!o)return;const[ie]=G;m({width:Math.round(ie.contentRect.width),height:Math.round(ie.contentRect.height)})});return V.observe(b),()=>V.unobserve(b)},[b]),a.useEffect(()=>{!o||M.current===A.type||(W(V=>V+1),M.current=A.type)},[A.type]),r.jsx("div",{className:lt(rt.wrapper,{[rt.editor]:i}),ref:E,children:r.jsxs("div",{className:rt.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:A.backgroundColor&&A.type==="fade in"?A.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:lt(rt.captionBlock),children:r.jsx("div",{className:rt.captionTextWrapper,children:t.map((V,G)=>r.jsx("div",{className:lt(rt.captionText,np[w.alignment],{[rt.withPointerEvents]:G===L&&i,[rt.active]:G===L}),style:{fontFamily:Er(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":$.scalingValue(l.width,i),letterSpacing:$.scalingValue(c,i),wordSpacing:$.scalingValue(p,i),textAlign:u,fontSize:$.scalingValue(v.fontSize,i),lineHeight:$.scalingValue(v.lineHeight,i),textTransform:y.textTransform??"none",textDecoration:y.textDecoration??"none",fontVariant:y.fontVariant??"normal",color:g,transitionDuration:A.duration?`${Math.round(parseInt(A.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:rt.captionTextInner,style:{"--link-hover-color":w.linkHoverColor,"--link-color":w.linkColor,position:"relative",top:$.scalingValue(w.offset.y,i),left:$.scalingValue(w.offset.x,i)},children:r.jsx(yi,{content:V.imageCaption})})},G))})}),r.jsx(Za,{onMove:V=>{C(V.index)},ref:s,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,autoplay:P.autoPlay!==null,...P.autoPlay!==null&&{interval:parseInt(P.autoPlay)*1e3},direction:B==="horiz"||A.type==="fade in"?"ltr":"ttb",pagination:!1,drag:P.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:A.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((V,G)=>r.jsx(Ja,{children:r.jsx("div",{className:rt.sliderItem,children:r.jsx("div",{className:rt.imgWrapper,children:r.jsx("img",{className:lt(rt.sliderImage,{[rt.contain]:V.image.objectFit==="contain",[rt.cover]:V.image.objectFit==="cover"}),src:V.image.url,alt:V.image.name??""})})})},G))},K),T.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:lt(rt.arrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{onClick:()=>{q("-1")},className:rt.arrowInner,style:{transform:`translate(${$.scalingValue(X,i)}, ${$.scalingValue(k*(B==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(rn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:lt(rt.arrowImg,rt.mirror)}),!T.arrowsImgUrl&&r.jsx(Ls,{color:T.color,className:lt(rt.arrowIcon,rt.arrowImg,rt.mirror)})]})}),r.jsx("div",{className:lt(rt.arrow,rt.nextArrow,{[rt.arrowVertical]:B==="vert",[rt.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{className:rt.arrowInner,onClick:()=>q("+1"),style:{transform:`translate(${$.scalingValue(X*(B==="horiz"?-1:1),i)}, ${$.scalingValue(k,i)}) scale(${e.controls.scale/100}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(rn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:rt.arrowImg}),!T.arrowsImgUrl&&r.jsx(Ls,{color:T.color,className:lt(rt.arrowIcon,rt.arrowImg)})]})})]}),P.triggersList.click&&r.jsx("div",{className:rt.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:lt(rt.pagination,{[rt.paginationInsideBottom]:j.position==="inside-1"&&B==="horiz",[rt.paginationInsideTop]:j.position==="inside-2"&&B==="horiz",[rt.paginationOutsideBottom]:j.position==="outside-1"&&B==="horiz",[rt.paginationOutsideTop]:j.position==="outside-2"&&B==="horiz",[rt.paginationInsideLeft]:j.position==="inside-1"&&B==="vert",[rt.paginationInsideRight]:j.position==="inside-2"&&B==="vert",[rt.paginationOutsideLeft]:j.position==="outside-1"&&B==="vert",[rt.paginationOutsideRight]:j.position==="outside-2"&&B==="vert",[rt.paginationVertical]:B==="vert"}),children:r.jsx("div",{className:rt.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${$.scalingValue(j.offset.x,i)}, ${$.scalingValue(j.offset.y,i)}) rotate(${B==="horiz"?"0deg":"90deg"})`},children:t.map((V,G)=>r.jsx("button",{onClick:()=>{o&&o.go(G)},className:lt(rt.paginationItem),children:r.jsx("div",{className:lt(rt.dot,{[rt.activeDot]:G===L}),style:{backgroundColor:G===L?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},G))})})]})})}function Ls({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 op={element:ip,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"]}},rp="ImageRevealSlider-module__imageRevealSlider___UE5Ob",ap="ImageRevealSlider-module__image___Qjt-e",sp="ImageRevealSlider-module__link___N-iLG",lp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:rp,image:ap,link:sp,cursor:lp};function Rs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function cp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Br(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Br(e);s=l.height/l.width*o}else{const l=await Br(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function dp({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,v]=a.useState({x:0,y:0}),[y,g]=a.useState(1),[h,m]=a.useState("none"),b=a.useRef({x:0,y:0}),[E,L]=a.useState(!1),{sizeType:C,imageWidth:K,randomRangeImageWidth:W}=e.imageSize,{revealPosition:B,visible:A}=e.position,{cursorType:T,target:j,defaultCursorScale:w,defaultCursor:P,hoverCursorScale:M,hoverCursor:X}=e.cursor;a.useEffect(()=>{if(!i)return;const V=(S,R)=>{const O=i.getBoundingClientRect(),ae=S-O.left,se=R-O.top;if(v({x:ae,y:se}),T==="system"){m("none"),g(1);return}const I=ae,de=se,F=document.elementFromPoint(O.left+I,O.top+de);if(F&&F.closest("a")){m("none"),g(1);return}const te=Rs(I,de,s)||j==="area"?{img:X??"none",scale:M}:{img:P??"none",scale:w};m(te.img),g(te.scale)},G=S=>{S.stopPropagation(),b.current={x:S.clientX,y:S.clientY},V(S.clientX,S.clientY)},ie=()=>{E&&V(b.current.x,b.current.y)};return i.addEventListener("mousemove",G),window.addEventListener("scroll",ie,!0),()=>{i.removeEventListener("mousemove",G),window.removeEventListener("scroll",ie,!0)}},[i,E,p,T,j,X,P,M,w,s]),a.useEffect(()=>{E||(m("none"),g(0))},[E]);const k=async(V,G,ie,S={})=>{const{width:R,height:O,finalWidth:ae}=await cp(V.image.url,C,K,W);let se=0,I=0;B==="same"?(se=G/2,I=ie/2):(se=S.x??Math.random()*G,I=S.y??Math.random()*ie);const de=Math.min(Math.max(se,R/2),G-R/2),F=Math.min(Math.max(I,O/2),ie-O/2);return{id:u.current++,url:V.image.url,link:V.link,name:V.image.name,x:de,y:F,width:ae}};a.useEffect(()=>{if(!i||t.length===0)return;const V=i.getBoundingClientRect(),G=V.width,ie=V.height,S=[];(async()=>{const O=t[0],ae=await k(O,G,ie);S.push(ae),l(S),c(1)})()},[C,K,W,B,i]),a.useEffect(()=>{A==="last One"&&l(V=>V.length>0?[V[V.length-1]]:[])},[A]);const q=async V=>{if(!i)return;const G=i.getBoundingClientRect(),ie=V.clientX-G.left,S=V.clientY-G.top;if(j==="image"&&!Rs(ie,S,s))return;let R=0,O=0;B==="on Click"?(R=ie,O=S):B==="same"?(R=G.width/2,O=G.height/2):(R=Math.random()*G.width,O=Math.random()*G.height);const ae=t[d],se=await k(ae,G.width,G.height,{x:R,y:O});l(I=>A==="all"?[...I,se]:[se]),c(I=>I>=t.length-1?0:I+1)};return r.jsxs("div",{ref:o,onClick:q,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(V=>r.jsx("div",{className:wi.wrapper,style:{top:`${V.y}px`,left:`${V.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:V.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:j==="area"&&V.link?r.jsx("a",{href:V.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)}):r.jsx("img",{src:V.url,alt:V.name,className:wi.image},V.id)},V.id)),E&&r.jsx("div",{className:wi.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 up={element:dp,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:""}]}}}},pp="LightBox-module__hidden___9s-9x",mp="LightBox-module__heroImage___sTxNF",gp="LightBox-module__background___rm9ml",hp="LightBox-module__editor___4ACaY",fp="LightBox-module__contentStyle___Bgnsq",yp="LightBox-module__imageStyle___tLIlB",vp="LightBox-module__imgWrapper___LuFUp",xp="LightBox-module__contain___8-yaS",bp="LightBox-module__cover___hNvOG",wp="LightBox-module__caption___b6L2I",Sp="LightBox-module__captionTextInner___rCGNH",$p="LightBox-module__lightboxSplide___XFuWC",Cp="LightBox-module__arrow___iz38X",Tp="LightBox-module__arrowVertical___Zfz81",Lp="LightBox-module__nextArrow___zkAQN",Rp="LightBox-module__arrowInner___p48sW",Ip="LightBox-module__arrowIcon___3VaFf",Ep="LightBox-module__arrowImg___pNV88",Mp="LightBox-module__mirror___pjeXc",Pp="LightBox-module__thumbsWrapper___GB-nU",kp="LightBox-module__thumbsContainerVertical___wttk5",Ap="LightBox-module__thumbsContainer___osSma",Fp="LightBox-module__thumbsAlignStart___MO6tY",Wp="LightBox-module__thumbsAlignCenter___Q4sUx",_p="LightBox-module__thumbsAlignEnd___p4y9R",Hp="LightBox-module__thumbItem___HvnF3",Np="LightBox-module__closeButton___g2khP",Op="LightBox-module__fadeIn___0m5GW",Dp="LightBox-module__slideInLeft___gPYwC",jp="LightBox-module__slideInRight___S-pPp",zp="LightBox-module__slideInTop___DFdAj",Bp="LightBox-module__slideInBottom___m27kZ",Vp="LightBox-module__fadeOut___55qBR",Gp="LightBox-module__slideOutLeft___NvU7P",qp="LightBox-module__slideOutRight___SK7eC",Up="LightBox-module__slideOutTop___Vgg0z",Kp="LightBox-module__slideOutBottom___nJ0Ef",Xp="LightBox-module__scaleSlide___vZriG",Ue={hidden:pp,heroImage:mp,background:gp,editor:hp,contentStyle:fp,imageStyle:yp,imgWrapper:vp,contain:xp,cover:bp,caption:wp,captionTextInner:Sp,lightboxSplide:$p,arrow:Cp,arrowVertical:Tp,nextArrow:Lp,arrowInner:Rp,arrowIcon:Ip,arrowImg:Ep,mirror:Mp,thumbsWrapper:Pp,thumbsContainerVertical:kp,thumbsContainer:Ap,thumbsAlignStart:Fp,thumbsAlignCenter:Wp,thumbsAlignEnd:_p,thumbItem:Hp,closeButton:Np,fadeIn:Op,slideInLeft:Dp,slideInRight:jp,slideInTop:zp,slideInBottom:Bp,fadeOut:Vp,slideOutLeft:Gp,slideOutRight:qp,slideOutTop:Up,slideOutBottom:Kp,scaleSlide:Xp},Do=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:i.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,i};function hc(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 Yp(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 fc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Zp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function yc(e,t,n,i,o){const{x:s,y:l}=Yp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Jp(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Zp:fc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:v,offsetY:y}=yc(n,i,u,p,d),g=(v+u/2)/n*100,h=(y+p/2)/i*100;return`${g}% ${h}%`}function Qp(e){return Jp(e)}function mr(e){const t=e.getBoundingClientRect(),n=hc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=fc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=yc(i,o,d,c,u),y=t.left+n.left,g=t.top+n.top;return{x:p+y,y:v+g,width:d,height:c}}function Is(e){const t=e.getBoundingClientRect(),n=hc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Es(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 em(e,t){const n=(()=>{if(e==="fade in")return Ue.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeIn;if(e==="slide in")switch(t){case"left":return Ue.slideInLeft;case"right":return Ue.slideInRight;case"top":return Ue.slideInTop;case"bottom":return Ue.slideInBottom;default:return Ue.slideInRight}return Ue.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ue.fadeOut;if(e==="slide in")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})(),s=(()=>{if(e==="fade in")return Ue.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ue.slideOutLeft;case"right":return Ue.slideOutRight;case"top":return Ue.slideOutTop;case"bottom":return Ue.slideOutBottom;default:return Ue.slideOutRight}return Ue.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const tm=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ue.heroImage,onClick:()=>c(!0)}),r.jsx(nm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},nm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var be;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:y,fontSizeLineHeight:g,textAppearance:h,color:m}=i.imageCaption??{},[b,E]=a.useState(0),[L,C]=a.useState(0),[K,W]=a.useState(!1),[B,A]=a.useState(!1),[T,j]=a.useState({}),w=a.useRef(null),P=a.useRef(null),M=a.useRef(null),X=a.useRef(!1),k=a.useRef(null),q=a.useRef(null),V=a.useRef(null),G=a.useRef(null),ie=a.useRef(!1),S=a.useRef(null),[R,O]=a.useState(!1),{appear:ae,triggers:se,slider:I,thumbnail:de,controls:F,area:te,caption:Z,layout:ve}=o.lightboxBlock,{appearClass:Ae,backdropAppearClass:he,backdropDisappearClass:pe,disappearClass:U}=em(ae.type,ae.direction),ee=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const z=()=>{setTimeout(()=>{var ye,we;(we=(ye=w.current)==null?void 0:ye.splide)==null||we.refresh()},16)},le=()=>{C(ye=>ye+1)};return window.addEventListener("ArticleEditor.Layout:change",z),window.addEventListener("ArticleEditor.ComponentContent:change",le),()=>{window.removeEventListener("ArticleEditor.Layout:change",z),window.removeEventListener("ArticleEditor.ComponentContent:change",le)}},[]),a.useEffect(()=>{if(!e||!de.isActive){O(!1);return}const z=S.current;if(!z)return;const le=()=>{I.direction==="horiz"?O(z.scrollWidth>z.clientWidth):O(z.scrollHeight>z.clientHeight)};le();const ye=new ResizeObserver(le);return ye.observe(z),()=>ye.disconnect()},[e,de.isActive,n.length,T,I.direction]);const Y=a.useCallback(()=>{const z=window.matchMedia("(max-width: 768px)").matches,le=Es(te.color);z&&!l&&le>.9&&(document.body.style.backgroundColor=""),W(!0),X.current=!0;const ye=we=>{we.target===k.current&&we.animationName&&(k.current&&q.current&&k.current.removeEventListener("animationend",q.current),q.current=null,X.current&&(X.current=!1,t()),W(!1))};k.current&&(q.current=ye,k.current.addEventListener("animationend",ye))},[t,te.color,l]),Oe=(z,le,ye)=>{var we,Pe;if(z){if(se.type==="click"&&se.switch==="image")se.repeat==="close"&&b===n.length-1?Y():(we=w.current)==null||we.go("+1");else if(se.type==="click"&&se.switch==="50/50"){const Ce=z.getBoundingClientRect(),_=le-Ce.left,ge=ye-Ce.top,ne=Ce.width,H=Ce.height;let Q;I.direction==="horiz"?Q=_<ne/2?"-1":"+1":Q=ge<H/2?"-1":"+1",(Pe=w.current)==null||Pe.go(Q)}}},$e=z=>{if(ie.current){ie.current=!1;return}const le=n[b],ye=(le==null?void 0:le.image.objectFit)==="cover";let we,Pe;if("changedTouches"in z&&z.changedTouches.length>0)we=z.changedTouches[0].clientX,Pe=z.changedTouches[0].clientY;else if("clientX"in z)we=z.clientX,Pe=z.clientY;else return;let Ce;if(ye&&M.current){const _=Is(M.current);Ce=we>=_.left&&we<=_.right&&Pe>=_.top&&Pe<=_.bottom}else{const _=M.current?mr(M.current):null;if(!_){z.target===z.currentTarget&&Y();return}Ce=we>=_.x&&we<=_.x+_.width&&Pe>=_.y&&Pe<=_.y+_.height}Ce?Oe(M.current,we,Pe):Y()},He=z=>{const le=z.target;(le.classList.contains(Ue.thumbsWrapper)||le.classList.contains(Ue.thumbsContainer))&&$e(z)};a.useEffect(()=>{if(!e)return;const z=le=>{var ye,we;if(le.key==="Escape"){Y();return}if(le.key==="ArrowRight"){E(Pe=>(Pe+1)%Math.max(n.length,1)),(ye=w.current)==null||ye.go("+1");return}le.key==="ArrowLeft"&&(E(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(we=w.current)==null||we.go("-1"))};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[e,Y,n.length]),a.useEffect(()=>{if(e){if(E(0),C(le=>le+1),X.current=!1,W(!1),A(!1),j({}),!ee)return;const z=new CustomEvent("page-overlay",{detail:{itemId:ee}});window.dispatchEvent(z)}return()=>{k.current&&q.current&&(k.current.removeEventListener("animationend",q.current),q.current=null),A(!1)}},[e,ee]),a.useEffect(()=>{P.current!==null&&P.current!==I.type&&C(z=>z+1),P.current=I.type},[I.type]),a.useEffect(()=>{if(!e)return;const z=document.body.style.overflow,le=window.matchMedia("(max-width: 768px)").matches,ye=Es(te.color);document.body.style.overflow="hidden",A(!1);const we=Ce=>{Ce.target===k.current&&!X.current&&Ce.animationName&&(le&&!l&&ye>.9&&(document.body.style.backgroundColor=te.color),A(!0),k.current&&V.current&&k.current.removeEventListener("animationend",V.current),V.current=null)};k.current&&(V.current=we,k.current.addEventListener("animationend",we));const Pe=Ce=>{const _=Ce.target;_&&(_.closest(`.${Ue.thumbsWrapper}`)||_.closest(`.${Ue.thumbsContainer}`))||I.type!=="slide"&&Ce.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=z,document.removeEventListener("touchmove",Pe),k.current&&V.current&&(k.current.removeEventListener("animationend",V.current),V.current=null),A(!1)}},[e,l,te.color,I.type]),a.useEffect(()=>{if(!e)return;const z=le=>{var we,Pe;if(X.current){le.stopPropagation();return}if(ie.current){ie.current=!1;return}const ye=le.target;if(!(ye&&(ye.closest(`.${Ue.thumbsContainer}`)||ye.closest(`.${Ue.thumbItem}`)||ye.closest(`.${Ue.arrow}`)||ye.closest(`.${Ue.closeButton}`)||ye.closest(`.${Ue.caption}`)))){if(I.type==="slide"&&se.type==="drag"&&((Pe=(we=w.current)==null?void 0:we.splide)!=null&&Pe.root)){const Ce=w.current.splide.root;if(ye&&(Ce.contains(ye)||Ce===ye))return}if(le.touches.length===0&&le.changedTouches.length>0){const Ce=n[b],_=(Ce==null?void 0:Ce.image.objectFit)==="cover",ge=le.changedTouches[0];let ne;if(_&&M.current){const H=Is(M.current);ne=ge.clientX>=H.left&&ge.clientX<=H.right&&ge.clientY>=H.top&&ge.clientY<=H.bottom}else{const H=M.current?mr(M.current):null;if(!H)return;ne=ge.clientX>=H.x&&ge.clientX<=H.x+H.width&&ge.clientY>=H.y&&ge.clientY<=H.y+H.height}if(!ne){le.stopPropagation(),X.current=!0;const H=Q=>{Q.stopPropagation(),Q.preventDefault(),document.removeEventListener("click",H,!0)};document.addEventListener("click",H,!0),Y()}}}};return document.addEventListener("touchend",z,{passive:!0}),()=>{document.removeEventListener("touchend",z)}},[e,Y,b,n]);const ue=(I.type==="scale"||I.type==="fade")&&I.direction==="vert"&&se.type==="drag";a.useEffect(()=>{var Q,Fe;if(!e||!ue||!((Fe=(Q=w.current)==null?void 0:Q.splide)!=null&&Fe.root))return;const z=w.current.splide.root,le=30,ye=(re,N)=>{if(G.current){const qe=Math.abs(re-G.current.x),Be=Math.abs(N-G.current.y);(qe>0||Be>0)&&(ie.current=!0)}},we=re=>{G.current&&(re.preventDefault(),ye(re.clientX,re.clientY))},Pe=re=>{G.current&&re.touches.length>0&&(re.preventDefault(),ye(re.touches[0].clientX,re.touches[0].clientY))},Ce=(re,N)=>{if(!G.current||!w.current){G.current=null;return}const qe=Math.abs(re-G.current.x),Be=Math.abs(N-G.current.y);Be>le&&Be>qe&&w.current.go(N<G.current.y?"+1":"-1"),G.current=null},_=re=>{G.current&&Ce(re.clientX,re.clientY),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("pointermove",we)},ge=re=>{if(G.current){if(re.changedTouches.length>0){const N=re.changedTouches[0];Ce(N.clientX,N.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",Pe)}},ne=re=>{G.current={x:re.clientX,y:re.clientY},ie.current=!1,document.addEventListener("pointermove",we,{passive:!1}),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)},H=re=>{re.touches.length>0&&(G.current={x:re.touches[0].clientX,y:re.touches[0].clientY},ie.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return z.addEventListener("pointerdown",ne),z.addEventListener("touchstart",H),()=>{z.removeEventListener("pointerdown",ne),z.removeEventListener("touchstart",H),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),G.current=null,ie.current=!1}},[e,ue,L]);const me={backgroundColor:te.color,backdropFilter:`blur(${te.blur}px)`,animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:k,className:lt(Ue.background,K?pe:he,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{...me,...B&&!l&&!K?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?k:null,className:lt(Ue.contentStyle,K?U:Ae,{[Ue.editor]:l},{[Ue.hidden]:!e}),style:{animationDuration:`${parseInt(ae.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Za,{onMove:z=>E(z.index),ref:w,className:Ue.lightboxSplide,options:{arrows:!1,speed:I.duration?parseInt(I.duration):500,direction:I.direction==="horiz"||I.type==="fade"||I.type==="scale"?"ltr":"ttb",pagination:!1,drag:se.type==="drag"&&!ue,perPage:1,width:"100%",height:"100%",type:I.type==="fade"||I.type==="scale"?"fade":"loop",padding:0,rewind:se.repeat!=="close",start:0},style:{"--splide-speed":I.duration},children:n.map((z,le)=>{const ye=Do(ve.position,ve.offset,l),we=`${$.scalingValue(ve.padding.top,l)} ${$.scalingValue(ve.padding.right,l)} ${$.scalingValue(ve.padding.bottom,l)} ${$.scalingValue(ve.padding.left,l)}`,Pe=I.type==="scale"?(()=>{const{transform:Ce,..._}=ye;return{..._,position:"absolute",padding:we,boxSizing:"border-box","--position-transform":Ce||"none"}})():{...ye,position:"absolute",padding:we,boxSizing:"border-box"};return r.jsx(Ja,{children:r.jsx("div",{className:Ue.imgWrapper,onClick:$e,children:r.jsx("img",{ref:le===b?M:null,className:lt(Ue.imageStyle,{[Ue.contain]:z.image.objectFit==="contain",[Ue.cover]:z.image.objectFit==="cover",[Ue.scaleSlide]:I.type==="scale"}),src:z.image.url,alt:z.image.name??"",style:{...Pe,pointerEvents:z.image.objectFit==="contain"?"none":"auto"}})})},le)})},L),F.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:lt(Ue.arrow,{[Ue.arrowVertical]:I.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x,l)}, ${$.scalingValue(F.offset.y*(I.direction==="horiz"?1:-1),l)}) scale(${F.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=w.current)==null?void 0:z.go("-1")},"aria-label":"Previous",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:lt(Ue.arrowImg,Ue.mirror)}),!F.arrowsImgUrl&&r.jsx(Ms,{color:F.color,className:lt(Ue.arrowIcon,Ue.arrowImg,Ue.mirror)})]})}),r.jsx("div",{className:lt(Ue.arrow,Ue.nextArrow,{[Ue.arrowVertical]:I.direction==="vert"}),style:{color:F.color,"--arrow-hover-color":F.hover},children:r.jsxs("button",{className:Ue.arrowInner,style:{transform:`translate(${$.scalingValue(F.offset.x*(I.direction==="horiz"?-1:1),l)}, ${$.scalingValue(F.offset.y,l)}) scale(${F.scale}) rotate(${I.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var z;return(z=w.current)==null?void 0:z.go("+1")},"aria-label":"Next",children:[F.arrowsImgUrl&&r.jsx(rn,{url:F.arrowsImgUrl,fill:F.color,hoverFill:F.hover,className:Ue.arrowImg}),!F.arrowsImgUrl&&r.jsx(Ms,{color:F.color,className:lt(Ue.arrowIcon,Ue.arrowImg)})]})})]}),te.closeIconUrl&&(()=>{const z=Do(te.closeIconAlign,te.closeIconOffset,l),le=`scale(${te.closeIconScale})`,ye=z.transform?`${z.transform} ${le}`:le;return r.jsx("button",{className:Ue.closeButton,style:{...z,transform:ye},onClick:Y,"aria-label":"Close lightbox",children:r.jsx(rn,{url:te.closeIconUrl,fill:te.closeIconColor??"#000000",hoverFill:te.closeIconHover??"#cccccc"})})})(),Z&&Z.isActive&&i.imageCaption&&((be=n[b])==null?void 0:be.imageCaption)&&r.jsx("div",{className:Ue.caption,style:{...Do(Z.alignment,Z.offset,l),fontFamily:Er(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":$.scalingValue(c.width,l),letterSpacing:$.scalingValue(p,l),wordSpacing:$.scalingValue(y,l),textAlign:v,fontSize:$.scalingValue(g.fontSize,l),lineHeight:$.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:z=>z.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ue.captionTextInner,style:{"--link-color":Z.linkColor,"--link-hover-color":Z.linkHoverColor},children:r.jsx(yi,{content:n[b].imageCaption})})}),de.isActive&&(()=>{const[z,le]=de.position.split("-"),ye=I.direction==="horiz"?`${z}-left`:de.position,we=Do(ye,de.offset,l),Pe=()=>{if(I.direction==="horiz"){if(le==="left")return"flex-start";if(le==="center")return"center";if(le==="right")return"flex-end"}else{if(z==="top")return"flex-start";if(z==="middle")return"center";if(z==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:S,className:Ue.thumbsWrapper,onClick:Ce=>He(Ce),style:{position:l?"absolute":"fixed",...we,...I.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:lt(Ue.thumbsContainer,{[Ue.thumbsContainerVertical]:I.direction==="vert",[Ue.thumbsAlignStart]:de.align==="start",[Ue.thumbsAlignCenter]:de.align==="center",[Ue.thumbsAlignEnd]:de.align==="end"}),style:{gap:$.scalingValue(de.grid.gap,l),justifyContent:R?"flex-start":Pe()},children:n.map((Ce,_)=>{const ge=_===b,ne=T[_],Q=de.grid.size*(ge?de.activeState.scale:1),Fe=()=>{if(de.fit!=="fit")return{};if(!ne)return I.direction==="horiz"?{height:$.scalingValue(Q,l)}:{width:$.scalingValue(Q,l)};const re=ne.width/ne.height;if(I.direction==="horiz"){const N=Q,qe=N*re;return{width:$.scalingValue(qe,l),height:$.scalingValue(N,l)}}else{const N=Q,qe=N/re;return{width:$.scalingValue(N,l),height:$.scalingValue(qe,l)}}};return r.jsx("button",{className:Ue.thumbItem,style:{...I.direction==="horiz"&&de.fit!=="fit"?{height:$.scalingValue(Q,l)}:{},...I.direction==="vert"&&de.fit!=="fit"?{width:$.scalingValue(Q,l)}:{},...de.fit==="cover"?{width:$.scalingValue(Q,l),height:$.scalingValue(Q,l)}:{},...Fe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?de.activeState.opacity/100:de.opacity/100,"--thumb-hover":de.activeState.opacity/100},onClick:re=>{var N;re.stopPropagation(),E(_),(N=w.current)==null||N.go(_)},onMouseEnter:()=>{var re;de.triggers==="hov"&&((re=w.current)==null||re.go(_))},children:r.jsx("img",{src:Ce.image.url,alt:Ce.image.name??"",onLoad:re=>{const N=re.currentTarget;N.naturalWidth&&N.naturalHeight&&j(qe=>({...qe,[_]:{width:N.naturalWidth,height:N.naturalHeight}}))},style:{objectFit:de.fit==="cover"?"cover":"contain",...de.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...de.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Ce.image.name}-${_}`)})})})})()]})]}),document.getElementById(s))};function Ms({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 im={element:tm,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 jo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function om(e){return`
|
|
6
|
+
*/const Uu="RichTextRenderer-module__link___BWeZ2",Ku={link:Uu},Xu=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))},Er=e=>e&&e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>Xu(n)?`"${n.replace(/"/g,'\\"')}"`:n).join(", ");function on(e){const{color:t,...n}=e;return n}function Kt(e,t){var o,s,l;const{fontSize:n,lineHeight:i}=e;return{fontFamily:Er(e.fontSettings.fontFamily),fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:$.scalingValue(e.letterSpacing,t),wordSpacing:$.scalingValue(e.wordSpacing,t),fontSize:$.scalingValue(n,t),lineHeight:i!==void 0?$.scalingValue(i,t):void 0,textTransform:(o=e.textAppearance)==null?void 0:o.textTransform,textDecoration:(s=e.textAppearance)==null?void 0:s.textDecoration,fontVariant:(l=e.textAppearance)==null?void 0:l.fontVariant,textAlign:e.textAlign,color:e.color}}const yi=({content:e})=>{const t=n=>n.map((i,o)=>i.type==="link"?r.jsx("a",{className:Ku.link,href:i.value,target:i.target,children:t(i.children)},o):r.jsx("span",{style:Yu(i),children:i.text},o));return r.jsx(r.Fragment,{children:e.map((n,i)=>{const o=n.children;return r.jsx("div",{children:t(o)},i)})})};function Yu(e){return{...e.fontFamily&&{fontFamily:Er(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 Zu="SvgImage-module__svg___q3xE-",Ju="SvgImage-module__img___VsTm-",Ts={svg:Zu,img:Ju},Qu=e=>{const t=e.trim().toLowerCase();return!!(t.startsWith("data:image/svg+xml")||t.includes("image/svg+xml")||t.includes(".svg")||t.startsWith("blob:"))},ep=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,rn=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:i="",style:o})=>{const[s,l]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")'));return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const d=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');l(d)}},[]),!Qu(e)||!s?r.jsx("img",{src:e,alt:"",className:dt(Ts.img,i),style:o}):r.jsx("span",{"data-supports-mask":s,className:dt(Ts.svg,i),style:{"--svg":ep(e),"--fill":t,"--hover-fill":n,...o??{}}})},tp={"top-left":at.topLeftAlignment,"top-center":at.topCenterAlignment,"top-right":at.topRightAlignment,"middle-left":at.middleLeftAlignment,"middle-center":at.middleCenterAlignment,"middle-right":at.middleRightAlignment,"bottom-left":at.bottomLeftAlignment,"bottom-center":at.bottomCenterAlignment,"bottom-right":at.bottomRightAlignment};function np({settings:e,content:t,styles:n,isEditor:i}){const[o,s]=a.useState(null),{widthSettings:l,fontSettings:d,letterSpacing:c,textAlign:u,wordSpacing:p,fontSizeLineHeight:v,textAppearance:x,color:g}=n.imageCaption??{},[h,m]=a.useState(void 0),[b,I]=a.useState(null),[C,R]=a.useState(0),[K,F]=a.useState(0),{direction:V,transition:A,controls:T,pagination:j,imageCaption:y,triggers:W}=e,M=a.useRef(A.type),{x:Y,y:P}=e.controls.offset,U=z=>{o&&o.go(z)};return a.useEffect(()=>{if(!b)return;const z=new ResizeObserver(B=>{if(!o)return;const[te]=B;m({width:Math.round(te.contentRect.width),height:Math.round(te.contentRect.height)})});return z.observe(b),()=>z.unobserve(b)},[b]),a.useEffect(()=>{!o||M.current===A.type||(F(z=>z+1),M.current=A.type)},[A.type]),r.jsx("div",{className:dt(at.wrapper,{[at.editor]:i}),ref:I,children:r.jsxs("div",{className:at.sliderInner,style:{width:h?h.width:"100%",height:h?h.height:"100%",backgroundColor:A.backgroundColor&&A.type==="fade in"?A.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&r.jsx("div",{className:dt(at.captionBlock),children:r.jsx("div",{className:at.captionTextWrapper,children:t.map((z,B)=>r.jsx("div",{className:dt(at.captionText,tp[y.alignment],{[at.withPointerEvents]:B===C&&i,[at.active]:B===C}),style:{fontFamily:Er(d.fontFamily),fontWeight:d.fontWeight,fontStyle:d.fontStyle,width:l.sizing==="auto"?"max-content":$.scalingValue(l.width,i),letterSpacing:$.scalingValue(c,i),wordSpacing:$.scalingValue(p,i),textAlign:u,fontSize:$.scalingValue(v.fontSize,i),lineHeight:$.scalingValue(v.lineHeight,i),textTransform:x.textTransform??"none",textDecoration:x.textDecoration??"none",fontVariant:x.fontVariant??"normal",color:g,transitionDuration:A.duration?`${Math.round(parseInt(A.duration)/2)}ms`:"500ms"},children:r.jsx("div",{"data-styles":"imageCaption",className:at.captionTextInner,style:{"--link-hover-color":y.linkHoverColor,"--link-color":y.linkColor,position:"relative",top:$.scalingValue(y.offset.y,i),left:$.scalingValue(y.offset.x,i)},children:r.jsx(yi,{content:z.imageCaption})})},B))})}),r.jsx(Za,{onMove:z=>{R(z.index)},ref:s,options:{arrows:!1,speed:A.duration?parseInt(A.duration):500,autoplay:W.autoPlay!==null,...W.autoPlay!==null&&{interval:parseInt(W.autoPlay)*1e3},direction:V==="horiz"||A.type==="fade in"?"ltr":"ttb",pagination:!1,drag:W.triggersList.drag,perPage:1,width:h?h.width:"100%",height:h?h.height:"100%",type:A.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((z,B)=>r.jsx(Ja,{children:r.jsx("div",{className:at.sliderItem,children:r.jsx("div",{className:at.imgWrapper,children:r.jsx("img",{className:dt(at.sliderImage,{[at.contain]:z.image.objectFit==="contain",[at.cover]:z.image.objectFit==="cover"}),src:z.image.url,alt:z.image.name??""})})})},B))},K),T.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(at.arrow,{[at.arrowVertical]:V==="vert",[at.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{onClick:()=>{U("-1")},className:at.arrowInner,style:{transform:`translate(${$.scalingValue(Y,i)}, ${$.scalingValue(P*(V==="horiz"?1:-1),i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(rn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:dt(at.arrowImg,at.mirror)}),!T.arrowsImgUrl&&r.jsx(Ls,{color:T.color,className:dt(at.arrowIcon,at.arrowImg,at.mirror)})]})}),r.jsx("div",{className:dt(at.arrow,at.nextArrow,{[at.arrowVertical]:V==="vert",[at.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:r.jsxs("button",{className:at.arrowInner,onClick:()=>U("+1"),style:{transform:`translate(${$.scalingValue(Y*(V==="horiz"?-1:1),i)}, ${$.scalingValue(P,i)}) scale(${e.controls.scale/100}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&r.jsx(rn,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:at.arrowImg}),!T.arrowsImgUrl&&r.jsx(Ls,{color:T.color,className:dt(at.arrowIcon,at.arrowImg)})]})})]}),W.triggersList.click&&r.jsx("div",{className:at.clickOverlay,onClick:()=>{o&&o.go("+1")}}),j.isActive&&r.jsx("div",{className:dt(at.pagination,{[at.paginationInsideBottom]:j.position==="inside-1"&&V==="horiz",[at.paginationInsideTop]:j.position==="inside-2"&&V==="horiz",[at.paginationOutsideBottom]:j.position==="outside-1"&&V==="horiz",[at.paginationOutsideTop]:j.position==="outside-2"&&V==="horiz",[at.paginationInsideLeft]:j.position==="inside-1"&&V==="vert",[at.paginationInsideRight]:j.position==="inside-2"&&V==="vert",[at.paginationOutsideLeft]:j.position==="outside-1"&&V==="vert",[at.paginationOutsideRight]:j.position==="outside-2"&&V==="vert",[at.paginationVertical]:V==="vert"}),children:r.jsx("div",{className:at.paginationInner,style:{backgroundColor:j.colors[2],transform:`scale(${j.scale/100}) translate(${$.scalingValue(j.offset.x,i)}, ${$.scalingValue(j.offset.y,i)}) rotate(${V==="horiz"?"0deg":"90deg"})`},children:t.map((z,B)=>r.jsx("button",{onClick:()=>{o&&o.go(B)},className:dt(at.paginationItem),children:r.jsx("div",{className:dt(at.dot,{[at.activeDot]:B===C}),style:{backgroundColor:B===C?j.colors[0]:j.colors[1],"--pagination-hover-color":j.hover}})},B))})})]})})}function Ls({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 ip={element:np,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"]}},op="ImageRevealSlider-module__imageRevealSlider___UE5Ob",rp="ImageRevealSlider-module__image___Qjt-e",ap="ImageRevealSlider-module__link___N-iLG",sp="ImageRevealSlider-module__cursor___2U03d",wi={imageRevealSlider:op,image:rp,link:ap,cursor:sp};function Rs(e,t,n){for(const i of n){const o=new Image;o.src=i.url;const s=i.width?Number.parseFloat(i.width):o.naturalWidth,l=o.naturalHeight/o.naturalWidth*s,d=s/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 Br(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function lp(e,t,n,i){let o,s;if(t==="custom"){o=n;const l=await Br(e);s=l.height/l.width*o}else if(t==="random"){o=Math.random()*(i.max-i.min)+i.min;const l=await Br(e);s=l.height/l.width*o}else{const l=await Br(e);o=l.width,s=l.height}return{width:o,height:s,finalWidth:`${o}px`}}function cp({settings:e,content:t,isEditor:n}){const[i,o]=a.useState(null),[s,l]=a.useState([]),[d,c]=a.useState(0),u=a.useRef(0),[p,v]=a.useState({x:0,y:0}),[x,g]=a.useState(1),[h,m]=a.useState("none"),b=a.useRef({x:0,y:0}),[I,C]=a.useState(!1),{sizeType:R,imageWidth:K,randomRangeImageWidth:F}=e.imageSize,{revealPosition:V,visible:A}=e.position,{cursorType:T,target:j,defaultCursorScale:y,defaultCursor:W,hoverCursorScale:M,hoverCursor:Y}=e.cursor;a.useEffect(()=>{if(!i)return;const z=(S,E)=>{const D=i.getBoundingClientRect(),se=S-D.left,oe=E-D.top;if(v({x:se,y:oe}),T==="system"){m("none"),g(1);return}const L=se,ue=oe,k=document.elementFromPoint(D.left+L,D.top+ue);if(k&&k.closest("a")){m("none"),g(1);return}const ne=Rs(L,ue,s)||j==="area"?{img:Y??"none",scale:M}:{img:W??"none",scale:y};m(ne.img),g(ne.scale)},B=S=>{S.stopPropagation(),b.current={x:S.clientX,y:S.clientY},z(S.clientX,S.clientY)},te=()=>{I&&z(b.current.x,b.current.y)};return i.addEventListener("mousemove",B),window.addEventListener("scroll",te,!0),()=>{i.removeEventListener("mousemove",B),window.removeEventListener("scroll",te,!0)}},[i,I,p,T,j,Y,W,M,y,s]),a.useEffect(()=>{I||(m("none"),g(0))},[I]);const P=async(z,B,te,S={})=>{const{width:E,height:D,finalWidth:se}=await lp(z.image.url,R,K,F);let oe=0,L=0;V==="same"?(oe=B/2,L=te/2):(oe=S.x??Math.random()*B,L=S.y??Math.random()*te);const ue=Math.min(Math.max(oe,E/2),B-E/2),k=Math.min(Math.max(L,D/2),te-D/2);return{id:u.current++,url:z.image.url,link:z.link,name:z.image.name,x:ue,y:k,width:se}};a.useEffect(()=>{if(!i||t.length===0)return;const z=i.getBoundingClientRect(),B=z.width,te=z.height,S=[];(async()=>{const D=t[0],se=await P(D,B,te);S.push(se),l(S),c(1)})()},[R,K,F,V,i]),a.useEffect(()=>{A==="last One"&&l(z=>z.length>0?[z[z.length-1]]:[])},[A]);const U=async z=>{if(!i)return;const B=i.getBoundingClientRect(),te=z.clientX-B.left,S=z.clientY-B.top;if(j==="image"&&!Rs(te,S,s))return;let E=0,D=0;V==="on Click"?(E=te,D=S):V==="same"?(E=B.width/2,D=B.height/2):(E=Math.random()*B.width,D=Math.random()*B.height);const se=t[d],oe=await P(se,B.width,B.height,{x:E,y:D});l(L=>A==="all"?[...L,oe]:[oe]),c(L=>L>=t.length-1?0:L+1)};return r.jsxs("div",{ref:o,onClick:U,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),className:wi.imageRevealSlider,style:{cursor:h==="none"?"default":"none"},children:[s.map(z=>r.jsx("div",{className:wi.wrapper,style:{top:`${z.y}px`,left:`${z.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:z.width??"auto",height:"auto",cursor:h==="none"?"default":"none"},children:j==="area"&&z.link?r.jsx("a",{href:z.link,target:"_blank",className:wi.link,children:r.jsx("img",{src:z.url,alt:z.name,className:wi.image},z.id)}):r.jsx("img",{src:z.url,alt:z.name,className:wi.image},z.id)},z.id)),I&&r.jsx("div",{className:wi.cursor,style:{left:`${p.x}px`,top:`${p.y}px`,transform:`translate(-50%, -50%) scale(${x})`,backgroundImage:`url('${h}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const dp={element:cp,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:""}]}}}},up="LightBox-module__hidden___9s-9x",pp="LightBox-module__heroImage___sTxNF",mp="LightBox-module__background___rm9ml",gp="LightBox-module__editor___4ACaY",hp="LightBox-module__contentStyle___Bgnsq",fp="LightBox-module__imageStyle___tLIlB",yp="LightBox-module__imgWrapper___LuFUp",vp="LightBox-module__contain___8-yaS",xp="LightBox-module__cover___hNvOG",bp="LightBox-module__caption___b6L2I",wp="LightBox-module__captionTextInner___rCGNH",Sp="LightBox-module__lightboxSplide___XFuWC",$p="LightBox-module__arrow___iz38X",Cp="LightBox-module__arrowVertical___Zfz81",Tp="LightBox-module__nextArrow___zkAQN",Lp="LightBox-module__arrowInner___p48sW",Rp="LightBox-module__arrowIcon___3VaFf",Ip="LightBox-module__arrowImg___pNV88",Ep="LightBox-module__mirror___pjeXc",Mp="LightBox-module__thumbsWrapper___GB-nU",Pp="LightBox-module__thumbsContainerVertical___wttk5",kp="LightBox-module__thumbsContainer___osSma",Ap="LightBox-module__thumbsAlignStart___MO6tY",Fp="LightBox-module__thumbsAlignCenter___Q4sUx",Wp="LightBox-module__thumbsAlignEnd___p4y9R",_p="LightBox-module__thumbItem___HvnF3",Hp="LightBox-module__closeButton___g2khP",Np="LightBox-module__fadeIn___0m5GW",Op="LightBox-module__slideInLeft___gPYwC",Dp="LightBox-module__slideInRight___S-pPp",jp="LightBox-module__slideInTop___DFdAj",zp="LightBox-module__slideInBottom___m27kZ",Bp="LightBox-module__fadeOut___55qBR",Vp="LightBox-module__slideOutLeft___NvU7P",Gp="LightBox-module__slideOutRight___SK7eC",qp="LightBox-module__slideOutTop___Vgg0z",Up="LightBox-module__slideOutBottom___nJ0Ef",Kp="LightBox-module__scaleSlide___vZriG",Ke={hidden:up,heroImage:pp,background:mp,editor:gp,contentStyle:hp,imageStyle:fp,imgWrapper:yp,contain:vp,cover:xp,caption:bp,captionTextInner:wp,lightboxSplide:Sp,arrow:$p,arrowVertical:Cp,nextArrow:Tp,arrowInner:Lp,arrowIcon:Rp,arrowImg:Ip,mirror:Ep,thumbsWrapper:Mp,thumbsContainerVertical:Pp,thumbsContainer:kp,thumbsAlignStart:Ap,thumbsAlignCenter:Fp,thumbsAlignEnd:Wp,thumbItem:_p,closeButton:Hp,fadeIn:Np,slideInLeft:Op,slideInRight:Dp,slideInTop:jp,slideInBottom:zp,fadeOut:Bp,slideOutLeft:Vp,slideOutRight:Gp,slideOutTop:qp,slideOutBottom:Up,scaleSlide:Kp},Do=(e,t,n)=>{const i={},[o,s]=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"),s==="left"?(i.left="0",i.right="auto"):s==="center"?(i.left="50%",i.right="auto"):s==="right"&&(i.left="auto",i.right="0"),o==="middle"&&s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), calc(-50% + ${$.scalingValue(t.y,n)}))`:o==="middle"?i.transform=`translate(${$.scalingValue(t.x,n)}, calc(-50% + ${$.scalingValue(t.y,n)}))`:s==="center"?i.transform=`translate(calc(-50% + ${$.scalingValue(t.x,n)}), ${$.scalingValue(t.y,n)})`:i.transform=`translate(${$.scalingValue(t.x,n)}, ${$.scalingValue(t.y,n)})`,i};function gc(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 Xp(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 hc(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=e;return{renderedW:d,renderedH:d/s}}const l=t;return{renderedW:l*s,renderedH:l}}function Yp(e,t,n,i){if(!n||!i||!e||!t)return{renderedW:e,renderedH:t};const o=e/t,s=n/i;if(s>o){const d=t;return{renderedW:d*s,renderedH:d}}const l=e;return{renderedW:l,renderedH:l/s}}function fc(e,t,n,i,o){const{x:s,y:l}=Xp(o);return{offsetX:s*(e-n),offsetY:l*(t-i)}}function Zp(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,s=e instanceof HTMLVideoElement?e.videoHeight:e.naturalHeight,{objectFit:l,objectPosition:d}=window.getComputedStyle(e),c=l==="cover"?Yp:hc,{renderedW:u,renderedH:p}=c(n,i,o,s),{offsetX:v,offsetY:x}=fc(n,i,u,p,d),g=(v+u/2)/n*100,h=(x+p/2)/i*100;return`${g}% ${h}%`}function Jp(e){return Zp(e)}function mr(e){const t=e.getBoundingClientRect(),n=gc(e),i=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),s=e.naturalWidth,l=e.naturalHeight,{renderedW:d,renderedH:c}=hc(i,o,s,l),u=window.getComputedStyle(e).objectPosition,{offsetX:p,offsetY:v}=fc(i,o,d,c,u),x=t.left+n.left,g=t.top+n.top;return{x:p+x,y:v+g,width:d,height:c}}function Is(e){const t=e.getBoundingClientRect(),n=gc(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Es(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 Qp(e,t){const n=(()=>{if(e==="fade in")return Ke.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),i=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeIn;if(e==="slide in")switch(t){case"left":return Ke.slideInLeft;case"right":return Ke.slideInRight;case"top":return Ke.slideInTop;case"bottom":return Ke.slideInBottom;default:return Ke.slideInRight}return Ke.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return Ke.fadeOut;if(e==="slide in")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})(),s=(()=>{if(e==="fade in")return Ke.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return Ke.slideOutLeft;case"right":return Ke.slideOutRight;case"top":return Ke.slideOutTop;case"bottom":return Ke.slideOutBottom;default:return Ke.slideOutRight}return Ke.fadeOut})();return{appearClass:n,backdropAppearClass:i,backdropDisappearClass:o,disappearClass:s}}const em=({settings:e,content:t,styles:n,portalId:i,activeEvent:o,isEditor:s,isPreviewMode:l})=>{const[d,c]=a.useState(!1),{url:u}=e.thumbnailBlock.cover;return a.useEffect(()=>{o==="close"&&c(!1),o==="open"&&c(!0)},[o]),r.jsxs(r.Fragment,{children:[r.jsx("img",{src:u,alt:"Cover",className:Ke.heroImage,onClick:()=>c(!0)}),r.jsx(tm,{isOpen:d,onClose:()=>c(!1),content:t,settings:e,lightboxStyles:n,portalId:i,isEditor:s})]})},tm=({isOpen:e,onClose:t,content:n,lightboxStyles:i,settings:o,portalId:s,isEditor:l,metadata:d})=>{var $e;const{widthSettings:c,fontSettings:u,letterSpacing:p,textAlign:v,wordSpacing:x,fontSizeLineHeight:g,textAppearance:h,color:m}=i.imageCaption??{},[b,I]=a.useState(0),[C,R]=a.useState(0),[K,F]=a.useState(!1),[V,A]=a.useState(!1),[T,j]=a.useState({}),y=a.useRef(null),W=a.useRef(null),M=a.useRef(null),Y=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),z=a.useRef(null),B=a.useRef(null),te=a.useRef(!1),S=a.useRef(null),[E,D]=a.useState(!1),{appear:se,triggers:oe,slider:L,thumbnail:ue,controls:k,area:ne,caption:X,layout:be}=o.lightboxBlock,{appearClass:Ae,backdropAppearClass:fe,backdropDisappearClass:le,disappearClass:q}=Qp(se.type,se.direction),Q=(d==null?void 0:d.itemId)??null;a.useEffect(()=>{const G=()=>{setTimeout(()=>{var pe,Se;(Se=(pe=y.current)==null?void 0:pe.splide)==null||Se.refresh()},16)},re=()=>{R(pe=>pe+1)};return window.addEventListener("ArticleEditor.Layout:change",G),window.addEventListener("ArticleEditor.ComponentContent:change",re),()=>{window.removeEventListener("ArticleEditor.Layout:change",G),window.removeEventListener("ArticleEditor.ComponentContent:change",re)}},[]),a.useEffect(()=>{if(!e||!ue.isActive){D(!1);return}const G=S.current;if(!G)return;const re=()=>{L.direction==="horiz"?D(G.scrollWidth>G.clientWidth):D(G.scrollHeight>G.clientHeight)};re();const pe=new ResizeObserver(re);return pe.observe(G),()=>pe.disconnect()},[e,ue.isActive,n.length,T,L.direction]);const Z=a.useCallback(()=>{const G=window.matchMedia("(max-width: 768px)").matches,re=Es(ne.color);G&&!l&&re>.9&&(document.body.style.backgroundColor=""),F(!0),Y.current=!0;const pe=Se=>{Se.target===P.current&&Se.animationName&&(P.current&&U.current&&P.current.removeEventListener("animationend",U.current),U.current=null,Y.current&&(Y.current=!1,t()),F(!1))};P.current&&(U.current=pe,P.current.addEventListener("animationend",pe))},[t,ne.color,l]),Ne=(G,re,pe)=>{var Se,Pe;if(G){if(oe.type==="click"&&oe.switch==="image")oe.repeat==="close"&&b===n.length-1?Z():(Se=y.current)==null||Se.go("+1");else if(oe.type==="click"&&oe.switch==="50/50"){const Re=G.getBoundingClientRect(),H=re-Re.left,ge=pe-Re.top,ie=Re.width,_=Re.height;let ee;L.direction==="horiz"?ee=H<ie/2?"-1":"+1":ee=ge<_/2?"-1":"+1",(Pe=y.current)==null||Pe.go(ee)}}},Te=G=>{if(te.current){te.current=!1;return}const re=n[b],pe=(re==null?void 0:re.image.objectFit)==="cover";let Se,Pe;if("changedTouches"in G&&G.changedTouches.length>0)Se=G.changedTouches[0].clientX,Pe=G.changedTouches[0].clientY;else if("clientX"in G)Se=G.clientX,Pe=G.clientY;else return;let Re;if(pe&&M.current){const H=Is(M.current);Re=Se>=H.left&&Se<=H.right&&Pe>=H.top&&Pe<=H.bottom}else{const H=M.current?mr(M.current):null;if(!H){G.target===G.currentTarget&&Z();return}Re=Se>=H.x&&Se<=H.x+H.width&&Pe>=H.y&&Pe<=H.y+H.height}Re?Ne(M.current,Se,Pe):Z()},We=G=>{const re=G.target;(re.classList.contains(Ke.thumbsWrapper)||re.classList.contains(Ke.thumbsContainer))&&Te(G)};a.useEffect(()=>{if(!e)return;const G=re=>{var pe,Se;if(re.key==="Escape"){Z();return}if(re.key==="ArrowRight"){I(Pe=>(Pe+1)%Math.max(n.length,1)),(pe=y.current)==null||pe.go("+1");return}re.key==="ArrowLeft"&&(I(Pe=>(Pe-1+Math.max(n.length,1))%Math.max(n.length,1)),(Se=y.current)==null||Se.go("-1"))};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[e,Z,n.length]),a.useEffect(()=>{if(e){if(I(0),R(re=>re+1),Y.current=!1,F(!1),A(!1),j({}),!Q)return;const G=new CustomEvent("page-overlay",{detail:{itemId:Q}});window.dispatchEvent(G)}return()=>{P.current&&U.current&&(P.current.removeEventListener("animationend",U.current),U.current=null),A(!1)}},[e,Q]),a.useEffect(()=>{W.current!==null&&W.current!==L.type&&R(G=>G+1),W.current=L.type},[L.type]),a.useEffect(()=>{if(!e)return;const G=document.body.style.overflow,re=window.matchMedia("(max-width: 768px)").matches,pe=Es(ne.color);document.body.style.overflow="hidden",A(!1);const Se=Re=>{Re.target===P.current&&!Y.current&&Re.animationName&&(re&&!l&&pe>.9&&(document.body.style.backgroundColor=ne.color),A(!0),P.current&&z.current&&P.current.removeEventListener("animationend",z.current),z.current=null)};P.current&&(z.current=Se,P.current.addEventListener("animationend",Se));const Pe=Re=>{const H=Re.target;H&&(H.closest(`.${Ke.thumbsWrapper}`)||H.closest(`.${Ke.thumbsContainer}`))||L.type!=="slide"&&Re.preventDefault()};return document.addEventListener("touchmove",Pe,{passive:!1}),()=>{document.body.style.overflow=G,document.removeEventListener("touchmove",Pe),P.current&&z.current&&(P.current.removeEventListener("animationend",z.current),z.current=null),A(!1)}},[e,l,ne.color,L.type]),a.useEffect(()=>{if(!e)return;const G=re=>{var Se,Pe;if(Y.current){re.stopPropagation();return}if(te.current){te.current=!1;return}const pe=re.target;if(!(pe&&(pe.closest(`.${Ke.thumbsContainer}`)||pe.closest(`.${Ke.thumbItem}`)||pe.closest(`.${Ke.arrow}`)||pe.closest(`.${Ke.closeButton}`)||pe.closest(`.${Ke.caption}`)))){if(L.type==="slide"&&oe.type==="drag"&&((Pe=(Se=y.current)==null?void 0:Se.splide)!=null&&Pe.root)){const Re=y.current.splide.root;if(pe&&(Re.contains(pe)||Re===pe))return}if(re.touches.length===0&&re.changedTouches.length>0){const Re=n[b],H=(Re==null?void 0:Re.image.objectFit)==="cover",ge=re.changedTouches[0];let ie;if(H&&M.current){const _=Is(M.current);ie=ge.clientX>=_.left&&ge.clientX<=_.right&&ge.clientY>=_.top&&ge.clientY<=_.bottom}else{const _=M.current?mr(M.current):null;if(!_)return;ie=ge.clientX>=_.x&&ge.clientX<=_.x+_.width&&ge.clientY>=_.y&&ge.clientY<=_.y+_.height}if(!ie){re.stopPropagation(),Y.current=!0;const _=ee=>{ee.stopPropagation(),ee.preventDefault(),document.removeEventListener("click",_,!0)};document.addEventListener("click",_,!0),Z()}}}};return document.addEventListener("touchend",G,{passive:!0}),()=>{document.removeEventListener("touchend",G)}},[e,Z,b,n]);const ce=(L.type==="scale"||L.type==="fade")&&L.direction==="vert"&&oe.type==="drag";a.useEffect(()=>{var ee,Fe;if(!e||!ce||!((Fe=(ee=y.current)==null?void 0:ee.splide)!=null&&Fe.root))return;const G=y.current.splide.root,re=30,pe=(ae,N)=>{if(B.current){const qe=Math.abs(ae-B.current.x),je=Math.abs(N-B.current.y);(qe>0||je>0)&&(te.current=!0)}},Se=ae=>{B.current&&(ae.preventDefault(),pe(ae.clientX,ae.clientY))},Pe=ae=>{B.current&&ae.touches.length>0&&(ae.preventDefault(),pe(ae.touches[0].clientX,ae.touches[0].clientY))},Re=(ae,N)=>{if(!B.current||!y.current){B.current=null;return}const qe=Math.abs(ae-B.current.x),je=Math.abs(N-B.current.y);je>re&&je>qe&&y.current.go(N<B.current.y?"+1":"-1"),B.current=null},H=ae=>{B.current&&Re(ae.clientX,ae.clientY),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("pointermove",Se)},ge=ae=>{if(B.current){if(ae.changedTouches.length>0){const N=ae.changedTouches[0];Re(N.clientX,N.clientY)}document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),document.removeEventListener("touchmove",Pe)}},ie=ae=>{B.current={x:ae.clientX,y:ae.clientY},te.current=!1,document.addEventListener("pointermove",Se,{passive:!1}),document.addEventListener("pointerup",H),document.addEventListener("pointercancel",H)},_=ae=>{ae.touches.length>0&&(B.current={x:ae.touches[0].clientX,y:ae.touches[0].clientY},te.current=!1,document.addEventListener("touchmove",Pe,{passive:!1}),document.addEventListener("touchend",ge),document.addEventListener("touchcancel",ge))};return G.addEventListener("pointerdown",ie),G.addEventListener("touchstart",_),()=>{G.removeEventListener("pointerdown",ie),G.removeEventListener("touchstart",_),document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),document.removeEventListener("touchmove",Pe),document.removeEventListener("touchend",ge),document.removeEventListener("touchcancel",ge),B.current=null,te.current=!1}},[e,ce,C]);const ye={backgroundColor:ne.color,backdropFilter:`blur(${ne.blur}px)`,animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(s)?null:Yn.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:l?null:P,className:dt(Ke.background,K?le:fe,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{...ye,...V&&!l&&!K?{position:"absolute"}:{}}}),r.jsxs("div",{ref:l?P:null,className:dt(Ke.contentStyle,K?q:Ae,{[Ke.editor]:l},{[Ke.hidden]:!e}),style:{animationDuration:`${parseInt(se.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[r.jsx(Za,{onMove:G=>I(G.index),ref:y,className:Ke.lightboxSplide,options:{arrows:!1,speed:L.duration?parseInt(L.duration):500,direction:L.direction==="horiz"||L.type==="fade"||L.type==="scale"?"ltr":"ttb",pagination:!1,drag:oe.type==="drag"&&!ce,perPage:1,width:"100%",height:"100%",type:L.type==="fade"||L.type==="scale"?"fade":"loop",padding:0,rewind:oe.repeat!=="close",start:0},style:{"--splide-speed":L.duration},children:n.map((G,re)=>{const pe=Do(be.position,be.offset,l),Se=`${$.scalingValue(be.padding.top,l)} ${$.scalingValue(be.padding.right,l)} ${$.scalingValue(be.padding.bottom,l)} ${$.scalingValue(be.padding.left,l)}`,Pe=L.type==="scale"?(()=>{const{transform:Re,...H}=pe;return{...H,position:"absolute",padding:Se,boxSizing:"border-box","--position-transform":Re||"none"}})():{...pe,position:"absolute",padding:Se,boxSizing:"border-box"};return r.jsx(Ja,{children:r.jsx("div",{className:Ke.imgWrapper,onClick:Te,children:r.jsx("img",{ref:re===b?M:null,className:dt(Ke.imageStyle,{[Ke.contain]:G.image.objectFit==="contain",[Ke.cover]:G.image.objectFit==="cover",[Ke.scaleSlide]:L.type==="scale"}),src:G.image.url,alt:G.image.name??"",style:{...Pe,pointerEvents:G.image.objectFit==="contain"?"none":"auto"}})})},re)})},C),k.isActive&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(Ke.arrow,{[Ke.arrowVertical]:L.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x,l)}, ${$.scalingValue(k.offset.y*(L.direction==="horiz"?1:-1),l)}) scale(${k.scale}) rotate(${L.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=y.current)==null?void 0:G.go("-1")},"aria-label":"Previous",children:[k.arrowsImgUrl&&r.jsx(rn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:dt(Ke.arrowImg,Ke.mirror)}),!k.arrowsImgUrl&&r.jsx(Ms,{color:k.color,className:dt(Ke.arrowIcon,Ke.arrowImg,Ke.mirror)})]})}),r.jsx("div",{className:dt(Ke.arrow,Ke.nextArrow,{[Ke.arrowVertical]:L.direction==="vert"}),style:{color:k.color,"--arrow-hover-color":k.hover},children:r.jsxs("button",{className:Ke.arrowInner,style:{transform:`translate(${$.scalingValue(k.offset.x*(L.direction==="horiz"?-1:1),l)}, ${$.scalingValue(k.offset.y,l)}) scale(${k.scale}) rotate(${L.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var G;return(G=y.current)==null?void 0:G.go("+1")},"aria-label":"Next",children:[k.arrowsImgUrl&&r.jsx(rn,{url:k.arrowsImgUrl,fill:k.color,hoverFill:k.hover,className:Ke.arrowImg}),!k.arrowsImgUrl&&r.jsx(Ms,{color:k.color,className:dt(Ke.arrowIcon,Ke.arrowImg)})]})})]}),ne.closeIconUrl&&(()=>{const G=Do(ne.closeIconAlign,ne.closeIconOffset,l),re=`scale(${ne.closeIconScale})`,pe=G.transform?`${G.transform} ${re}`:re;return r.jsx("button",{className:Ke.closeButton,style:{...G,transform:pe},onClick:Z,"aria-label":"Close lightbox",children:r.jsx(rn,{url:ne.closeIconUrl,fill:ne.closeIconColor??"#000000",hoverFill:ne.closeIconHover??"#cccccc"})})})(),X&&X.isActive&&i.imageCaption&&(($e=n[b])==null?void 0:$e.imageCaption)&&r.jsx("div",{className:Ke.caption,style:{...Do(X.alignment,X.offset,l),fontFamily:Er(u.fontFamily),fontWeight:u.fontWeight,fontStyle:u.fontStyle,width:c.sizing==="auto"?"max-content":$.scalingValue(c.width,l),letterSpacing:$.scalingValue(p,l),wordSpacing:$.scalingValue(x,l),textAlign:v,fontSize:$.scalingValue(g.fontSize,l),lineHeight:$.scalingValue(g.lineHeight,l),textTransform:h.textTransform??"none",textDecoration:h.textDecoration??"none",fontVariant:h.fontVariant??"normal",color:m},onClick:G=>G.stopPropagation(),children:r.jsx("div",{"data-styles":"imageCaption",className:Ke.captionTextInner,style:{"--link-color":X.linkColor,"--link-hover-color":X.linkHoverColor},children:r.jsx(yi,{content:n[b].imageCaption})})}),ue.isActive&&(()=>{const[G,re]=ue.position.split("-"),pe=L.direction==="horiz"?`${G}-left`:ue.position,Se=Do(pe,ue.offset,l),Pe=()=>{if(L.direction==="horiz"){if(re==="left")return"flex-start";if(re==="center")return"center";if(re==="right")return"flex-end"}else{if(G==="top")return"flex-start";if(G==="middle")return"center";if(G==="bottom")return"flex-end"}return"flex-start"};return r.jsx("div",{ref:S,className:Ke.thumbsWrapper,onClick:Re=>We(Re),style:{position:l?"absolute":"fixed",...Se,...L.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:r.jsx("div",{className:dt(Ke.thumbsContainer,{[Ke.thumbsContainerVertical]:L.direction==="vert",[Ke.thumbsAlignStart]:ue.align==="start",[Ke.thumbsAlignCenter]:ue.align==="center",[Ke.thumbsAlignEnd]:ue.align==="end"}),style:{gap:$.scalingValue(ue.grid.gap,l),justifyContent:E?"flex-start":Pe()},children:n.map((Re,H)=>{const ge=H===b,ie=T[H],ee=ue.grid.size*(ge?ue.activeState.scale:1),Fe=()=>{if(ue.fit!=="fit")return{};if(!ie)return L.direction==="horiz"?{height:$.scalingValue(ee,l)}:{width:$.scalingValue(ee,l)};const ae=ie.width/ie.height;if(L.direction==="horiz"){const N=ee,qe=N*ae;return{width:$.scalingValue(qe,l),height:$.scalingValue(N,l)}}else{const N=ee,qe=N/ae;return{width:$.scalingValue(N,l),height:$.scalingValue(qe,l)}}};return r.jsx("button",{className:Ke.thumbItem,style:{...L.direction==="horiz"&&ue.fit!=="fit"?{height:$.scalingValue(ee,l)}:{},...L.direction==="vert"&&ue.fit!=="fit"?{width:$.scalingValue(ee,l)}:{},...ue.fit==="cover"?{width:$.scalingValue(ee,l),height:$.scalingValue(ee,l)}:{},...Fe(),transition:ge?"all 0.25s ease-out":"none",opacity:ge?ue.activeState.opacity/100:ue.opacity/100,"--thumb-hover":ue.activeState.opacity/100},onClick:ae=>{var N;ae.stopPropagation(),I(H),(N=y.current)==null||N.go(H)},onMouseEnter:()=>{var ae;ue.triggers==="hov"&&((ae=y.current)==null||ae.go(H))},children:r.jsx("img",{src:Re.image.url,alt:Re.image.name??"",onLoad:ae=>{const N=ae.currentTarget;N.naturalWidth&&N.naturalHeight&&j(qe=>({...qe,[H]:{width:N.naturalWidth,height:N.naturalHeight}}))},style:{objectFit:ue.fit==="cover"?"cover":"contain",...ue.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...ue.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Re.image.name}-${H}`)})})})})()]})]}),document.getElementById(s))};function Ms({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 nm={element:em,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 jo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function im(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 om({settings:e,isEditor:t,isEditMode:n,isPreviewMode:i,metadata:o,activeEvent:s}){const l=!!n,d=i&&t||!t,{prefix:c}=$.useScopedStyles(),{type:u="A",fieldsToShow:p=2,fields:v=[],buttonLabel:x,gap:g,fieldsGap:h,buttonCorners:m,buttonStroke:b,buttonPadding:I,isButtonFullWidth:C,inputCorners:R,inputStroke:K,inputPadding:F,inputColor:V,inputTextColor:A,inputBorderColor:T,placeholderColor:j,buttonColor:y,buttonTextColor:W,buttonBorderColor:M,labelTextColor:Y,successColor:P,errorColor:U,fontFamily:z,inputFontSettings:B,inputFontSize:te,inputLineHeight:S,inputLetterSpacing:E,inputWordSpacing:D,inputTextAppearance:se,buttonFontSettings:oe,buttonFontSize:L,buttonLineHeight:ue,buttonLetterSpacing:k,buttonWordSpacing:ne,buttonTextAppearance:X,labelFontSettings:be,labelFontSize:Ae,labelLineHeight:fe,labelLetterSpacing:le,labelWordSpacing:q,labelTextAppearance:Q,statusFontSettings:Z,statusFontSize:Ne,statusLineHeight:Te,statusLetterSpacing:We,statusWordSpacing:ce,statusTextAppearance:ye,successMessage:$e,errorMessage:G,stateOverrides:re}=e,pe=u==="B",Se=v.slice(0,Math.min(p,v.length)),Pe={fontSettings:{fontFamily:z,fontWeight:(B==null?void 0:B.fontWeight)??400,fontStyle:(B==null?void 0:B.fontStyle)??"normal"},fontSize:te??.01,lineHeight:S,letterSpacing:E??0,wordSpacing:D??0,textAppearance:se,color:A},Re=on(Kt(Pe,t)),H=$.scalingValue(K??0,t),ge=$.scalingValue((S??te??.01)+((F==null?void 0:F.top)??0)+((F==null?void 0:F.bottom)??0)+(u==="C"?K??0:(K??0)*2),t),ie={...Re,borderStyle:"solid",borderRadius:u==="C"?0:$.scalingValue(R??0,t),...u==="C"?{borderTopWidth:0,borderRightWidth:0,borderBottomWidth:H,borderLeftWidth:0}:{borderWidth:H},paddingTop:$.scalingValue((F==null?void 0:F.top)??0,t),paddingRight:$.scalingValue((F==null?void 0:F.right)??0,t),paddingBottom:$.scalingValue((F==null?void 0:F.bottom)??0,t),paddingLeft:$.scalingValue((F==null?void 0:F.left)??0,t),height:ge,minHeight:ge},_={fontSettings:{fontFamily:z,fontWeight:(oe==null?void 0:oe.fontWeight)??400,fontStyle:(oe==null?void 0:oe.fontStyle)??"normal"},fontSize:L??.01,lineHeight:ue,letterSpacing:k??0,wordSpacing:ne??0,textAppearance:X,color:W},ee=on(Kt(_,t)),Fe=$.scalingValue(b??0,t),ae={fontSettings:{fontFamily:z,fontWeight:(be==null?void 0:be.fontWeight)??400,fontStyle:(be==null?void 0:be.fontStyle)??"normal"},fontSize:Ae??.01,lineHeight:fe,letterSpacing:le??0,wordSpacing:q??0,textAppearance:Q,color:Y},N=Kt(ae,t),qe={fontSettings:{fontFamily:z,fontWeight:(Z==null?void 0:Z.fontWeight)??400,fontStyle:(Z==null?void 0:Z.fontStyle)??"normal"},fontSize:Ne??.01,lineHeight:Te,letterSpacing:We??0,wordSpacing:ce??0,textAppearance:ye,color:P},je=on(Kt(qe,t)),st=$.buildColorVars(c,{inputColor:V,inputTextColor:A,inputBorderColor:T,placeholderColor:j!=null&&j.trim()?j:"#cccccc",buttonColor:y,buttonTextColor:W,buttonBorderColor:M,labelTextColor:Y,successColor:P,errorColor:U},rm,am,re),[et,pt]=a.useState(()=>Object.fromEntries(Se.map(ke=>[ke.name,""]))),[rt,Ve]=a.useState("idle"),[xe,me]=a.useState(null),he=s==="success"?"success":s==="error"?"error":rt,He=s==="error"?G:xe,ve=s==="filled",Ee=a.useMemo(()=>{if(!ve)return et;let ke=null;for(const Xe of Se)(et[Xe.name]??"").trim().length>0||(ke=ke??{...et},ke[Xe.name]="Filled");return ke??et},[et,ve,Se]),Me=he==="error"?$.getFormFieldValidationError(Se,Ee):null,Ze=`${s&&s!=="default"?`${c}-state-${s}`:""}`.trim(),Ue=o==null?void 0:o.submitUrl,lt=(ke,Xe)=>{pt(Oe=>({...Oe,[ke]:Xe}))},tt=async ke=>{if(ke.preventDefault(),!d)return;const Xe=Object.fromEntries(Se.map(ot=>{var ct;return[ot.name,((ct=et[ot.name])==null?void 0:ct.trim())??""]}).filter(([,ot])=>ot));if(!Ue){Ve("error"),me("No integrations were found for this form.");return}if(Object.keys(Xe).length===0)return;const Oe=$.getFormFieldValidationError(Se,et);if(Oe){Ve("error"),me(Oe);return}Ve("submitting"),me(null);try{const ot=await fetch(Ue,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Xe)});if(!ot.ok){const ct=await ot.text();throw new Error(ct||`Request failed: ${ot.status}`)}Ve("success"),pt(Object.fromEntries(Se.map(ct=>[ct.name,""])))}catch(ot){Ve("error"),me(ot instanceof Error?ot.message:"Something went wrong")}};return r.jsxs("div",{className:`${c}-wrapper ${c}-type-${u} ${Ze}`.trim(),style:st,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:im(c)}}),r.jsxs("form",{onSubmit:tt,className:`${c}-form`,children:[r.jsx("div",{className:`${c}-fields`,children:Se.map((ke,Xe)=>r.jsxs(a.Fragment,{children:[Xe>0&&r.jsx("div",{"data-controls":l?"fieldsGap":void 0,className:l?`${c}-control`:void 0,style:{height:$.scalingValue(h??0,t)}}),r.jsxs("div",{className:`${c}-field-group${pe?` ${c}-labeled`:""}`,children:[pe&&r.jsx("span",{className:`${c}-field-label`,style:N?{...N,lineHeight:N.fontSize}:void 0,children:ke.label||ke.name}),ke.type==="textarea"?r.jsx("textarea",{name:ke.name,autoComplete:"off",value:Ee[ke.name]??"",onChange:Oe=>lt(ke.name,Oe.target.value),placeholder:ke.placeholder,className:`${c}-input`,style:ie,rows:1,"data-filled":ve||(Ee[ke.name]??"").trim().length>0,"data-field-type":"textarea"}):r.jsx("input",{type:ke.type==="phone"?"tel":ke.type==="email"?"email":"text",name:ke.name,autoComplete:"off",value:Ee[ke.name]??"",onChange:Oe=>lt(ke.name,Oe.target.value),placeholder:ke.placeholder,required:ke.isRequired??ke.type==="email",className:`${c}-input`,style:ie,"data-filled":ve||(Ee[ke.name]??"").trim().length>0})]})]},Xe))}),r.jsx("div",{"data-controls":l?"gap":void 0,className:l?`${c}-control`:void 0,style:{height:$.scalingValue(g??0,t)}}),r.jsx("div",{className:`${c}-overlay-anchor`,children:r.jsx("button",{type:d?"submit":"button",className:`${c}-button`,style:{borderStyle:"solid",borderRadius:$.scalingValue(m??0,t),borderWidth:Fe,paddingTop:$.scalingValue((I==null?void 0:I.top)??0,t),paddingRight:$.scalingValue((I==null?void 0:I.right)??0,t),paddingBottom:$.scalingValue((I==null?void 0:I.bottom)??0,t),paddingLeft:$.scalingValue((I==null?void 0:I.left)??0,t),pointerEvents:d?"auto":void 0,...ee,...C?{width:"100%",textAlign:"center",whiteSpace:"normal"}:{}},children:r.jsx("span",{className:`${c}-overlay-anchor`,style:C?{display:"inline-block",maxWidth:"100%",whiteSpace:"normal",textAlign:"center"}:void 0,children:rt==="submitting"?"...":x})})})]}),he==="success"&&r.jsx("p",{className:`${c}-success`,style:{...je},children:$e}),he==="error"&&r.jsx("p",{className:`${c}-error`,style:{...je},role:"alert",children:Me??He??G})]})}const rm={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"},am=["hover","focus","filled","success","error"],sm=`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
|
-
`,cm=[{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"}],zo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},dm=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],um={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:{...zo.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:{...zo.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:{...zo.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:{...zo.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:cm,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:[...dm],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"]},pm={element:rm,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:um,sourceCode:lm,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function mm(e){return`
|
|
792
|
+
`,lm=[{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"}],zo={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},cm=["inputColor","inputTextColor","inputBorderColor","placeholderColor","buttonColor","buttonTextColor","buttonBorderColor","labelTextColor","successColor","errorColor"],dm={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:{...zo.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:{...zo.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:{...zo.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:{...zo.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:lm,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:[...cm],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"]},um={element:om,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:dm,sourceCode:sm,fontRelations:{inputFontSettings:"fontFamily",buttonFontSettings:"fontFamily",labelFontSettings:"fontFamily",statusFontSettings:"fontFamily"},assetsPaths:{content:[],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"fontFamily"}]}};function Bo(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function pm(e){return`
|
|
793
793
|
.${e}-wrapper {
|
|
794
794
|
display: flex;
|
|
795
795
|
flex-direction: column;
|
|
@@ -980,7 +980,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
980
980
|
font-size: ${Bo(14)};
|
|
981
981
|
color: var(--${e}-error-error-color, var(--${e}-error-color));
|
|
982
982
|
}
|
|
983
|
-
`}const
|
|
983
|
+
`}const mm=({settings:e,isEditor:t,isPreviewMode:n,metadata:i,activeEvent:o})=>{const{prefix:s}=$.useScopedStyles(),l=n&&t||!t,{fields:d=[{name:"email",type:"email",placeholder:"Your email"}],buttonIcon:c,buttonLabel:u,fieldsToShow:p=1,fontFamily:v,inputFontSettings:x,inputFontSize:g,inputLineHeight:h,inputLetterSpacing:m,inputWordSpacing:b,inputTextAppearance:I,buttonFontSettings:C,buttonFontSize:R,buttonLineHeight:K,buttonLetterSpacing:F,buttonWordSpacing:V,buttonTextAppearance:A,statusFontSettings:T,statusFontSize:j,statusLineHeight:y,statusLetterSpacing:W,statusWordSpacing:M,statusTextAppearance:Y,iconMaxWidth:P,minHeight:U,corners:z,stroke:B,stateOverrides:te,inputPadding:S,buttonPadding:E,successMessage:D="Thanks for subscribing!",errorMessage:se="Please, fill all required fields."}=e,oe=d.slice(0,Math.min(p,d.length)),[L,ue]=a.useState(()=>Object.fromEntries(oe.map(ae=>[ae.name,""]))),[k,ne]=a.useState("idle"),[X,be]=a.useState(null),Ae=o==="success"?"success":o==="error"?"error":k,fe=o==="error"?se:X,le=o==="filled",q=a.useMemo(()=>{if(!le)return L;let ae=null;for(const N of oe)(L[N.name]??"").trim().length>0||(ae=ae??{...L},ae[N.name]="Filled");return ae??L},[le,L,oe]),Q=Ae==="error"?$.getFormFieldValidationError(oe,q):null,Z=o&&o!=="default"?`${s}-state-${o}`:"",Ne=oe.some(ae=>(q[ae.name]??"").trim().length>0),Te=Z!==`${s}-state-filled`&&Ne?`${s}-state-filled`:"",We=`${Z} ${Te}`.trim(),ce=i==null?void 0:i.submitUrl,ye=u??"",$e=(c==null?void 0:c.icon)??"",G=(c==null?void 0:c.mode)==="On",re=ye||"Submit",pe={fontSettings:{fontFamily:v,fontWeight:(x==null?void 0:x.fontWeight)??400,fontStyle:(x==null?void 0:x.fontStyle)??"normal"},fontSize:g??.01,lineHeight:h,letterSpacing:m??0,wordSpacing:b??0,textAppearance:I,color:e.inputTextColor??"#111111"},Se={fontSettings:{fontFamily:v,fontWeight:(C==null?void 0:C.fontWeight)??400,fontStyle:(C==null?void 0:C.fontStyle)??"normal"},fontSize:R??.01,lineHeight:K,letterSpacing:F??0,wordSpacing:V??0,textAppearance:A,color:e.buttonTextColor??"#ffffff"},Pe={fontSettings:{fontFamily:v,fontWeight:(T==null?void 0:T.fontWeight)??400,fontStyle:(T==null?void 0:T.fontStyle)??"normal"},fontSize:j??.01,lineHeight:y,letterSpacing:W??0,wordSpacing:M??0,textAppearance:Y,color:e.successColor??"#22c55e"},Re=on(Kt(pe,t)),H=on(Kt(Se,t)),ge=on(Kt(Pe,t)),ie=$.buildColorVars(s,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(pe==null?void 0:pe.color)??"#111111",buttonTextColor:e.buttonTextColor??(Se==null?void 0:Se.color)??"#ffffff"},gm,hm,te),_={borderRadius:$.scalingValue(z,t),borderWidth:$.scalingValue(B,t),borderStyle:"solid"},ee={borderLeftWidth:$.scalingValue(B,t)},Fe=async ae=>{if(ae.preventDefault(),!l)return;const N=Object.fromEntries(oe.map(je=>{var st;return[je.name,((st=L[je.name])==null?void 0:st.trim())??""]}).filter(([,je])=>je));if(!ce){ne("error"),be("No integrations were found for this form.");return}if(Object.keys(N).length===0)return;const qe=$.getFormFieldValidationError(oe,L);if(qe){ne("error"),be(qe);return}ne("submitting"),be(null);try{const je=await fetch(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!je.ok){const st=await je.text();throw new Error(st||`Request failed: ${je.status}`)}ne("success"),ue(Object.fromEntries(oe.map(st=>[st.name,""])))}catch(je){ne("error"),be(je instanceof Error?je.message:"Something went wrong")}};return r.jsxs("div",{className:`${s}-wrapper ${We}`.trim(),style:ie,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:pm(s)}}),r.jsxs("form",{onSubmit:Fe,className:`${s}-form`,style:{..._,height:$.scalingValue(U,t),minHeight:$.scalingValue(U,t)},children:[r.jsx("div",{className:`${s}-inputWrap ${s}-overlayAnchor`,style:{flex:1,minWidth:0},children:oe.map(ae=>r.jsx("input",{type:ae.type==="email"?"email":ae.type==="phone"?"tel":"text",name:ae.name,autoComplete:"off",value:q[ae.name]??"",onChange:N=>ue(qe=>({...qe,[ae.name]:N.target.value})),placeholder:ae.placeholder,required:ae.isRequired??ae.type==="email",className:`${s}-input`,style:{...Re,paddingRight:$.scalingValue(S.right,t),paddingLeft:$.scalingValue(S.left,t),paddingTop:$.scalingValue(S.top,t),paddingBottom:$.scalingValue(S.bottom,t)}},ae.name))}),r.jsx("div",{className:`${s}-overlayAnchor`,children:r.jsx("button",{type:l?"submit":"button",className:`${s}-submitBtn`,"aria-label":re,style:{...H,...ee,paddingRight:$.scalingValue(E.right,t),paddingLeft:$.scalingValue(E.left,t),paddingTop:$.scalingValue(E.top,t),paddingBottom:$.scalingValue(E.bottom,t),pointerEvents:l?"auto":void 0},children:k==="submitting"?"...":G?$e&&r.jsx(rn,{url:$e,className:`${s}-submitBtnIcon`,style:{maxWidth:$.scalingValue(P??0,t)},fill:`var(--${s}-button-text-color)`,hoverFill:`var(--${s}-button-text-color)`}):ye})})]}),Ae==="success"&&r.jsx("p",{className:`${s}-success`,style:{...ge},children:D}),Ae==="error"&&r.jsx("p",{className:`${s}-error`,style:{...ge},role:"alert",children:Q??fe??se})]})},gm={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"},hm=["hover","focus","filled","success","error"],fm=`import React, { useMemo, useState } from 'react';
|
|
984
984
|
import { CommonComponentProps } from '../props';
|
|
985
985
|
import { buildColorVars, getFormFieldValidationError, scalingValue, useScopedStyles } from '../utils/index';
|
|
986
986
|
import { omitTextColors, textStylesToCss, type TextStyles } from '../utils/textStylesToCss';
|
|
@@ -1557,7 +1557,7 @@ const COLOR_VAR_MAP: Record<OnelinerColorKeys, string> = {
|
|
|
1557
1557
|
};
|
|
1558
1558
|
|
|
1559
1559
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
1560
|
-
`,vm="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>'),xm=[{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."}],Vr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},bm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],wm={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:{...Vr.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:{...Vr.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:{...Vr.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:xm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:vm},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:[...bm],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"]},Sm={element:gm,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:wm,sourceCode:ym};function $m(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1560
|
+
`,ym="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>'),vm=[{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."}],Vr={fontSettings:{type:"object",display:{type:"font-settings-weight",visible:!0},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},xm=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],bm={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:{...Vr.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:{...Vr.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:{...Vr.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:vm,fieldsToShow:1,buttonLabel:"Subscribe",buttonIcon:{mode:"Off",icon:ym},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:[...xm],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"]},wm={element:mm,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:bm,sourceCode:fm};function Sm(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
1561
1561
|
.${e}-marquee-wrapper {
|
|
1562
1562
|
overflow: hidden;
|
|
1563
1563
|
width: 100%;
|
|
@@ -1689,7 +1689,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
1689
1689
|
.${e}-image-hover-grayscale:hover video {
|
|
1690
1690
|
filter: grayscale(100%);
|
|
1691
1691
|
}
|
|
1692
|
-
`}const
|
|
1692
|
+
`}const $m=30,Cm=20,Gr=3,Tm=12,Lm=32,Rm=3,Im=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")},Em=(e,t)=>Array.from({length:t},()=>e).flat(),Mm=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},yc=e=>e.reduce((t,n)=>t+(n.offsetWidth||n.getBoundingClientRect().width),0),Ps=(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),s=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=yc(d);return c<=0?0:c+s*Math.max(0,t-1)},Pm=e=>{const t=e.getBoundingClientRect().width;if(t>0)return t;const n=e.offsetWidth;if(n>0)return n;const i=yc(Array.from(e.children));if(i<=0)return 0;const o=getComputedStyle(e),s=Number.parseFloat(o.columnGap||o.gap||"0")||0,l=Number.parseFloat(o.paddingRight)||0;return i+s*Math.max(0,e.children.length-1)+l},km=(e,t)=>{const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.right>n.left&&i.left<n.right},Am=(e,t)=>{const n=e.querySelectorAll(`[data-marquee-item-index="${t}"]`);return Array.from(n).some(i=>km(i,e))},Fm=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??"")},Wm=e=>e?e instanceof HTMLVideoElement?e.readyState>=2:e.complete:!1,_m=({item:e,prefix:t,imageFit:n,imageMaxWidth:i,imageMaxHeight:o,cornerRadius:s,imageHoverClass:l,isFirstSet:d,scaled:c,onFirstSetImageDone:u})=>{var M,Y,P,U;const p=a.useRef(null),v=!!((M=e.image)!=null&&M.url&&Fm(e.image));a.useLayoutEffect(()=>{d&&Wm(p.current)&&(u==null||u())},[d,(Y=e.image)==null?void 0:Y.url,u]);const x=n.display==="cover",g=n.ratioValue??"1:1",h=n.reversed??!1,[m,b]=g.split(":").map(Number),R=(h?b:m)/(h?m:b),K=i/R,F=K>o?o:K,V=K>o?o*R:i,A=c(V),T=c(F),j={borderRadius:c(s)},y=x?{pointerEvents:"auto",display:"block",width:"100%",height:"100%",objectFit:"cover",...j}:{pointerEvents:"auto",display:"block",width:"auto",height:"auto",maxWidth:c(i),maxHeight:c(o),objectFit:"contain",...j},W=((P=e.image)==null?void 0:P.url)&&(v?r.jsx("video",{ref:z=>{p.current=z},src:e.image.url,style:y,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto",onLoadedData:d?u:void 0,onError:d?u:void 0}):r.jsx("img",{ref:z=>{p.current=z},src:e.image.url,alt:((U=e.image)==null?void 0:U.name)??"",style:y,onLoad:d?u:void 0,onError:d?u:void 0}));return r.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"start",...x?{width:A}:{width:"max-content",maxWidth:c(i),minWidth:0}},children:r.jsx("div",{className:l,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flexShrink:0,...x?{width:A,height:T,overflow:"hidden",...j}:{width:"max-content",maxWidth:c(i),height:c(o)}},children:W&&e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:dt(`${t}-marquee-link`,!x&&`${t}-marquee-link-contain`),children:W}):W})})},Hm=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,u=a.useMemo(()=>Sm(s,c),[s,c]),{speed:p,direction:v,pauseOnHover:x,gap:g,imageMaxWidth:h,imageMaxHeight:m,hoverEffect:b,cornerRadius:I=0}=e,C=a.useMemo(()=>Mm(e.imageFit),[e.imageFit]),R=(t==null?void 0:t.length)??0,K=!!o,F=!n||!!i,V=F&&b!=="off"&&b!=="randomize"?`${s}-image-hover-${b}`:void 0,A=n?!!i:!0,j=((t==null?void 0:t.length)??0)>0&&(A||!!n),y=Math.max(0,p)*$m,W=Te=>$.scalingValue(Te,n??!1),M=a.useRef(null),Y=a.useRef(null),P=a.useRef(null),[U,z]=a.useState(0),B=A&&x==="on",[te,S]=a.useState(!1),[E,D]=a.useState({}),se=a.useRef(E);se.current=E;const oe=a.useRef(null),L=a.useRef(0),ue=a.useRef(null),k=a.useMemo(()=>(t??[]).map(Te=>{var We;return((We=Te.image)==null?void 0:We.url)??""}).join("\0"),[t]),[ne,X]=a.useState(Gr),be=a.useMemo(()=>{const Te=t??[];return Te.length===0||!(A||!!n)?Te:Em(Te,ne)},[t,A,ne,n]),Ae=a.useMemo(()=>(t??[]).filter(Te=>{var We;return!!((We=Te.image)!=null&&We.url)}).length,[t]),fe=j?Rm:1;a.useLayoutEffect(()=>{L.current=0,D({}),oe.current=null,X(Gr),d(0)},[k]),a.useEffect(()=>{if(!F||b!=="randomize")return;const Te=M.current;if(!Te)return;const We=G=>{D(re=>{const pe=Array.from(G).filter(Pe=>Pe in re&&!Am(Te,Pe));if(pe.length===0)return re;const Se={...re};return pe.forEach(Pe=>{delete Se[Pe]}),Se})},ce=new IntersectionObserver(G=>{const re=new Set;for(const pe of G){const Se=pe.target.dataset.marqueeItemIndex,Pe=Se!==void 0?Number(Se):NaN;Number.isNaN(Pe)||re.add(Pe)}re.size>0&&We(re)},{root:Te,threshold:0});Object.keys(E).forEach(G=>{const re=Number(G);Te.querySelectorAll(`[data-marquee-item-index="${re}"]`).forEach(pe=>ce.observe(pe))});const ye={current:0},$e=()=>{const G=Object.keys(se.current);G.length!==0&&(We(G.map(Number)),ye.current=requestAnimationFrame($e))};return Object.keys(se.current).length>0&&(ye.current=requestAnimationFrame($e)),()=>{cancelAnimationFrame(ye.current),ce.disconnect()}},[b,E,F]),a.useLayoutEffect(()=>{if(!j)return;const Te=M.current,We=P.current;if(!Te||!We)return;const ce={current:0},ye=()=>{const re=Te.getBoundingClientRect().width||Te.offsetWidth,pe=Pm(We),Se=oe.current,Pe=typeof Se=="number"&&Math.abs(Se-pe)<=.25;oe.current=pe;let Re=ne,H=0;if((A||n)&&R>0&&re>0){const _=Ps(We,R);if(_>=Lm){H=_;const ee=Math.min(Tm,Math.max(Gr,Math.ceil(re/_)+1));Re=ee,ee!==ne&&X(ee)}}const ie=Re!==ne&&H>0?H*Re:pe>0?pe:H>0?H*Re:(()=>{const _=Ps(We,R);return _>0?_*Re:0})();ie>0?d(_=>_<=0?ie:!Pe||Math.round(_)===Math.round(ie)?_:ie):!Pe&&l<=0&&(cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ye))},$e=()=>{cancelAnimationFrame(ce.current),ce.current=requestAnimationFrame(ye)};ue.current=$e,$e();const G=new ResizeObserver($e);return G.observe(Te),G.observe(We),()=>{ue.current=null,cancelAnimationFrame(ce.current),G.disconnect()}},[A,j,l,k,ne,R,n]),a.useLayoutEffect(()=>{if(!j||c<=0)return;const Te=Y.current;Te&&Im(Te)},[j,c,v,y]),a.useLayoutEffect(()=>{if(!j||l<=0){z(0);return}const Te=Y.current,We=P.current;if(!Te||!We)return;const ce=()=>{const $e=Te.offsetHeight||Te.getBoundingClientRect().height,G=Array.from(We.children).reduce((pe,Se)=>Math.max(pe,Se.offsetHeight||Se.getBoundingClientRect().height),0),re=$e>0?$e:G;z(re>0?re:0)};ce();const ye=new ResizeObserver(ce);return ye.observe(Te),ye.observe(We),()=>ye.disconnect()},[j,fe,be,n,g,h,m,l,C,E]),a.useLayoutEffect(()=>{if(!n||!K||!j||typeof window>"u")return;const Te=requestAnimationFrame(()=>{window.dispatchEvent(new Event("scroll"))});return()=>cancelAnimationFrame(Te)},[n,K,j,v,l,U,g,be]);const le=()=>{B&&S(!0)},q=()=>{B&&S(!1)},Q=a.useCallback(()=>{var Te;L.current=Math.min(Ae,L.current+1),(Te=ue.current)==null||Te.call(ue)},[Ae]),Z=a.useCallback((Te,We)=>{D(ce=>{const ye=ce[Te]??We,$e=(t??[]).filter(re=>re!==ye);if($e.length===0)return ce;const G=$e[Math.floor(Math.random()*$e.length)];return{...ce,[Te]:G}})},[t]),Ne=(Te,We,ce,ye)=>{const $e=F&&b==="randomize"&&C.display==="cover"?E[ce]??Te:Te,G=`max(${W(g)}, ${Cm}px)`,re=`calc(-0.5 * (${G} + ${W(g)}))`;return r.jsxs("div",{className:`${s}-marquee-card`,"data-marquee-item-index":ce,onMouseEnter:F&&b==="randomize"&&C.display==="cover"?()=>Z(ce,Te):void 0,children:[r.jsx(_m,{item:$e,prefix:s,imageFit:C,imageMaxWidth:h,imageMaxHeight:m,cornerRadius:I,imageHoverClass:V,isEditor:n,isFirstSet:ye,scaled:W,onFirstSetImageDone:Q}),K&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",className:`${s}-gap-control`,style:{position:"absolute",top:0,right:re,width:G,height:"100%"}})]},`${We}-${ce}`)};if(j){const Te=A?B&&te?"paused":"running":"paused",We=c>0&&y>0?c/y*1e3:0,ce=`${Math.max(0,We)/1e3}s`;return r.jsxs("div",{ref:M,className:dt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Marquee",style:U>0?{height:U}:void 0,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{ref:Y,className:`${s}-marquee-track`,"data-direction":v,onMouseEnter:le,onMouseLeave:q,style:{WebkitAnimationDuration:ce,animationDuration:ce,WebkitAnimationPlayState:Te,animationPlayState:Te},children:Array.from({length:fe},(ye,$e)=>r.jsx("div",{ref:$e===0?P:void 0,className:dt(`${s}-marquee-row`,`${s}-marquee-set`),style:{gap:W(g),paddingRight:W(g)},"aria-hidden":$e>0,children:be.map((G,re)=>Ne(G,$e,re,$e===0&&re<R))},`set-${$e}`))})]})}return r.jsxs("div",{ref:M,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),r.jsx("div",{className:dt(`${s}-marquee-row`,`${s}-marquee-static`),style:{gap:W(g),transform:"none"},"aria-label":"Marquee",children:t==null?void 0:t.map((Te,We)=>Ne(Te,0,We))},"marquee-static")]})},Nm=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
1693
1693
|
import cn from 'classnames';
|
|
1694
1694
|
import { CommonComponentProps } from '../props';
|
|
1695
1695
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2472,7 +2472,7 @@ type MarqueeProps = {
|
|
|
2472
2472
|
isPreviewMode?: boolean;
|
|
2473
2473
|
isEditMode?: boolean;
|
|
2474
2474
|
} & CommonComponentProps;
|
|
2475
|
-
`,
|
|
2475
|
+
`,Om={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:""}]}},Dm={element:Hm,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:Om,sourceCode:Nm,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}};function jm(e,t,n){const i=t>0?`${t}px`:"0px",o=n?`
|
|
2476
2476
|
.${e}-item-image-wrap {
|
|
2477
2477
|
display: flex;
|
|
2478
2478
|
flex: 0 0 auto;
|
|
@@ -2538,7 +2538,6 @@ type MarqueeProps = {
|
|
|
2538
2538
|
display: flex;
|
|
2539
2539
|
flex-direction: row;
|
|
2540
2540
|
width: max-content;
|
|
2541
|
-
will-change: transform;
|
|
2542
2541
|
backface-visibility: hidden;
|
|
2543
2542
|
-webkit-backface-visibility: hidden;
|
|
2544
2543
|
flex-wrap: nowrap;
|
|
@@ -2602,7 +2601,7 @@ ${o}
|
|
|
2602
2601
|
left: -9999px;
|
|
2603
2602
|
top: 0;
|
|
2604
2603
|
}
|
|
2605
|
-
`}const Bm=30,qr=3,Vm=12,Gm=3,Ca=.72,qm=100,Um=10,Km=e=>Math.max(0,e)/qm,Xm=e=>Math.max(0,e)/Um,Ym=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")},Zm=(e,t)=>{const n=[];for(let i=0;i<t;i++)n.push(...e);return n};let Si;const Jm=()=>Si!==void 0?Si:typeof document>"u"?(Si=null,Si):(Si=document.createElement("canvas").getContext("2d"),Si),Qm=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},ks=e=>{e.style.transform=""},eg=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},tg=(e,t)=>{let n=e.offsetWidth/2,i=e;for(;i&&i!==t;){n+=i.offsetLeft,n+=eg(getComputedStyle(i).transform);const o=i.offsetParent;if(!o||o===i)break;i=o}return n},ng=96,ig=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),s=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;for(let u=0;u<n;u+=1){const p=u*c,v=p+c;o[u+1]=v,s[u+1]=s[u]+(d(p)+d(v))*.5*c}return{wavelength:i,periodArc:s[n],x:o,s}},og=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),s=i-o*e.periodArc,{s:l,x:d}=e;let c=0,u=l.length-1;for(;u-c>1;){const y=c+u>>1;l[y]<=s?c=y:u=y}const p=l[u]-l[c],v=p>0?(s-l[c])/p:0;return n*(o*e.wavelength+d[c]+(d[u]-d[c])*v)},rg=(e,t,n,i)=>{const o=Math.max(0,n),s=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(s*p),d=p=>t*s*Math.cos(s*p),c=Math.max(4,Math.ceil(o*4)),u=[`M0 ${l(0).toFixed(2)}`];for(let p=0;p<c;p++){const v=p/c*e,y=(p+1)/c*e,g=y-v,h=l(v),m=l(y),b=v+g/3,E=h+d(v)*g/3,L=y-g/3,C=m-d(y)*g/3;u.push(`C${b.toFixed(2)} ${E.toFixed(2)} ${L.toFixed(2)} ${C.toFixed(2)} ${y.toFixed(2)} ${m.toFixed(2)}`)}return u.join(" ")},ag=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:s,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ca}em`},u=((g=e.image)==null?void 0:g.url)&&r.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?r.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?r.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,m)=>r.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:r.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},m))}):r.jsx("span",{className:`${t}-text`,style:d,children:e.text}),y=r.jsxs(r.Fragment,{children:[p,v]});return r.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:s},children:e.link?r.jsx("a",{href:e.link,target:"_self",rel:"noopener noreferrer",className:`${t}-item-link`,style:{gap:s},children:y}):y})},sg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),[l,d]=a.useState(0),c=l>0?Math.round(l):0,{speed:u,direction:p,pauseOnHover:v,gap:y,layoutType:g,curveAmplitude:h,curveFrequency:m,textFontFamily:b,textFontSettings:E,textFontSize:L,textLineHeight:C,textLetterSpacing:K,textWordSpacing:W,textTextAppearance:B,textColor:A,backgroundColor:T,ribbonWidth:j}=e,w=j??C,P=g==="curve",M=Km(h),X=Xm(m),k=a.useMemo(()=>zm(s,c,P),[s,c,P]),q=a.useMemo(()=>Kt({fontSettings:{fontFamily:b,fontWeight:E.fontWeight,fontStyle:E.fontStyle},letterSpacing:K,wordSpacing:W,fontSize:L,lineHeight:C,textAppearance:B,color:A},n),[b,E,K,W,L,C,B,A,n]),V=ke=>$.scalingValue(ke,n??!1),G=(t==null?void 0:t.length)??0,ie=G>0,S=n?!!i:!0,R=ie&&(S||!!n),O=Math.max(0,u)*Bm,ae=S&&v==="on",[se,I]=a.useState(!1),de=a.useRef(null),F=a.useRef(null),te=a.useRef(null),Z=a.useRef(null),ve=a.useRef(null),[Ae,he]=a.useState(0),[pe,U]=a.useState(0),[ee,Y]=a.useState(0),[Oe,$e]=a.useState(0),[He,ue]=a.useState(0),me=a.useMemo(()=>(t??[]).map(ke=>{var Ie;return`${ke.text}${((Ie=ke.image)==null?void 0:Ie.url)??""}`}).join("\0"),[t]),[be,z]=a.useState(qr),le=a.useMemo(()=>{const ke=t??[];return ke.length===0||!(S||n)?ke:Zm(ke,be)},[t,S,be,n]),ye=R?Gm:1;a.useLayoutEffect(()=>{z(qr),d(0)},[me]),a.useLayoutEffect(()=>{var Ee;const ke=ve.current;if(!ke)return;const Ie=()=>{const De=getComputedStyle(ke),fe=parseFloat(De.fontSize)||0;if(fe<=0)return;const Me=Jm();if(!Me){he(fe*Ca),U(0);return}Me.font=`${De.fontStyle} ${De.fontWeight} ${fe}px ${De.fontFamily}`;const _e=Me.measureText("H"),Ke=_e.actualBoundingBoxAscent>0?_e.actualBoundingBoxAscent:fe*Ca,it=Math.max(0,_e.actualBoundingBoxDescent||0),Ye=_e.fontBoundingBoxAscent||0,xt=_e.fontBoundingBoxDescent||0;he(We=>Math.abs(We-Ke)>.5?Ke:We);const ot=Ye>0||xt>0?(xt-it-(Ye-Ke))/2:0;U(We=>Math.abs(We-ot)>.25?ot:We)};Ie();const oe=typeof document<"u"?document.fonts:void 0;(Ee=oe==null?void 0:oe.ready)==null||Ee.then(Ie).catch(()=>{});const Te=new ResizeObserver(Ie);return Te.observe(ke),()=>Te.disconnect()},[q.fontFamily,q.fontWeight,q.fontStyle,q.fontSize,q.lineHeight]),a.useLayoutEffect(()=>{if(!R)return;const ke=de.current,Ie=te.current;if(!ke||!Ie)return;let oe=0;const Te=()=>{const De=ke.getBoundingClientRect().width||ke.offsetWidth,fe=Ie.getBoundingClientRect().width||Ie.offsetWidth;if(G>0&&De>0&&fe>0){const Me=fe/be;if(Me>0){const _e=Math.min(Vm,Math.max(qr,Math.ceil(De/Me)+1));if(_e!==be){z(_e);return}}}fe>0&&d(fe)};oe=requestAnimationFrame(Te);const Ee=new ResizeObserver(()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(Te)});return Ee.observe(ke),Ee.observe(Ie),()=>{cancelAnimationFrame(oe),Ee.disconnect()}},[R,me,be,G,Ae]),a.useLayoutEffect(()=>{const ke=Z.current;if(!ke)return;let Ie=0;const oe=()=>{const Ee=ke.offsetHeight;Ee>0&&ue(De=>Math.abs(De-Ee)>.5?Ee:De)};Ie=requestAnimationFrame(oe);const Te=new ResizeObserver(()=>{cancelAnimationFrame(Ie),Ie=requestAnimationFrame(oe)});return Te.observe(ke),()=>{cancelAnimationFrame(Ie),Te.disconnect()}},[w,n]),a.useLayoutEffect(()=>{if(!P){Y(0),$e(0);return}const ke=de.current,Ie=te.current;if(!ke||!Ie)return;let oe=0;const Te=()=>{const De=ke.offsetWidth,fe=Ie.offsetHeight;De>0&&$e(Me=>Math.abs(Me-De)>.5?De:Me),fe>0&&Y(Me=>Math.abs(Me-fe)>.5?fe:Me)};oe=requestAnimationFrame(Te);const Ee=new ResizeObserver(()=>{cancelAnimationFrame(oe),oe=requestAnimationFrame(Te)});return Ee.observe(ke),Ee.observe(Ie),()=>{cancelAnimationFrame(oe),Ee.disconnect()}},[P,me,Ae,C,L,R]),a.useLayoutEffect(()=>{if(!R||c<=0)return;const ke=F.current;ke&&Ym(ke)},[R,c,p,O]),a.useLayoutEffect(()=>{if(!P||!ie)return;const ke=de.current;if(!ke)return;let Ie=0,oe=!1,Te=null,Ee="";const De=()=>{if(oe)return;const fe=ke.querySelector(`.${s}-marquee-wrapper`)??ke,Me=fe.offsetWidth||1,_e=Me*M,Ke=2*Math.PI*X/Me,it=`${Me}|${_e}|${Ke}`;it!==Ee&&(Ee=it,Te=ig(_e,Ke,ng));const Ye=ke.getBoundingClientRect(),xt=Ye.left,ot=Ye.right,We=Te&&Te.wavelength>0?Math.max(0,(Te.periodArc/Te.wavelength-1)*Me):0;ke.querySelectorAll("[data-marquee-text-item]").forEach(Ve=>{const st=Ve.getBoundingClientRect();if(st.right<xt||st.left>ot+We)return;Ve.querySelectorAll("[data-marquee-wave-node]").forEach(ct=>{const Et=ct.firstElementChild;if(!Et)return;const zt=tg(ct,fe),Xt=Te?og(Te,zt):zt,yt=Ke*Xt,bt=_e*Math.sin(yt),Nt=_e*Ke*Math.cos(yt),At=Math.atan(Nt)*(180/Math.PI);Qm(Et,Xt-zt,bt,At)})}),Ie=requestAnimationFrame(De)};return Ie=requestAnimationFrame(De),()=>{oe=!0,cancelAnimationFrame(Ie),ke.querySelectorAll("[data-marquee-wave-node]").forEach(fe=>{const Me=fe.firstElementChild;Me&&ks(Me)}),ke.querySelectorAll("[data-marquee-text-item]").forEach(ks)}},[P,M,X,ie,l,me,s]);const we=()=>{ae&&I(!0)},Pe=()=>{ae&&I(!1)},Ce=P?M*100:0,_=V(w),ge={minHeight:_,...P?{paddingTop:`${Ce}%`,paddingBottom:`${Ce}%`}:{}},ne={height:_,...P?{visibility:"hidden"}:{backgroundColor:T}},H={gap:V(y),minHeight:_},Q=Oe*M,Fe=He>0?He:ee,re=Math.max(ee,Fe),N=P&&Oe>0&&re>0?rg(Oe,Q,X,Q+re/2):"",qe=Q*2+re,Be=N?r.jsx("svg",{className:`${s}-curve-bg`,viewBox:`0 0 ${Oe} ${qe}`,preserveAspectRatio:"none","aria-hidden":!0,children:r.jsx("path",{d:N,fill:"none",stroke:T,strokeWidth:Fe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,at=r.jsx("div",{ref:Z,className:`${s}-ribbon`,style:ne,"aria-hidden":!0}),et=(ke,Ie,oe)=>r.jsx(ag,{item:ke,prefix:s,textCss:q,capHeightPx:Ae,opticalOffsetY:pe,imageGapPx:V(y),isCurve:P},`${Ie}-${oe}`),ut=r.jsx("span",{ref:ve,"aria-hidden":!0,className:`${s}-cap-ref`,style:q,children:"H"});if(R){const ke=S?ae&&se?"paused":"running":"paused",Ie=c>0&&O>0?c/O*1e3:0,oe=`${Math.max(0,Ie)/1e3}s`;return r.jsxs("div",{ref:de,className:`${s}-wrapper`,"aria-label":"Marquee text",children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),ut,r.jsxs("div",{className:`${s}-marquee-wrapper`,style:ge,children:[at,Be,r.jsx("div",{ref:F,className:`${s}-marquee-track`,"data-direction":p,onMouseEnter:we,onMouseLeave:Pe,style:{WebkitAnimationDuration:oe,animationDuration:oe,WebkitAnimationPlayState:ke,animationPlayState:ke},children:Array.from({length:ye},(Te,Ee)=>r.jsx("div",{ref:Ee===0?te:void 0,className:`${s}-marquee-set`,style:{...H,paddingRight:V(y)},"aria-hidden":Ee>0,children:le.map((De,fe)=>et(De,Ee,fe))},`set-${Ee}`))})]})]})}return r.jsxs("div",{ref:de,className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:k}}),ut,r.jsxs("div",{className:`${s}-marquee-wrapper`,style:ge,children:[at,Be,r.jsx("div",{ref:te,className:lt(`${s}-marquee-set`,`${s}-marquee-static`),style:H,"aria-label":"Marquee text",children:t==null?void 0:t.map((ke,Ie)=>et(ke,0,Ie))})]})]})},lg=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2604
|
+
`}const zm=30,qr=3,Bm=12,Vm=3,Ca=.72,Gm=100,qm=10,Um=e=>Math.max(0,e)/Gm,Km=e=>Math.max(0,e)/qm,Xm=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")},Ym=(e,t)=>Array.from({length:t*e.length},(n,i)=>e[i%e.length]),Si={ctx:void 0},Zm=()=>Si.ctx!==void 0?Si.ctx:typeof document>"u"?(Si.ctx=null,Si.ctx):(Si.ctx=document.createElement("canvas").getContext("2d"),Si.ctx),Jm=(e,t,n,i)=>{e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${i}deg)`},Qm=e=>{e.style.transform=""},eg=e=>{if(!e||e==="none")return 0;try{return new DOMMatrixReadOnly(e).m41}catch{return 0}},tg=(e,t)=>{const n=(i,o)=>{if(!i||i===t)return o;const s=o+i.offsetLeft,l=i.offsetParent;return!l||l===i?s:n(l,s)};return n(e,e.offsetWidth/2)},ng=96,ig=(e,t,n)=>{if(t<=0||e<=0||n<2)return null;const i=2*Math.PI/t,o=new Float64Array(n+1),s=new Float64Array(n+1),l=e*t,d=u=>Math.sqrt(1+(l*Math.cos(t*u))**2),c=i/n;return Array.from({length:n},(u,p)=>{const v=p*c,x=v+c;o[p+1]=x,s[p+1]=s[p]+(d(v)+d(x))*.5*c}),{wavelength:i,periodArc:s[n],x:o,s}},og=(e,t)=>{if(e.periodArc<=0)return t;const n=t<0?-1:1,i=Math.abs(t),o=Math.floor(i/e.periodArc),s=i-o*e.periodArc,{s:l,x:d}=e,c=(g,h)=>{if(h-g<=1)return[g,h];const m=g+h>>1;return l[m]<=s?c(m,h):c(g,m)},[u,p]=c(0,l.length-1),v=l[p]-l[u],x=v>0?(s-l[u])/v:0;return n*(o*e.wavelength+d[u]+(d[p]-d[u])*x)},rg=(e,t,n,i)=>{const o=Math.max(0,n),s=e>0?2*Math.PI*o/e:0,l=p=>i+t*Math.sin(s*p),d=p=>t*s*Math.cos(s*p),c=Math.max(4,Math.ceil(o*4)),u=Array.from({length:c},(p,v)=>{const x=v/c*e,g=(v+1)/c*e,h=g-x,m=l(x),b=l(g),I=x+h/3,C=m+d(x)*h/3,R=g-h/3,K=b-d(g)*h/3;return`C${I.toFixed(2)} ${C.toFixed(2)} ${R.toFixed(2)} ${K.toFixed(2)} ${g.toFixed(2)} ${b.toFixed(2)}`});return[`M0 ${l(0).toFixed(2)}`,...u].join(" ")},ag=({item:e,prefix:t,textCss:n,capHeightPx:i,opticalOffsetY:o,imageGapPx:s,isCurve:l})=>{var g;const d=o!==0?{...n,transform:`translateY(${o}px)`}:n,c=i>0?{height:`${i}px`}:{fontSize:n.fontSize,height:`${Ca}em`},u=((g=e.image)==null?void 0:g.url)&&r.jsx("img",{src:e.image.url,alt:e.image.name??"",className:`${t}-item-image`,style:c}),p=u&&(l?r.jsx("span",{className:`${t}-item-image-wrap`,"data-marquee-wave-node":!0,children:u}):u),v=l?r.jsx("span",{className:`${t}-text`,style:d,children:Array.from(e.text).map((h,m)=>r.jsx("span",{className:`${t}-glyph`,"data-marquee-wave-node":!0,children:r.jsx("span",{className:`${t}-glyph-inner`,children:h===" "?" ":h})},m))}):r.jsx("span",{className:`${t}-text`,style:d,children:e.text}),x=r.jsxs(r.Fragment,{children:[p,v]});return r.jsx("div",{className:`${t}-item`,"data-marquee-text-item":!0,style:{gap:s},children:e.link?r.jsx("a",{href:e.link,className:`${t}-item-link`,style:{gap:s},children:x}):x})},sg=({settings:e,content:t,isEditor:n,isPreviewMode:i})=>{const{prefix:o}=$.useScopedStyles(),[s,l]=a.useState(0),d=s>0?Math.round(s):0,{speed:c,direction:u,pauseOnHover:p,gap:v,layoutType:x,curveAmplitude:g,curveFrequency:h,textFontFamily:m,textFontSettings:b,textFontSize:I,textLineHeight:C,textLetterSpacing:R,textWordSpacing:K,textTextAppearance:F,textColor:V,backgroundColor:A,ribbonWidth:T}=e,j=T??C,y=x==="curve",W=Um(g),M=Km(h),Y=a.useMemo(()=>jm(o,d,y),[o,d,y]),P=a.useMemo(()=>Kt({fontSettings:{fontFamily:m,fontWeight:b.fontWeight,fontStyle:b.fontStyle},letterSpacing:R,wordSpacing:K,fontSize:I,lineHeight:C,textAppearance:F,color:V},n),[m,b,R,K,I,C,F,V,n]),U=me=>$.scalingValue(me,n??!1),z=((t==null?void 0:t.length)??0)>0,B=n?!!i:!0,te=z&&(B||!!n),S=Math.max(0,c)*zm,E=B&&p==="on",[D,se]=a.useState(!1),oe=B?E&&D?"paused":"running":"paused",L=oe==="running"&&S>0&&d>0,ue=a.useRef(null),k=a.useRef(null),ne=a.useRef(null),X=a.useRef(null),be=a.useRef(null),Ae=a.useRef(null),fe=a.useRef(L),le=a.useRef(null);fe.current=L;const[q,Q]=a.useState(0),[Z,Ne]=a.useState(0),[Te,We]=a.useState(0),[ce,ye]=a.useState(0),[$e,G]=a.useState(0),re=a.useMemo(()=>(t??[]).map(me=>{var he;return`${me.text}\0${((he=me.image)==null?void 0:he.url)??""}`}).join("\0"),[t]),[pe,Se]=a.useState(qr),Pe=a.useMemo(()=>{const me=t??[];return me.length===0||!(B||n)?me:Ym(me,pe)},[t,B,pe,n]),Re=te?Vm:1;a.useLayoutEffect(()=>{Se(qr),l(0)},[re]),a.useLayoutEffect(()=>{var Ee;const me=Ae.current;if(!me)return;const he=()=>{const Me=getComputedStyle(me),Ge=parseFloat(Me.fontSize)||0;if(Ge<=0)return;const Ze=Zm();if(!Ze){Q(Ge*Ca),Ne(0);return}Ze.font=`${Me.fontStyle} ${Me.fontWeight} ${Ge}px ${Me.fontFamily}`;const Ue=Ze.measureText("H"),lt=Ue.actualBoundingBoxAscent>0?Ue.actualBoundingBoxAscent:Ge*Ca,tt=Math.max(0,Ue.actualBoundingBoxDescent||0),ke=Ue.fontBoundingBoxAscent||0,Xe=Ue.fontBoundingBoxDescent||0;Q(ot=>Math.abs(ot-lt)>.5?lt:ot);const Oe=ke>0||Xe>0?(Xe-tt-(ke-lt))/2:0;Ne(ot=>Math.abs(ot-Oe)>.25?Oe:ot)};he();const He=typeof document<"u"?document.fonts:void 0;(Ee=He==null?void 0:He.ready)==null||Ee.then(he).catch(()=>{});const ve=new ResizeObserver(he);return ve.observe(me),()=>ve.disconnect()},[P.fontFamily,P.fontWeight,P.fontStyle,P.fontSize,P.lineHeight]),a.useLayoutEffect(()=>{if(!te)return;const me=ue.current,he=X.current;if(!me||!he)return;const He={id:0},ve=()=>{const Me=me.getBoundingClientRect().width||me.offsetWidth,Ge=he.getBoundingClientRect().width||he.offsetWidth;if(z&&Me>0&&Ge>0){const Ze=Ge/pe;if(Ze>0){const Ue=Math.min(Bm,Math.max(qr,Math.ceil(Me/Ze)+1));if(Ue!==pe){Se(Ue);return}}}Ge>0&&l(Ge)};He.id=requestAnimationFrame(ve);const Ee=new ResizeObserver(()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(ve)});return Ee.observe(me),Ee.observe(he),()=>{cancelAnimationFrame(He.id),Ee.disconnect()}},[te,re,pe,z,q]),a.useLayoutEffect(()=>{const me=be.current;if(!me)return;const he={id:0},He=()=>{const Ee=me.offsetHeight;Ee>0&&G(Me=>Math.abs(Me-Ee)>.5?Ee:Me)};he.id=requestAnimationFrame(He);const ve=new ResizeObserver(()=>{cancelAnimationFrame(he.id),he.id=requestAnimationFrame(He)});return ve.observe(me),()=>{cancelAnimationFrame(he.id),ve.disconnect()}},[j,n]),a.useLayoutEffect(()=>{if(!y){We(0),ye(0);return}const me=ue.current,he=X.current;if(!me||!he)return;const He={id:0},ve=()=>{const Me=me.offsetWidth,Ge=he.offsetHeight;Me>0&&ye(Ze=>Math.abs(Ze-Me)>.5?Me:Ze),Ge>0&&We(Ze=>Math.abs(Ze-Ge)>.5?Ge:Ze)};He.id=requestAnimationFrame(ve);const Ee=new ResizeObserver(()=>{cancelAnimationFrame(He.id),He.id=requestAnimationFrame(ve)});return Ee.observe(me),Ee.observe(he),()=>{cancelAnimationFrame(He.id),Ee.disconnect()}},[y,re,q,C,I,te]),a.useLayoutEffect(()=>{if(!te||d<=0)return;const me=ne.current;me&&Xm(me)},[te,d,u,S]),a.useLayoutEffect(()=>{if(!y||!z)return;const me=ue.current;if(!me)return;const he={raf:0,cancelled:!1,lut:null,lutKey:"",itemsCache:[],cacheDirty:!0},He=()=>{for(const Ue of he.itemsCache)for(const lt of Ue.glyphs)Qm(lt.inner)},ve=()=>{const Ue=k.current??me;he.itemsCache=Array.from(me.querySelectorAll("[data-marquee-text-item]"),lt=>{const tt=[];return lt.querySelectorAll("[data-marquee-wave-node]").forEach(ke=>{const Xe=ke.firstElementChild;Xe&&tt.push({inner:Xe,layoutLocalX:tg(ke,Ue)})}),{item:lt,glyphs:tt}}),he.cacheDirty=!1},Ee=()=>{he.cacheDirty&&ve();const lt=(k.current??me).offsetWidth||1,tt=lt*W,ke=2*Math.PI*M/lt,Xe=`${lt}|${tt}|${ke}`;Xe!==he.lutKey&&(he.lutKey=Xe,he.lut=ig(tt,ke,ng));const Oe=ne.current,ot=Oe?eg(getComputedStyle(Oe).transform):0,ct=me.getBoundingClientRect(),mt=ct.left,Mt=ct.right,Ut=he.lut&&he.lut.wavelength>0?Math.max(0,(he.lut.periodArc/he.lut.wavelength-1)*lt):0;for(const{item:Yt,glyphs:xt}of he.itemsCache){const bt=Yt.getBoundingClientRect();if(!(bt.right<mt||bt.left>Mt+Ut))for(const _t of xt){const kt=_t.layoutLocalX+ot,vt=he.lut?og(he.lut,kt):kt,Ft=ke*vt,zt=tt*Math.sin(Ft),Zt=tt*ke*Math.cos(Ft),en=Math.atan(Zt)*(180/Math.PI);Jm(_t.inner,vt-kt,zt,en)}}},Me=()=>{he.cancelled||(he.raf=0,Ee(),fe.current&&!document.hidden&&(he.raf=requestAnimationFrame(Me)))},Ge=()=>{he.cancelled||he.raf||(he.raf=requestAnimationFrame(Me))};le.current=Ge,Ge();const Ze=()=>{if(document.hidden){cancelAnimationFrame(he.raf),he.raf=0;return}Ge()};return document.addEventListener("visibilitychange",Ze),()=>{he.cancelled=!0,le.current=null,cancelAnimationFrame(he.raf),document.removeEventListener("visibilitychange",Ze),He()}},[y,W,M,z,s,re,pe,q]),a.useLayoutEffect(()=>{var me;(me=le.current)==null||me.call(le)},[L]);const H=()=>{E&&se(!0)},ge=()=>{E&&se(!1)},ie=y?W*100:0,_=U(j),ee={minHeight:_,...y?{paddingTop:`${ie}%`,paddingBottom:`${ie}%`}:{}},Fe={height:_,...y?{visibility:"hidden"}:{backgroundColor:A}},ae={gap:U(v),minHeight:_},N=ce*W,qe=$e>0?$e:Te,je=Math.max(Te,qe),st=y&&ce>0&&je>0?rg(ce,N,M,N+je/2):"",et=N*2+je,pt=st?r.jsx("svg",{className:`${o}-curve-bg`,viewBox:`0 0 ${ce} ${et}`,preserveAspectRatio:"none","aria-hidden":!0,children:r.jsx("path",{d:st,fill:"none",stroke:A,strokeWidth:qe,strokeLinecap:"round",strokeLinejoin:"round"})}):null,rt=r.jsx("div",{ref:be,className:`${o}-ribbon`,style:Fe,"aria-hidden":!0}),Ve=(me,he,He)=>r.jsx(ag,{item:me,prefix:o,textCss:P,capHeightPx:q,opticalOffsetY:Z,imageGapPx:U(v),isCurve:y},`${he}-${He}`),xe=r.jsx("span",{ref:Ae,"aria-hidden":!0,className:`${o}-cap-ref`,style:P,children:"H"});if(te){const me=d>0&&S>0?d/S*1e3:0,he=`${Math.max(0,me)/1e3}s`;return r.jsxs("div",{ref:ue,className:`${o}-wrapper`,"aria-label":"Marquee text",children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Y}}),xe,r.jsxs("div",{ref:k,className:`${o}-marquee-wrapper`,style:ee,children:[rt,pt,r.jsx("div",{ref:ne,className:`${o}-marquee-track`,"data-direction":u,onMouseEnter:H,onMouseLeave:ge,style:{WebkitAnimationDuration:he,animationDuration:he,WebkitAnimationPlayState:oe,animationPlayState:oe},children:Array.from({length:Re},(He,ve)=>r.jsx("div",{ref:ve===0?X:void 0,className:`${o}-marquee-set`,style:{...ae,paddingRight:U(v)},"aria-hidden":ve>0,children:Pe.map((Ee,Me)=>Ve(Ee,ve,Me))},`set-${ve}`))})]})]})}return r.jsxs("div",{ref:ue,className:`${o}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Y}}),xe,r.jsxs("div",{ref:k,className:`${o}-marquee-wrapper`,style:ee,children:[rt,pt,r.jsx("div",{ref:X,className:dt(`${o}-marquee-set`,`${o}-marquee-static`),style:ae,"aria-label":"Marquee text",children:t==null?void 0:t.map((me,he)=>Ve(me,0,he))})]})]})},lg=`import { useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
2606
2605
|
import cn from 'classnames';
|
|
2607
2606
|
import { CommonComponentProps } from '../props';
|
|
2608
2607
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -2678,7 +2677,6 @@ function getCSS(P: string, setWidthPx: number, isCurve: boolean): string {
|
|
|
2678
2677
|
display: flex;
|
|
2679
2678
|
flex-direction: row;
|
|
2680
2679
|
width: max-content;
|
|
2681
|
-
will-change: transform;
|
|
2682
2680
|
backface-visibility: hidden;
|
|
2683
2681
|
-webkit-backface-visibility: hidden;
|
|
2684
2682
|
flex-wrap: nowrap;
|
|
@@ -2764,21 +2762,19 @@ const restartTrackAnimation = (track: HTMLElement) => {
|
|
|
2764
2762
|
track.style.removeProperty('-webkit-animation-name');
|
|
2765
2763
|
};
|
|
2766
2764
|
|
|
2767
|
-
const expandSetContent = (items: MarqueeTextItem[], repeat: number): MarqueeTextItem[] =>
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
return result;
|
|
2771
|
-
};
|
|
2765
|
+
const expandSetContent = (items: MarqueeTextItem[], repeat: number): MarqueeTextItem[] => (
|
|
2766
|
+
Array.from({ length: repeat * items.length }, (_, i) => items[i % items.length])
|
|
2767
|
+
);
|
|
2772
2768
|
|
|
2773
|
-
|
|
2769
|
+
const sharedCanvas = { ctx: undefined as CanvasRenderingContext2D | null | undefined };
|
|
2774
2770
|
const getSharedCanvasCtx = (): CanvasRenderingContext2D | null => {
|
|
2775
|
-
if (
|
|
2771
|
+
if (sharedCanvas.ctx !== undefined) return sharedCanvas.ctx;
|
|
2776
2772
|
if (typeof document === 'undefined') {
|
|
2777
|
-
|
|
2778
|
-
return
|
|
2773
|
+
sharedCanvas.ctx = null;
|
|
2774
|
+
return sharedCanvas.ctx;
|
|
2779
2775
|
}
|
|
2780
|
-
|
|
2781
|
-
return
|
|
2776
|
+
sharedCanvas.ctx = document.createElement('canvas').getContext('2d');
|
|
2777
|
+
return sharedCanvas.ctx;
|
|
2782
2778
|
};
|
|
2783
2779
|
|
|
2784
2780
|
type MarqueeTextItemViewProps = {
|
|
@@ -2808,17 +2804,26 @@ const readTranslateX = (transform: string): number => {
|
|
|
2808
2804
|
}
|
|
2809
2805
|
};
|
|
2810
2806
|
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
x
|
|
2816
|
-
x += readTranslateX(getComputedStyle(node).transform);
|
|
2807
|
+
// Layout-only X in ancestor space; track translateX is added once per frame.
|
|
2808
|
+
const getLayoutLocalCenterX = (el: HTMLElement, ancestor: HTMLElement): number => {
|
|
2809
|
+
const walk = (node: HTMLElement | null, x: number): number => {
|
|
2810
|
+
if (!node || node === ancestor) return x;
|
|
2811
|
+
const nextX = x + node.offsetLeft;
|
|
2817
2812
|
const parent = node.offsetParent as HTMLElement | null;
|
|
2818
|
-
if (!parent || parent === node)
|
|
2819
|
-
|
|
2820
|
-
}
|
|
2821
|
-
return
|
|
2813
|
+
if (!parent || parent === node) return nextX;
|
|
2814
|
+
return walk(parent, nextX);
|
|
2815
|
+
};
|
|
2816
|
+
return walk(el, el.offsetWidth / 2);
|
|
2817
|
+
};
|
|
2818
|
+
|
|
2819
|
+
type WaveGlyphCache = {
|
|
2820
|
+
inner: HTMLElement;
|
|
2821
|
+
layoutLocalX: number;
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
type WaveItemCache = {
|
|
2825
|
+
item: HTMLElement;
|
|
2826
|
+
glyphs: WaveGlyphCache[];
|
|
2822
2827
|
};
|
|
2823
2828
|
|
|
2824
2829
|
const WAVE_ARC_LUT_SAMPLES = 96;
|
|
@@ -2840,12 +2845,12 @@ const buildWaveArcLut = (amplitude: number, k: number, samples: number): WaveArc
|
|
|
2840
2845
|
const slopeAmp = amplitude * k;
|
|
2841
2846
|
const ds = (t: number) => Math.sqrt(1 + (slopeAmp * Math.cos(k * t)) ** 2);
|
|
2842
2847
|
const dx = wavelength / samples;
|
|
2843
|
-
|
|
2848
|
+
Array.from({ length: samples }, (_, i) => {
|
|
2844
2849
|
const t0 = i * dx;
|
|
2845
2850
|
const t1 = t0 + dx;
|
|
2846
2851
|
x[i + 1] = t1;
|
|
2847
2852
|
s[i + 1] = s[i] + (ds(t0) + ds(t1)) * 0.5 * dx;
|
|
2848
|
-
}
|
|
2853
|
+
});
|
|
2849
2854
|
return { wavelength, periodArc: s[samples], x, s };
|
|
2850
2855
|
};
|
|
2851
2856
|
|
|
@@ -2856,13 +2861,12 @@ const xFromArcLength = (lut: WaveArcLut, targetS: number): number => {
|
|
|
2856
2861
|
const n = Math.floor(sAbs / lut.periodArc);
|
|
2857
2862
|
const r = sAbs - n * lut.periodArc;
|
|
2858
2863
|
const { s, x } = lut;
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
while (hi - lo > 1) {
|
|
2864
|
+
const findBracket = (lo: number, hi: number): [number, number] => {
|
|
2865
|
+
if (hi - lo <= 1) return [lo, hi];
|
|
2862
2866
|
const mid = (lo + hi) >> 1;
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2867
|
+
return s[mid] <= r ? findBracket(mid, hi) : findBracket(lo, mid);
|
|
2868
|
+
};
|
|
2869
|
+
const [lo, hi] = findBracket(0, s.length - 1);
|
|
2866
2870
|
const span = s[hi] - s[lo];
|
|
2867
2871
|
const t = span > 0 ? (r - s[lo]) / span : 0;
|
|
2868
2872
|
return sign * (n * lut.wavelength + x[lo] + (x[hi] - x[lo]) * t);
|
|
@@ -2879,8 +2883,7 @@ const buildCurveBackgroundPath = (
|
|
|
2879
2883
|
const yAt = (x: number) => centerY + amplitude * Math.sin(k * x);
|
|
2880
2884
|
const dyAt = (x: number) => amplitude * k * Math.cos(k * x);
|
|
2881
2885
|
const segments = Math.max(4, Math.ceil(periods * 4));
|
|
2882
|
-
const
|
|
2883
|
-
for (let i = 0; i < segments; i++) {
|
|
2886
|
+
const curveParts = Array.from({ length: segments }, (_, i) => {
|
|
2884
2887
|
const x0 = (i / segments) * width;
|
|
2885
2888
|
const x1 = ((i + 1) / segments) * width;
|
|
2886
2889
|
const dx = x1 - x0;
|
|
@@ -2890,9 +2893,9 @@ const buildCurveBackgroundPath = (
|
|
|
2890
2893
|
const c1y = y0 + (dyAt(x0) * dx) / 3;
|
|
2891
2894
|
const c2x = x1 - dx / 3;
|
|
2892
2895
|
const c2y = y1 - (dyAt(x1) * dx) / 3;
|
|
2893
|
-
|
|
2894
|
-
}
|
|
2895
|
-
return
|
|
2896
|
+
return \`C\${c1x.toFixed(2)} \${c1y.toFixed(2)} \${c2x.toFixed(2)} \${c2y.toFixed(2)} \${x1.toFixed(2)} \${y1.toFixed(2)}\`;
|
|
2897
|
+
});
|
|
2898
|
+
return [\`M0 \${yAt(0).toFixed(2)}\`, ...curveParts].join(' ');
|
|
2896
2899
|
};
|
|
2897
2900
|
|
|
2898
2901
|
const MarqueeTextItemView = ({ item, prefix: P, textCss, capHeightPx, opticalOffsetY, imageGapPx, isCurve }: MarqueeTextItemViewProps) => {
|
|
@@ -2906,9 +2909,7 @@ const MarqueeTextItemView = ({ item, prefix: P, textCss, capHeightPx, opticalOff
|
|
|
2906
2909
|
style={imageHeightStyle}
|
|
2907
2910
|
/>
|
|
2908
2911
|
);
|
|
2909
|
-
const imageNode = image && (isCurve
|
|
2910
|
-
? <span className={\`\${P}-item-image-wrap\`} data-marquee-wave-node>{image}</span>
|
|
2911
|
-
: image);
|
|
2912
|
+
const imageNode = image && (isCurve ? <span className={\`\${P}-item-image-wrap\`} data-marquee-wave-node>{image}</span>: image);
|
|
2912
2913
|
const textNode = isCurve
|
|
2913
2914
|
? (
|
|
2914
2915
|
<span className={\`\${P}-text\`} style={textStyle}>
|
|
@@ -2929,17 +2930,13 @@ const MarqueeTextItemView = ({ item, prefix: P, textCss, capHeightPx, opticalOff
|
|
|
2929
2930
|
return (
|
|
2930
2931
|
<div className={\`\${P}-item\`} data-marquee-text-item style={{ gap: imageGapPx }}>
|
|
2931
2932
|
{item.link
|
|
2932
|
-
?
|
|
2933
|
-
<a href={item.link} target="_self" rel="noopener noreferrer" className={\`\${P}-item-link\`} style={{ gap: imageGapPx }}>
|
|
2934
|
-
{content}
|
|
2935
|
-
</a>
|
|
2936
|
-
)
|
|
2933
|
+
? <a href={item.link} className={\`\${P}-item-link\`} style={{ gap: imageGapPx }}>{content}</a>
|
|
2937
2934
|
: content}
|
|
2938
2935
|
</div>
|
|
2939
2936
|
);
|
|
2940
2937
|
};
|
|
2941
2938
|
|
|
2942
|
-
export const MarqueeText = ({ settings, content, isEditor, isPreviewMode
|
|
2939
|
+
export const MarqueeText = ({ settings, content, isEditor, isPreviewMode }: MarqueeTextProps) => {
|
|
2943
2940
|
const { prefix: P } = useScopedStyles();
|
|
2944
2941
|
const [setWidth, setSetWidth] = useState(0);
|
|
2945
2942
|
const animationDistance = setWidth > 0 ? Math.round(setWidth) : 0;
|
|
@@ -2983,20 +2980,28 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
2983
2980
|
}, isEditor), [textFontFamily, textFontSettings, textLetterSpacing, textWordSpacing, textFontSize, textLineHeight, textTextAppearance, textColor, isEditor]);
|
|
2984
2981
|
|
|
2985
2982
|
const scaled = (v: number) => scalingValue(v, isEditor ?? false);
|
|
2986
|
-
const
|
|
2987
|
-
const hasContent = originalItemCount > 0;
|
|
2983
|
+
const hasContent = (content?.length ?? 0) > 0;
|
|
2988
2984
|
const autoplayEnabled = isEditor ? Boolean(isPreviewMode) : true;
|
|
2989
2985
|
const useMarqueeTrack = hasContent && (autoplayEnabled || Boolean(isEditor));
|
|
2990
2986
|
const pxPerSec = Math.max(0, speed) * PX_PER_SEC_PER_SPEED_UNIT;
|
|
2991
2987
|
const hoverPauseEnabled = autoplayEnabled && pauseOnHover === 'on';
|
|
2992
2988
|
const [isHovering, setIsHovering] = useState(false);
|
|
2993
|
-
|
|
2989
|
+
const playState: 'paused' | 'running' = !autoplayEnabled
|
|
2990
|
+
? 'paused'
|
|
2991
|
+
: hoverPauseEnabled
|
|
2992
|
+
? (isHovering ? 'paused' : 'running')
|
|
2993
|
+
: 'running';
|
|
2994
|
+
const waveShouldLoop = playState === 'running' && pxPerSec > 0 && animationDistance > 0;
|
|
2994
2995
|
|
|
2995
2996
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
2997
|
+
const bandRef = useRef<HTMLDivElement | null>(null);
|
|
2996
2998
|
const trackRef = useRef<HTMLDivElement | null>(null);
|
|
2997
2999
|
const setRef = useRef<HTMLDivElement | null>(null);
|
|
2998
3000
|
const ribbonRef = useRef<HTMLDivElement | null>(null);
|
|
2999
3001
|
const capRefEl = useRef<HTMLSpanElement | null>(null);
|
|
3002
|
+
const waveShouldLoopRef = useRef(waveShouldLoop);
|
|
3003
|
+
const waveKickRef = useRef<(() => void) | null>(null);
|
|
3004
|
+
waveShouldLoopRef.current = waveShouldLoop;
|
|
3000
3005
|
const [capHeightPx, setCapHeightPx] = useState(0);
|
|
3001
3006
|
const [opticalOffsetY, setOpticalOffsetY] = useState(0);
|
|
3002
3007
|
const [curveBandHeightPx, setCurveBandHeightPx] = useState(0);
|
|
@@ -3004,7 +3009,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3004
3009
|
const [ribbonHeightPx, setRibbonHeightPx] = useState(0);
|
|
3005
3010
|
|
|
3006
3011
|
const contentKey = useMemo(
|
|
3007
|
-
() => (content ?? []).map((i) => \`\${i.text}
|
|
3012
|
+
() => (content ?? []).map((i) => \`\${i.text}\\0\${i.image?.url ?? ''}\`).join('\\0'),
|
|
3008
3013
|
[content],
|
|
3009
3014
|
);
|
|
3010
3015
|
const [contentSequenceRepeat, setContentSequenceRepeat] = useState(MIN_CONTENT_SEQUENCE_REPEAT);
|
|
@@ -3021,8 +3026,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3021
3026
|
setSetWidth(0);
|
|
3022
3027
|
}, [contentKey]);
|
|
3023
3028
|
|
|
3024
|
-
// Cap-height + optical vertical offset
|
|
3025
|
-
// cap height and shift text so empty space above/below ink is equal in the line box.
|
|
3029
|
+
// Cap-height + optical vertical offset for image sizing / text baseline balance.
|
|
3026
3030
|
useLayoutEffect(() => {
|
|
3027
3031
|
const el = capRefEl.current;
|
|
3028
3032
|
if (!el) return;
|
|
@@ -3045,8 +3049,6 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3045
3049
|
const fontAscent = metrics.fontBoundingBoxAscent || 0;
|
|
3046
3050
|
const fontDescent = metrics.fontBoundingBoxDescent || 0;
|
|
3047
3051
|
setCapHeightPx((prev) => (Math.abs(prev - inkAscent) > 0.5 ? inkAscent : prev));
|
|
3048
|
-
// Equalize empty space above/below ink inside the font bounding box (half-leading
|
|
3049
|
-
// is already symmetric, so only the font-box asymmetry needs correcting).
|
|
3050
3052
|
const nextOffset = (fontAscent > 0 || fontDescent > 0)
|
|
3051
3053
|
? ((fontDescent - inkDescent) - (fontAscent - inkAscent)) / 2
|
|
3052
3054
|
: 0;
|
|
@@ -3065,11 +3067,11 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3065
3067
|
const wrapper = wrapperRef.current;
|
|
3066
3068
|
const set = setRef.current;
|
|
3067
3069
|
if (!wrapper || !set) return;
|
|
3068
|
-
|
|
3070
|
+
const raf = { id: 0 };
|
|
3069
3071
|
const measure = () => {
|
|
3070
3072
|
const containerWidth = wrapper.getBoundingClientRect().width || wrapper.offsetWidth;
|
|
3071
3073
|
const rawSetWidth = set.getBoundingClientRect().width || set.offsetWidth;
|
|
3072
|
-
if (
|
|
3074
|
+
if (hasContent && containerWidth > 0 && rawSetWidth > 0) {
|
|
3073
3075
|
const singleCycleWidth = rawSetWidth / contentSequenceRepeat;
|
|
3074
3076
|
if (singleCycleWidth > 0) {
|
|
3075
3077
|
const targetRepeat = Math.min(
|
|
@@ -3084,35 +3086,35 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3084
3086
|
}
|
|
3085
3087
|
if (rawSetWidth > 0) setSetWidth(rawSetWidth);
|
|
3086
3088
|
};
|
|
3087
|
-
raf = requestAnimationFrame(measure);
|
|
3089
|
+
raf.id = requestAnimationFrame(measure);
|
|
3088
3090
|
const ro = new ResizeObserver(() => {
|
|
3089
|
-
cancelAnimationFrame(raf);
|
|
3090
|
-
raf = requestAnimationFrame(measure);
|
|
3091
|
+
cancelAnimationFrame(raf.id);
|
|
3092
|
+
raf.id = requestAnimationFrame(measure);
|
|
3091
3093
|
});
|
|
3092
3094
|
ro.observe(wrapper);
|
|
3093
3095
|
ro.observe(set);
|
|
3094
3096
|
return () => {
|
|
3095
|
-
cancelAnimationFrame(raf);
|
|
3097
|
+
cancelAnimationFrame(raf.id);
|
|
3096
3098
|
ro.disconnect();
|
|
3097
3099
|
};
|
|
3098
|
-
}, [useMarqueeTrack, contentKey, contentSequenceRepeat,
|
|
3100
|
+
}, [useMarqueeTrack, contentKey, contentSequenceRepeat, hasContent, capHeightPx]);
|
|
3099
3101
|
|
|
3100
3102
|
useLayoutEffect(() => {
|
|
3101
3103
|
const ribbon = ribbonRef.current;
|
|
3102
3104
|
if (!ribbon) return;
|
|
3103
|
-
|
|
3105
|
+
const raf = { id: 0 };
|
|
3104
3106
|
const measure = () => {
|
|
3105
3107
|
const height = ribbon.offsetHeight;
|
|
3106
3108
|
if (height > 0) setRibbonHeightPx((prev) => (Math.abs(prev - height) > 0.5 ? height : prev));
|
|
3107
3109
|
};
|
|
3108
|
-
raf = requestAnimationFrame(measure);
|
|
3110
|
+
raf.id = requestAnimationFrame(measure);
|
|
3109
3111
|
const ro = new ResizeObserver(() => {
|
|
3110
|
-
cancelAnimationFrame(raf);
|
|
3111
|
-
raf = requestAnimationFrame(measure);
|
|
3112
|
+
cancelAnimationFrame(raf.id);
|
|
3113
|
+
raf.id = requestAnimationFrame(measure);
|
|
3112
3114
|
});
|
|
3113
3115
|
ro.observe(ribbon);
|
|
3114
3116
|
return () => {
|
|
3115
|
-
cancelAnimationFrame(raf);
|
|
3117
|
+
cancelAnimationFrame(raf.id);
|
|
3116
3118
|
ro.disconnect();
|
|
3117
3119
|
};
|
|
3118
3120
|
}, [ribbonWidth, isEditor]);
|
|
@@ -3126,22 +3128,22 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3126
3128
|
const wrapper = wrapperRef.current;
|
|
3127
3129
|
const set = setRef.current;
|
|
3128
3130
|
if (!wrapper || !set) return;
|
|
3129
|
-
|
|
3131
|
+
const raf = { id: 0 };
|
|
3130
3132
|
const measure = () => {
|
|
3131
3133
|
const width = wrapper.offsetWidth;
|
|
3132
3134
|
const bandHeight = set.offsetHeight;
|
|
3133
3135
|
if (width > 0) setCurveWidthPx((prev) => (Math.abs(prev - width) > 0.5 ? width : prev));
|
|
3134
3136
|
if (bandHeight > 0) setCurveBandHeightPx((prev) => (Math.abs(prev - bandHeight) > 0.5 ? bandHeight : prev));
|
|
3135
3137
|
};
|
|
3136
|
-
raf = requestAnimationFrame(measure);
|
|
3138
|
+
raf.id = requestAnimationFrame(measure);
|
|
3137
3139
|
const ro = new ResizeObserver(() => {
|
|
3138
|
-
cancelAnimationFrame(raf);
|
|
3139
|
-
raf = requestAnimationFrame(measure);
|
|
3140
|
+
cancelAnimationFrame(raf.id);
|
|
3141
|
+
raf.id = requestAnimationFrame(measure);
|
|
3140
3142
|
});
|
|
3141
3143
|
ro.observe(wrapper);
|
|
3142
3144
|
ro.observe(set);
|
|
3143
3145
|
return () => {
|
|
3144
|
-
cancelAnimationFrame(raf);
|
|
3146
|
+
cancelAnimationFrame(raf.id);
|
|
3145
3147
|
ro.disconnect();
|
|
3146
3148
|
};
|
|
3147
3149
|
}, [isCurveLayout, contentKey, capHeightPx, textLineHeight, textFontSize, useMarqueeTrack]);
|
|
@@ -3153,65 +3155,121 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3153
3155
|
restartTrackAnimation(track);
|
|
3154
3156
|
}, [useMarqueeTrack, animationDistance, direction, pxPerSec]);
|
|
3155
3157
|
|
|
3156
|
-
// Curve layout only: a sine wave in the band's local layout space (offsetWidth
|
|
3157
|
-
// + offsetLeft), not screen getBoundingClientRect. Glyphs are placed by arc
|
|
3158
|
-
// length so layout advance (including letter-spacing) is kept along the path,
|
|
3159
|
-
// not along horizontal x. Straight never enters this loop.
|
|
3160
3158
|
useLayoutEffect(() => {
|
|
3161
3159
|
if (!isCurveLayout || !hasContent) return;
|
|
3162
3160
|
const wrapper = wrapperRef.current;
|
|
3163
3161
|
if (!wrapper) return;
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3162
|
+
|
|
3163
|
+
const wave = {
|
|
3164
|
+
raf: 0,
|
|
3165
|
+
cancelled: false,
|
|
3166
|
+
lut: null as WaveArcLut | null,
|
|
3167
|
+
lutKey: '',
|
|
3168
|
+
itemsCache: [] as WaveItemCache[],
|
|
3169
|
+
cacheDirty: true,
|
|
3170
|
+
};
|
|
3171
|
+
|
|
3172
|
+
const clearWaveTransforms = () => {
|
|
3173
|
+
for (const item of wave.itemsCache) {
|
|
3174
|
+
for (const glyph of item.glyphs) clearWaveTransform(glyph.inner);
|
|
3175
|
+
}
|
|
3176
|
+
};
|
|
3177
|
+
|
|
3178
|
+
const rebuildCache = () => {
|
|
3179
|
+
const band = bandRef.current ?? wrapper;
|
|
3180
|
+
wave.itemsCache = Array.from(
|
|
3181
|
+
wrapper.querySelectorAll<HTMLElement>('[data-marquee-text-item]'),
|
|
3182
|
+
(item) => {
|
|
3183
|
+
const glyphs: WaveGlyphCache[] = [];
|
|
3184
|
+
item.querySelectorAll<HTMLElement>('[data-marquee-wave-node]').forEach((node) => {
|
|
3185
|
+
const inner = node.firstElementChild as HTMLElement | null;
|
|
3186
|
+
if (!inner) return;
|
|
3187
|
+
glyphs.push({
|
|
3188
|
+
inner,
|
|
3189
|
+
layoutLocalX: getLayoutLocalCenterX(node, band),
|
|
3190
|
+
});
|
|
3191
|
+
});
|
|
3192
|
+
return { item, glyphs };
|
|
3193
|
+
},
|
|
3194
|
+
);
|
|
3195
|
+
wave.cacheDirty = false;
|
|
3196
|
+
};
|
|
3197
|
+
|
|
3198
|
+
const applyWave = () => {
|
|
3199
|
+
if (wave.cacheDirty) rebuildCache();
|
|
3200
|
+
const band = bandRef.current ?? wrapper;
|
|
3171
3201
|
const width = band.offsetWidth || 1;
|
|
3172
3202
|
const amplitude = width * amplitudeRatio;
|
|
3173
3203
|
const k = (2 * Math.PI * curvePeriods) / width;
|
|
3174
3204
|
const nextLutKey = \`\${width}|\${amplitude}|\${k}\`;
|
|
3175
|
-
if (nextLutKey !== lutKey) {
|
|
3176
|
-
lutKey = nextLutKey;
|
|
3177
|
-
lut = buildWaveArcLut(amplitude, k, WAVE_ARC_LUT_SAMPLES);
|
|
3205
|
+
if (nextLutKey !== wave.lutKey) {
|
|
3206
|
+
wave.lutKey = nextLutKey;
|
|
3207
|
+
wave.lut = buildWaveArcLut(amplitude, k, WAVE_ARC_LUT_SAMPLES);
|
|
3178
3208
|
}
|
|
3209
|
+
|
|
3210
|
+
const track = trackRef.current;
|
|
3211
|
+
const trackTx = track ? readTranslateX(getComputedStyle(track).transform) : 0;
|
|
3179
3212
|
const wrapperRect = wrapper.getBoundingClientRect();
|
|
3180
3213
|
const viewLeft = wrapperRect.left;
|
|
3181
3214
|
const viewRight = wrapperRect.right;
|
|
3182
|
-
const extraRight = lut && lut.wavelength > 0
|
|
3183
|
-
? Math.max(0, (lut.periodArc / lut.wavelength - 1) * width)
|
|
3215
|
+
const extraRight = wave.lut && wave.lut.wavelength > 0
|
|
3216
|
+
? Math.max(0, (wave.lut.periodArc / wave.lut.wavelength - 1) * width)
|
|
3184
3217
|
: 0;
|
|
3185
|
-
|
|
3186
|
-
|
|
3218
|
+
|
|
3219
|
+
for (const { item, glyphs } of wave.itemsCache) {
|
|
3187
3220
|
const itemRect = item.getBoundingClientRect();
|
|
3188
|
-
if (itemRect.right < viewLeft || itemRect.left > viewRight + extraRight)
|
|
3189
|
-
const
|
|
3190
|
-
|
|
3191
|
-
const
|
|
3192
|
-
if (!inner) return;
|
|
3193
|
-
const localX = getLocalCenterX(el, band);
|
|
3194
|
-
const xPath = lut ? xFromArcLength(lut, localX) : localX;
|
|
3221
|
+
if (itemRect.right < viewLeft || itemRect.left > viewRight + extraRight) continue;
|
|
3222
|
+
for (const glyph of glyphs) {
|
|
3223
|
+
const localX = glyph.layoutLocalX + trackTx;
|
|
3224
|
+
const xPath = wave.lut ? xFromArcLength(wave.lut, localX) : localX;
|
|
3195
3225
|
const phase = k * xPath;
|
|
3196
3226
|
const y = amplitude * Math.sin(phase);
|
|
3197
3227
|
const slope = amplitude * k * Math.cos(phase);
|
|
3198
3228
|
const rotateDeg = Math.atan(slope) * (180 / Math.PI);
|
|
3199
|
-
applyWaveTransform(inner, xPath - localX, y, rotateDeg);
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
|
|
3229
|
+
applyWaveTransform(glyph.inner, xPath - localX, y, rotateDeg);
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
|
|
3234
|
+
const tick = () => {
|
|
3235
|
+
if (wave.cancelled) return;
|
|
3236
|
+
wave.raf = 0;
|
|
3237
|
+
applyWave();
|
|
3238
|
+
if (waveShouldLoopRef.current && !document.hidden) {
|
|
3239
|
+
wave.raf = requestAnimationFrame(tick);
|
|
3240
|
+
}
|
|
3203
3241
|
};
|
|
3204
|
-
|
|
3242
|
+
|
|
3243
|
+
const kick = () => {
|
|
3244
|
+
if (wave.cancelled || wave.raf) return;
|
|
3245
|
+
wave.raf = requestAnimationFrame(tick);
|
|
3246
|
+
};
|
|
3247
|
+
|
|
3248
|
+
waveKickRef.current = kick;
|
|
3249
|
+
kick();
|
|
3250
|
+
|
|
3251
|
+
const onVisibility = () => {
|
|
3252
|
+
if (document.hidden) {
|
|
3253
|
+
cancelAnimationFrame(wave.raf);
|
|
3254
|
+
wave.raf = 0;
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
kick();
|
|
3258
|
+
};
|
|
3259
|
+
document.addEventListener('visibilitychange', onVisibility);
|
|
3260
|
+
|
|
3205
3261
|
return () => {
|
|
3206
|
-
cancelled = true;
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
});
|
|
3212
|
-
wrapper.querySelectorAll<HTMLElement>('[data-marquee-text-item]').forEach(clearWaveTransform);
|
|
3262
|
+
wave.cancelled = true;
|
|
3263
|
+
waveKickRef.current = null;
|
|
3264
|
+
cancelAnimationFrame(wave.raf);
|
|
3265
|
+
document.removeEventListener('visibilitychange', onVisibility);
|
|
3266
|
+
clearWaveTransforms();
|
|
3213
3267
|
};
|
|
3214
|
-
}, [isCurveLayout, amplitudeRatio, curvePeriods, hasContent, setWidth, contentKey,
|
|
3268
|
+
}, [isCurveLayout, amplitudeRatio, curvePeriods, hasContent, setWidth, contentKey, contentSequenceRepeat, capHeightPx]);
|
|
3269
|
+
|
|
3270
|
+
useLayoutEffect(() => {
|
|
3271
|
+
waveKickRef.current?.();
|
|
3272
|
+
}, [waveShouldLoop]);
|
|
3215
3273
|
|
|
3216
3274
|
const onTrackEnter = () => {
|
|
3217
3275
|
if (hoverPauseEnabled) setIsHovering(true);
|
|
@@ -3240,8 +3298,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3240
3298
|
};
|
|
3241
3299
|
const curveAmplitudePx = curveWidthPx * amplitudeRatio;
|
|
3242
3300
|
const curveStrokeWidth = ribbonHeightPx > 0 ? ribbonHeightPx : curveBandHeightPx;
|
|
3243
|
-
//
|
|
3244
|
-
// the wave background at sine peaks (stroke extends ±ribbon/2 around the path).
|
|
3301
|
+
// Keep content band >= stroke so overflow:hidden does not clip sine peaks.
|
|
3245
3302
|
const curveContentBandPx = Math.max(curveBandHeightPx, curveStrokeWidth);
|
|
3246
3303
|
const curveBgPath = isCurveLayout && curveWidthPx > 0 && curveContentBandPx > 0
|
|
3247
3304
|
? buildCurveBackgroundPath(
|
|
@@ -3291,11 +3348,6 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3291
3348
|
);
|
|
3292
3349
|
|
|
3293
3350
|
if (useMarqueeTrack) {
|
|
3294
|
-
const playState = !autoplayEnabled
|
|
3295
|
-
? 'paused'
|
|
3296
|
-
: hoverPauseEnabled
|
|
3297
|
-
? (isHovering ? 'paused' : 'running')
|
|
3298
|
-
: 'running';
|
|
3299
3351
|
const durationMs = animationDistance > 0 && pxPerSec > 0 ? (animationDistance / pxPerSec) * 1000 : 0;
|
|
3300
3352
|
const durationS = \`\${Math.max(0, durationMs) / 1000}s\`;
|
|
3301
3353
|
|
|
@@ -3303,7 +3355,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3303
3355
|
<div ref={wrapperRef} className={\`\${P}-wrapper\`} aria-label="Marquee text">
|
|
3304
3356
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
3305
3357
|
{capRef}
|
|
3306
|
-
<div className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
3358
|
+
<div ref={bandRef} className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
3307
3359
|
{ribbon}
|
|
3308
3360
|
{curveBgSvg}
|
|
3309
3361
|
<div
|
|
@@ -3340,7 +3392,7 @@ export const MarqueeText = ({ settings, content, isEditor, isPreviewMode, isEdit
|
|
|
3340
3392
|
<div ref={wrapperRef} className={\`\${P}-wrapper\`}>
|
|
3341
3393
|
<style dangerouslySetInnerHTML={{ __html: scopedCss }} />
|
|
3342
3394
|
{capRef}
|
|
3343
|
-
<div className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
3395
|
+
<div ref={bandRef} className={\`\${P}-marquee-wrapper\`} style={bandStyle}>
|
|
3344
3396
|
{ribbon}
|
|
3345
3397
|
{curveBgSvg}
|
|
3346
3398
|
<div
|
|
@@ -3399,7 +3451,7 @@ type MarqueeTextProps = {
|
|
|
3399
3451
|
isPreviewMode?: boolean;
|
|
3400
3452
|
isEditMode?: boolean;
|
|
3401
3453
|
} & CommonComponentProps;
|
|
3402
|
-
`,cg={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},dg={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:0,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:{...cg.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:"
|
|
3454
|
+
`,cg={fontSettings:{type:"object",scope:"common",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},dg={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:0,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:{...cg.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:""}]}},ug={element:sg,id:"marquee-text",name:"Marquee Text",category:"galleries",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:dg,sourceCode:lg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily"}};function pg(e,t){const n=t>0?`${t}px`:"0px";return`
|
|
3403
3455
|
.${e}-marquee-wrapper {
|
|
3404
3456
|
overflow: hidden;
|
|
3405
3457
|
width: 100%;
|
|
@@ -3488,7 +3540,7 @@ type MarqueeTextProps = {
|
|
|
3488
3540
|
pointer-events: auto;
|
|
3489
3541
|
z-index: 10;
|
|
3490
3542
|
}
|
|
3491
|
-
`}const mg=30,
|
|
3543
|
+
`}const mg=30,ks=2,gg=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")},hg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),{align:l,speed:d,direction:c,pauseOnHover:u,gap:p,cardWidth:v,corners:x,stroke:g,strokeColor:h,bgColor:m,padding:b,logoMarginTop:I,logoWidth:C,logoHeight:R,captionMarginTop:K}=e,F=!!o,V=((t==null?void 0:t.length)??0)>0,A=d>0&&(!n||i),T=V&&(A||n),j=Math.max(0,d)*mg,y=H=>$.scalingValue(H,n??!1),W=a.useRef(null),M=a.useRef(null),Y=a.useRef(null),[P,U]=a.useState(0),[z,B]=a.useState(0),te=z>0?z:0,S=a.useMemo(()=>pg(s,te),[s,te]),[E,D]=a.useState(0),se=A&&u==="on",[oe,L]=a.useState(!1),ue=a.useRef(null),[k,ne]=a.useState(0),[X,be]=a.useState(0),Ae=a.useRef(null),fe=H=>{var ie,_,ee,Fe,ae;return{fontSettings:{fontFamily:(e==null?void 0:e[`${H}FontFamily`])??"Arial",fontWeight:((ie=e==null?void 0:e[`${H}FontSettings`])==null?void 0:ie.fontWeight)??400,fontStyle:((_=e==null?void 0:e[`${H}FontSettings`])==null?void 0:_.fontStyle)??"normal"},textAppearance:{textTransform:((ee=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ee.textTransform)??"none",textDecoration:((Fe=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:Fe.textDecoration)??"none",fontVariant:((ae=e==null?void 0:e[`${H}TextAppearance`])==null?void 0:ae.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${H}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${H}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${H}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${H}LineHeight`])??.01,color:(e==null?void 0:e[`${H}Color`])??"#000000"}},le=fe("text"),q=fe("caption"),Q=a.useMemo(()=>((t==null?void 0:t.length)??0)>1&&(t??[]).some(H=>{var ge,ie;return(((ge=H.text)==null?void 0:ge.length)??0)>0||(((ie=H.caption)==null?void 0:ie.length)??0)>0}),[t]),Z=a.useMemo(()=>!T||(t==null?void 0:t.length)===0?1:z<=0||P<=0?ks:Math.max(ks,Math.ceil(P/z)+1),[T,t==null?void 0:t.length,z,P]);a.useLayoutEffect(()=>{if(!T)return;const H=W.current,ge=Y.current;if(!H||!ge)return;let ie=0;const _=()=>{const ae=H.getBoundingClientRect().width,N=ge.getBoundingClientRect().width,qe=Ae.current,je=typeof qe=="number"&&Math.abs(qe-N)<=.25;if(Ae.current=N,U(ae),typeof N=="number"&&N>0&&z<=0){B(N);return}je&&N!==z?B(N):!je&&z<=0&&(cancelAnimationFrame(ie),ie=requestAnimationFrame(_))},ee=()=>{cancelAnimationFrame(ie),ie=requestAnimationFrame(_)};ee();const Fe=new ResizeObserver(ee);return Fe.observe(H),Fe.observe(ge),()=>{cancelAnimationFrame(ie),Fe.disconnect()}},[A,T,z]);const Ne=te>0&&j>0?te/j*1e3:0,Te=`${Math.max(0,Ne)/1e3}s`;a.useLayoutEffect(()=>{if(!T||te<=0)return;const H=M.current;H&&gg(H)},[T,te,c]),a.useLayoutEffect(()=>{if(!T){D(0);return}const H=Y.current,ge=M.current;if(!H||!ge)return;const ie=()=>{let ee=0;for(let Fe=0;Fe<H.children.length;Fe++){const N=H.children[Fe].firstElementChild;N&&(ee=Math.max(ee,N.offsetHeight))}ee<=0&&(ee=ge.offsetHeight),D(ee>0?ee:0)};ie();const _=new ResizeObserver(ie);return _.observe(H),_.observe(ge),()=>{_.disconnect()}},[T,Z,t,n,p,v,b,g,x,C,R,k,X]);const We=()=>{se&&L(!0)},ce=()=>{se&&L(!1)},ye=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[l]),$e=a.useMemo(()=>{switch(l){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[l]),G=a.useCallback((H,ge,ie,_)=>r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ye,width:"100%"},children:[r.jsx("div",{"data-controls":F?_==null?void 0:_.controlsName:void 0,"data-controls-axis":F?"y":void 0,className:F?`${s}-control`:void 0,style:{height:y((_==null?void 0:_.marginTop)??0)}}),r.jsx("div",{..._!=null&&_.dataMeasureKind?{"data-testimonial-measure":_.dataMeasureKind}:{},style:{...Kt(H,n),textAlign:$e,pointerEvents:"auto",...typeof(_==null?void 0:_.minHeightPx)=="number"&&_.minHeightPx>0?{minHeight:_.minHeightPx}:{}},children:r.jsx(yi,{content:ge})})]},ie),[ye,$e,n,F,s,y]),re=a.useCallback((H,ge,ie)=>{var _,ee,Fe;return r.jsxs("div",{style:{padding:`${y(b.top)} ${y(b.right)} ${y(b.bottom)} ${y(b.left)}`,width:y(v+g*2),height:"100%",borderRadius:y(x),border:`${y(g)} solid ${h}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[r.jsx("div",{className:`${s}-cover`,style:{background:m}}),r.jsxs("div",{className:`${s}-elements-overlay`,style:{alignItems:ye,textAlign:$e},children:[H.text&&G(le,H.text,"text",ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(ie==null?void 0:ie.textMinHeightPx)=="number"&&ie.textMinHeightPx>0?{minHeightPx:ie.textMinHeightPx}:void 0),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:ye,width:"100%"},children:[r.jsx("div",{"data-controls":F&&!(ie!=null&&ie.dataMeasureAttrs)?"logoMarginTop":void 0,className:F&&!(ie!=null&&ie.dataMeasureAttrs)?`${s}-control`:void 0,style:{height:y(I)}}),r.jsx("div",{style:{width:y(C),height:y(R)},children:((_=H.logo)==null?void 0:_.url)&&r.jsx("img",{src:H.logo.url,alt:((ee=H.logo)==null?void 0:ee.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((Fe=H.logo)==null?void 0:Fe.objectFit)||"contain"}})})]}),H.caption&&G(q,H.caption,"caption",{...ie!=null&&ie.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:K,...ie!=null&&ie.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(ie==null?void 0:ie.captionMinHeightPx)=="number"&&ie.captionMinHeightPx>0?{minHeightPx:ie.captionMinHeightPx}:{}})]})]},ge)},[m,K,q,v,x,R,I,C,ye,$e,b.bottom,b.left,b.right,b.top,G,g,h,le,n,F,s]),pe=a.useCallback(H=>{ne(H.maxTextPx),be(H.maxCaptionPx)},[]);a.useLayoutEffect(()=>{if(!Q){pe({maxTextPx:0,maxCaptionPx:0});return}const H=ue.current;if(!H)return;const ge=()=>{$.readTestimonialTextMeasure(H,pe)};ge();const ie=new ResizeObserver(ge);return ie.observe(H),()=>{ie.disconnect()}},[Q,pe,t,re]);const Se=Q?{textMinHeightPx:k,captionMinHeightPx:X}:void 0,Pe=Q?r.jsx("div",{ref:ue,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(t??[]).map((H,ge)=>re(H,`measure-${ge}`,{dataMeasureAttrs:!0}))}):null,Re=(H,ge)=>r.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[re(H,`card-${ge}`,Se),F&&r.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${y(p)})`,width:y(p),height:"100%",pointerEvents:"auto",zIndex:2}})]},ge);if(T){const H=A?se&&oe?"paused":"running":"paused";return r.jsxs("div",{ref:W,className:dt(`${s}-wrapper`,`${s}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...E>0?{height:E}:{}},children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Pe,r.jsx("div",{ref:M,className:`${s}-marquee-track`,"data-direction":c,onMouseEnter:We,onMouseLeave:ce,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:Te,WebkitAnimationDuration:Te,animationPlayState:H,WebkitAnimationPlayState:H},children:Array.from({length:Z},(ge,ie)=>r.jsx("div",{ref:ie===0?Y:void 0,className:`${s}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:y(p),paddingRight:y(p)},"aria-hidden":ie>0,children:t==null?void 0:t.map((_,ee)=>Re(_,`${ie}-${ee}`))},`set-${ie}`))})]})}return r.jsxs("div",{className:`${s}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:S}}),Pe,r.jsx("div",{style:{gap:y(p),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:t==null?void 0:t.map((H,ge)=>Re(H,ge))})]})},fg=`import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3492
3544
|
import cn from 'classnames';
|
|
3493
3545
|
import { CommonComponentProps } from '../props';
|
|
3494
3546
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4119,7 +4171,7 @@ type TestimonialsSettings = {
|
|
|
4119
4171
|
logoHeight: number;
|
|
4120
4172
|
captionMarginTop: number;
|
|
4121
4173
|
};
|
|
4122
|
-
`,
|
|
4174
|
+
`,As={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},yg={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:{...As.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:{...As.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"}]}]}]}},vg={element:hg,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:yg,sourceCode:fg,assetsPaths:{content:[{path:"logo.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function xg(e){return`
|
|
4123
4175
|
.${e}-container {
|
|
4124
4176
|
position: relative;
|
|
4125
4177
|
overflow-x: clip;
|
|
@@ -4243,7 +4295,7 @@ type TestimonialsSettings = {
|
|
|
4243
4295
|
width: 100%;
|
|
4244
4296
|
height: 100%;
|
|
4245
4297
|
}
|
|
4246
|
-
`}const bg=3e3,wg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:
|
|
4298
|
+
`}const bg=3e3,wg=({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o})=>{const{prefix:s}=$.useScopedStyles(),l=t||[],{speed:d,align:c,width:u,imageMarginTop:p,textMarginTop:v,captionMarginTop:x,imageWidth:g,imageHeight:h,controlsWidth:m,controlsColor:b,controlsHoverColor:I}=e,C=d>0&&(!n||!!i),[R,K]=a.useState(0),[F,V]=a.useState(null),[A,T]=a.useState(!1),j=a.useRef(null),y=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[c]),W=a.useMemo(()=>{switch(c){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[c]);a.useEffect(()=>{K(0),V(null),T(!1)},[l.length]);const M=l[R],Y=F===null?null:l[F],P=fe=>{var q,Q,Z,Ne,Te;return{fontSettings:{fontFamily:(e==null?void 0:e[`${fe}FontFamily`])??"Arial",fontWeight:((q=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:q.fontWeight)??400,fontStyle:((Q=e==null?void 0:e[`${fe}FontSettings`])==null?void 0:Q.fontStyle)??"normal"},textAppearance:{textTransform:((Z=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:Z.textTransform)??"none",textDecoration:((Ne=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:Ne.textDecoration)??"none",fontVariant:((Te=e==null?void 0:e[`${fe}TextAppearance`])==null?void 0:Te.fontVariant)??"normal"},fontSize:(e==null?void 0:e[`${fe}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${fe}LineHeight`])??.01,letterSpacing:(e==null?void 0:e[`${fe}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${fe}WordSpacing`])??0,color:(e==null?void 0:e[`${fe}Color`])??"#000000"}},U=P("text"),z=P("caption"),B=l.length>1&&l.some(fe=>{var le,q;return(((le=fe.text)==null?void 0:le.length)??0)>0||(((q=fe.caption)==null?void 0:q.length)??0)>0}),te=a.useRef(null),[S,E]=a.useState(0),[D,se]=a.useState(0),oe=e.controls??{mode:"Off",icon:null},L=l.length>1,ue=a.useCallback((fe,le)=>!L||le===fe?fe:(j.current&&window.clearTimeout(j.current),V(fe),T(!0),j.current=window.setTimeout(()=>{V(null),T(!1),j.current=null},300),le),[L]),k=a.useCallback(()=>{L&&K(fe=>ue(fe,(fe-1+l.length)%l.length))},[L,ue,l.length]),ne=a.useCallback(()=>{L&&K(fe=>ue(fe,(fe+1)%l.length))},[L,ue,l.length]);a.useEffect(()=>{if(!C||!L)return;const fe=Math.max(300,bg/d),le=window.setInterval(()=>{K(q=>ue(q,(q+1)%l.length))},fe);return()=>{window.clearInterval(le)}},[C,L,ue,l.length,d]),a.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);const X=(fe,le)=>{var Te,We,ce,ye;const q=le==null?void 0:le.textMinHeightPx,Q=le==null?void 0:le.captionMinHeightPx,Z=le==null?void 0:le.dataMeasureAttrs,Ne=o&&!(le!=null&&le.dataMeasureAttrs)&&!(le!=null&&le.hideControls);return r.jsxs(r.Fragment,{children:[fe.text&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":Ne?"textMarginTop":void 0,className:Ne?`${s}-control`:void 0,style:{height:$.scalingValue(v??0,n??!1)}}),r.jsx("div",{...Z&&{"data-testimonial-measure":"text"},style:{...Kt(U,n),...q&&q>0?{minHeight:q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:fe.text})})]}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":Ne?"imageMarginTop":void 0,className:Ne?`${s}-control`:void 0,style:{height:$.scalingValue(p??0,n??!1)}}),r.jsx("div",{style:{width:$.scalingValue(g??0,n??!1),height:$.scalingValue(h??0,n??!1)},children:((Te=fe.image)==null?void 0:Te.url)&&r.jsx("img",{src:(We=fe.image)==null?void 0:We.url,alt:((ce=fe.image)==null?void 0:ce.name)??"",className:`${s}-icon`,style:{objectFit:((ye=fe.image)==null?void 0:ye.objectFit)||"contain"}})})]}),fe.caption&&r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:y,width:"100%"},children:[r.jsx("div",{"data-controls":Ne?"captionMarginTop":void 0,className:Ne?`${s}-control`:void 0,style:{height:$.scalingValue(x??0,n??!1)}}),r.jsx("div",{...Z?{"data-testimonial-measure":"caption"}:{},style:{...Kt(z,n),...Q&&Q>0?{minHeight:Q}:{},textAlign:W,pointerEvents:"auto"},children:r.jsx(yi,{content:fe.caption})})]})]})},be=a.useCallback(fe=>{E(fe.maxTextPx),se(fe.maxCaptionPx)},[]);if(a.useLayoutEffect(()=>{if(!B){be({maxTextPx:0,maxCaptionPx:0});return}const fe=te.current;if(!fe)return;const le=()=>{$.readTestimonialTextMeasure(fe,be)};le();const q=new ResizeObserver(le);return q.observe(fe),()=>{q.disconnect()}},[B,be,t]),!M)return r.jsx(r.Fragment,{});const Ae=B?{textMinHeightPx:S,captionMinHeightPx:D}:void 0;return r.jsx(r.Fragment,{children:r.jsxs("div",{className:`${s}-container`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:xg(s)}}),r.jsxs("div",{className:`${s}-wrapper`,style:{width:$.scalingValue(u??0,n??!1),alignItems:y},children:[B&&r.jsx("div",{ref:te,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:l.map((fe,le)=>r.jsx("div",{style:{width:"100%"},children:X(fe,{dataMeasureAttrs:!0})},le))}),r.jsxs("div",{className:`${s}-fade-stack`,children:[Y&&A&&r.jsx("div",{className:dt(`${s}-fade-item-prev`,`${s}-fade-out`),children:X(Y,{...Ae,hideControls:!0})}),r.jsx("div",{className:dt(`${s}-fade-item-current`,A?`${s}-fade-in`:void 0),children:X(M,Ae)})]})]}),oe.mode==="On"&&r.jsxs("div",{className:`${s}-controls`,children:[r.jsx("div",{className:`${s}-arrow`,style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:k,disabled:!L,"aria-label":"Previous testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:b,hoverFill:I,className:dt(`${s}-arrow-img`,`${s}-mirror`)})})}),r.jsx("div",{className:dt(`${s}-arrow`,`${s}-next-arrow`),style:{width:$.scalingValue(m??.02,n??!1),height:$.scalingValue(m??.02,n??!1),"--arrow-hover-color":I},children:r.jsx("button",{type:"button",className:`${s}-arrow-inner`,onClick:ne,disabled:!L,"aria-label":"Next testimonial",children:oe.icon&&r.jsx(rn,{url:oe.icon,fill:b,hoverFill:I,className:`${s}-arrow-img`})})})]})]})})},Sg=`import cn from 'classnames';
|
|
4247
4299
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
4248
4300
|
import { CommonComponentProps } from '../props';
|
|
4249
4301
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
@@ -4739,7 +4791,7 @@ type TestimonialsSettings = {
|
|
|
4739
4791
|
icon?: string | null;
|
|
4740
4792
|
};
|
|
4741
4793
|
};
|
|
4742
|
-
`,$g="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>'),
|
|
4794
|
+
`,$g="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>'),Fs={fontSettings:{type:"object",scope:"common",display:{type:"font-settings"},properties:{fontWeight:{type:"number",scope:"common"},fontStyle:{type:"string",scope:"common"}}}},Cg={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:{...Fs.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:{...Fs.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:$g},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"}]}]}]}},Tg={element:wg,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:Cg,sourceCode:Sg,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls.icon"}]},fontSettingsPaths:{content:[],parameters:[{path:"textFontFamily"},{path:"captionFontFamily"}]},fontRelations:{textFontSettings:"textFontFamily",captionFontSettings:"captionFontFamily"}};function Lg(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ws(e){return((e==null?void 0:e.trim().length)??0)>0}function Ur(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Kr(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Rg(e){return`
|
|
4743
4795
|
.${e}-wrapper {
|
|
4744
4796
|
display: grid;
|
|
4745
4797
|
align-items: start;
|
|
@@ -5086,7 +5138,7 @@ type TestimonialsSettings = {
|
|
|
5086
5138
|
z-index: 2;
|
|
5087
5139
|
width: 100%;
|
|
5088
5140
|
}
|
|
5089
|
-
`}function Ig(){return Math.random()<.5?"ltr":"ttb"}function Eg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Mg(e){const t=Ig();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Eg(e)})})}const vn=500,Pg=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",kg=72,Ag=50;function Fg(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 Wg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function _g(e){const[t]=e.media;return t!=null&&t.url?t:null}function xc(e){return!Array.isArray(e)||e.length===0?[]:Fg(e)?e.flatMap(t=>{const n=Wg(t);if(!n)return[];const i=_g(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 gi(e){return e.type==="video"}function Hg(e){const t=new Set,n=[];for(const i of e){const o=xc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Ng({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Og(e){e.pause(),e.removeAttribute("src"),e.load()}function Hs({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Ns(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Dg(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function jg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{Og(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function zg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=a.useRef(null),y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),E=a.useRef("none"),L=a.useRef(!1),C=a.useRef(!1),K=a.useRef(null),W=a.useRef(0),B=a.useRef(null),A=a.useRef(!1),T=a.useRef(null),j=a.useRef(null),w=a.useRef(null),P=a.useRef(()=>{}),[M,X]=a.useState(null),[k,q]=a.useState(null),[V,G]=a.useState("opening"),[ie,S]=a.useState(0),[R,O]=a.useState(0),[ae,se]=a.useState(null),[I,de]=a.useState(!1),[F,te]=a.useState(!1),[Z,ve]=a.useState(!1),[Ae,he]=a.useState(null),pe=a.useRef(n),U=a.useRef(void 0),ee=t[n],Y=ee?gi(ee):!1,Oe=R!==0||I,$e=ae!==null,He=a.useCallback(fe=>{const Me=fe.currentTarget,_e=Me instanceof HTMLVideoElement?{width:Me.videoWidth,height:Me.videoHeight}:{width:Me.naturalWidth,height:Me.naturalHeight};!_e.width||!_e.height||he(_e)},[]);a.useEffect(()=>{K.current=k},[k]),a.useEffect(()=>{const fe=v.current;if(!fe)return;const Me=()=>q(Ns(fe));Me();const _e=new ResizeObserver(Me);return _e.observe(fe),()=>_e.disconnect()},[]);const ue=a.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),me=a.useCallback(()=>{const fe=j.current;j.current=null,ue(),B.current=null,A.current=!1,se(null),de(!1),O(0),W.current=0,te(!1),L.current=!1,b.current=0,E.current="none",fe===1?d():fe===-1&&l()},[ue,d,l]),be=a.useCallback(()=>{ue(),j.current=null,B.current=null,A.current=!1,se(null),de(!1),O(0),W.current=0},[ue]),z=a.useCallback(()=>{ue(),T.current=window.setTimeout(()=>{j.current!==null&&me()},vn+32)},[ue,me]),le=a.useCallback((fe,Me)=>{var Ke;const _e=((Ke=K.current)==null?void 0:Ke.width)??0;if(ue(),B.current=fe,se(fe),A.current=!0,de(!0),Me){j.current=fe;const it=-fe*_e;W.current=it,O(it),z();return}W.current=0,O(0),T.current=window.setTimeout(()=>{T.current=null,be()},vn+32)},[ue,be,z]),ye=a.useCallback(fe=>{if(!(t.length<=1)){if(A.current){if(j.current===fe){w.current=fe,me();return}be()}ue(),B.current=fe,se(fe),A.current=!1,de(!1),W.current=0,O(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(fe,!0)})})}},[t.length,le,me,be,ue]);P.current=ye;const we=a.useCallback(fe=>{fe.propertyName!=="transform"||!A.current||j.current!==null&&me()},[me]),Pe=a.useCallback(()=>{const fe=y.current;if(!fe)return;const Me=Ns(fe);!Me.width||!Me.height||X(Me)},[]);a.useEffect(()=>{Pe();const fe=y.current;if(!fe)return;const Me=new ResizeObserver(()=>Pe());return Me.observe(fe),()=>Me.disconnect()},[Pe]),a.useEffect(()=>{V==="opening"&&M&&G("open")},[V,M]),a.useEffect(()=>{if(V!=="closing")return;const fe=setTimeout(()=>s(),vn);return()=>clearTimeout(fe)},[V,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{pe.current===n&&U.current===(ee==null?void 0:ee.url)||(ue(),j.current=null,se(null),S(0),O(0),de(!1),ve(!1),te(!1),he(null),m.current=0,b.current=0,E.current="none",L.current=!1,A.current=!1,W.current=0,B.current=null,h.current=null,C.current=!1,pe.current=n,U.current=ee==null?void 0:ee.url)},[n,ee==null?void 0:ee.url,ue]),a.useLayoutEffect(()=>{const fe=w.current;fe!==null&&(w.current=null,requestAnimationFrame(()=>{P.current(fe)}))},[n,ee==null?void 0:ee.url]),a.useEffect(()=>{if(V!=="open")return;let fe=null;const Me=()=>{fe&&(document.removeEventListener("click",fe,!0),fe=null)},_e=()=>{Me(),fe=ot=>{ot.stopPropagation(),ot.preventDefault(),Me()},document.addEventListener("click",fe,!0)},Ke=ot=>{const We=ot<0?1:-1;if(Math.abs(ot)>Ag&&t.length>1){le(We,!0);return}le(We,!1)},it=ot=>{if(ot.touches.length!==1||A.current)return;const We=ot.touches[0];C.current=!0,h.current={x:We.clientX,y:We.clientY},E.current="none",b.current=0,L.current=!1},Ye=ot=>{if(!h.current||ot.touches.length!==1||A.current)return;const We=ot.touches[0],Ze=We.clientX-h.current.x,Ve=We.clientY-h.current.y;if(E.current==="none"){if(Math.abs(Ze)<10&&Math.abs(Ve)<10)return;if(Math.abs(Ze)>Math.abs(Ve)){if(t.length<=1)return;E.current="horizontal"}else if(Ve>0)E.current="vertical";else return}if(E.current==="horizontal"){L.current=!0,te(!0),b.current=Ze;const st=Ze<0?1:-1;B.current!==st&&(B.current=st,se(st)),W.current=Ze,O(Ze),ot.preventDefault();return}E.current==="vertical"&&(L.current=!0,te(!0),m.current=Ve,S(Ve),ot.preventDefault())},xt=()=>{if(!h.current)return;const ot=E.current,We=L.current;if(We&&ot==="horizontal")Ke(b.current),_e();else if(We&&ot==="vertical")if(m.current>kg){const Ve=window.innerHeight;m.current=Ve,ve(!0),S(Ve),G("closing")}else m.current=0,S(0),_e();else ot==="horizontal"&&Math.abs(b.current)>0&&(Ke(b.current),_e());h.current=null,E.current="none",b.current=0,L.current=!1,te(!1)};return document.addEventListener("touchstart",it,{passive:!0}),document.addEventListener("touchmove",Ye,{passive:!1}),document.addEventListener("touchend",xt),document.addEventListener("touchcancel",xt),()=>{document.removeEventListener("touchstart",it),document.removeEventListener("touchmove",Ye),document.removeEventListener("touchend",xt),document.removeEventListener("touchcancel",xt),Me()}},[V,t.length,le]),a.useEffect(()=>{const fe=Me=>{Me.key==="Escape"&&(Me.preventDefault(),Me.stopPropagation(),V!=="closing"&&G("closing"))};return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[V]);const Ce=()=>{V!=="closing"&&G("closing")},_=V==="open",ge=V==="closing",ne=ie>0?Math.max(0,1-ie/500):1,H=ie>0?Math.max(.35,1-ie/500):1,Q=M?p?M:Dg(M,Ae):null,Fe=fe=>{if(fe.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const Me=Q??fe.currentTarget.getBoundingClientRect(),_e=fe.clientY-Me.top,Ke=Math.min(52,Me.height*.2);if(!(_e>Me.height-Ke)){if(fe.clientX-Me.left<Me.width/2){ye(-1);return}ye(1)}},re=fe=>{if(t.length<=1)return;const Me=Q??fe.currentTarget.getBoundingClientRect(),_e=fe.clientX-Me.left,Ke=fe.clientY-Me.top,it=Math.min(52,Me.height*.2);if(Ke>Me.height-it){fe.currentTarget.style.cursor="default";return}fe.currentTarget.style.cursor=_e<Me.width/2?"w-resize":"e-resize"},N={position:"fixed",top:k==null?void 0:k.top,left:k==null?void 0:k.left,width:k==null?void 0:k.width,height:k==null?void 0:k.height,zIndex:9998},qe=p?"cover":"contain",Be=R!==0||ie>0?`translate(${R}px, ${ie}px)`:void 0,at=F&&!I?"none":I?`transform ${vn}ms ${Hn}`:Z?`transform ${vn}ms ${Hn}, opacity ${vn}ms ${Hn}`:V==="opening"||ge?`opacity ${vn}ms ${Hn}`:"none",et={...N,transform:Be,opacity:ie>0?H:V==="opening"||ge?0:1,transition:at,pointerEvents:"none"},ut={position:"absolute",top:((Q==null?void 0:Q.top)??0)-((k==null?void 0:k.top)??0),left:((Q==null?void 0:Q.left)??0)-((k==null?void 0:k.left)??0),width:Q==null?void 0:Q.width,height:Q==null?void 0:Q.height,objectFit:qe,pointerEvents:Y&&_&&!Oe?"auto":"none",touchAction:Y&&_?"none":void 0},ke=(k==null?void 0:k.width)??0,Ie=$e?(n+ae+t.length)%t.length:null,oe=Ie!==null?t[Ie]:null,Te={...N,transform:$e?`translateX(${ae*ke+R}px)`:void 0,opacity:1,transition:I?`transform ${vn}ms ${Hn}`:"none",pointerEvents:"none"},Ee={position:"absolute",top:((M==null?void 0:M.top)??0)-((k==null?void 0:k.top)??0),left:((M==null?void 0:M.left)??0)-((k==null?void 0:k.left)??0),width:M==null?void 0:M.width,height:M==null?void 0:M.height,objectFit:qe,pointerEvents:"none"},De=Q?{position:"fixed",top:Q.top,height:Q.height,width:Q.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:V==="open"?"none":void 0},onClick:Ce,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:_?ne:0,transition:F?"none":`opacity ${vn}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:_?1:0,transition:`opacity ${vn}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),M&&k&&oe&&r.jsx("div",{style:Te,onTransitionEnd:we,children:gi(oe)?r.jsx("video",{src:oe.url,muted:!0,playsInline:!0,preload:"auto",style:Ee},`neighbor-${Ie}-${oe.url}`):r.jsx("img",{src:oe.url,alt:oe.name,style:Ee},`neighbor-${Ie}-${oe.url}`)}),M&&k&&ee&&r.jsx("div",{style:et,onTransitionEnd:we,children:Y?r.jsx(jg,{src:ee.url,phase:V,mediaRef:g,mediaStyle:ut,onLoadedMetadata:He,onClick:Fe,onMouseMove:re},`${n}-${ee.url}`):r.jsx("img",{ref:g,src:ee.url,alt:ee.name,onLoad:He,style:ut},`${n}-${ee.url}`)}),_&&De&&t.length>1&&!Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...De,left:Q.left,cursor:"w-resize",pointerEvents:F?"none":"auto"},onClick:fe=>{if(C.current){C.current=!1;return}fe.stopPropagation(),ye(-1)}}),r.jsx("div",{style:{...De,left:Q.left+Q.width/2,cursor:"e-resize",pointerEvents:F?"none":"auto"},onClick:fe=>{if(C.current){C.current=!1;return}fe.stopPropagation(),ye(1)}})]})]})}function Bg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=$.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:y=100,verticalGap:g,entriesCount:h,lightbox:m,imageDisplay:b,imageCorners:E,lightboxImageDisplay:L,slider:C,sliderTiming:K,direction:W,transition:B,titleMarginTop:A,subtitleMarginTop:T,titleColor:j,subtitleColor:w,lightboxCounterColor:P,titleFontFamily:M,titleFontSettings:X,titleFontSize:k,titleLineHeight:q,titleLetterSpacing:V,titleWordSpacing:G,titleTextAppearance:ie,subtitleFontFamily:S,subtitleFontSettings:R,subtitleFontSize:O,subtitleLineHeight:ae,subtitleLetterSpacing:se,subtitleWordSpacing:I,subtitleTextAppearance:de,lightboxCounterFontFamily:F,lightboxCounterFontSettings:te,lightboxCounterFontSize:Z,lightboxCounterLineHeight:ve,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:he,lightboxCounterTextAppearance:pe,showText:U="always",alignEntries:ee="off",align:Y="top"}=e,Oe={fontSettings:{fontFamily:M,fontWeight:(X==null?void 0:X.fontWeight)??400,fontStyle:(X==null?void 0:X.fontStyle)??"normal"},fontSize:k??.01,lineHeight:q,letterSpacing:V??0,wordSpacing:G??0,textAppearance:ie,color:j},He={...on(Kt(Oe,n))},ue={fontSettings:{fontFamily:S,fontWeight:(R==null?void 0:R.fontWeight)??400,fontStyle:(R==null?void 0:R.fontStyle)??"normal"},fontSize:O??.01,lineHeight:ae,letterSpacing:se??0,wordSpacing:I??0,textAppearance:de,color:w},be={...on(Kt(ue,n))},z={fontSettings:{fontFamily:F,fontWeight:(te==null?void 0:te.fontWeight)??400,fontStyle:(te==null?void 0:te.fontStyle)??"normal"},fontSize:Z??.01,lineHeight:ve,letterSpacing:Ae??0,wordSpacing:he??0,textAppearance:pe,color:P},ye={...on(Kt(z,n)),...Kr(Z,ve,u,n)},we=Ur(k,q,`${u}-item-title`,`${u}-text-tight-leading`),Pe=Ur(O,ae,`${u}-item-subtitle`,`${u}-text-tight-leading`),Ce=Kr(k,q,u,n),_=Kr(O,ae,u,n),ge=Ur(Z,ve,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ne=$.buildColorVars(u,{titleColor:j,subtitleColor:w,lightboxCounterColor:P},Gg,qg),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${U==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),re=h===0?1/0:h,N=(t??[]).slice(0,re),qe=a.useMemo(()=>m==="on"?Hg(N):[],[N,m]),Be=v.entryWidth??.2,at=(b==null?void 0:b.display)==="cover",et=(b==null?void 0:b.ratioValue)??"1:1",ut=(b==null?void 0:b.reversed)??!1,[ke,Ie]=et.split(":").map(Number),Ee=`${ut?Ie:ke} / ${ut?ke:Ie}`,De=v.columnsCount,fe=$.scalingValue(Be??0,n),Me=fe,_e=!at&&C!=="off",Ke=N.length%De||De,it=Ke<De&&N.length>0,Ye=N.length-Ke,xt=it?Math.floor((De-Ke)/2)+1:1,ot=E?$.scalingValue(E,n):void 0,We={width:Me,...at?{aspectRatio:Ee,height:"auto",overflow:"hidden"}:{height:"auto"},...ot?{borderRadius:ot,overflow:"hidden"}:{}},Ze=`${u}-item-image-wrapper${_e?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Ve=p==="d"||p==="e"||p==="f",st=ee==="on",pt=`calc(${$.scalingValue(Be??0,n)} * (${y} / 100))`,ct=$.scalingValue(Be*y/100,n),Et=at?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ot?{borderRadius:ot}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ot?{borderRadius:ot}:{}},[zt,Xt]=a.useState(0),yt=a.useRef(null),bt=B==="fade"||W==="horizontal"?"ltr":W==="vertical"?"ttb":"ltr";a.useEffect(()=>{const mt=yt.current;if(!mt)return;const Le=new ResizeObserver(ze=>{Xt(Math.round(ze[0].contentRect.width))});return Le.observe(mt),()=>Le.disconnect()},[]);const Nt=(()=>{const mt={...ne},Le=yt.current?getComputedStyle(yt.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(mt["--cntrl-article-width"]=Le),mt})(),[At,wt]=a.useState(!1),[Ot,Ut]=a.useState([]),[Zt,tn]=a.useState(0),Ct=m==="on"&&(!n||i),Bt=(mt,Le)=>{n&&!i||m!=="off"&&(Ut(mt),tn(Le),wt(!0))};a.useEffect(()=>{if(!At||m!=="on"||typeof document>"u")return;const mt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=mt}},[At,m]),a.useEffect(()=>{!n||i||wt(!1)},[n,i]);const cn=a.useMemo(()=>Rg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(Ng,{mediaList:qe}),r.jsx("div",{style:ne,children:r.jsx("div",{ref:yt,className:`${u}-wrapper ${u}-type-${p}${st?` ${u}-align-entries`:""} ${u}-image-align-${Y} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${De}, ${fe})`,rowGap:st?0:$.scalingValue(g??0,n),columnGap:$.scalingValue(v.horizontalGap??0,n),width:$.scalingValue(v.wrapperWidth??0,n),...st?{[`--${u}-align-entries-row-gap`]:$.scalingValue(g??0,n)}:{}},children:N.map((mt,Le)=>{var Ft;const ze=_s(mt.title),tt=_s(mt.subtitle),gt=(((Ft=mt.link)==null?void 0:Ft.length)??0)>0&&m==="off"?mt.link:void 0,ht=Math.floor(Le/De)===Math.ceil(N.length/De)-1,Rt=it&&Le>=Ye?`${xt+(Le-Ye)}`:void 0,dt=Ve?r.jsxs("div",{className:`${u}-item-text-block`,children:[ze&&r.jsx("p",{className:we,style:{width:pt,...He,...Ce},children:mt.title}),ze&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:ct}}),tt&&r.jsx("p",{className:Pe,style:{width:pt,...be,..._},children:mt.subtitle}),tt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(T??0,n),width:ct}})]}):null,Dt=st?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&ze?"titleMarginTop":void 0,className:o&&ze?`${u}-control`:void 0,style:{height:ze?$.scalingValue(A??0,n):0,width:ct}}),ze&&r.jsx("p",{className:we,style:{width:pt,...He,...Ce},children:mt.title}),Ve&&ze&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:ct}})]}):null,kt=st?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Ve&&r.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?$.scalingValue(T??0,n):0,width:ct}}),tt&&r.jsx("p",{className:Pe,style:{width:pt,...be,..._},children:mt.subtitle}),Ve&&tt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(T??0,n),width:ct}})]}):null,Pt=gt?r.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:[Dt,kt]}):r.jsxs(r.Fragment,{children:[Dt,kt]}),Vt=xc(mt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Wt=r.jsx("div",{className:Ze,style:We,children:Vt.length===0?null:C==="off"?(()=>{const{displayMedia:St,lightboxMedia:x}=Vt[0],xe=x?Gt.findIndex(Re=>Re.url===x.url):-1;return r.jsx(Hs,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Et,onMediaClick:Ct&&xe>=0?()=>Bt(Gt,xe):void 0})})():r.jsxs(r.Fragment,{children:[_e&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>gi(St)?r.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):r.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),r.jsx(Za,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:K*1e3,width:"100%",height:"100%",speed:Pg,type:B==="fade"?"fade":"loop",rewind:B==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:St=>{W!=="random"||B==="fade"||Mg(St)},children:Vt.map(({displayMedia:St,lightboxMedia:x},xe)=>{const Re=x?Gt.findIndex(Ne=>Ne.url===x.url):-1;return r.jsx(Ja,{children:r.jsx(Hs,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Et,onMediaClick:Ct&&Re>=0?()=>Bt(Gt,Re):void 0})},xe)})},`${B}-${Be}-${W}-${K}-${zt}-${d}`)]})}),_t=Ve?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&ze?"titleMarginTop":void 0,className:o&&ze?`${u}-control`:void 0,style:{height:ze?$.scalingValue(A??0,n):0,width:ct}}),r.jsx("p",{className:we,style:{width:pt,...He,...Ce},children:mt.title}),r.jsx("div",{"data-controls":o&&tt?"subtitleMarginTop":void 0,className:o&&tt?`${u}-control`:void 0,style:{height:tt?$.scalingValue(T??0,n):0,width:ct}}),r.jsx("p",{className:Pe,style:{width:pt,...be,..._},children:mt.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!st?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${st&&ht?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(y??0)>100?`calc(${fe} * (${y} / 100))`:fe,...Rt&&st?{gridColumn:Rt}:{}},children:st?r.jsx(r.Fragment,{children:Ve?r.jsxs(r.Fragment,{children:[Pt,r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Wt})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:Wt}),Pt]})}):gt?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:gt,target:"_blank",className:`${u}-item-image-link`,children:[dt,Wt]}),!Ve&&r.jsx("a",{href:gt,target:"_blank",className:`${u}-item-text-link`,children:_t})]}):r.jsxs(r.Fragment,{children:[dt,Wt,_t]})})},Le)})})}),(!n||i)&&At&&typeof document<"u"&&m==="on"&&(()=>{const mt=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Nt,"data-selection":"none",children:r.jsx(zg,{prefix:u,items:Ot,index:Zt,imageDisplay:Bg(L),isEditor:n,onClose:()=>wt(!1),onPrev:()=>tn(Le=>(Le-1+Ot.length)%Ot.length),onNext:()=>tn(Le=>(Le+1)%Ot.length),counterClassName:ge,counterStyle:ye})}),mt)})()]})}const Gg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qg=["hover","focus","filled","success","error"],Ug=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5141
|
+
`}function Ig(){return Math.random()<.5?"ltr":"ttb"}function Eg(e){const t=e.Components.Autoplay;t&&(t.pause(!1),t.play())}function Mg(e){const t=Ig();e.options.direction!==t&&(e.options={...e.options,direction:t}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Eg(e)})})}const vn=500,Pg=750,Hn="cubic-bezier(0.22, 1, 0.36, 1)",kg=72,Ag=50;function Fg(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 Wg(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function _g(e){const[t]=e.media;return t!=null&&t.url?t:null}function vc(e){return!Array.isArray(e)||e.length===0?[]:Fg(e)?e.flatMap(t=>{const n=Wg(t);if(!n)return[];const i=_g(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 gi(e){return e.type==="video"}function Hg(e){const t=new Set,n=[];for(const i of e){const o=vc(i.gallery);for(const s of o){const l=s.lightboxMedia;l!=null&&l.url&&!t.has(l.url)&&(t.add(l.url),n.push(l))}}return n}function Ng({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>gi(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Og(e){e.pause(),e.removeAttribute("src"),e.load()}function _s({media:e,className:t,style:n,onMediaClick:i}){return gi(e)?r.jsx("video",{src:e.url,className:t,style:{...n,cursor:i?"pointer":"default"},muted:!0,autoPlay:!0,loop:!0,playsInline:!0,onClick:i}):r.jsx("img",{src:e.url,alt:e.name,className:t,style:{...n,cursor:i?"pointer":"default"},onClick:i})}function Hs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Dg(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 s=e.width/n;return{width:e.width,height:s,left:e.left,top:e.top+(e.height-s)/2}}const o=e.height*n;return{width:o,height:e.height,left:e.left+(e.width-o)/2,top:e.top}}function jg({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l}){return a.useEffect(()=>{const d=n.current;if(d)return()=>{Og(d)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,style:i})}function zg({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u}){const p=i==="cover",v=a.useRef(null),x=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),C=a.useRef(!1),R=a.useRef(!1),K=a.useRef(null),F=a.useRef(0),V=a.useRef(null),A=a.useRef(!1),T=a.useRef(null),j=a.useRef(null),y=a.useRef(null),W=a.useRef(()=>{}),[M,Y]=a.useState(null),[P,U]=a.useState(null),[z,B]=a.useState("opening"),[te,S]=a.useState(0),[E,D]=a.useState(0),[se,oe]=a.useState(null),[L,ue]=a.useState(!1),[k,ne]=a.useState(!1),[X,be]=a.useState(!1),[Ae,fe]=a.useState(null),le=a.useRef(n),q=a.useRef(void 0),Q=t[n],Z=Q?gi(Q):!1,Ne=E!==0||L,Te=se!==null,We=a.useCallback(ve=>{const Ee=ve.currentTarget,Me=Ee instanceof HTMLVideoElement?{width:Ee.videoWidth,height:Ee.videoHeight}:{width:Ee.naturalWidth,height:Ee.naturalHeight};!Me.width||!Me.height||fe(Me)},[]);a.useEffect(()=>{K.current=P},[P]),a.useEffect(()=>{const ve=v.current;if(!ve)return;const Ee=()=>U(Hs(ve));Ee();const Me=new ResizeObserver(Ee);return Me.observe(ve),()=>Me.disconnect()},[]);const ce=a.useCallback(()=>{T.current!==null&&(window.clearTimeout(T.current),T.current=null)},[]),ye=a.useCallback(()=>{const ve=j.current;j.current=null,ce(),V.current=null,A.current=!1,oe(null),ue(!1),D(0),F.current=0,ne(!1),C.current=!1,b.current=0,I.current="none",ve===1?d():ve===-1&&l()},[ce,d,l]),$e=a.useCallback(()=>{ce(),j.current=null,V.current=null,A.current=!1,oe(null),ue(!1),D(0),F.current=0},[ce]),G=a.useCallback(()=>{ce(),T.current=window.setTimeout(()=>{j.current!==null&&ye()},vn+32)},[ce,ye]),re=a.useCallback((ve,Ee)=>{var Ge;const Me=((Ge=K.current)==null?void 0:Ge.width)??0;if(ce(),V.current=ve,oe(ve),A.current=!0,ue(!0),Ee){j.current=ve;const Ze=-ve*Me;F.current=Ze,D(Ze),G();return}F.current=0,D(0),T.current=window.setTimeout(()=>{T.current=null,$e()},vn+32)},[ce,$e,G]),pe=a.useCallback(ve=>{if(!(t.length<=1)){if(A.current){if(j.current===ve){y.current=ve,ye();return}$e()}ce(),V.current=ve,oe(ve),A.current=!1,ue(!1),F.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(ve,!0)})})}},[t.length,re,ye,$e,ce]);W.current=pe;const Se=a.useCallback(ve=>{ve.propertyName!=="transform"||!A.current||j.current!==null&&ye()},[ye]),Pe=a.useCallback(()=>{const ve=x.current;if(!ve)return;const Ee=Hs(ve);!Ee.width||!Ee.height||Y(Ee)},[]);a.useEffect(()=>{Pe();const ve=x.current;if(!ve)return;const Ee=new ResizeObserver(()=>Pe());return Ee.observe(ve),()=>Ee.disconnect()},[Pe]),a.useEffect(()=>{z==="opening"&&M&&B("open")},[z,M]),a.useEffect(()=>{if(z!=="closing")return;const ve=setTimeout(()=>s(),vn);return()=>clearTimeout(ve)},[z,s]),a.useEffect(()=>()=>{ce()},[ce]),a.useLayoutEffect(()=>{le.current===n&&q.current===(Q==null?void 0:Q.url)||(ce(),j.current=null,oe(null),S(0),D(0),ue(!1),be(!1),ne(!1),fe(null),m.current=0,b.current=0,I.current="none",C.current=!1,A.current=!1,F.current=0,V.current=null,h.current=null,R.current=!1,le.current=n,q.current=Q==null?void 0:Q.url)},[n,Q==null?void 0:Q.url,ce]),a.useLayoutEffect(()=>{const ve=y.current;ve!==null&&(y.current=null,requestAnimationFrame(()=>{W.current(ve)}))},[n,Q==null?void 0:Q.url]),a.useEffect(()=>{if(z!=="open")return;let ve=null;const Ee=()=>{ve&&(document.removeEventListener("click",ve,!0),ve=null)},Me=()=>{Ee(),ve=tt=>{tt.stopPropagation(),tt.preventDefault(),Ee()},document.addEventListener("click",ve,!0)},Ge=tt=>{const ke=tt<0?1:-1;if(Math.abs(tt)>Ag&&t.length>1){re(ke,!0);return}re(ke,!1)},Ze=tt=>{if(tt.touches.length!==1||A.current)return;const ke=tt.touches[0];R.current=!0,h.current={x:ke.clientX,y:ke.clientY},I.current="none",b.current=0,C.current=!1},Ue=tt=>{if(!h.current||tt.touches.length!==1||A.current)return;const ke=tt.touches[0],Xe=ke.clientX-h.current.x,Oe=ke.clientY-h.current.y;if(I.current==="none"){if(Math.abs(Xe)<10&&Math.abs(Oe)<10)return;if(Math.abs(Xe)>Math.abs(Oe)){if(t.length<=1)return;I.current="horizontal"}else if(Oe>0)I.current="vertical";else return}if(I.current==="horizontal"){C.current=!0,ne(!0),b.current=Xe;const ot=Xe<0?1:-1;V.current!==ot&&(V.current=ot,oe(ot)),F.current=Xe,D(Xe),tt.preventDefault();return}I.current==="vertical"&&(C.current=!0,ne(!0),m.current=Oe,S(Oe),tt.preventDefault())},lt=()=>{if(!h.current)return;const tt=I.current,ke=C.current;if(ke&&tt==="horizontal")Ge(b.current),Me();else if(ke&&tt==="vertical")if(m.current>kg){const Oe=window.innerHeight;m.current=Oe,be(!0),S(Oe),B("closing")}else m.current=0,S(0),Me();else tt==="horizontal"&&Math.abs(b.current)>0&&(Ge(b.current),Me());h.current=null,I.current="none",b.current=0,C.current=!1,ne(!1)};return document.addEventListener("touchstart",Ze,{passive:!0}),document.addEventListener("touchmove",Ue,{passive:!1}),document.addEventListener("touchend",lt),document.addEventListener("touchcancel",lt),()=>{document.removeEventListener("touchstart",Ze),document.removeEventListener("touchmove",Ue),document.removeEventListener("touchend",lt),document.removeEventListener("touchcancel",lt),Ee()}},[z,t.length,re]),a.useEffect(()=>{const ve=Ee=>{Ee.key==="Escape"&&(Ee.preventDefault(),Ee.stopPropagation(),z!=="closing"&&B("closing"))};return window.addEventListener("keydown",ve,!0),()=>window.removeEventListener("keydown",ve,!0)},[z]);const Re=()=>{z!=="closing"&&B("closing")},H=z==="open",ge=z==="closing",ie=te>0?Math.max(0,1-te/500):1,_=te>0?Math.max(.35,1-te/500):1,ee=M?p?M:Dg(M,Ae):null,Fe=ve=>{if(ve.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const Ee=ee??ve.currentTarget.getBoundingClientRect(),Me=ve.clientY-Ee.top,Ge=Math.min(52,Ee.height*.2);if(!(Me>Ee.height-Ge)){if(ve.clientX-Ee.left<Ee.width/2){pe(-1);return}pe(1)}},ae=ve=>{if(t.length<=1)return;const Ee=ee??ve.currentTarget.getBoundingClientRect(),Me=ve.clientX-Ee.left,Ge=ve.clientY-Ee.top,Ze=Math.min(52,Ee.height*.2);if(Ge>Ee.height-Ze){ve.currentTarget.style.cursor="default";return}ve.currentTarget.style.cursor=Me<Ee.width/2?"w-resize":"e-resize"},N={position:"fixed",top:P==null?void 0:P.top,left:P==null?void 0:P.left,width:P==null?void 0:P.width,height:P==null?void 0:P.height,zIndex:9998},qe=p?"cover":"contain",je=E!==0||te>0?`translate(${E}px, ${te}px)`:void 0,st=k&&!L?"none":L?`transform ${vn}ms ${Hn}`:X?`transform ${vn}ms ${Hn}, opacity ${vn}ms ${Hn}`:z==="opening"||ge?`opacity ${vn}ms ${Hn}`:"none",et={...N,transform:je,opacity:te>0?_:z==="opening"||ge?0:1,transition:st,pointerEvents:"none"},pt={position:"absolute",top:((ee==null?void 0:ee.top)??0)-((P==null?void 0:P.top)??0),left:((ee==null?void 0:ee.left)??0)-((P==null?void 0:P.left)??0),width:ee==null?void 0:ee.width,height:ee==null?void 0:ee.height,objectFit:qe,pointerEvents:Z&&H&&!Ne?"auto":"none",touchAction:Z&&H?"none":void 0},rt=(P==null?void 0:P.width)??0,Ve=Te?(n+se+t.length)%t.length:null,xe=Ve!==null?t[Ve]:null,me={...N,transform:Te?`translateX(${se*rt+E}px)`:void 0,opacity:1,transition:L?`transform ${vn}ms ${Hn}`:"none",pointerEvents:"none"},he={position:"absolute",top:((M==null?void 0:M.top)??0)-((P==null?void 0:P.top)??0),left:((M==null?void 0:M.left)??0)-((P==null?void 0:P.left)??0),width:M==null?void 0:M.width,height:M==null?void 0:M.height,objectFit:qe,pointerEvents:"none"},He=ee?{position:"fixed",top:ee.top,height:ee.height,width:ee.width/2,zIndex:9999}:null;return r.jsxs("div",{ref:v,className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:z==="open"?"none":void 0},onClick:Re,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:H?ie:0,transition:k?"none":`opacity ${vn}ms ${Hn}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:p?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:x,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Hn}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:x,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:H?1:0,transition:`opacity ${vn}ms ${Hn}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),M&&P&&xe&&r.jsx("div",{style:me,onTransitionEnd:Se,children:gi(xe)?r.jsx("video",{src:xe.url,muted:!0,playsInline:!0,preload:"auto",style:he},`neighbor-${Ve}-${xe.url}`):r.jsx("img",{src:xe.url,alt:xe.name,style:he},`neighbor-${Ve}-${xe.url}`)}),M&&P&&Q&&r.jsx("div",{style:et,onTransitionEnd:Se,children:Z?r.jsx(jg,{src:Q.url,phase:z,mediaRef:g,mediaStyle:pt,onLoadedMetadata:We,onClick:Fe,onMouseMove:ae},`${n}-${Q.url}`):r.jsx("img",{ref:g,src:Q.url,alt:Q.name,onLoad:We,style:pt},`${n}-${Q.url}`)}),H&&He&&t.length>1&&!Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...He,left:ee.left,cursor:"w-resize",pointerEvents:k?"none":"auto"},onClick:ve=>{if(R.current){R.current=!1;return}ve.stopPropagation(),pe(-1)}}),r.jsx("div",{style:{...He,left:ee.left+ee.width/2,cursor:"e-resize",pointerEvents:k?"none":"auto"},onClick:ve=>{if(R.current){R.current=!1;return}ve.stopPropagation(),pe(1)}})]})]})}function Bg(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function Vg({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,metadata:s,activeEvent:l,layoutId:d,portalId:c}){const{prefix:u}=$.useScopedStyles(),{type:p="a",gridLayout:v,textBoxWidth:x=100,verticalGap:g,entriesCount:h,lightbox:m,imageDisplay:b,imageCorners:I,lightboxImageDisplay:C,slider:R,sliderTiming:K,direction:F,transition:V,titleMarginTop:A,subtitleMarginTop:T,titleColor:j,subtitleColor:y,lightboxCounterColor:W,titleFontFamily:M,titleFontSettings:Y,titleFontSize:P,titleLineHeight:U,titleLetterSpacing:z,titleWordSpacing:B,titleTextAppearance:te,subtitleFontFamily:S,subtitleFontSettings:E,subtitleFontSize:D,subtitleLineHeight:se,subtitleLetterSpacing:oe,subtitleWordSpacing:L,subtitleTextAppearance:ue,lightboxCounterFontFamily:k,lightboxCounterFontSettings:ne,lightboxCounterFontSize:X,lightboxCounterLineHeight:be,lightboxCounterLetterSpacing:Ae,lightboxCounterWordSpacing:fe,lightboxCounterTextAppearance:le,showText:q="always",alignEntries:Q="off",align:Z="top"}=e,Ne={fontSettings:{fontFamily:M,fontWeight:(Y==null?void 0:Y.fontWeight)??400,fontStyle:(Y==null?void 0:Y.fontStyle)??"normal"},fontSize:P??.01,lineHeight:U,letterSpacing:z??0,wordSpacing:B??0,textAppearance:te,color:j},We={...on(Kt(Ne,n))},ce={fontSettings:{fontFamily:S,fontWeight:(E==null?void 0:E.fontWeight)??400,fontStyle:(E==null?void 0:E.fontStyle)??"normal"},fontSize:D??.01,lineHeight:se,letterSpacing:oe??0,wordSpacing:L??0,textAppearance:ue,color:y},$e={...on(Kt(ce,n))},G={fontSettings:{fontFamily:k,fontWeight:(ne==null?void 0:ne.fontWeight)??400,fontStyle:(ne==null?void 0:ne.fontStyle)??"normal"},fontSize:X??.01,lineHeight:be,letterSpacing:Ae??0,wordSpacing:fe??0,textAppearance:le,color:W},pe={...on(Kt(G,n)),...Kr(X,be,u,n)},Se=Ur(P,U,`${u}-item-title`,`${u}-text-tight-leading`),Pe=Ur(D,se,`${u}-item-subtitle`,`${u}-text-tight-leading`),Re=Kr(P,U,u,n),H=Kr(D,se,u,n),ge=Ur(X,be,`${u}-lightbox-counter`,`${u}-text-tight-leading`),ie=$.buildColorVars(u,{titleColor:j,subtitleColor:y,lightboxCounterColor:W},Gg,qg),Fe=`${l&&l!=="default"?`${u}-state-${l}`:""}${q==="on hover"&&(!n||i)?` ${u}-show-text-hover`:""}`.trim(),ae=h===0?1/0:h,N=(t??[]).slice(0,ae),qe=a.useMemo(()=>m==="on"?Hg(N):[],[N,m]),je=v.entryWidth??.2,st=(b==null?void 0:b.display)==="cover",et=(b==null?void 0:b.ratioValue)??"1:1",pt=(b==null?void 0:b.reversed)??!1,[rt,Ve]=et.split(":").map(Number),he=`${pt?Ve:rt} / ${pt?rt:Ve}`,He=v.columnsCount,ve=$.scalingValue(je??0,n),Ee=ve,Me=!st&&R!=="off",Ge=N.length%He||He,Ze=Ge<He&&N.length>0,Ue=N.length-Ge,lt=Ze?Math.floor((He-Ge)/2)+1:1,tt=I?$.scalingValue(I,n):void 0,ke={width:Ee,...st?{aspectRatio:he,height:"auto",overflow:"hidden"}:{height:"auto"},...tt?{borderRadius:tt,overflow:"hidden"}:{}},Xe=`${u}-item-image-wrapper${Me?` ${u}-item-image-wrapper-fit-slider`:""}`.trim(),Oe=p==="d"||p==="e"||p==="f",ot=Q==="on",ct=`calc(${$.scalingValue(je??0,n)} * (${x} / 100))`,mt=$.scalingValue(je*x/100,n),Mt=st?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...tt?{borderRadius:tt}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...tt?{borderRadius:tt}:{}},[Ut,Yt]=a.useState(0),xt=a.useRef(null),bt=V==="fade"||F==="horizontal"?"ltr":F==="vertical"?"ttb":"ltr";a.useEffect(()=>{const gt=xt.current;if(!gt)return;const Le=new ResizeObserver(ze=>{Yt(Math.round(ze[0].contentRect.width))});return Le.observe(gt),()=>Le.disconnect()},[]);const _t=(()=>{const gt={...ie},Le=xt.current?getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim():"";return Le&&(gt["--cntrl-article-width"]=Le),gt})(),[kt,vt]=a.useState(!1),[Ft,zt]=a.useState([]),[Zt,en]=a.useState(0),Ct=m==="on"&&(!n||i),Bt=(gt,Le)=>{n&&!i||m!=="off"&&(zt(gt),en(Le),vt(!0))};a.useEffect(()=>{if(!kt||m!=="on"||typeof document>"u")return;const gt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=gt}},[kt,m]),a.useEffect(()=>{!n||i||vt(!1)},[n,i]);const cn=a.useMemo(()=>Rg(u),[u]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:cn}}),m==="on"&&r.jsx(Ng,{mediaList:qe}),r.jsx("div",{style:ie,children:r.jsx("div",{ref:xt,className:`${u}-wrapper ${u}-type-${p}${ot?` ${u}-align-entries`:""} ${u}-image-align-${Z} ${Fe}`.trim(),style:{gridTemplateColumns:`repeat(${He}, ${ve})`,rowGap:ot?0:$.scalingValue(g??0,n),columnGap:$.scalingValue(v.horizontalGap??0,n),width:$.scalingValue(v.wrapperWidth??0,n),...ot?{[`--${u}-align-entries-row-gap`]:$.scalingValue(g??0,n)}:{}},children:N.map((gt,Le)=>{var Wt;const ze=Ws(gt.title),nt=Ws(gt.subtitle),ht=(((Wt=gt.link)==null?void 0:Wt.length)??0)>0&&m==="off"?gt.link:void 0,ft=Math.floor(Le/He)===Math.ceil(N.length/He)-1,Rt=Ze&&Le>=Ue?`${lt+(Le-Ue)}`:void 0,ut=Oe?r.jsxs("div",{className:`${u}-item-text-block`,children:[ze&&r.jsx("p",{className:Se,style:{width:ct,...We,...Re},children:gt.title}),ze&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:mt}}),nt&&r.jsx("p",{className:Pe,style:{width:ct,...$e,...H},children:gt.subtitle}),nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(T??0,n),width:mt}})]}):null,Dt=ot?r.jsxs("div",{className:`${u}-item-title-row`,children:[!Oe&&r.jsx("div",{"data-controls":o&&ze?"titleMarginTop":void 0,className:o&&ze?`${u}-control`:void 0,style:{height:ze?$.scalingValue(A??0,n):0,width:mt}}),ze&&r.jsx("p",{className:Se,style:{width:ct,...We,...Re},children:gt.title}),Oe&&ze&&r.jsx("div",{"data-controls":o?"titleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(A??0,n),width:mt}})]}):null,At=ot?r.jsxs("div",{className:`${u}-item-subtitle-row`,children:[!Oe&&r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(T??0,n):0,width:mt}}),nt&&r.jsx("p",{className:Pe,style:{width:ct,...$e,...H},children:gt.subtitle}),Oe&&nt&&r.jsx("div",{"data-controls":o?"subtitleMarginTop":void 0,className:o?`${u}-control`:void 0,style:{height:$.scalingValue(T??0,n),width:mt}})]}):null,Pt=ht?r.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:[Dt,At]}):r.jsxs(r.Fragment,{children:[Dt,At]}),Vt=vc(gt.gallery),Gt=Vt.filter(St=>St.lightboxMedia).map(St=>St.lightboxMedia),Ht=r.jsx("div",{className:Xe,style:ke,children:Vt.length===0?null:R==="off"?(()=>{const{displayMedia:St,lightboxMedia:w}=Vt[0],we=w?Gt.findIndex(Ie=>Ie.url===w.url):-1;return r.jsx(_s,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Mt,onMediaClick:Ct&&we>=0?()=>Bt(Gt,we):void 0})})():r.jsxs(r.Fragment,{children:[Me&&r.jsx("div",{className:`${u}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Vt.map(({displayMedia:St})=>gi(St)?r.jsx("video",{src:St.url,muted:!0,playsInline:!0},`sizer-${St.url}`):r.jsx("img",{src:St.url,alt:""},`sizer-${St.url}`))}),r.jsx(Za,{className:`${u}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:K*1e3,width:"100%",height:"100%",speed:Pg,type:V==="fade"?"fade":"loop",rewind:V==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:bt},onMoved:St=>{F!=="random"||V==="fade"||Mg(St)},children:Vt.map(({displayMedia:St,lightboxMedia:w},we)=>{const Ie=w?Gt.findIndex(_e=>_e.url===w.url):-1;return r.jsx(Ja,{children:r.jsx(_s,{media:St,className:`${u}-item-${gi(St)?"video":"image"}`.trim(),style:Mt,onMediaClick:Ct&&Ie>=0?()=>Bt(Gt,Ie):void 0})},we)})},`${V}-${je}-${F}-${K}-${Ut}-${d}`)]})}),Nt=Oe?null:r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":o&&ze?"titleMarginTop":void 0,className:o&&ze?`${u}-control`:void 0,style:{height:ze?$.scalingValue(A??0,n):0,width:mt}}),r.jsx("p",{className:Se,style:{width:ct,...We,...Re},children:gt.title}),r.jsx("div",{"data-controls":o&&nt?"subtitleMarginTop":void 0,className:o&&nt?`${u}-control`:void 0,style:{height:nt?$.scalingValue(T??0,n):0,width:mt}}),r.jsx("p",{className:Pe,style:{width:ct,...$e,...H},children:gt.subtitle})]});return r.jsx("div",{className:`${u}-item`.trim(),style:Rt&&!ot?{gridColumn:Rt}:void 0,children:r.jsx("div",{className:`${o?`${u}-item-inner`:`${u}-item-inner-hidden`}${ot&&ft?` ${u}-item-inner-last-row`:""}`.trim(),style:{width:(x??0)>100?`calc(${ve} * (${x} / 100))`:ve,...Rt&&ot?{gridColumn:Rt}:{}},children:ot?r.jsx(r.Fragment,{children:Oe?r.jsxs(r.Fragment,{children:[Pt,r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht})]}):r.jsxs(r.Fragment,{children:[r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:Ht}),Pt]})}):ht?r.jsxs(r.Fragment,{children:[r.jsxs("a",{href:ht,target:"_blank",className:`${u}-item-image-link`,children:[ut,Ht]}),!Oe&&r.jsx("a",{href:ht,target:"_blank",className:`${u}-item-text-link`,children:Nt})]}):r.jsxs(r.Fragment,{children:[ut,Ht,Nt]})})},Le)})})}),(!n||i)&&kt&&typeof document<"u"&&m==="on"&&(()=>{const gt=(c?document.getElementById(c):null)??document.body;return Yn.createPortal(r.jsx("div",{style:_t,"data-selection":"none",children:r.jsx(zg,{prefix:u,items:Ft,index:Zt,imageDisplay:Bg(C),isEditor:n,onClose:()=>vt(!1),onPrev:()=>en(Le=>(Le-1+Ft.length)%Ft.length),onNext:()=>en(Le=>(Le+1)%Ft.length),counterClassName:ge,counterStyle:pe})}),gt)})()]})}const Gg={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},qg=["hover","focus","filled","success","error"],Ug=`import { Splide, SplideSlide } from '@splidejs/react-splide';
|
|
5090
5142
|
import '@splidejs/react-splide/css/core';
|
|
5091
5143
|
import { CommonComponentProps } from '../props';
|
|
5092
5144
|
import {
|
|
@@ -7139,7 +7191,7 @@ const COLOR_VAR_MAP: Record<ColorKeys, string> = {
|
|
|
7139
7191
|
};
|
|
7140
7192
|
|
|
7141
7193
|
const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
7142
|
-
`,Xr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["titleColor","subtitleColor","lightboxCounterColor"],Xg={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:{...Xr.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:{...Xr.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:{...Xr.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:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Yg={element:Vg,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:Xg,sourceCode:Ug},Zg=50,Os=10,Qa="cntrl-lightbox-journal",Mr=Qa,Ta=`${Qa}-`,Pr=e=>`${Qa}-${e}`,es=e=>e===Mr||e.startsWith(Ta),Ds=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},js=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Ds(t.get(Pr(e)));if(i)return i}const n=Ds(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ta))continue;const o=i.slice(Ta.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},zs=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},bc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{es(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Pr(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Jg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Pr(e)||i===Mr:es(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)}},wc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Pr(e)):[...t.keys()].some(n=>es(n))},Qg=(e,t)=>{if(wc(t)){if(e){window.history.back();return}Jg(t)}},eh=20,th=2,Yr=e=>`max(${e}, ${eh}px)`,Oi=e=>((e==null?void 0:e.image)??[]).slice(0,th),Sc=e=>e.reduce((t,n)=>t+Oi(n).length,0),nh=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Oi(s).length,1),i=Oi(e[t]).length;return{start:n,end:n+i-1}},ih=(e,t)=>{const n=Sc(e),{start:i,end:o}=nh(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},rr=(e,t)=>t==="B"?e.flatMap((n,i)=>Oi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Oi(n)})),oh=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return ih(i,o)},Bs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",rh=(e,t,n)=>e==="B"?t.length>1:Sc(n)>1,gn=.004,Bn=.004,Fi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Di=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},wo=(e,t)=>Di(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Di(e.length,n),effective:wo(e.length,n)}},$c=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Cc=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Qe=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ts={title1:"1",title2:"2",title3:"3",count:"Count"},ns=e=>[Qe(e,"fontFamily"),Qe(e,"fontSettings"),{type:"row",items:[Qe(e,"fontSize"),Qe(e,"lineHeight"),Qe(e,"letterSpacing"),Qe(e,"wordSpacing")]},Qe(e,"textAlign"),Qe(e,"textAppearance")],ah=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[ts[e],ns(e)]))}),sh={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},lh={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Qe(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[sh[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??lh[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Kt(i,n)};function Tc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:y=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:b=0,closeIcon:E=null,closeIconMaxWidth:L=0,closeIconColor:C="#000000",closeIconHoverColor:K="#cccccc"}=n,W=$.scalingValue(m,i),B=$.scalingValue(b,i),A=$.scalingValue(g,i),T=h==="mobile",j=pi("title1",ui(n,"title1"),i),w=pi("title2",ui(n,"title2"),i),P=pi("title3",ui(n,"title3"),i),M=a.useMemo(()=>({title1Width:d??Fi.title1Width,title2Width:c??Fi.title2Width,title3Width:u??Fi.title3Width}),[d,c,u]),X=a.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:y}),[v,y]),k=a.useMemo(()=>Vn(e,t,j,w,P),[e,t,j,w,P]),q=a.useMemo(()=>k.map(H=>M[H.widthKey]),[k,M]),V=a.useMemo(()=>Di(k.length,q),[k.length,q]),G=a.useMemo(()=>wo(k.length,q),[k.length,q]),ie=a.useMemo(()=>k.filter(H=>H.prefix==="title1"),[k]),S=a.useMemo(()=>k.filter(H=>H.prefix==="title2"||H.prefix==="title3"),[k]),R=a.useMemo(()=>Gn(ie,M),[ie,M]),O=a.useMemo(()=>Gn(S,M),[S,M]),ae=!!(t.title1||t.title2||t.title3),se=E!==null;if(!(ae||se))return null;const de=(p??0)>0||o,F=(H,Q)=>{const Fe=k.findIndex(N=>N.prefix===H.prefix);if(!T||Q==="single-row")return{effectiveWidth:G[Fe]??0,resolvedWidth:V[Fe]??0,maxWidth:sn(Fe,V)};if(Q==="two-row-top"){const N=ie.findIndex(qe=>qe.prefix===H.prefix);return{effectiveWidth:R.effective[N]??0,resolvedWidth:R.resolved[N]??0,maxWidth:sn(N,R.resolved)}}const re=S.findIndex(N=>N.prefix===H.prefix);return{effectiveWidth:O.effective[re]??0,resolvedWidth:O.resolved[re]??0,maxWidth:sn(re,O.resolved)}},te=(H,Q,Fe)=>{if(!T||Fe==="single-row"){const at=H.findIndex(Ie=>Ie.prefix===Q.prefix),et=H.map(Ie=>M[Ie.widthKey]),ut=Di(H.length,et);return{effectiveWidth:wo(H.length,et)[at]??0,resolvedWidth:ut[at]??0,maxWidth:sn(at,ut)}}if(Fe==="two-row-top"){const at=H.filter(Ie=>Ie.prefix==="title1"),et=at.findIndex(Ie=>Ie.prefix===Q.prefix),{resolved:ut,effective:ke}=Gn(at,M);return{effectiveWidth:ke[et]??0,resolvedWidth:ut[et]??0,maxWidth:sn(et,ut)}}const re=H.filter(at=>at.prefix==="title2"||at.prefix==="title3"),N=re.findIndex(at=>at.prefix===Q.prefix),{resolved:qe,effective:Be}=Gn(re,M);return{effectiveWidth:Be[N]??0,resolvedWidth:qe[N]??0,maxWidth:sn(N,qe)}},Z=H=>Cc(k,V,X,H)+(T?0:p??0),ve=()=>T?0:p??0,Ae=H=>S.slice(0,H).reduce((Q,Fe,re)=>Q+(Fe.marginLeftKey?X[Fe.marginLeftKey]??0:0)+(O.resolved[re]??0),0),he=H=>{const Q=S[H];return Ae(H)+(Q.marginLeftKey?X[Q.marginLeftKey]??0:0)+(O.resolved[H]??0)},pe=(H,Q,Fe)=>{const re=H.marginLeftKey?X[H.marginLeftKey]??0:0,{effectiveWidth:N,resolvedWidth:qe,maxWidth:Be}=Fe??F(H,Q),at=Math.max(re,Bn),et=o&&Q==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":H.prefix,style:{width:$.scalingValue(N,i),...re>0?{marginLeft:$.scalingValue(re,i)}:{}},children:[r.jsx("p",{className:H.className,style:H.style,children:H.text}),et&&H.marginLeftKey?r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(qe),style:{position:"absolute",top:0,left:$.scalingValue(-re,i),width:$.scalingValue(at,i),height:"100%",pointerEvents:"auto"}}):null,et?r.jsx("div",{"data-controls":H.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Be),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$.scalingValue(-gn/2,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},H.className)},U=(H="two-row")=>{const Q=k.findIndex(N=>N.prefix==="title1"),Fe=Q>=0?V[Q]:M.title1Width,re=H==="two-row"&&o;return r.jsx("div",{...re?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:$.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...re?{pointerEvents:"auto"}:{}}})},ee=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Y=H=>{const Q=Vn(e,H,j,w,P);return r.jsx(r.Fragment,{children:Q.map(Fe=>pe(Fe,"single-row",te(Q,Fe,"single-row")))})},Oe=H=>{const Q=Vn(e,H,j,w,P),Fe=Q.find(re=>re.prefix==="title1");return Fe?pe(Fe,"two-row-top",te(Q,Fe,"two-row-top")):null},$e=(H,Q=!1)=>{const Fe=Vn(e,H,j,w,P),re=Fe.filter(Be=>Be.prefix==="title2"||Be.prefix==="title3"),N=o&&Q;return re.length>0||N||(g??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[re.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:re.map(Be=>pe(Be,"two-row-bottom",te(Fe,Be,"two-row-bottom")))}),Q&&o?r.jsxs(r.Fragment,{children:[we(),Pe()]}):null]}):null,(g??0)>0||N?r.jsx("div",{"data-controls":N?"titleRowMarginBottom":void 0,"data-controls-axis":N?"y":void 0,"data-controls-reverse":N?"":void 0,className:N?`${e}-control`:void 0,style:{height:A,width:"100%",flexShrink:0,pointerEvents:N?"auto":"none"}}):null]}):null},He=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(L??0,i),height:$.scalingValue(L??0,i),marginRight:B,"--close-icon-hover-color":K},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:H=>{H.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:E??"",fill:C,hoverFill:i&&!s?C:K,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:B,height:"100%",pointerEvents:"auto"}})]}),ue=()=>se?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:He()}):null,me=H=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:H})}),be=H=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[se||ae?ee():null,de?U("two-row"):null,me(H),ue()]}),z=(H,Q=!1)=>r.jsxs(r.Fragment,{children:[be(Oe(H)),$e(H,Q)]}),le=()=>{const H=T?-1:k.findIndex(re=>re.prefix==="title1"),Q=!T&&(o||(p??0)>0)?(()=>{const re=p??0,N=H>=0?V[H]:M.title1Width,qe=Math.max(re,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N),style:{position:"absolute",top:0,left:0,width:$.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=k.flatMap((re,N)=>{if(!re.marginLeftKey)return[];const qe=X[re.marginLeftKey]??0,Be=$c(k,V,X,N)+ve(),at=Math.max(qe,Bn);return r.jsx("div",{"data-controls":re.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(V[N]),style:{position:"absolute",top:0,left:$.scalingValue(Be,i),width:$.scalingValue(at,i),height:"100%",pointerEvents:"auto"}},re.marginLeftKey)});return Q?[Q,...Fe]:Fe},ye=()=>k.map((H,Q)=>{const Fe=sn(Q,V),N=Z(Q)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":H.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:$.scalingValue(N,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),we=()=>S.flatMap((H,Q)=>{if(!H.marginLeftKey)return[];const Fe=X[H.marginLeftKey]??0,re=Ae(Q),N=Math.max(Fe,Bn),{resolvedWidth:qe}=F(H,"two-row-bottom");return r.jsx("div",{"data-controls":H.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(qe),style:{position:"absolute",top:0,left:$.scalingValue(re,i),width:$.scalingValue(N,i),height:"100%",pointerEvents:"auto"}},H.marginLeftKey)}),Pe=()=>S.map((H,Q)=>{const{maxWidth:Fe}=F(H,"two-row-bottom"),N=he(Q)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":H.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:$.scalingValue(N,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${H.widthKey}-junction`)}),Ce=()=>!o||T?null:r.jsxs(r.Fragment,{children:[le(),ye()]}),_=!!(t.title2||t.title3||(g??0)>0||o),ge=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[se||ae?ee():null,de?U("single-row"):null,ae?me(Y(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ue(),Ce()]}),ne=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,..._?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:_?void 0:{flex:"0 0 auto",height:"auto"},children:z(t,!0)}),Ce()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:W,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...T?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${T?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${T?` ${e}-text-bar-cell-stacked`:""}`,style:T?void 0:{flex:1,minWidth:0,width:"100%"},children:T?ne():ge()})})})]})}function ch(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function dh(e){return`
|
|
7194
|
+
`,Xr={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},Kg=["titleColor","subtitleColor","lightboxCounterColor"],Xg={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:{...Xr.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:{...Xr.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:{...Xr.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:[...Kg],panelIds:["general","typeStyle"],stateItems:{default:["titleColor","subtitleColor","lightboxCounterColor"]}}},Yg={element:Vg,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:Xg,sourceCode:Ug},Zg=50,Ns=10,Qa="cntrl-lightbox-journal",Mr=Qa,Ta=`${Qa}-`,Pr=e=>`${Qa}-${e}`,es=e=>e===Mr||e.startsWith(Ta),Os=e=>{if(!e)return null;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=1?t:null},Ds=e=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search);if(e){const i=Os(t.get(Pr(e)));if(i)return i}const n=Os(t.get(Mr));if(n)return n;for(const[i]of t){if(!i.startsWith(Ta))continue;const o=i.slice(Ta.length);if(!/^\d+$/.test(o))continue;const s=Number.parseInt(o,10);if(Number.isFinite(s)&&s>=1)return s}return null},js=(e,t)=>{if(t<=0)return-1;const n=e-1;return n<0||n>=t?-1:n},xc=(e,t,n=!0)=>{if(typeof window>"u")return;const i=new URL(window.location.href);[...i.searchParams.keys()].forEach(l=>{es(l)&&i.searchParams.delete(l)}),t?i.searchParams.set(Pr(t),String(e)):i.searchParams.set(Mr,String(e));const o=n?"replaceState":"pushState",s=`${i.pathname}${i.search}${i.hash}`;window.history[o](window.history.state,"",s)},Jg=e=>{if(typeof window>"u")return;const t=new URL(window.location.href),n=[...t.searchParams.keys()].filter(i=>e?i===Pr(e)||i===Mr:es(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)}},bc=e=>{if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return e?t.has(Pr(e)):[...t.keys()].some(n=>es(n))},Qg=(e,t)=>{if(bc(t)){if(e){window.history.back();return}Jg(t)}},eh=20,th=2,Yr=e=>`max(${e}, ${eh}px)`,Oi=e=>((e==null?void 0:e.image)??[]).slice(0,th),wc=e=>e.reduce((t,n)=>t+Oi(n).length,0),nh=(e,t)=>{const n=e.slice(0,t).reduce((o,s)=>o+Oi(s).length,1),i=Oi(e[t]).length;return{start:n,end:n+i-1}},ih=(e,t)=>{const n=wc(e),{start:i,end:o}=nh(e,t);return i===o?`${i} / ${n}`:`${i}-${o} / ${n}`},rr=(e,t)=>t==="B"?e.flatMap((n,i)=>Oi(n).map(o=>({entry:n,entryIndex:i,images:[o]}))):e.map((n,i)=>({entry:n,entryIndex:i,images:Oi(n)})),oh=(e,t,n,i)=>{var s;if(n==="B")return`${t+1} / ${e.length}`;const o=((s=e[t])==null?void 0:s.entryIndex)??0;return ih(i,o)},zs=e=>e?`${e.title1??""}|${e.title2??""}|${e.title3??""}`:"",rh=(e,t,n)=>e==="B"?t.length>1:wc(n)>1,gn=.004,Bn=.004,Fi={title1Width:.13,title2Width:.13,title3Width:.14},Vn=(e,t,n,i,o)=>{const s=[];return t.title1&&s.push({prefix:"title1",widthKey:"title1Width",className:`${e}-title1`,style:n,text:t.title1}),t.title2&&s.push({prefix:"title2",widthKey:"title2Width",marginLeftKey:"title2MarginLeft",className:`${e}-title2`,style:i,text:t.title2}),t.title3&&s.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:o,text:t.title3}),s},Di=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},wo=(e,t)=>Di(e,t),sn=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},Gn=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:Di(e.length,n),effective:wo(e.length,n)}},Sc=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),$c=(e,t,n,i)=>e.slice(0,i+1).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),Kn=["title1","title2","title3","count"],Qe=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,ts={title1:"1",title2:"2",title3:"3",count:"Count"},ns=e=>[Qe(e,"fontFamily"),Qe(e,"fontSettings"),{type:"row",items:[Qe(e,"fontSize"),Qe(e,"lineHeight"),Qe(e,"letterSpacing"),Qe(e,"wordSpacing")]},Qe(e,"textAlign"),Qe(e,"textAppearance")],ah=()=>({type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Kn.map(e=>[ts[e],ns(e)]))}),sh={title1:"title1Color",title2:"title2Color",title3:"title3Color",count:"countColor"},lh={title1:.02,title2:.02,title3:.02,count:.017},ui=(e,t)=>{const n=i=>{const o=Qe(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[sh[t]]}},pi=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??lh[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Kt(i,n)};function Cc({prefix:e,entry:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l}){const{title1Width:d,title2Width:c,title3Width:u,title1MarginLeft:p=0,title2MarginLeft:v=0,title3MarginLeft:x=0,titleRowMarginBottom:g=0,titleHeaderLayout:h="desktop",contentMarginTop:m=0,iconMarginRight:b=0,closeIcon:I=null,closeIconMaxWidth:C=0,closeIconColor:R="#000000",closeIconHoverColor:K="#cccccc"}=n,F=$.scalingValue(m,i),V=$.scalingValue(b,i),A=$.scalingValue(g,i),T=h==="mobile",j=pi("title1",ui(n,"title1"),i),y=pi("title2",ui(n,"title2"),i),W=pi("title3",ui(n,"title3"),i),M=a.useMemo(()=>({title1Width:d??Fi.title1Width,title2Width:c??Fi.title2Width,title3Width:u??Fi.title3Width}),[d,c,u]),Y=a.useMemo(()=>({title2MarginLeft:v,title3MarginLeft:x}),[v,x]),P=a.useMemo(()=>Vn(e,t,j,y,W),[e,t,j,y,W]),U=a.useMemo(()=>P.map(_=>M[_.widthKey]),[P,M]),z=a.useMemo(()=>Di(P.length,U),[P.length,U]),B=a.useMemo(()=>wo(P.length,U),[P.length,U]),te=a.useMemo(()=>P.filter(_=>_.prefix==="title1"),[P]),S=a.useMemo(()=>P.filter(_=>_.prefix==="title2"||_.prefix==="title3"),[P]),E=a.useMemo(()=>Gn(te,M),[te,M]),D=a.useMemo(()=>Gn(S,M),[S,M]),se=!!(t.title1||t.title2||t.title3),oe=I!==null;if(!(se||oe))return null;const ue=(p??0)>0||o,k=(_,ee)=>{const Fe=P.findIndex(N=>N.prefix===_.prefix);if(!T||ee==="single-row")return{effectiveWidth:B[Fe]??0,resolvedWidth:z[Fe]??0,maxWidth:sn(Fe,z)};if(ee==="two-row-top"){const N=te.findIndex(qe=>qe.prefix===_.prefix);return{effectiveWidth:E.effective[N]??0,resolvedWidth:E.resolved[N]??0,maxWidth:sn(N,E.resolved)}}const ae=S.findIndex(N=>N.prefix===_.prefix);return{effectiveWidth:D.effective[ae]??0,resolvedWidth:D.resolved[ae]??0,maxWidth:sn(ae,D.resolved)}},ne=(_,ee,Fe)=>{if(!T||Fe==="single-row"){const st=_.findIndex(Ve=>Ve.prefix===ee.prefix),et=_.map(Ve=>M[Ve.widthKey]),pt=Di(_.length,et);return{effectiveWidth:wo(_.length,et)[st]??0,resolvedWidth:pt[st]??0,maxWidth:sn(st,pt)}}if(Fe==="two-row-top"){const st=_.filter(Ve=>Ve.prefix==="title1"),et=st.findIndex(Ve=>Ve.prefix===ee.prefix),{resolved:pt,effective:rt}=Gn(st,M);return{effectiveWidth:rt[et]??0,resolvedWidth:pt[et]??0,maxWidth:sn(et,pt)}}const ae=_.filter(st=>st.prefix==="title2"||st.prefix==="title3"),N=ae.findIndex(st=>st.prefix===ee.prefix),{resolved:qe,effective:je}=Gn(ae,M);return{effectiveWidth:je[N]??0,resolvedWidth:qe[N]??0,maxWidth:sn(N,qe)}},X=_=>$c(P,z,Y,_)+(T?0:p??0),be=()=>T?0:p??0,Ae=_=>S.slice(0,_).reduce((ee,Fe,ae)=>ee+(Fe.marginLeftKey?Y[Fe.marginLeftKey]??0:0)+(D.resolved[ae]??0),0),fe=_=>{const ee=S[_];return Ae(_)+(ee.marginLeftKey?Y[ee.marginLeftKey]??0:0)+(D.resolved[_]??0)},le=(_,ee,Fe)=>{const ae=_.marginLeftKey?Y[_.marginLeftKey]??0:0,{effectiveWidth:N,resolvedWidth:qe,maxWidth:je}=Fe??k(_,ee),st=Math.max(ae,Bn),et=o&&ee==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":_.prefix,style:{width:$.scalingValue(N,i),...ae>0?{marginLeft:$.scalingValue(ae,i)}:{}},children:[r.jsx("p",{className:_.className,style:_.style,children:_.text}),et&&_.marginLeftKey?r.jsx("div",{"data-controls":_.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(qe),style:{position:"absolute",top:0,left:$.scalingValue(-ae,i),width:$.scalingValue(st,i),height:"100%",pointerEvents:"auto"}}):null,et?r.jsx("div",{"data-controls":_.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:$.scalingValue(-gn/2,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}}):null]},_.className)},q=(_="two-row")=>{const ee=P.findIndex(N=>N.prefix==="title1"),Fe=ee>=0?z[ee]:M.title1Width,ae=_==="two-row"&&o;return r.jsx("div",{...ae?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Fe)}:{},style:{width:$.scalingValue(p??0,i),flexShrink:0,alignSelf:"stretch",...ae?{pointerEvents:"auto"}:{}}})},Q=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:j,"aria-hidden":"true",children:" "}),Z=_=>{const ee=Vn(e,_,j,y,W);return r.jsx(r.Fragment,{children:ee.map(Fe=>le(Fe,"single-row",ne(ee,Fe,"single-row")))})},Ne=_=>{const ee=Vn(e,_,j,y,W),Fe=ee.find(ae=>ae.prefix==="title1");return Fe?le(Fe,"two-row-top",ne(ee,Fe,"two-row-top")):null},Te=(_,ee=!1)=>{const Fe=Vn(e,_,j,y,W),ae=Fe.filter(je=>je.prefix==="title2"||je.prefix==="title3"),N=o&ⅇreturn ae.length>0||N||(g??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[ae.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[r.jsx("div",{className:`${e}-titles-stack`,children:ae.map(je=>le(je,"two-row-bottom",ne(Fe,je,"two-row-bottom")))}),ee&&o?r.jsxs(r.Fragment,{children:[Se(),Pe()]}):null]}):null,(g??0)>0||N?r.jsx("div",{"data-controls":N?"titleRowMarginBottom":void 0,"data-controls-axis":N?"y":void 0,"data-controls-reverse":N?"":void 0,className:N?`${e}-control`:void 0,style:{height:A,width:"100%",flexShrink:0,pointerEvents:N?"auto":"none"}}):null]}):null},We=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(C??0,i),height:$.scalingValue(C??0,i),marginRight:V,"--close-icon-hover-color":K},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:_=>{_.stopPropagation(),l==null||l()},"aria-label":"Close",children:r.jsx(rn,{url:I??"",fill:R,hoverFill:i&&!s?R:K,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:V,height:"100%",pointerEvents:"auto"}})]}),ce=()=>oe?r.jsx("div",{className:`${e}-titles-row-header-controls`,children:We()}):null,ye=_=>r.jsx("div",{className:`${e}-titles-row-titles`,children:r.jsx("div",{className:`${e}-titles-stack`,children:_})}),$e=_=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[oe||se?Q():null,ue?q("two-row"):null,ye(_),ce()]}),G=(_,ee=!1)=>r.jsxs(r.Fragment,{children:[$e(Ne(_)),Te(_,ee)]}),re=()=>{const _=T?-1:P.findIndex(ae=>ae.prefix==="title1"),ee=!T&&(o||(p??0)>0)?(()=>{const ae=p??0,N=_>=0?z[_]:M.title1Width,qe=Math.max(ae,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(N),style:{position:"absolute",top:0,left:0,width:$.scalingValue(qe,i),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,Fe=P.flatMap((ae,N)=>{if(!ae.marginLeftKey)return[];const qe=Y[ae.marginLeftKey]??0,je=Sc(P,z,Y,N)+be(),st=Math.max(qe,Bn);return r.jsx("div",{"data-controls":ae.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(z[N]),style:{position:"absolute",top:0,left:$.scalingValue(je,i),width:$.scalingValue(st,i),height:"100%",pointerEvents:"auto"}},ae.marginLeftKey)});return ee?[ee,...Fe]:Fe},pe=()=>P.map((_,ee)=>{const Fe=sn(ee,z),N=X(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":_.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:$.scalingValue(N,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${_.widthKey}-junction`)}),Se=()=>S.flatMap((_,ee)=>{if(!_.marginLeftKey)return[];const Fe=Y[_.marginLeftKey]??0,ae=Ae(ee),N=Math.max(Fe,Bn),{resolvedWidth:qe}=k(_,"two-row-bottom");return r.jsx("div",{"data-controls":_.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(qe),style:{position:"absolute",top:0,left:$.scalingValue(ae,i),width:$.scalingValue(N,i),height:"100%",pointerEvents:"auto"}},_.marginLeftKey)}),Pe=()=>S.map((_,ee)=>{const{maxWidth:Fe}=k(_,"two-row-bottom"),N=fe(ee)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":_.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:$.scalingValue(N,i),width:$.scalingValue(gn,i),height:"100%",pointerEvents:"auto"}})},`${_.widthKey}-junction`)}),Re=()=>!o||T?null:r.jsxs(r.Fragment,{children:[re(),pe()]}),H=!!(t.title2||t.title3||(g??0)>0||o),ge=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[oe||se?Q():null,ue?q("single-row"):null,se?ye(Z(t)):r.jsx("div",{className:`${e}-titles-row-titles`,"aria-hidden":"true"}),ce(),Re()]}),ie=()=>r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...H?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:H?void 0:{flex:"0 0 auto",height:"auto"},children:G(t,!0)}),Re()]});return r.jsxs("div",{className:`${e}-lightbox-overlay-content`,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:F,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...T?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${T?` ${e}-lightbox-content-area-stacked`:""}`,children:r.jsx("div",{className:`${e}-text-bar-cell${T?` ${e}-text-bar-cell-stacked`:""}`,style:T?void 0:{flex:1,minWidth:0,width:"100%"},children:T?ie():ge()})})})]})}function ch(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function dh(e){return`
|
|
7143
7195
|
.${e}-wrapper {
|
|
7144
7196
|
display: grid;
|
|
7145
7197
|
align-items: start;
|
|
@@ -7459,7 +7511,7 @@ const STATE_KEYS = ['hover', 'focus', 'filled', 'success', 'error'] as const;
|
|
|
7459
7511
|
pointer-events: auto;
|
|
7460
7512
|
flex-shrink: 0;
|
|
7461
7513
|
}
|
|
7462
|
-
`}const Vs={url:"",name:"",objectFit:"cover"},$n=500,to=650,un="cubic-bezier(0.22, 1, 0.36, 1)",uh=72,ph=50,mh=1e4,gh=650,hh=500;function fh(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Lc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 yh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Lc(i,n):null}function vh(e){return e.reduce((t,n,i)=>{const o=is(n.gallery),l=os(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 ao(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 Gs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const xh=.03;function Rc(e){return e.width*xh}const Zr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Vo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function qs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function wh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function Sh(e,t){if(Ji(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 $h(e){const t=new Set,n=[];for(const i of e){const o=is(i.gallery),s=os(o);for(const l of s)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 Ch({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ji(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Rc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function Th(e,t,n){const{left:i,width:o}=n,s=Rc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Ic(e,t,n,i){const o=ji(e,"left",i),s=ji(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:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lh(e,t,n,i){const{start:o,end:s}=Ic(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Rh(e,t,n){const i=ji(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ec(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 is(e){if(!e)return;if(Ec(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??Vs,i??o??Vs]}]}function Ih(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eh(e){const[t]=e.media;return t!=null&&t.url?t:null}function os(e){if(!Array.isArray(e)||e.length===0)return[];if(Ec(e)){const t=[];for(const n of e){const i=Ih(n);if(!i)continue;const o=Eh(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 Ji(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Mh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ji(e)?r.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}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Ph({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Go({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ji(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function kh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const E=a.useRef(null),L=a.useRef(null),C=a.useRef(null),K=a.useRef(new Map),[W,B]=a.useState(0),A=a.useRef(null),T=a.useRef(0),j=a.useRef(0),w=a.useRef("none"),P=a.useRef(!1),M=a.useRef(!1),X=a.useRef(!1),k=a.useRef(null),q=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),R=a.useRef(null),O=a.useRef(!1),[ae,se]=a.useState(null),[I,de]=a.useState(Zr),[F,te]=a.useState(0),[Z,ve]=a.useState("opening"),[Ae,he]=a.useState(0),[pe,U]=a.useState(0),[ee,Y]=a.useState(!1),[Oe,$e]=a.useState(null),[He,ue]=a.useState(null),[me,be]=a.useState(null),[z,le]=a.useState(!1),[ye,we]=a.useState(null),[Pe,Ce]=a.useState(!1),_=a.useRef(!1),[ge,ne]=a.useState(!1),[H,Q]=a.useState(!1),Fe=a.useRef(n),re=a.useRef(void 0),N=t[n],qe=N?Ji(N):!1,Be=pe!==0||ee,at=!l&&(!s||!!d),et=c&&!l,ut=u.length>1,ke=a.useCallback((x,xe)=>t.length<=1?null:t[(x+xe+t.length)%t.length]??null,[t]),Ie=ut?ao(u,p,-1):ke(n,-1),oe=ut?ao(u,p,1):ke(n,1),Te=Oe===-1&&Be?ut&&He!==null?ao(u,He,-1):me!==null?ke(me,-1):null:null,Ee=Oe===1&&Be?ut&&He!==null?ao(u,He,1):me!==null?ke(me,1):null:null,De=Te&&Te.url!==(Ie==null?void 0:Ie.url)?Te:null,fe=Ee&&Ee.url!==(oe==null?void 0:oe.url)?Ee:null,Me=Ie&&et?(()=>{const x=ut?Gs(u,p,-1):t.length>2?ke((n-1+t.length)%t.length,-1):null;return x&&x.url!==Ie.url?x:null})():null,_e=oe&&et?(()=>{const x=ut?Gs(u,p,1):t.length>2?ke((n+1)%t.length,1):null;return x&&x.url!==oe.url?x:null})():null,Ke=De??Me,it=fe??_e,Ye=a.useCallback((x,xe,Re)=>{if(!x||!xe||!Re)return;const Ne=K.current,nt=Ne.get(x);(nt==null?void 0:nt.width)===xe&&(nt==null?void 0:nt.height)===Re||(Ne.set(x,{width:xe,height:Re}),B(Mt=>Mt+1))},[]),xt=a.useCallback(x=>{if(!(x!=null&&x.url))return null;const xe=K.current.get(x.url);return wh(L.current,xe)},[W,F]),ot=a.useCallback(()=>{if(!N)return;const x=xt(N);if(x){se(x);return}const xe=L.current;xe&&se(qs(xe))},[N,xt]),We=a.useCallback(x=>{if(ut){const xe=u.length;ue((p+x+xe)%xe),be(null);return}t.length>1&&(be((n+x+t.length)%t.length),ue(null))},[ut,u.length,p,t.length,n]),Ze=a.useCallback(x=>{X.current=x,Y(x)},[]),Ve=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),st=a.useCallback(()=>{Ve(),k.current=window.setTimeout(()=>{Ve(),Ze(!1)},to+32)},[Ve,Ze]),pt=a.useCallback(()=>{const x=E.current;if(!x){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:Zr.width,height:typeof window<"u"?window.innerHeight:Zr.height});return}const xe=x.getBoundingClientRect();de({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),ct=a.useCallback((x,xe)=>{if(Be){if(ge&&!ee)return`translate(${pe}px, 0px)`;if(ee&&Oe!==null){const Re=xt(x);if(!Re)return;const{x:Ne,y:nt}=Lh(Re,xe,Oe,I);return`translate(${Ne}px, ${nt}px)`}if(ee)return"translate(0px, 0px)"}},[Be,ge,ee,pe,Oe,I,xt]),Et=a.useCallback(()=>{const x=q.current;q.current=null,Ve(),Ze(!1),$e(null),ue(null),be(null),U(0),ne(!1),P.current=!1,j.current=0,w.current="none",x===-1?m():x===1&&b()},[Ve,Ze,m,b]),zt=a.useCallback(()=>{Ve(),k.current=window.setTimeout(()=>{q.current!==null&&Et()},to+32)},[Ve,Et]),Xt=a.useCallback(()=>{Ve(),q.current=null,Ze(!1),$e(null),ue(null),be(null),U(0),ne(!1),P.current=!1,j.current=0,w.current="none"},[Ve,Ze]),yt=a.useCallback(x=>{if(!(!et||!ae)){if(X.current){if(q.current===x){V.current=x,Et();return}Xt()}Ve(),We(x),q.current=x,$e(x),Ze(!0),zt()}},[et,ae,Et,Xt,Ve,We,Ze,zt]);G.current=yt;const bt=a.useCallback(()=>{ie.current=null,O.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),Nt=a.useCallback(x=>{S.current!==null&&window.clearInterval(S.current);const xe=O.current?hh:gh;S.current=window.setInterval(()=>{G.current(x)},xe)},[]),At=a.useCallback(x=>{ie.current!==x&&(bt(),ie.current=x,O.current=!1,G.current(x),Nt(x),R.current=window.setTimeout(()=>{R.current=null,ie.current===x&&(O.current=!0,Nt(x))},mh))},[bt,Nt]),wt=a.useCallback(()=>{const x=L.current;if(!x)return;const xe=N==null?void 0:N.url,Re=xe?K.current.get(xe):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){se(La(x,Re.width,Re.height));return}const Ne=C.current;if(Ne&&xe&&(Ne.src===xe||Ne.currentSrc===xe)){const{width:Mt,height:Je}=bh(Ne);if(Mt&&Je){Ye(xe,Mt,Je),se(La(x,Mt,Je));return}}const nt=qs(x);!nt.width||!nt.height||se(nt)},[N==null?void 0:N.url,Ye]),Ot=a.useCallback(x=>{if(C.current=x,!!x){if(x instanceof HTMLVideoElement){x.readyState>=1&&x.videoWidth>0&&wt();return}x.complete&&x.naturalWidth>0&&wt()}},[wt]),Ut=a.useCallback(()=>{pt(),wt(),te(x=>x+1)},[pt,wt]);a.useEffect(()=>{Ut();const x=L.current,xe=E.current,Re=new ResizeObserver(()=>Ut());return x&&Re.observe(x),xe&&Re.observe(xe),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,v]),a.useLayoutEffect(()=>{if(!N)return;const x=C.current;if(x){if(x instanceof HTMLImageElement&&x.complete&&x.naturalWidth>0){wt();return}x instanceof HTMLVideoElement&&x.readyState>=1&&x.videoWidth>0&&wt()}},[N==null?void 0:N.url,n,wt]),a.useEffect(()=>{ot()},[ot,W]),a.useEffect(()=>{const x=new Set,xe=[],Re=Ne=>{!(Ne!=null&&Ne.url)||x.has(Ne.url)||(x.add(Ne.url),xe.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),xe.forEach(Ne=>{K.current.has(Ne.url)||Sh(Ne,Ye)})},[t,u,Ye]),a.useEffect(()=>{if(Z!=="opening"||!ae)return;if(!y){ve("open");return}le(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(x)},[Z,ae,y]),a.useEffect(()=>{if(Z!=="closing")return;const x=setTimeout(()=>h(),$n);return()=>clearTimeout(x)},[Z,h]),a.useEffect(()=>()=>{Ve()},[Ve]),a.useLayoutEffect(()=>{Fe.current===n&&re.current===(N==null?void 0:N.url)||(Ve(),q.current=null,$e(null),ue(null),be(null),he(0),U(0),Ze(!1),Q(!1),ne(!1),T.current=0,j.current=0,w.current="none",P.current=!1,A.current=null,M.current=!1,C.current=null,ot(),Fe.current=n,re.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,Ze,Ve,ot]),a.useLayoutEffect(()=>{const x=V.current;x!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(x)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(Z==="opening"){_.current=!1,Ce(!1);return}if(Z!=="open"||_.current)return;if(!Ie&&!oe){_.current=!0;return}Ce(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),_.current=!0})});return()=>cancelAnimationFrame(x)},[Z,Ie==null?void 0:Ie.url,oe==null?void 0:oe.url]),a.useEffect(()=>{if(Z!=="open")return;const x=()=>{const Je=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},xe=Je=>{const ft=Je<0?1:-1;Ve(),We(ft),q.current=ft,$e(ft),Ze(!0),zt()},Re=Je=>{if(Math.abs(Je)>ph&&et){xe(Je);return}q.current=null,$e(null),ue(null),be(null),Ze(!0),U(0),st()},Ne=Je=>{if(Je.touches.length!==1||X.current)return;const ft=Je.touches[0];M.current=!0,A.current={x:ft.clientX,y:ft.clientY},w.current="none",j.current=0,P.current=!1},nt=Je=>{if(!A.current||Je.touches.length!==1||X.current)return;const ft=Je.touches[0],Ht=ft.clientX-A.current.x,Tt=ft.clientY-A.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!et)return;w.current="horizontal"}else if(Tt>0){if(!at)return;w.current="vertical"}else return}if(w.current==="horizontal"){P.current=!0,ne(!0),j.current=Ht,U(Ht),Je.preventDefault();return}w.current==="vertical"&&(P.current=!0,ne(!0),T.current=Tt,he(Tt),Je.preventDefault())},Mt=()=>{if(!A.current)return;const Je=w.current,ft=P.current;if(ft&&Je==="horizontal")Re(j.current),x();else if(ft&&Je==="vertical"){const Ht=T.current;if(at&&Ht>uh){const Tt=window.innerHeight;T.current=Tt,Q(!0),he(Tt),ve("closing")}else T.current=0,he(0);x()}else Je==="horizontal"&&Math.abs(j.current)>0&&(Re(j.current),x());A.current=null,w.current="none",j.current=0,P.current=!1,ne(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",nt,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",nt),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[Z,et,Ze,st,Ve,at,zt,We]);const Zt=a.useCallback(()=>{const x=(g==null?void 0:g())??y??null;x&&ae&&(we(x),le(!0)),ve("closing")},[g,y,ae]);a.useEffect(()=>{const x=Ne=>{if(Ne.key==="Escape"){if(s&&d||Z==="closing")return;bt(),Zt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||Z!=="open"||!et)return;Ne.preventDefault();const nt=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&ie.current===nt||At(nt)},xe=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const nt=Ne.key==="ArrowLeft"?-1:1;ie.current===nt&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",x),window.addEventListener("keyup",xe),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",x),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Re),bt()}},[Z,s,d,Zt,et,At,bt]),a.useEffect(()=>{Z!=="open"&&bt()},[Z,bt]);const tn=()=>{Z==="closing"||l||Zt()},Ct=Z==="open",Bt=Z==="closing",cn=Ae>0?Math.max(0,1-Ae/500):1,mt=Ae>0?Math.max(.35,1-Ae/500):1,Le=a.useCallback(x=>{if(!(x.propertyName!=="transform"||!X.current)){if(q.current!==null){Et();return}Ve(),Ze(!1)}},[Ve,Ze,Et]),ze=Z==="closing"?ye??y:y,tt=ze&&ae&&(Z==="opening"||Bt)?fh(ze,ae):void 0,gt=Be&&N?ct(N,"center"):Ae>0?`translateY(${Ae}px)`:tt,ht=ae?Vo(ae,I):null,Rt=!!(ze&&ae),dt=Rt&&(Z==="closing"||Z==="open"&&z),Dt={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ae>0?mt:Rt?1:Z==="opening"||Bt?0:1,transition:ge&&!ee?"none":ee?`transform ${to}ms ${un}`:H?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:dt?`transform ${$n}ms ${un}`:Z==="opening"||Bt?`opacity ${$n}ms ${un}`:"none",pointerEvents:qe&&Ct&&!Be?"auto":"none",touchAction:qe&&Ct?"none":void 0,zIndex:1,overflow:qe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Be?"auto":"none"},Pt=(x,xe,Re="adjacent")=>{const Ne=xt(x);if(!Ne)return{display:"none"};const nt=Re==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=Oe!==null?Ic(Ne,nt,Oe,I):{start:Re==="far"?gr(Ne,xe,I):ji(Ne,xe,I)},Je=Vo(Mt,I),ft=ct(x,nt),Ht=!Be&&Re==="adjacent"&&Ct&&!Pe?Rh(Ne,xe,I):null,Tt=Re==="far"&&Be&&Oe===(xe==="left"?-1:1),nn=ge&&!ee?!1:ee,dn=Re==="adjacent"&&Ct&&Pe&&!Be;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${to}ms ${un}`:`transform ${to}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:Z==="opening"||Bt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Vt=(x,xe)=>{const Re=xt(x);return Re?Th(ji(Re,xe,I),xe,I):null},Gt=x=>xe=>{if(!l){if(M.current){M.current=!1;return}xe.stopPropagation(),yt(x)}},Wt=Ie?Vt(Ie,"left"):null,_t=oe?Vt(oe,"right"):null,Ft=Wt?Vo(Wt,I):null,St=_t?Vo(_t,I):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Z==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:ge?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ge?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&r.jsx(Go,{media:Ke,style:Pt(Ke,"left","far"),onMeasure:Ye,onTransitionEnd:Le},`far-prev-${Ke.url}`),Ct&&Ie&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:Ie,style:Pt(Ie,"left"),onMeasure:Ye,onTransitionEnd:Le},`prev-${Ie.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&oe&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:oe,style:Pt(oe,"right"),onMeasure:Ye,onTransitionEnd:Le},`next-${oe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&it&&r.jsx(Go,{media:it,style:Pt(it,"right","far"),onMeasure:Ye,onTransitionEnd:Le},`far-next-${it.url}`),ae&&N&&(qe?r.jsx(Ph,{src:N.url,phase:Z,onMediaElement:Ot,wrapperStyle:Dt,videoStyle:kt,onLoadedMetadata:wt,onTransitionEnd:Le},`${n}-${N.url}`):r.jsx("img",{ref:Ot,src:N.url,alt:N.name,onLoad:wt,onTransitionEnd:Le,style:Dt},`${n}-${N.url}`))]})}function Ah({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,y=(v==null?void 0:v.display)==="cover",g=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[m,b]=g.split(":").map(Number),C=`${h?b:m} / ${h?m:b}`,K=c.entryWidth??.2,W=c.columnsCount,B=$.scalingValue(K,n),A=$.scalingValue(c.horizontalGap??0,n),T=B,j=B,w={width:T,...y?{aspectRatio:C,height:"auto",overflow:"hidden"}:{height:"auto"}},P=y?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},M=a.useRef(null),[X,k]=a.useState(!1),[q,V]=a.useState([]),[G,ie]=a.useState(0),[S,R]=a.useState(0),[O,ae]=a.useState(null),[se,I]=a.useState({title1:"",title2:"",title3:""}),de=(()=>{const me={},be=M.current?getComputedStyle(M.current).getPropertyValue("--cntrl-article-width").trim():"";return be&&(me["--cntrl-article-width"]=be),me})(),F=!n||i||o,te=a.useMemo(()=>dh(d),[d]),Z=t??[],ve=Z.length%W||W,Ae=ve<W&&Z.length>0,he=Z.length-ve,pe=Ae?Math.floor((W-ve)/2)+1:1,U=a.useMemo(()=>vh(Z),[Z]),ee=a.useMemo(()=>$h(Z),[Z]),Y=(me,be,z)=>{if(n&&!o&&!i)return;const le=U.findIndex(we=>we.gridIndex===me);if(le<0)return;const ye=U[le];R(le),V(ye.items),ie(be),I(ye.entry),ae(z??null),k(!0)},Oe=a.useCallback(()=>{k(!1),ae(null)},[]),$e=a.useCallback(()=>{const me=U[S];return!me||!M.current?O:yh(M.current,me.gridIndex,y?"cover":"contain")??O},[U,S,O,y]),He=a.useCallback(me=>{if(U.length>1){const be=U.length,z=(S+me+be)%be,le=U[z],ye=Math.min(G,le.items.length-1);R(z),V(le.items),ie(ye),I(le.entry);return}ie(be=>(be+me+q.length)%q.length)},[U,S,G,q.length]),ue=U.length>1||q.length>1;return a.useEffect(()=>{if(!X||typeof document>"u")return;const me=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=me}},[X]),a.useEffect(()=>{!n||o||i||k(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:te}}),r.jsx(Ch,{mediaList:ee}),r.jsx("div",{ref:M,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${W}, ${B})`,rowGap:0,columnGap:A,width:$.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:$.scalingValue(u??0,n)},children:Z.map((me,be)=>{const z=is(me.gallery),le=os(z),ye=le.filter(ne=>ne.lightboxMedia).map(ne=>ne.lightboxMedia),we=Math.floor(be/W)===Math.ceil(Z.length/W)-1,Pe=Ae&&be>=he?`${pe+(be-he)}`:void 0,Ce=le[0],_=Ce!=null&&Ce.lightboxMedia?ye.findIndex(ne=>ne.url===Ce.lightboxMedia.url):-1,ge=r.jsx("div",{className:`${d}-item-image-wrapper`,style:w,children:le.length>0&&r.jsx(Mh,{media:Ce.displayMedia,gridIndex:be,className:`${d}-item-${Ji(Ce.displayMedia)?"video":"image"}`.trim(),style:P,onMediaClick:F&&_>=0?ne=>Y(be,_,Lc(ne.currentTarget,y?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,we?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:B,...Pe?{gridColumn:Pe}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:j}})}),r.jsx("a",{className:`${d}-item-image-link`,children:ge}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:j}})})]})},be)})}),X&&typeof document<"u"&&(()=>{const me=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:de,"data-selection":"none",children:r.jsx(kh,{prefix:d,items:q,index:G,entry:se,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ue,lightboxEntries:U,entryIdx:S,layoutId:s,sourceRect:O,resolveCloseSourceRect:$e,onClose:Oe,onPrev:()=>He(-1),onNext:()=>He(1)})}),me)})()]})}const Fh=`import { CommonComponentProps } from '../props';
|
|
7514
|
+
`}const Bs={url:"",name:"",objectFit:"cover"},$n=500,to=650,un="cubic-bezier(0.22, 1, 0.36, 1)",uh=72,ph=50,mh=1e4,gh=650,hh=500;function fh(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Tc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 yh(e,t,n){const i=e.querySelector(`[data-hive-grid-index="${t}"]`);return i instanceof HTMLElement?Tc(i,n):null}function vh(e){return e.reduce((t,n,i)=>{const o=is(n.gallery),l=os(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 ao(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 Vs(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return ao(e,i,n)}const xh=.03;function Lc(e){return e.width*xh}const Zr={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Vo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Gs(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function bh(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function La(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function wh(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:La(e,t.width,t.height)}function Sh(e,t){if(Ji(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 $h(e){const t=new Set,n=[];for(const i of e){const o=is(i.gallery),s=os(o);for(const l of s)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 Ch({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Ji(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function ji(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Lc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function gr(e,t,n){const i=ji(e,t,n);return{...i,left:2*i.left-e.left}}function Th(e,t,n){const{left:i,width:o}=n,s=Lc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Rc(e,t,n,i){const o=ji(e,"left",i),s=ji(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:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Lh(e,t,n,i){const{start:o,end:s}=Rc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function Rh(e,t,n){const i=ji(e,t,n),o=gr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Ic(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 is(e){if(!e)return;if(Ic(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??Bs,i??o??Bs]}]}function Ih(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function Eh(e){const[t]=e.media;return t!=null&&t.url?t:null}function os(e){if(!Array.isArray(e)||e.length===0)return[];if(Ic(e)){const t=[];for(const n of e){const i=Ih(n);if(!i)continue;const o=Eh(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 Ji(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Mh({media:e,className:t,style:n,gridIndex:i,onMediaClick:o}){return Ji(e)?r.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}):r.jsx("img",{src:e.url,alt:e.name,className:t,"data-hive-grid-index":i,style:{...n,cursor:o?"pointer":"default"},onClick:o})}function Ph({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Go({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Ji(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function kh({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),C=a.useRef(null),R=a.useRef(null),K=a.useRef(new Map),[F,V]=a.useState(0),A=a.useRef(null),T=a.useRef(0),j=a.useRef(0),y=a.useRef("none"),W=a.useRef(!1),M=a.useRef(!1),Y=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),z=a.useRef(null),B=a.useRef(()=>{}),te=a.useRef(null),S=a.useRef(null),E=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[L,ue]=a.useState(Zr),[k,ne]=a.useState(0),[X,be]=a.useState("opening"),[Ae,fe]=a.useState(0),[le,q]=a.useState(0),[Q,Z]=a.useState(!1),[Ne,Te]=a.useState(null),[We,ce]=a.useState(null),[ye,$e]=a.useState(null),[G,re]=a.useState(!1),[pe,Se]=a.useState(null),[Pe,Re]=a.useState(!1),H=a.useRef(!1),[ge,ie]=a.useState(!1),[_,ee]=a.useState(!1),Fe=a.useRef(n),ae=a.useRef(void 0),N=t[n],qe=N?Ji(N):!1,je=le!==0||Q,st=!l&&(!s||!!d),et=c&&!l,pt=u.length>1,rt=a.useCallback((w,we)=>t.length<=1?null:t[(w+we+t.length)%t.length]??null,[t]),Ve=pt?ao(u,p,-1):rt(n,-1),xe=pt?ao(u,p,1):rt(n,1),me=Ne===-1&&je?pt&&We!==null?ao(u,We,-1):ye!==null?rt(ye,-1):null:null,he=Ne===1&&je?pt&&We!==null?ao(u,We,1):ye!==null?rt(ye,1):null:null,He=me&&me.url!==(Ve==null?void 0:Ve.url)?me:null,ve=he&&he.url!==(xe==null?void 0:xe.url)?he:null,Ee=Ve&&et?(()=>{const w=pt?Vs(u,p,-1):t.length>2?rt((n-1+t.length)%t.length,-1):null;return w&&w.url!==Ve.url?w:null})():null,Me=xe&&et?(()=>{const w=pt?Vs(u,p,1):t.length>2?rt((n+1)%t.length,1):null;return w&&w.url!==xe.url?w:null})():null,Ge=He??Ee,Ze=ve??Me,Ue=a.useCallback((w,we,Ie)=>{if(!w||!we||!Ie)return;const _e=K.current,it=_e.get(w);(it==null?void 0:it.width)===we&&(it==null?void 0:it.height)===Ie||(_e.set(w,{width:we,height:Ie}),V(Et=>Et+1))},[]),lt=a.useCallback(w=>{if(!(w!=null&&w.url))return null;const we=K.current.get(w.url);return wh(C.current,we)},[F,k]),tt=a.useCallback(()=>{if(!N)return;const w=lt(N);if(w){oe(w);return}const we=C.current;we&&oe(Gs(we))},[N,lt]),ke=a.useCallback(w=>{if(pt){const we=u.length;ce((p+w+we)%we),$e(null);return}t.length>1&&($e((n+w+t.length)%t.length),ce(null))},[pt,u.length,p,t.length,n]),Xe=a.useCallback(w=>{Y.current=w,Z(w)},[]),Oe=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ot=a.useCallback(()=>{Oe(),P.current=window.setTimeout(()=>{Oe(),Xe(!1)},to+32)},[Oe,Xe]),ct=a.useCallback(()=>{const w=I.current;if(!w){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:Zr.width,height:typeof window<"u"?window.innerHeight:Zr.height});return}const we=w.getBoundingClientRect();ue({left:we.left,top:we.top,width:we.width,height:we.height})},[]),mt=a.useCallback((w,we)=>{if(je){if(ge&&!Q)return`translate(${le}px, 0px)`;if(Q&&Ne!==null){const Ie=lt(w);if(!Ie)return;const{x:_e,y:it}=Lh(Ie,we,Ne,L);return`translate(${_e}px, ${it}px)`}if(Q)return"translate(0px, 0px)"}},[je,ge,Q,le,Ne,L,lt]),Mt=a.useCallback(()=>{const w=U.current;U.current=null,Oe(),Xe(!1),Te(null),ce(null),$e(null),q(0),ie(!1),W.current=!1,j.current=0,y.current="none",w===-1?m():w===1&&b()},[Oe,Xe,m,b]),Ut=a.useCallback(()=>{Oe(),P.current=window.setTimeout(()=>{U.current!==null&&Mt()},to+32)},[Oe,Mt]),Yt=a.useCallback(()=>{Oe(),U.current=null,Xe(!1),Te(null),ce(null),$e(null),q(0),ie(!1),W.current=!1,j.current=0,y.current="none"},[Oe,Xe]),xt=a.useCallback(w=>{if(!(!et||!se)){if(Y.current){if(U.current===w){z.current=w,Mt();return}Yt()}Oe(),ke(w),U.current=w,Te(w),Xe(!0),Ut()}},[et,se,Mt,Yt,Oe,ke,Xe,Ut]);B.current=xt;const bt=a.useCallback(()=>{te.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),_t=a.useCallback(w=>{S.current!==null&&window.clearInterval(S.current);const we=D.current?hh:gh;S.current=window.setInterval(()=>{B.current(w)},we)},[]),kt=a.useCallback(w=>{te.current!==w&&(bt(),te.current=w,D.current=!1,B.current(w),_t(w),E.current=window.setTimeout(()=>{E.current=null,te.current===w&&(D.current=!0,_t(w))},mh))},[bt,_t]),vt=a.useCallback(()=>{const w=C.current;if(!w)return;const we=N==null?void 0:N.url,Ie=we?K.current.get(we):void 0;if(Ie!=null&&Ie.width&&(Ie!=null&&Ie.height)){oe(La(w,Ie.width,Ie.height));return}const _e=R.current;if(_e&&we&&(_e.src===we||_e.currentSrc===we)){const{width:Et,height:Je}=bh(_e);if(Et&&Je){Ue(we,Et,Je),oe(La(w,Et,Je));return}}const it=Gs(w);!it.width||!it.height||oe(it)},[N==null?void 0:N.url,Ue]),Ft=a.useCallback(w=>{if(R.current=w,!!w){if(w instanceof HTMLVideoElement){w.readyState>=1&&w.videoWidth>0&&vt();return}w.complete&&w.naturalWidth>0&&vt()}},[vt]),zt=a.useCallback(()=>{ct(),vt(),ne(w=>w+1)},[ct,vt]);a.useEffect(()=>{zt();const w=C.current,we=I.current,Ie=new ResizeObserver(()=>zt());return w&&Ie.observe(w),we&&Ie.observe(we),window.addEventListener("resize",zt),()=>{Ie.disconnect(),window.removeEventListener("resize",zt)}},[zt,n,v]),a.useLayoutEffect(()=>{if(!N)return;const w=R.current;if(w){if(w instanceof HTMLImageElement&&w.complete&&w.naturalWidth>0){vt();return}w instanceof HTMLVideoElement&&w.readyState>=1&&w.videoWidth>0&&vt()}},[N==null?void 0:N.url,n,vt]),a.useEffect(()=>{tt()},[tt,F]),a.useEffect(()=>{const w=new Set,we=[],Ie=_e=>{!(_e!=null&&_e.url)||w.has(_e.url)||(w.add(_e.url),we.push(_e))};t.forEach(Ie),u.forEach(_e=>_e.items.forEach(Ie)),we.forEach(_e=>{K.current.has(_e.url)||Sh(_e,Ue)})},[t,u,Ue]),a.useEffect(()=>{if(X!=="opening"||!se)return;if(!x){be("open");return}re(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),be("open")})});return()=>cancelAnimationFrame(w)},[X,se,x]),a.useEffect(()=>{if(X!=="closing")return;const w=setTimeout(()=>h(),$n);return()=>clearTimeout(w)},[X,h]),a.useEffect(()=>()=>{Oe()},[Oe]),a.useLayoutEffect(()=>{Fe.current===n&&ae.current===(N==null?void 0:N.url)||(Oe(),U.current=null,Te(null),ce(null),$e(null),fe(0),q(0),Xe(!1),ee(!1),ie(!1),T.current=0,j.current=0,y.current="none",W.current=!1,A.current=null,M.current=!1,R.current=null,tt(),Fe.current=n,ae.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,Xe,Oe,tt]),a.useLayoutEffect(()=>{const w=z.current;w!==null&&(z.current=null,requestAnimationFrame(()=>{B.current(w)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(X==="opening"){H.current=!1,Re(!1);return}if(X!=="open"||H.current)return;if(!Ve&&!xe){H.current=!0;return}Re(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Re(!0),H.current=!0})});return()=>cancelAnimationFrame(w)},[X,Ve==null?void 0:Ve.url,xe==null?void 0:xe.url]),a.useEffect(()=>{if(X!=="open")return;const w=()=>{const Je=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},we=Je=>{const yt=Je<0?1:-1;Oe(),ke(yt),U.current=yt,Te(yt),Xe(!0),Ut()},Ie=Je=>{if(Math.abs(Je)>ph&&et){we(Je);return}U.current=null,Te(null),ce(null),$e(null),Xe(!0),q(0),ot()},_e=Je=>{if(Je.touches.length!==1||Y.current)return;const yt=Je.touches[0];M.current=!0,A.current={x:yt.clientX,y:yt.clientY},y.current="none",j.current=0,W.current=!1},it=Je=>{if(!A.current||Je.touches.length!==1||Y.current)return;const yt=Je.touches[0],Ot=yt.clientX-A.current.x,Tt=yt.clientY-A.current.y;if(y.current==="none"){if(Math.abs(Ot)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ot)>Math.abs(Tt)){if(!et)return;y.current="horizontal"}else if(Tt>0){if(!st)return;y.current="vertical"}else return}if(y.current==="horizontal"){W.current=!0,ie(!0),j.current=Ot,q(Ot),Je.preventDefault();return}y.current==="vertical"&&(W.current=!0,ie(!0),T.current=Tt,fe(Tt),Je.preventDefault())},Et=()=>{if(!A.current)return;const Je=y.current,yt=W.current;if(yt&&Je==="horizontal")Ie(j.current),w();else if(yt&&Je==="vertical"){const Ot=T.current;if(st&&Ot>uh){const Tt=window.innerHeight;T.current=Tt,ee(!0),fe(Tt),be("closing")}else T.current=0,fe(0);w()}else Je==="horizontal"&&Math.abs(j.current)>0&&(Ie(j.current),w());A.current=null,y.current="none",j.current=0,W.current=!1,ie(!1)};return document.addEventListener("touchstart",_e,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",_e),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[X,et,Xe,ot,Oe,st,Ut,ke]);const Zt=a.useCallback(()=>{const w=(g==null?void 0:g())??x??null;w&&se&&(Se(w),re(!0)),be("closing")},[g,x,se]);a.useEffect(()=>{const w=_e=>{if(_e.key==="Escape"){if(s&&d||X==="closing")return;bt(),Zt();return}if(_e.key!=="ArrowLeft"&&_e.key!=="ArrowRight"||X!=="open"||!et)return;_e.preventDefault();const it=_e.key==="ArrowLeft"?-1:1;_e.repeat&&te.current===it||kt(it)},we=_e=>{if(_e.key!=="ArrowLeft"&&_e.key!=="ArrowRight")return;const it=_e.key==="ArrowLeft"?-1:1;te.current===it&&bt()},Ie=()=>{bt()};return window.addEventListener("keydown",w),window.addEventListener("keyup",we),window.addEventListener("blur",Ie),()=>{window.removeEventListener("keydown",w),window.removeEventListener("keyup",we),window.removeEventListener("blur",Ie),bt()}},[X,s,d,Zt,et,kt,bt]),a.useEffect(()=>{X!=="open"&&bt()},[X,bt]);const en=()=>{X==="closing"||l||Zt()},Ct=X==="open",Bt=X==="closing",cn=Ae>0?Math.max(0,1-Ae/500):1,gt=Ae>0?Math.max(.35,1-Ae/500):1,Le=a.useCallback(w=>{if(!(w.propertyName!=="transform"||!Y.current)){if(U.current!==null){Mt();return}Oe(),Xe(!1)}},[Oe,Xe,Mt]),ze=X==="closing"?pe??x:x,nt=ze&&se&&(X==="opening"||Bt)?fh(ze,se):void 0,ht=je&&N?mt(N,"center"):Ae>0?`translateY(${Ae}px)`:nt,ft=se?Vo(se,L):null,Rt=!!(ze&&se),ut=Rt&&(X==="closing"||X==="open"&&G),Dt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Ae>0?gt:Rt?1:X==="opening"||Bt?0:1,transition:ge&&!Q?"none":Q?`transform ${to}ms ${un}`:_?`transform ${$n}ms ${un}, opacity ${$n}ms ${un}`:ut?`transform ${$n}ms ${un}`:X==="opening"||Bt?`opacity ${$n}ms ${un}`:"none",pointerEvents:qe&&Ct&&!je?"auto":"none",touchAction:qe&&Ct?"none":void 0,zIndex:1,overflow:qe?"hidden":void 0},At={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!je?"auto":"none"},Pt=(w,we,Ie="adjacent")=>{const _e=lt(w);if(!_e)return{display:"none"};const it=Ie==="far"?we==="left"?"far-left":"far-right":we==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ne!==null?Rc(_e,it,Ne,L):{start:Ie==="far"?gr(_e,we,L):ji(_e,we,L)},Je=Vo(Et,L),yt=mt(w,it),Ot=!je&&Ie==="adjacent"&&Ct&&!Pe?Rh(_e,we,L):null,Tt=Ie==="far"&&je&&Ne===(we==="left"?-1:1),nn=ge&&!Q?!1:Q,dn=Ie==="adjacent"&&Ct&&Pe&&!je;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ie==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Ie==="far"?`transform ${to}ms ${un}`:`transform ${to}ms ${un}, opacity ${$n}ms ${un}`:dn?`transform ${$n}ms ${un}`:X==="opening"||Bt?`opacity ${$n}ms ${un}`:"none",pointerEvents:"none",zIndex:1}},Vt=(w,we)=>{const Ie=lt(w);return Ie?Th(ji(Ie,we,L),we,L):null},Gt=w=>we=>{if(!l){if(M.current){M.current=!1;return}we.stopPropagation(),xt(w)}},Ht=Ve?Vt(Ve,"left"):null,Nt=xe?Vt(xe,"right"):null,Wt=Ht?Vo(Ht,L):null,St=Nt?Vo(Nt,L):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:en,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:ge?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:C,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ge?"none":`opacity ${$n}ms ${un}`,pointerEvents:"none"},children:r.jsx(Cc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Ct&&Ge&&r.jsx(Go,{media:Ge,style:Pt(Ge,"left","far"),onMeasure:Ue,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&Ve&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:Ve,style:Pt(Ve,"left"),onMeasure:Ue,onTransitionEnd:Le},`prev-${Ve.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&xe&&r.jsxs(r.Fragment,{children:[r.jsx(Go,{media:xe,style:Pt(xe,"right"),onMeasure:Ue,onTransitionEnd:Le},`next-${xe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&r.jsx(Go,{media:Ze,style:Pt(Ze,"right","far"),onMeasure:Ue,onTransitionEnd:Le},`far-next-${Ze.url}`),se&&N&&(qe?r.jsx(Ph,{src:N.url,phase:X,onMediaElement:Ft,wrapperStyle:Dt,videoStyle:At,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${N.url}`):r.jsx("img",{ref:Ft,src:N.url,alt:N.name,onLoad:vt,onTransitionEnd:Le,style:Dt},`${n}-${N.url}`))]})}function Ah({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),{gridLayout:c,verticalGap:u,align:p="top",imageDisplay:v}=e,x=(v==null?void 0:v.display)==="cover",g=(v==null?void 0:v.ratioValue)??"1:1",h=(v==null?void 0:v.reversed)??!1,[m,b]=g.split(":").map(Number),R=`${h?b:m} / ${h?m:b}`,K=c.entryWidth??.2,F=c.columnsCount,V=$.scalingValue(K,n),A=$.scalingValue(c.horizontalGap??0,n),T=V,j=V,y={width:T,...x?{aspectRatio:R,height:"auto",overflow:"hidden"}:{height:"auto"}},W=x?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%"}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%"},M=a.useRef(null),[Y,P]=a.useState(!1),[U,z]=a.useState([]),[B,te]=a.useState(0),[S,E]=a.useState(0),[D,se]=a.useState(null),[oe,L]=a.useState({title1:"",title2:"",title3:""}),ue=(()=>{const ye={},$e=M.current?getComputedStyle(M.current).getPropertyValue("--cntrl-article-width").trim():"";return $e&&(ye["--cntrl-article-width"]=$e),ye})(),k=!n||i||o,ne=a.useMemo(()=>dh(d),[d]),X=t??[],be=X.length%F||F,Ae=be<F&&X.length>0,fe=X.length-be,le=Ae?Math.floor((F-be)/2)+1:1,q=a.useMemo(()=>vh(X),[X]),Q=a.useMemo(()=>$h(X),[X]),Z=(ye,$e,G)=>{if(n&&!o&&!i)return;const re=q.findIndex(Se=>Se.gridIndex===ye);if(re<0)return;const pe=q[re];E(re),z(pe.items),te($e),L(pe.entry),se(G??null),P(!0)},Ne=a.useCallback(()=>{P(!1),se(null)},[]),Te=a.useCallback(()=>{const ye=q[S];return!ye||!M.current?D:yh(M.current,ye.gridIndex,x?"cover":"contain")??D},[q,S,D,x]),We=a.useCallback(ye=>{if(q.length>1){const $e=q.length,G=(S+ye+$e)%$e,re=q[G],pe=Math.min(B,re.items.length-1);E(G),z(re.items),te(pe),L(re.entry);return}te($e=>($e+ye+U.length)%U.length)},[q,S,B,U.length]),ce=q.length>1||U.length>1;return a.useEffect(()=>{if(!Y||typeof document>"u")return;const ye=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ye}},[Y]),a.useEffect(()=>{!n||o||i||P(!1)},[n,o,i]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:ne}}),r.jsx(Ch,{mediaList:Q}),r.jsx("div",{ref:M,className:`${d}-wrapper ${d}-align-entries ${d}-image-align-${p}`.trim(),style:{gridTemplateColumns:`repeat(${F}, ${V})`,rowGap:0,columnGap:A,width:$.scalingValue(c.wrapperWidth??0,n),[`--${d}-align-entries-row-gap`]:$.scalingValue(u??0,n)},children:X.map((ye,$e)=>{const G=is(ye.gallery),re=os(G),pe=re.filter(ie=>ie.lightboxMedia).map(ie=>ie.lightboxMedia),Se=Math.floor($e/F)===Math.ceil(X.length/F)-1,Pe=Ae&&$e>=fe?`${le+($e-fe)}`:void 0,Re=re[0],H=Re!=null&&Re.lightboxMedia?pe.findIndex(ie=>ie.url===Re.lightboxMedia.url):-1,ge=r.jsx("div",{className:`${d}-item-image-wrapper`,style:y,children:re.length>0&&r.jsx(Mh,{media:Re.displayMedia,gridIndex:$e,className:`${d}-item-${Ji(Re.displayMedia)?"video":"image"}`.trim(),style:W,onMediaClick:k&&H>=0?ie=>Z($e,H,Tc(ie.currentTarget,x?"cover":"contain")):void 0})});return r.jsx("div",{className:`${d}-item`,children:r.jsxs("div",{className:[o?`${d}-item-inner`:`${d}-item-inner-hidden`,Se?`${d}-item-inner-last-row`:""].filter(Boolean).join(" "),style:{width:V,...Pe?{gridColumn:Pe}:{}},children:[r.jsx("div",{className:`${d}-item-title-row`,children:r.jsx("div",{style:{height:0,width:j}})}),r.jsx("a",{className:`${d}-item-image-link`,children:ge}),r.jsx("div",{className:`${d}-item-subtitle-row`,children:r.jsx("div",{style:{height:0,width:j}})})]})},$e)})}),Y&&typeof document<"u"&&(()=>{const ye=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:ue,"data-selection":"none",children:r.jsx(kh,{prefix:d,items:U,index:B,entry:oe,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:ce,lightboxEntries:q,entryIdx:S,layoutId:s,sourceRect:D,resolveCloseSourceRect:Te,onClose:Ne,onPrev:()=>We(-1),onNext:()=>We(1)})}),ye)})()]})}const Fh=`import { CommonComponentProps } from '../props';
|
|
7463
7515
|
import { scalingValue, useScopedStyles } from '../utils/index';
|
|
7464
7516
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
7465
7517
|
import { createPortal } from 'react-dom';
|
|
@@ -9802,7 +9854,7 @@ export function Hive({
|
|
|
9802
9854
|
</>
|
|
9803
9855
|
);
|
|
9804
9856
|
}
|
|
9805
|
-
`,Wh="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),oi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function _h(e){const t={};return t[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Kn.filter(e=>e!=="count"),Hh=zi.reduce((e,t)=>({...e,..._h(t)}),{}),Nh=zi.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Arial",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Jr(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const Oh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[ts[e],ns(e)]))},Dh={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},jh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Dh,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),zh={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:jh},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"}},...Hh},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Wh,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Nh},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,...Jr({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,...Jr({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,...Jr({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:[Oh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Bh={element:Ah,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:[...zi.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})},schema:zh,sourceCode:Fh};function Vh(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 Gh({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Qr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qh(e){return String(e??"").trim().length>0}function Us(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 Ks(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 Xs(e,t,n,i,o,s,l){const d=$.scalingValue(s,l),c=$.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Uh(e,t,n){const i=$.scalingValue(t,n),o=$.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Ys=10,Zs=10,no={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Kh(e,t,n){return Math.max(t,Math.min(n,e))}function ea(e,t,n){return e+(t-e)*n}function Xh(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+Ys,y:n.clientY-d.top+Ys}}switch(e){case"left":return{x:Zs+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Zs-i/2,y:l};default:return{x:o/2,y:l}}}function Yh(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.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=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const g=i.current;t?(g.x=ea(g.x,g.targetX,no.positionEase),g.y=ea(g.y,g.targetY,no.positionEase),g.rotation=ea(g.rotation,g.targetRotation,no.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),s();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,m=Math.abs(g.rotation-g.targetRotation)<.08;!h||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((g,h)=>{const m=i.current;m.targetX=g,m.targetY=h,m.targetRotation=0,m.x=g,m.y=h,m.rotation=0,m.lastX=g,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((g,h)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const b=g-m.lastX;m.targetRotation=Kh(b*no.rotationFactor,-20,no.maxRotation)}else m.targetRotation=0;if(m.lastX=g,m.hasLastX=!0,m.targetX=g,m.targetY=h,t){c();return}m.x=g,m.y=h,m.rotation=m.targetRotation,s()},[e,s,t,c]),v=a.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),y=a.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 a.useEffect(()=>(e||y(),l),[e,y,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:y}}function Zh(e){return`
|
|
9857
|
+
`,Wh="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),oi={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function _h(e){const t={};return t[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...oi.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...oi.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...oi.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...oi.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...oi.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...oi.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...oi.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const zi=Kn.filter(e=>e!=="count"),Hh=zi.reduce((e,t)=>({...e,..._h(t)}),{}),Nh=zi.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Arial",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function Jr(e){return zi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const Oh={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(zi.map(e=>[ts[e],ns(e)]))},Dh={title1:"NASA",title2:"Ames Research Center",title3:"Archive Footage"},jh=(()=>{const e=[];for(let t=1;t<=24;t+=1)e.push({...Dh,gallery:[{media:[{url:`https://cdn.cntrl.site/component-assets/hive_${t}.jpg`,name:"",objectFit:"cover"},{url:"",name:"",objectFit:"cover"}]}]});return e})(),zh={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:jh},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"}},...Hh},defaults:{imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},align:"top",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",backgroundColor:"#FFFFFF",closeIcon:Wh,closeIconColor:"#000000",closeIconHoverColor:"#999999",...Nh},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,...Jr({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,...Jr({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,...Jr({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:[Oh]}],paletteBookmark:{items:["title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","typeStyle"]}},Bh={element:Ah,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:[...zi.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{...zi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})},schema:zh,sourceCode:Fh};function Vh(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 Gh({media:e,className:t,style:n}){const i=a.useRef(null);return a.useEffect(()=>{if(!e.isVideo)return;const o=i.current;if(!o)return;const s=o.play();s&&s.catch(()=>{})},[e.isVideo,e.url]),e.isVideo?r.jsx("video",{ref:i,className:t,src:e.url,style:n,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):r.jsx("img",{className:t,src:e.url,alt:"",style:n})}function Qr(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function qh(e){return String(e??"").trim().length>0}function qs(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 Us(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 Ks(e,t,n,i,o,s,l){const d=$.scalingValue(s,l),c=$.scalingValue(0,l),u=e===0,p=e===t-1&&!o;return{borderTopWidth:u&&n?d:c,borderBottomWidth:!p||i?d:c}}function Uh(e,t,n){const i=$.scalingValue(t,n),o=$.scalingValue(0,n);return{borderTopWidth:o,borderBottomWidth:e?i:o}}const Xs=10,Ys=10,no={positionEase:.14,rotationEase:.09,rotationFactor:2.5,maxRotation:20};function Kh(e,t,n){return Math.max(t,Math.min(n,e))}function ea(e,t,n){return e+(t-e)*n}function Xh(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+Xs,y:n.clientY-d.top+Xs}}switch(e){case"left":return{x:Ys+i/2,y:l};case"center":return{x:o/2,y:l};case"right":return{x:o-Ys-i/2,y:l};default:return{x:o/2,y:l}}}function Yh(e,t){const n=a.useRef(null),i=a.useRef({x:0,y:0,rotation:0,targetX:0,targetY:0,targetRotation:0,lastX:0,hasLastX:!1}),o=a.useRef(null),s=a.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=a.useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)},[]),d=a.useCallback(()=>{const g=i.current;t?(g.x=ea(g.x,g.targetX,no.positionEase),g.y=ea(g.y,g.targetY,no.positionEase),g.rotation=ea(g.rotation,g.targetRotation,no.rotationEase)):(g.x=g.targetX,g.y=g.targetY,g.rotation=g.targetRotation),s();const h=Math.abs(g.x-g.targetX)<.4&&Math.abs(g.y-g.targetY)<.4,m=Math.abs(g.rotation-g.targetRotation)<.08;!h||!m?o.current=requestAnimationFrame(d):o.current=null},[s,t]),c=a.useCallback(()=>{o.current===null&&(o.current=requestAnimationFrame(d))},[d]),u=a.useCallback((g,h)=>{const m=i.current;m.targetX=g,m.targetY=h,m.targetRotation=0,m.x=g,m.y=h,m.rotation=0,m.lastX=g,m.hasLastX=!0,s(),t&&c()},[s,t,c]),p=a.useCallback((g,h)=>{if(!e)return;const m=i.current;if(t&&m.hasLastX){const b=g-m.lastX;m.targetRotation=Kh(b*no.rotationFactor,-20,no.maxRotation)}else m.targetRotation=0;if(m.lastX=g,m.hasLastX=!0,m.targetX=g,m.targetY=h,t){c();return}m.x=g,m.y=h,m.rotation=m.targetRotation,s()},[e,s,t,c]),v=a.useCallback(g=>{l(),i.current.hasLastX=!1,g==null||g()},[l]),x=a.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 a.useEffect(()=>(e||x(),l),[e,x,l]),{anchorRef:n,onShow:u,onCursorMove:p,exit:v,reset:x}}function Zh(e){return`
|
|
9806
9858
|
.${e}-wrapper {
|
|
9807
9859
|
display: grid;
|
|
9808
9860
|
align-items: start;
|
|
@@ -10178,7 +10230,7 @@ a.${e}-list-item {
|
|
|
10178
10230
|
overflow-wrap: anywhere;
|
|
10179
10231
|
word-break: break-word;
|
|
10180
10232
|
}
|
|
10181
|
-
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],rs=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",So=[...rs,An],kr=["A","B","C","D","E"];function Mc(e){return`${e}ColumnVerticalAlign`}const Ra=["Top","Center","Bottom"];function as(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return kr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Jh(e){const t=as(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Qh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return kr.includes(n)?n:null}function Pc(e,t,n){const i=Qh(e);return i?i===t?!1:Jh(n[Mc(i)]):!0}function $o(e){const t=as(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return kr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ef(e,t,n){if(kc(e,t,n))return $o(e);const i=$o(e);return i.kind==="baseline"?{kind:"top"}:i}function tf(e){const t=$o(e);return t.kind==="baseline"?{kind:"top"}:t}function kc(e,t,n){return Pc(e,n,t)?$o(e).kind==="baseline":!1}function nf(e){const t={};let n=!1;for(const i of kr){const o=Mc(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Pc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function of(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function rf(e){const t=$o(e).kind;return t==="baseline"?"center":t}function af(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Js(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function sf(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(),s=o-i;return n.remove(),s}function ta(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=sf(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 lf(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function cf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const df={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const uf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function pf(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function mf(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(So.map(e=>[uf[e],pf(e)]))}}function hr(e,t){const n=i=>{const o=It(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Qs(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 on(Kt(n,t))}function el(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function tl(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Vi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],gf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},hf=["hover","focus","filled","success","error"],nl=.004,Ei=.004,na=Ei,ss=50,Co=1440,To=ss/Co;function Ac(e){const t=typeof e=="number"&&e>0?e:Co;return ss/t}function ff(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 Co}const Fc={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function yf(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function vf(){return Object.fromEntries([...Bi.map(e=>[e,0]),...Vi.map(e=>[e,0])])}function xf(){return Object.fromEntries(Gi.map(e=>[e,0]))}function qo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function Wc(e,t,n){const i=e-To,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ar(e,t,n){const i=ls(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function bf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Bi[o],l=Vi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Wc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ls(e,t,n){if(e<=0)return[];const i=fn.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)+To;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]-To;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function wf(e,t,n){if(e<=1)return{};const i=ls(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function il(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Sf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function $f(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Bi[c],v=Vi[c],y=Gi[c],g=fn[l],h=Bi[l],m=Vi[l],b=Gi[l],E=n[u],L=n[p],C=n[v],K=n[y];typeof E=="number"&&(s[g]=E),typeof L=="number"&&(s[h]=L),typeof C=="number"&&(s[m]=C),typeof K=="number"&&(s[b]=K)}return s}function _c(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 Cf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=po(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...yf(n,o),...vf()};if(s)for(const d of Gi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,xf());return _c(e,l)?l:e}function Tf(e,t,n){const i=nf(e);i&&(e={...e,...i});const o=Ac(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=po(e),c=po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,v=C=>{if(u)return C;const K=qo({...t,...C}),W=po(C),B=ar(p,W,K),A=bf(p,B,{...t,...C});return Object.keys(A).length===0?C:{...C,...A}};if(typeof s=="number"&&s!==l)return e;const y=il(e),g=il(t);if(!Sf(y,g))return v({...e,...$f(y,g,t,p)});if(d<c&&typeof p=="number"&&!u){const C=qo({...t,...e});return v({...e,...wf(p,d,C)})}if(u){const C=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,K=Math.max(0,(d-o)/2);return C>K?{...e,textPaddingLR:K}:e}const h=qo({...t,...e}),m=ar(p,c,qo(t)),E=ar(p,d,h).some((C,K)=>C<(m[K]??C)),L=fn.some(C=>{const K=e[C],W=t[C];return typeof K=="number"&&typeof W=="number"&&K!==W});return E||L?v(e):e}function Lf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(To,i-o-s-To)}function Rf(e,t){return Math.random()*(t-e)+e}function If(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Fc[t]]))}function ia(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ef(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Bi[d],u=Vi[d],p=Gi[d];return{key:l,textPrefix:df[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function Mf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=$.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:y,entriesCount:g,cellMinHeight:h,dividerWidth:m,showVisibility:b,cut:E,showCut:L,cutCellMinHeight:C,cutLabel:K,imageSize:W,imageOnHover:B,imagePosition:A="cursor",imageInterpolation:T="on",entryHoverEffect:j,entryHoverShowOption:w,rowPaddingTop:P,rowPaddingBottom:M,rowPaddingTopB:X,columnsOrder:k,textPaddingLR:q,textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:S,backgroundHoverColor:R,dividerHoverColor:O}=e,[ae,se]=a.useState(void 0),[I,de]=a.useState(null),F=a.useRef(null),te=B==="on"&&(!n||i),Z=A==="cursor",ve=Z&&T==="on",{anchorRef:Ae,onShow:he,onCursorMove:pe,exit:U}=Yh(!!(te&&I!==null),ve),ee=(E??0)>0,Y=v==="b",Oe=a.useRef(null),$e=a.useRef(null),[He,ue]=a.useState(null),[me,be]=a.useState(Co),z=Ac(me),le=Math.max(0,((y??0)-z)/2),ye=Math.min(q??0,le),we=Math.max(ye,Ei),Pe=((y??0)+z)/2;a.useLayoutEffect(()=>{if(!n){be(Co);return}const Le=()=>{be(ff(Oe.current))};Le();const ze=Oe.current;if(!ze)return;const tt=new ResizeObserver(Le);tt.observe(ze);let gt=ze;for(;gt&&!gt.style.getPropertyValue("--cntrl-article-width");)gt=gt.parentElement;return gt&&tt.observe(gt),()=>tt.disconnect()},[n,l]),a.useEffect(()=>{se(void 0)},[E,L,t,g]),a.useEffect(()=>{n&&!i&&se(void 0)},[n,i]);const Ce=$.buildColorVars(c,{textColor:V,backgroundColor:G,dividerColor:ie,textHoverColor:S,backgroundHoverColor:R,dividerHoverColor:O},gf,hf),_=s&&s!=="default"?`${c}-state-${s}`:"",ne=`${!n||i?j==="default"?`${c}-entry-hover-default`:j==="blinds"?`${c}-entry-hover-blinds`:j==="reveal"?`${c}-entry-hover-reveal`:"":""} ${_}`.trim(),H=j==="reveal"&&(!n||i),Q=(b==null?void 0:b[0])??!1,Fe=(b==null?void 0:b[1])??!1,re=a.useRef(e),N=a.useRef(l);a.useEffect(()=>{if(!d||!n){re.current=e,N.current=l;return}if(N.current!==l){re.current=e,N.current=l;return}const Le=re.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){re.current=e;return}const tt=Tf(e,Le,{designWidth:me});re.current=e,_c(e,tt)&&d(tt)},[e,d,n,l,me]);const qe=a.useMemo(()=>If(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),Be=a.useMemo(()=>ia(e,Bi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),at=a.useMemo(()=>ia(e,Vi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),et=a.useMemo(()=>ia(e,Gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),ut=a.useMemo(()=>Array.isArray(k)&&k.length>0?k:[...Xn],[k]),ke=a.useMemo(()=>Ef(ut,p,qe,Be,at,et),[ut,p,qe,Be,at,et]),Ie=po(e),oe=a.useMemo(()=>fn.slice(0,p).map(Le=>qe[Le]),[p,qe]),Te=a.useMemo(()=>ls(p,Ie,qe),[p,Ie,qe]),Ee=a.useMemo(()=>ar(p,Ie,qe),[p,Ie,qe]),De=a.useMemo(()=>ke.map((Le,ze)=>Wc(Ee[ze]??0,Le.paddingLeft,Le.paddingRight)),[ke,Ee]),fe=a.useMemo(()=>{const Le=g===0?1/0:g;return(t??[]).slice(0,Le).map((tt,gt)=>({id:gt,cells:Object.fromEntries(Xn.map(ht=>[ht,tt[ht]??""])),image:tt.image,link:tt.link}))},[t,g]),Me=ee?ae??E:fe.length,_e=a.useMemo(()=>ee?fe.slice(0,Me):fe,[fe,ee,Me]),Ke=ee&&Me<fe.length,it=_e.length>1||Ke,Ye=[Q?`${c}-divider-top`:"",Fe||it?`${c}-divider-bottom`:""].filter(Boolean).join(" "),xt=!n||i,ot=()=>{if(!xt)return;const Le=ae??E;if(!L){se(fe.length);return}se(Math.min(Le+L,fe.length))},We=Le=>$.scalingValue(Le,n??!1),Ze=Y?X??0:P??0,Ve=M??0,st=h??0,pt=Math.max(Ve,na),ct=Xs(0,_e.length,Q,Fe,Ke,m??0,n??!1).borderTopWidth,Et=Y?"rowPaddingTopB":"rowPaddingTop",zt=ke[0],Xt=ke[ke.length-1],yt=De[0],bt=De[De.length-1],Nt=zt&&yt?Math.max(yt.paddingLeft,Ei):0,At=Xt&&bt?Math.max(bt.paddingRight,Ei):0,wt=Ie,Ot=(Le,ze)=>Xh(A,Oe.current,Z?Le:null,ze),Ut=(Le,ze)=>{if(!te)return;const tt=Le.image;if(!(tt!=null&&tt.url)){U(()=>de(null));return}const gt=(W==null?void 0:W.min)??80,ht=(W==null?void 0:W.max)??320,Rt=(I==null?void 0:I.rowId)===Le.id,dt=Rt?I.widthPx:Rf(gt,ht),{x:Dt,y:kt}=Ot(ze,dt);if(Rt&&Z){pe(Dt,kt);return}de({rowId:Le.id,url:tt.url,objectFit:"contain",isVideo:Vh(tt),widthPx:dt}),F.current={x:Dt,y:kt}},Zt=Le=>{if(!te||!I||!Z)return;const{x:ze,y:tt}=Ot(Le,I.widthPx);pe(ze,tt)},tn=()=>{I&&U(()=>de(null))},Ct=Le=>{H&&Us(Le,c),!(!te||!I)&&U(()=>de(null))},Bt=Le=>{H&&Ks(Le,c)};a.useLayoutEffect(()=>{if(!I||!F.current)return;const{x:Le,y:ze}=F.current;F.current=null,he(Le,ze)},[I==null?void 0:I.rowId,I==null?void 0:I.url,he]),a.useLayoutEffect(()=>{if(!u||Y){ue(null);return}const Le=$e.current,ze=Le==null?void 0:Le.parentElement;if(!Le||!ze){ue(null);return}const tt=()=>{const ht=Le.querySelector("[data-list-row]");if(!ht){ue(null);return}const Rt=ze.getBoundingClientRect(),dt=ht.getBoundingClientRect();ue(dt.top-Rt.top+dt.height/2)};tt();const gt=new ResizeObserver(tt);return gt.observe(Le),gt.observe(ze),()=>gt.disconnect()},[u,Y,_e,Ze,Ve,st,t,e,ke,Ee,me,m,Q,Fe,Ke]);const cn=a.useMemo(()=>!Y&&rs.some(Le=>{const ze=Le.charAt(0),tt=e[`${Le}VerticalAlign`];return kc(tt,e,ze)}),[Y,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Dt;const Le=Oe.current;if(!Le)return;const ze=()=>{Le.querySelectorAll("[data-list-col]").forEach(kt=>{kt.style.transform="";const Pt=kt.querySelector(`.${c}-list-col`);Pt&&(Pt.style.minHeight="",Pt.style.height="");const Vt=kt.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(Y||!cn){ze();return}const tt=()=>{const kt=Array.from(Le.querySelectorAll("[data-list-row]")),Pt=`${c}-list-col`,Vt=`${c}-baseline-probe`;kt.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Wt=>{Wt.style.transform="";const _t=Wt.querySelector(`.${Pt}`);_t&&(_t.style.minHeight="",_t.style.height="");const Ft=Wt.querySelector(`.${c}-list-col-title`);Ft&&(Ft.style.transform="")})}),kt.forEach(Gt=>{const Wt=Array.from(Gt.querySelectorAll("[data-list-col]"));lf(Gt,Wt,Pt)}),Le.offsetHeight,kt.forEach(Gt=>{const Wt=Array.from(Gt.querySelectorAll("[data-list-col]")),_t=Gt.getBoundingClientRect().top,Ft=new Map,St=Wt.map(Re=>{const Ne=Re.querySelector(`.${c}-list-col-title`),nt={el:Re,titleEl:Ne,letter:Re.getAttribute("data-col-letter")??"",kind:Re.getAttribute("data-valign")??"top",anchor:Re.getAttribute("data-valign-anchor")};return Ft.set(nt.letter,nt),nt}),x=new Map,xe=(Re,Ne)=>{const nt=x.get(Re.letter);if(nt!==void 0)return nt;const Mt=Re.anchor?Ft.get(Re.anchor):void 0;if(Re.kind!=="baseline"||!Mt||Ne.has(Re.letter)){const nn=ta(Re,_t,Pt,Vt);return x.set(Re.letter,nn),nn}Ne.add(Re.letter);const Je=xe(Mt,Ne);Ne.delete(Re.letter);const ft=ta(Re,_t,Pt,Vt),Ht=Je-ft;cf(Re.titleEl,Ht);const Tt=ta(Re,_t,Pt,Vt);return x.set(Re.letter,Tt),Tt};St.forEach(Re=>xe(Re,new Set))})};let gt=null;const ht=()=>{gt===null&&(gt=requestAnimationFrame(()=>{gt=null,tt()}))};tt();const Rt=new ResizeObserver(()=>ht());Rt.observe(Le);let dt=!1;return typeof document<"u"&&((Dt=document.fonts)!=null&&Dt.ready)&&document.fonts.ready.then(()=>{dt||ht()}),()=>{dt=!0,gt!==null&&(cancelAnimationFrame(gt),gt=null),Rt.disconnect(),ze()}},[cn,Y,e,t,me,_e,Ee]);const mt=a.useMemo(()=>Zh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:mt}}),r.jsx("div",{style:Ce,children:r.jsxs("div",{ref:Oe,className:`${c}-wrapper ${ne}${Ye?` ${Ye}`:""}${Y?` ${c}-type-b`:""}`.trim(),style:{width:$.scalingValue(y??0,n)},onMouseMove:te?Zt:void 0,onMouseLeave:te?tn:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[_e.map((Le,ze)=>{var Rt;const tt=(((Rt=Le.link)==null?void 0:Rt.length)??0)>0,gt=tt&&(!n||i)?"a":"div",ht=Xs(ze,_e.length,Q,Fe,Ke,m??0,n??!1);return r.jsxs(gt,{ref:ze===0?dt=>{$e.current=dt}:void 0,className:`${c}-list-item${tt||w==="always"?` ${c}-list-item-has-link`:""}${Ke&&ze===_e.length-1?` ${c}-list-item-before-cut`:""}`,...tt?{href:Le.link,target:"_blank"}:{},style:ht,onMouseEnter:dt=>{H&&(tt||w==="always")&&Us(dt,c),te&&Ut(Le,dt)},onMouseLeave:dt=>{H&&(tt||w==="always")&&Ks(dt,c)},children:[Ze>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(Ze)}}),r.jsxs("div",{className:`${c}-list-cols-row${Y?"":` ${c}-list-cols-row-h`}${u&&ze===0&&Y?` ${c}-list-cols-row-controls`:""}`,...Y?{}:{"data-list-row":""},style:Y?void 0:{minHeight:We(st)},children:[ke.map((dt,Dt)=>{const kt=Dt===ke.length-1,Pt=De[Dt],Vt=dt.paddingBottom,Gt=qh(Le.cells[dt.key]),Wt=Y&&Gt&&Vt>0,_t=Y?{minHeight:We(st)}:{width:We(Ee[Dt])},Ft=Y?{paddingLeft:We(ye),paddingRight:We(ye)}:{paddingLeft:We(Pt.paddingLeft),paddingRight:We(Pt.paddingRight)},St=dt.textPrefix.charAt(0),x=Y?tf(e[`${dt.textPrefix}VerticalAlign`]):ef(e[`${dt.textPrefix}VerticalAlign`],e,St),xe=Y&&Gt&&u&&ze===0;return Y&&!Gt?null:r.jsxs("div",{className:Y?`${c}-list-col-wrap`:void 0,...Y?{}:{"data-list-col":"","data-col-letter":St,"data-valign":x.kind,...x.kind==="baseline"?{"data-valign-anchor":x.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${kt?` ${c}-list-col-last`:""}`,style:{...Ft,..._t,...Y?{justifyContent:Js(x.kind)}:{}},"data-test":dt.width,children:r.jsx("span",{className:el(e,dt.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Qs(hr(e,dt.textPrefix),n),...tl(e,dt.textPrefix,c,n),...Y?{}:of(x.kind)},children:Le.cells[dt.key]??null})}),Wt&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(Vt)}}),xe&&r.jsx("div",{"data-controls":dt.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:We(Math.max(Vt,na))}})]},dt.key)}),u&&ze===0&&Y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:We(we),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:We(Math.max(we,Ie-we)),width:We(we),height:"100%"}})]})]}),!Y&&Ve>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:We(Ve)}}),u&&ze===0&&!Y&&r.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:We(pt)}})]},Le.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Et,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Y?"center":"left-y",className:`${c}-control-anchor`,style:{top:ct,left:0,width:"100%",height:We(Math.max(Ze,na))}})},"row-padding-handles"),u&&!Y&&zt&&Xt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":zt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ee[0]-((yt==null?void 0:yt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":He??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:We(Nt),height:"100%"}}),r.jsx("div",{"data-controls":Xt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ee[ke.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":He??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(wt-At),width:We(At),height:"100%"}})]},"column-edge-padding-handles"),u&&!Y&&ke.slice(0,-1).map((Le,ze)=>{const tt=ke[ze+1],gt=Te.slice(0,ze+1).reduce((kt,Pt)=>kt+Pt,0),ht=De[ze],Rt=De[ze+1],dt=Math.max(ht.paddingRight,Ei),Dt=Math.max(Rt.paddingLeft,Ei);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Ee[ze]-ht.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":He??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(gt-dt),width:We(dt),height:"100%"}}),r.jsx("div",{"data-controls":tt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Ee[ze+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":He??void 0,className:`${c}-control-anchor`,style:{top:0,left:We(gt),width:We(Dt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!Y&&ke.slice(0,-1).map((Le,ze)=>{const tt=Lf(ze,Te,oe,Ie),ht=Te.slice(0,ze+1).reduce((Rt,dt)=>Rt+dt,0)-nl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(ss),"data-controls-max-fraction":String(tt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:We(ht),width:We(nl),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),Ke&&(()=>{const Le=hr(e,An),ze=rf(e.cutLabelVerticalAlign),tt=Le.textTextAlign==="justify"||Y;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:We(C??0),cursor:xt?"pointer":"default",...Uh(Fe,m??0,n??!1)},onClick:xt?ot:void 0,onMouseEnter:H||te?Ct:void 0,onMouseLeave:H?Bt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Y?{paddingLeft:We(ye),paddingRight:We(ye)}:{},justifyContent:af(Le.textTextAlign),alignItems:Js(ze)},children:r.jsx("span",{className:el(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Qs(Le,n),...tl(e,An,c,n),...tt?{width:"100%"}:{}},children:K})})})})(),te&&I&&(()=>{const Le=`${I.widthPx}px`,ze={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return r.jsx("div",{ref:Ae,className:`${c}-hover-media-anchor`,children:r.jsx(Gh,{media:I,className:I.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:ze},`${I.rowId}-${I.url}`)})})()]})})]})}const Pf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10233
|
+
`}const Xn=["AColumn","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],rs=["AColumn","BColumn","CColumn","DColumn","EColumn"],An="cutLabel",So=[...rs,An],kr=["A","B","C","D","E"];function Ec(e){return`${e}ColumnVerticalAlign`}const Ra=["Top","Center","Bottom"];function as(e){const t=String(e??"Top").trim();if(t.toLowerCase().startsWith("baseline")){const i=t.slice(-1).toUpperCase();return kr.includes(i)?`Baseline ${i}`:"Top"}const n=t.toLowerCase();return n==="center"?"Center":n==="bottom"?"Bottom":n==="top"?"Top":t}function Jh(e){const t=as(e);return t.toLowerCase().startsWith("baseline")?!1:t==="Top"||t==="Center"||t==="Bottom"}function Qh(e){const t=String(e??"").trim();if(!t.toLowerCase().startsWith("baseline"))return null;const n=t.slice(-1).toUpperCase();return kr.includes(n)?n:null}function Mc(e,t,n){const i=Qh(e);return i?i===t?!1:Jh(n[Ec(i)]):!0}function $o(e){const t=as(e);if(t.toLowerCase().startsWith("baseline")){const n=t.slice(-1).toUpperCase();return kr.includes(n)?{kind:"baseline",anchorLetter:n}:{kind:"top"}}return t==="Center"?{kind:"center"}:t==="Bottom"?{kind:"bottom"}:{kind:"top"}}function ef(e,t,n){if(Pc(e,t,n))return $o(e);const i=$o(e);return i.kind==="baseline"?{kind:"top"}:i}function tf(e){const t=$o(e);return t.kind==="baseline"?{kind:"top"}:t}function Pc(e,t,n){return Mc(e,n,t)?$o(e).kind==="baseline":!1}function nf(e){const t={};let n=!1;for(const i of kr){const o=Ec(i),s=e[o];if(e.type==="b"){const l=String(s??"Top").trim();l!=="Top"&&l!=="Center"&&l!=="Bottom"&&(t[o]="Top",n=!0);continue}Mc(s,i,e)||(t[o]="Top",n=!0)}return n?t:null}function of(e){return e==="center"?{flex:"0 0 auto",marginTop:"auto",marginBottom:"auto"}:e==="bottom"?{flex:"0 0 auto",marginTop:"auto"}:{}}function rf(e){const t=$o(e).kind;return t==="baseline"?"center":t}function af(e){return e==="right"?"flex-end":e==="center"?"center":"flex-start"}function Zs(e){return e==="center"?"center":e==="bottom"?"flex-end":"flex-start"}function sf(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(),s=o-i;return n.remove(),s}function ta(e,t,n,i){const o=e.titleEl;if(!o)return 0;const s=o.closest(`.${n}`);if(!s)return 0;const l=sf(o,i);if(e.kind==="baseline")return o.getBoundingClientRect().top-t+l;const d=s.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 lf(e,t,n){const i=e.getBoundingClientRect().height;return i<=0?0:(t.forEach(o=>{const s=o.querySelector(`.${n}`);s&&(s.style.minHeight=`${i}px`,s.style.height=`${i}px`)}),i)}function cf(e,t){return!e||!t?(e&&(e.style.transform=""),0):(e.style.transform=`translateY(${t}px)`,t)}const df={AColumn:"AColumn",BColumnWidth:"BColumn",CColumnWidth:"CColumn",DColumnWidth:"DColumn",EColumnWidth:"EColumn"};function It(e,t){return`${e}${t.replace(/^text/,"Text")}`}const uf={AColumn:"A",BColumn:"B",CColumn:"C",DColumn:"D",EColumn:"E",cutLabel:"CUT"};function pf(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),{type:"row",items:[It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing")]},It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function mf(){return{type:"tab",id:"listColumnTextStyle",tabs:Object.fromEntries(So.map(e=>[uf[e],pf(e)]))}}function hr(e,t){const n=i=>{const o=It(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===An?"center":"left"),textTextAppearance:n("textTextAppearance"),textColor:e.textColor}}function Js(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 on(Kt(n,t))}function Qs(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l!==void 0&&l<s?`${n} ${i}`:n}function el(e,t,n,i){const o=hr(e,t),s=o.textFontSize??.01,l=o.textLineHeight;return l===void 0||l>=s?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((s-l)/2,i)}}const fn=["AColumnWidth","BColumnWidth","CColumnWidth","DColumnWidth","EColumnWidth"],Bi=["AColumnPaddingLeft","BColumnPaddingLeft","CColumnPaddingLeft","DColumnPaddingLeft","EColumnPaddingLeft"],Vi=["AColumnPaddingRight","BColumnPaddingRight","CColumnPaddingRight","DColumnPaddingRight","EColumnPaddingRight"],Gi=["AColumnPaddingBottom","BColumnPaddingBottom","CColumnPaddingBottom","DColumnPaddingBottom","EColumnPaddingBottom"],gf={textColor:"text-color",backgroundColor:"background-color",dividerColor:"divider-color",textHoverColor:"text-hover-color",backgroundHoverColor:"background-hover-color",dividerHoverColor:"divider-hover-color"},hf=["hover","focus","filled","success","error"],tl=.004,Ei=.004,na=Ei,ss=50,Co=1440,To=ss/Co;function kc(e){const t=typeof e=="number"&&e>0?e:Co;return ss/t}function ff(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 Co}const Ac={AColumnWidth:.02,BColumnWidth:.02,CColumnWidth:.02,DColumnWidth:.02,EColumnWidth:.02};function po(e){const t=typeof e.wrapperWidth=="number"?e.wrapperWidth:1;return Math.max(0,t)}function yf(e,t=1){const n=t/e;return Object.fromEntries(fn.map(i=>[i,n]))}function vf(){return Object.fromEntries([...Bi.map(e=>[e,0]),...Vi.map(e=>[e,0])])}function xf(){return Object.fromEntries(Gi.map(e=>[e,0]))}function qo(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ac[t]]))}function Fc(e,t,n){const i=e-To,o=t+n;if(o<=0||o<=i)return{paddingLeft:t,paddingRight:n};if(i<=0)return{paddingLeft:0,paddingRight:0};const s=i/o;return{paddingLeft:t*s,paddingRight:n*s}}function ar(e,t,n){const i=ls(e,t,n);if(e<=0)return[];const o=i.slice(0,e-1).reduce((s,l)=>s+l,0);return[...i.slice(0,e-1),Math.max(0,t-o)]}function bf(e,t,n){const i={};for(let o=0;o<e;o+=1){const s=Bi[o],l=Vi[o],d=typeof n[s]=="number"?n[s]:0,c=typeof n[l]=="number"?n[l]:0,u=Fc(t[o]??0,d,c);u.paddingLeft!==d&&(i[s]=u.paddingLeft),u.paddingRight!==c&&(i[l]=u.paddingRight)}return i}function ls(e,t,n){if(e<=0)return[];const i=fn.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)+To;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]-To;if(p<=0)continue;const v=Math.min(c,p);d[u]-=v,c-=v}return[...d,i[e-1]]}function wf(e,t,n){if(e<=1)return{};const i=ls(e,t,n),o={};for(let s=0;s<e-1;s+=1){const l=fn[s];i[s]!==n[l]&&(o[l]=i[s])}return o}function nl(e){return Array.isArray(e.columnsOrder)&&e.columnsOrder.length>0?e.columnsOrder:[...Xn]}function Sf(e,t){return e.length!==t.length?!1:e.every((n,i)=>n===t[i])}function $f(e,t,n,i){const o=Math.min(i,e.length,fn.length),s={};for(let l=0;l<o;l+=1){const d=e[l],c=t.indexOf(d);if(c===-1)continue;const u=fn[c],p=Bi[c],v=Vi[c],x=Gi[c],g=fn[l],h=Bi[l],m=Vi[l],b=Gi[l],I=n[u],C=n[p],R=n[v],K=n[x];typeof I=="number"&&(s[g]=I),typeof C=="number"&&(s[h]=C),typeof R=="number"&&(s[m]=R),typeof K=="number"&&(s[b]=K)}return s}function Wc(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 Cf(e,t){const n=e.columns,i=t.columns;if(typeof n!="number"||n===i)return e;const o=po(e),s=e.type==="b"||e.type===void 0&&t.type==="b",l={...e,...yf(n,o),...vf()};if(s)for(const d of Gi)typeof t[d]=="number"&&(l[d]=t[d]);else Object.assign(l,xf());return Wc(e,l)?l:e}function Tf(e,t,n){const i=nf(e);i&&(e={...e,...i});const o=kc(n==null?void 0:n.designWidth),s=e.columns,l=t.columns,d=po(e),c=po(t),u=e.type==="b"||e.type===void 0&&t.type==="b",p=typeof s=="number"?s:typeof l=="number"?l:Xn.length,v=R=>{if(u)return R;const K=qo({...t,...R}),F=po(R),V=ar(p,F,K),A=bf(p,V,{...t,...R});return Object.keys(A).length===0?R:{...R,...A}};if(typeof s=="number"&&s!==l)return e;const x=nl(e),g=nl(t);if(!Sf(x,g))return v({...e,...$f(x,g,t,p)});if(d<c&&typeof p=="number"&&!u){const R=qo({...t,...e});return v({...e,...wf(p,d,R)})}if(u){const R=typeof e.textPaddingLR=="number"?e.textPaddingLR:0,K=Math.max(0,(d-o)/2);return R>K?{...e,textPaddingLR:K}:e}const h=qo({...t,...e}),m=ar(p,c,qo(t)),I=ar(p,d,h).some((R,K)=>R<(m[K]??R)),C=fn.some(R=>{const K=e[R],F=t[R];return typeof K=="number"&&typeof F=="number"&&K!==F});return I||C?v(e):e}function Lf(e,t,n,i){const o=t.slice(0,e).reduce((l,d)=>l+d,0),s=n.slice(e+1,t.length-1).reduce((l,d)=>l+d,0);return Math.max(To,i-o-s-To)}function Rf(e,t){return Math.random()*(t-e)+e}function If(e){return Object.fromEntries(fn.map(t=>[t,typeof e[t]=="number"?e[t]:Ac[t]]))}function ia(e,t,n=0){return Object.fromEntries(t.map(i=>[i,typeof e[i]=="number"?e[i]:n]))}function Ef(e,t,n,i,o,s){return e.slice(0,t).map((l,d)=>{const c=Bi[d],u=Vi[d],p=Gi[d];return{key:l,textPrefix:df[l],widthKey:fn[d],width:n[fn[d]],paddingLeftKey:c,paddingRightKey:u,paddingBottomKey:p,paddingLeft:i[c],paddingRight:o[u],paddingBottom:s[p]}})}function Mf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s,layoutId:l,onUpdateSettings:d}){const{prefix:c}=$.useScopedStyles(),u=!!o,{columns:p,type:v,wrapperWidth:x,entriesCount:g,cellMinHeight:h,dividerWidth:m,showVisibility:b,cut:I,showCut:C,cutCellMinHeight:R,cutLabel:K,imageSize:F,imageOnHover:V,imagePosition:A="cursor",imageInterpolation:T="on",entryHoverEffect:j,entryHoverShowOption:y,rowPaddingTop:W,rowPaddingBottom:M,rowPaddingTopB:Y,columnsOrder:P,textPaddingLR:U,textColor:z,backgroundColor:B,dividerColor:te,textHoverColor:S,backgroundHoverColor:E,dividerHoverColor:D}=e,[se,oe]=a.useState(void 0),[L,ue]=a.useState(null),k=a.useRef(null),ne=V==="on"&&(!n||i),X=A==="cursor",be=X&&T==="on",{anchorRef:Ae,onShow:fe,onCursorMove:le,exit:q}=Yh(!!(ne&&L!==null),be),Q=(I??0)>0,Z=v==="b",Ne=a.useRef(null),Te=a.useRef(null),[We,ce]=a.useState(null),[ye,$e]=a.useState(Co),G=kc(ye),re=Math.max(0,((x??0)-G)/2),pe=Math.min(U??0,re),Se=Math.max(pe,Ei),Pe=((x??0)+G)/2;a.useLayoutEffect(()=>{if(!n){$e(Co);return}const Le=()=>{$e(ff(Ne.current))};Le();const ze=Ne.current;if(!ze)return;const nt=new ResizeObserver(Le);nt.observe(ze);let ht=ze;for(;ht&&!ht.style.getPropertyValue("--cntrl-article-width");)ht=ht.parentElement;return ht&&nt.observe(ht),()=>nt.disconnect()},[n,l]),a.useEffect(()=>{oe(void 0)},[I,C,t,g]),a.useEffect(()=>{n&&!i&&oe(void 0)},[n,i]);const Re=$.buildColorVars(c,{textColor:z,backgroundColor:B,dividerColor:te,textHoverColor:S,backgroundHoverColor:E,dividerHoverColor:D},gf,hf),H=s&&s!=="default"?`${c}-state-${s}`:"",ie=`${!n||i?j==="default"?`${c}-entry-hover-default`:j==="blinds"?`${c}-entry-hover-blinds`:j==="reveal"?`${c}-entry-hover-reveal`:"":""} ${H}`.trim(),_=j==="reveal"&&(!n||i),ee=(b==null?void 0:b[0])??!1,Fe=(b==null?void 0:b[1])??!1,ae=a.useRef(e),N=a.useRef(l);a.useEffect(()=>{if(!d||!n){ae.current=e,N.current=l;return}if(N.current!==l){ae.current=e,N.current=l;return}const Le=ae.current;if(!(Le!==e))return;if(typeof Le.columns=="number"&&typeof e.columns=="number"&&Le.columns!==e.columns){ae.current=e;return}const nt=Tf(e,Le,{designWidth:ye});ae.current=e,Wc(e,nt)&&d(nt)},[e,d,n,l,ye]);const qe=a.useMemo(()=>If(e),[e.AColumnWidth,e.BColumnWidth,e.CColumnWidth,e.DColumnWidth,e.EColumnWidth]),je=a.useMemo(()=>ia(e,Bi),[e.AColumnPaddingLeft,e.BColumnPaddingLeft,e.CColumnPaddingLeft,e.DColumnPaddingLeft,e.EColumnPaddingLeft]),st=a.useMemo(()=>ia(e,Vi),[e.AColumnPaddingRight,e.BColumnPaddingRight,e.CColumnPaddingRight,e.DColumnPaddingRight,e.EColumnPaddingRight]),et=a.useMemo(()=>ia(e,Gi),[e.AColumnPaddingBottom,e.BColumnPaddingBottom,e.CColumnPaddingBottom,e.DColumnPaddingBottom,e.EColumnPaddingBottom]),pt=a.useMemo(()=>Array.isArray(P)&&P.length>0?P:[...Xn],[P]),rt=a.useMemo(()=>Ef(pt,p,qe,je,st,et),[pt,p,qe,je,st,et]),Ve=po(e),xe=a.useMemo(()=>fn.slice(0,p).map(Le=>qe[Le]),[p,qe]),me=a.useMemo(()=>ls(p,Ve,qe),[p,Ve,qe]),he=a.useMemo(()=>ar(p,Ve,qe),[p,Ve,qe]),He=a.useMemo(()=>rt.map((Le,ze)=>Fc(he[ze]??0,Le.paddingLeft,Le.paddingRight)),[rt,he]),ve=a.useMemo(()=>{const Le=g===0?1/0:g;return(t??[]).slice(0,Le).map((nt,ht)=>({id:ht,cells:Object.fromEntries(Xn.map(ft=>[ft,nt[ft]??""])),image:nt.image,link:nt.link}))},[t,g]),Ee=Q?se??I:ve.length,Me=a.useMemo(()=>Q?ve.slice(0,Ee):ve,[ve,Q,Ee]),Ge=Q&&Ee<ve.length,Ze=Me.length>1||Ge,Ue=[ee?`${c}-divider-top`:"",Fe||Ze?`${c}-divider-bottom`:""].filter(Boolean).join(" "),lt=!n||i,tt=()=>{if(!lt)return;const Le=se??I;if(!C){oe(ve.length);return}oe(Math.min(Le+C,ve.length))},ke=Le=>$.scalingValue(Le,n??!1),Xe=Z?Y??0:W??0,Oe=M??0,ot=h??0,ct=Math.max(Oe,na),mt=Ks(0,Me.length,ee,Fe,Ge,m??0,n??!1).borderTopWidth,Mt=Z?"rowPaddingTopB":"rowPaddingTop",Ut=rt[0],Yt=rt[rt.length-1],xt=He[0],bt=He[He.length-1],_t=Ut&&xt?Math.max(xt.paddingLeft,Ei):0,kt=Yt&&bt?Math.max(bt.paddingRight,Ei):0,vt=Ve,Ft=(Le,ze)=>Xh(A,Ne.current,X?Le:null,ze),zt=(Le,ze)=>{if(!ne)return;const nt=Le.image;if(!(nt!=null&&nt.url)){q(()=>ue(null));return}const ht=(F==null?void 0:F.min)??80,ft=(F==null?void 0:F.max)??320,Rt=(L==null?void 0:L.rowId)===Le.id,ut=Rt?L.widthPx:Rf(ht,ft),{x:Dt,y:At}=Ft(ze,ut);if(Rt&&X){le(Dt,At);return}ue({rowId:Le.id,url:nt.url,objectFit:"contain",isVideo:Vh(nt),widthPx:ut}),k.current={x:Dt,y:At}},Zt=Le=>{if(!ne||!L||!X)return;const{x:ze,y:nt}=Ft(Le,L.widthPx);le(ze,nt)},en=()=>{L&&q(()=>ue(null))},Ct=Le=>{_&&qs(Le,c),!(!ne||!L)&&q(()=>ue(null))},Bt=Le=>{_&&Us(Le,c)};a.useLayoutEffect(()=>{if(!L||!k.current)return;const{x:Le,y:ze}=k.current;k.current=null,fe(Le,ze)},[L==null?void 0:L.rowId,L==null?void 0:L.url,fe]),a.useLayoutEffect(()=>{if(!u||Z){ce(null);return}const Le=Te.current,ze=Le==null?void 0:Le.parentElement;if(!Le||!ze){ce(null);return}const nt=()=>{const ft=Le.querySelector("[data-list-row]");if(!ft){ce(null);return}const Rt=ze.getBoundingClientRect(),ut=ft.getBoundingClientRect();ce(ut.top-Rt.top+ut.height/2)};nt();const ht=new ResizeObserver(nt);return ht.observe(Le),ht.observe(ze),()=>ht.disconnect()},[u,Z,Me,Xe,Oe,ot,t,e,rt,he,ye,m,ee,Fe,Ge]);const cn=a.useMemo(()=>!Z&&rs.some(Le=>{const ze=Le.charAt(0),nt=e[`${Le}VerticalAlign`];return Pc(nt,e,ze)}),[Z,e,e.AColumnVerticalAlign,e.BColumnVerticalAlign,e.CColumnVerticalAlign,e.DColumnVerticalAlign,e.EColumnVerticalAlign]);a.useLayoutEffect(()=>{var Dt;const Le=Ne.current;if(!Le)return;const ze=()=>{Le.querySelectorAll("[data-list-col]").forEach(At=>{At.style.transform="";const Pt=At.querySelector(`.${c}-list-col`);Pt&&(Pt.style.minHeight="",Pt.style.height="");const Vt=At.querySelector(`.${c}-list-col-title`);Vt&&(Vt.style.transform="")})};if(Z||!cn){ze();return}const nt=()=>{const At=Array.from(Le.querySelectorAll("[data-list-row]")),Pt=`${c}-list-col`,Vt=`${c}-baseline-probe`;At.forEach(Gt=>{Gt.querySelectorAll("[data-list-col]").forEach(Ht=>{Ht.style.transform="";const Nt=Ht.querySelector(`.${Pt}`);Nt&&(Nt.style.minHeight="",Nt.style.height="");const Wt=Ht.querySelector(`.${c}-list-col-title`);Wt&&(Wt.style.transform="")})}),At.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]"));lf(Gt,Ht,Pt)}),Le.offsetHeight,At.forEach(Gt=>{const Ht=Array.from(Gt.querySelectorAll("[data-list-col]")),Nt=Gt.getBoundingClientRect().top,Wt=new Map,St=Ht.map(Ie=>{const _e=Ie.querySelector(`.${c}-list-col-title`),it={el:Ie,titleEl:_e,letter:Ie.getAttribute("data-col-letter")??"",kind:Ie.getAttribute("data-valign")??"top",anchor:Ie.getAttribute("data-valign-anchor")};return Wt.set(it.letter,it),it}),w=new Map,we=(Ie,_e)=>{const it=w.get(Ie.letter);if(it!==void 0)return it;const Et=Ie.anchor?Wt.get(Ie.anchor):void 0;if(Ie.kind!=="baseline"||!Et||_e.has(Ie.letter)){const nn=ta(Ie,Nt,Pt,Vt);return w.set(Ie.letter,nn),nn}_e.add(Ie.letter);const Je=we(Et,_e);_e.delete(Ie.letter);const yt=ta(Ie,Nt,Pt,Vt),Ot=Je-yt;cf(Ie.titleEl,Ot);const Tt=ta(Ie,Nt,Pt,Vt);return w.set(Ie.letter,Tt),Tt};St.forEach(Ie=>we(Ie,new Set))})};let ht=null;const ft=()=>{ht===null&&(ht=requestAnimationFrame(()=>{ht=null,nt()}))};nt();const Rt=new ResizeObserver(()=>ft());Rt.observe(Le);let ut=!1;return typeof document<"u"&&((Dt=document.fonts)!=null&&Dt.ready)&&document.fonts.ready.then(()=>{ut||ft()}),()=>{ut=!0,ht!==null&&(cancelAnimationFrame(ht),ht=null),Rt.disconnect(),ze()}},[cn,Z,e,t,ye,Me,he]);const gt=a.useMemo(()=>Zh(c),[c]);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:gt}}),r.jsx("div",{style:Re,children:r.jsxs("div",{ref:Ne,className:`${c}-wrapper ${ie}${Ue?` ${Ue}`:""}${Z?` ${c}-type-b`:""}`.trim(),style:{width:$.scalingValue(x??0,n)},onMouseMove:ne?Zt:void 0,onMouseLeave:ne?en:void 0,children:[r.jsxs("div",{style:{width:"100%",position:"relative"},children:[Me.map((Le,ze)=>{var Rt;const nt=(((Rt=Le.link)==null?void 0:Rt.length)??0)>0,ht=nt&&(!n||i)?"a":"div",ft=Ks(ze,Me.length,ee,Fe,Ge,m??0,n??!1);return r.jsxs(ht,{ref:ze===0?ut=>{Te.current=ut}:void 0,className:`${c}-list-item${nt||y==="always"?` ${c}-list-item-has-link`:""}${Ge&&ze===Me.length-1?` ${c}-list-item-before-cut`:""}`,...nt?{href:Le.link,target:"_blank"}:{},style:ft,onMouseEnter:ut=>{_&&(nt||y==="always")&&qs(ut,c),ne&&zt(Le,ut)},onMouseLeave:ut=>{_&&(nt||y==="always")&&Us(ut,c)},children:[Xe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Xe)}}),r.jsxs("div",{className:`${c}-list-cols-row${Z?"":` ${c}-list-cols-row-h`}${u&&ze===0&&Z?` ${c}-list-cols-row-controls`:""}`,...Z?{}:{"data-list-row":""},style:Z?void 0:{minHeight:ke(ot)},children:[rt.map((ut,Dt)=>{const At=Dt===rt.length-1,Pt=He[Dt],Vt=ut.paddingBottom,Gt=qh(Le.cells[ut.key]),Ht=Z&&Gt&&Vt>0,Nt=Z?{minHeight:ke(ot)}:{width:ke(he[Dt])},Wt=Z?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{paddingLeft:ke(Pt.paddingLeft),paddingRight:ke(Pt.paddingRight)},St=ut.textPrefix.charAt(0),w=Z?tf(e[`${ut.textPrefix}VerticalAlign`]):ef(e[`${ut.textPrefix}VerticalAlign`],e,St),we=Z&&Gt&&u&&ze===0;return Z&&!Gt?null:r.jsxs("div",{className:Z?`${c}-list-col-wrap`:void 0,...Z?{}:{"data-list-col":"","data-col-letter":St,"data-valign":w.kind,...w.kind==="baseline"?{"data-valign-anchor":w.anchorLetter}:{}},children:[r.jsx("div",{className:`${c}-list-col${At?` ${c}-list-col-last`:""}`,style:{...Wt,...Nt,...Z?{justifyContent:Zs(w.kind)}:{}},"data-test":ut.width,children:r.jsx("span",{className:Qs(e,ut.textPrefix,`${c}-list-col-title`,`${c}-text-tight-leading`),style:{...Js(hr(e,ut.textPrefix),n),...el(e,ut.textPrefix,c,n),...Z?{}:of(w.kind)},children:Le.cells[ut.key]??null})}),Ht&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Vt)}}),we&&r.jsx("div",{"data-controls":ut.paddingBottomKey,"data-controls-axis":"y","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ke(Math.max(Vt,na))}})]},ut.key)}),u&&ze===0&&Z&&r.jsxs(r.Fragment,{children:[r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:0,width:ke(Se),height:"100%"}}),r.jsx("div",{"data-controls":"textPaddingLR","data-controls-paired":"","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(Pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center",className:`${c}-control-anchor`,style:{top:0,left:ke(Math.max(Se,Ve-Se)),width:ke(Se),height:"100%"}})]})]}),!Z&&Oe>0&&r.jsx("div",{className:`${c}-row-padding-handle`,style:{height:ke(Oe)}}),u&&ze===0&&!Z&&r.jsx("div",{"data-controls":"rowPaddingBottom","data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":"left-y",className:`${c}-control-anchor`,style:{bottom:0,left:0,width:"100%",height:ke(ct)}})]},Le.id)}),u&&r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Mt,"data-controls-axis":"y","data-controls-variant":"row-padding","data-controls-min":"0","data-controls-center-only-drag":"","data-controls-hit-placement":Z?"center":"left-y",className:`${c}-control-anchor`,style:{top:mt,left:0,width:"100%",height:ke(Math.max(Xe,na))}})},"row-padding-handles"),u&&!Z&&Ut&&Yt&&r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Ut.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he[0]-((xt==null?void 0:xt.paddingRight)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:0,width:ke(_t),height:"100%"}}),r.jsx("div",{"data-controls":Yt.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(he[rt.length-1]-((bt==null?void 0:bt.paddingLeft)??0)),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(vt-kt),width:ke(kt),height:"100%"}})]},"column-edge-padding-handles"),u&&!Z&&rt.slice(0,-1).map((Le,ze)=>{const nt=rt[ze+1],ht=me.slice(0,ze+1).reduce((At,Pt)=>At+Pt,0),ft=He[ze],Rt=He[ze+1],ut=Math.max(ft.paddingRight,Ei),Dt=Math.max(Rt.paddingLeft,Ei);return r.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[r.jsx("div",{"data-controls":Le.paddingRightKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-reverse":"","data-controls-min":"0","data-controls-max-fraction":String(he[ze]-ft.paddingLeft),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(ht-ut),width:ke(ut),height:"100%"}}),r.jsx("div",{"data-controls":nt.paddingLeftKey,"data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(he[ze+1]-Rt.paddingRight),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x","data-controls-hit-top":We??void 0,className:`${c}-control-anchor`,style:{top:0,left:ke(ht),width:ke(Dt),height:"100%"}})]},`${Le.paddingRightKey}-padding`)}),u&&!Z&&rt.slice(0,-1).map((Le,ze)=>{const nt=Lf(ze,me,xe,Ve),ft=me.slice(0,ze+1).reduce((Rt,ut)=>Rt+ut,0)-tl/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":Le.widthKey,"data-controls-axis":"x","data-controls-min":String(ss),"data-controls-max-fraction":String(nt),"data-controls-variant":"column-width",className:`${c}-col-resize-handle`,style:{position:"absolute",top:"0px",left:ke(ft),width:ke(tl),height:"calc(100%)",pointerEvents:"auto"}})},`${Le.widthKey}-junction`)})]}),Ge&&(()=>{const Le=hr(e,An),ze=rf(e.cutLabelVerticalAlign),nt=Le.textTextAlign==="justify"||Z;return r.jsx("button",{type:"button",className:`${c}-cut-item`,style:{minHeight:ke(R??0),cursor:lt?"pointer":"default",...Uh(Fe,m??0,n??!1)},onClick:lt?tt:void 0,onMouseEnter:_||ne?Ct:void 0,onMouseLeave:_?Bt:void 0,children:r.jsx("div",{className:`${c}-list-cols-row`,style:{...Z?{paddingLeft:ke(pe),paddingRight:ke(pe)}:{},justifyContent:af(Le.textTextAlign),alignItems:Zs(ze)},children:r.jsx("span",{className:Qs(e,An,`${c}-cut-label`,`${c}-text-tight-leading`),style:{...Js(Le,n),...el(e,An,c,n),...nt?{width:"100%"}:{}},children:K})})})})(),ne&&L&&(()=>{const Le=`${L.widthPx}px`,ze={width:Le,height:"auto",maxHeight:Le,objectFit:"contain"};return r.jsx("div",{ref:Ae,className:`${c}-hover-media-anchor`,children:r.jsx(Gh,{media:L,className:L.isVideo?`${c}-hover-video`:`${c}-hover-image`,style:ze},`${L.rowId}-${L.url}`)})})()]})})]})}const Pf=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties } from 'react';
|
|
10182
10234
|
import { CommonComponentProps } from '../props';
|
|
10183
10235
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
10184
10236
|
import { omitTextColors, TextStyles, textStylesToCss } from '../utils/textStylesToCss';
|
|
@@ -13266,7 +13318,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13266
13318
|
</>
|
|
13267
13319
|
);
|
|
13268
13320
|
}
|
|
13269
|
-
`,Qi=["A","B","C","D","E"],ol=[...Ra,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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 kf(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Uo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Af(){return Object.fromEntries(Qi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,kf(i)]}))}function Ff(){const e={};for(const t of Qi)e[`${t}ColumnWidth`]=Uo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Uo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Uo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Uo(`${t} column padding bottom`);return e}function rl(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Qi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Wf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ra]},enum:[...Ra]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...ol],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...ol]}}return t[It(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[It(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[It(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[It(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[It(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[It(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[It(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[It(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const _f=So.reduce((e,t)=>({...e,...Wf(t)}),{});function Hf(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Nf(e,t={}){var n;return{...Hf(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const al=new Set(["textFontFamily","textFontSettings"]);function Of(e,t,n){const i=s=>n===void 0?!0:n==="common"?al.has(s):!al.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=as(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[It(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[It(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[It(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[It(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[It(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[It(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[It(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[It(e,"textTextAppearance")]=t.textTextAppearance),o}function sr(e={},t){return So.reduce((n,i)=>({...n,...Of(i,Nf(i,e),t)}),{})}const Df=sr(),jf=mf();function Hc(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing"),It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function zf(){const e=[];return rs.forEach((t,n)=>{const i=Xn[n],o=Hc(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(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 Bf=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];Hc(An);const Vf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{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"}],Gf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],qf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Uf={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:{...Af(),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:Gf},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"}},...Ff(),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"}},..._f,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",...Df,...sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:rl({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},...sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:rl({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},...sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...zf(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Vf.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}},...Qi.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",...qf]},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__",jf]}],paletteBookmark:{items:[...Bf],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Kf={element:Mf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Cf(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:[...So.map(e=>({path:`${It(e,"textFontFamily")}`}))]},fontRelations:{...So.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${It(t,"textFontFamily")}`}),{})},schema:Uf,sourceCode:Pf},sl=300,Nn=.004,Xf={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"},Yf=["hover","focus","filled","success","error"];function Zf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function ll(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function cl(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Jf(e){return`
|
|
13321
|
+
`,Qi=["A","B","C","D","E"],il=[...Ra,"Baseline A","Baseline B","Baseline C","Baseline D","Baseline E"],ri={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 kf(e){return{type:"string",label:e,placeholder:"Add Title...",display:{type:"text-input"}}}function Uo(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}function Af(){return Object.fromEntries(Qi.map((e,t)=>{const n=Xn[t],i=`${e} column`;return[n,kf(i)]}))}function Ff(){const e={};for(const t of Qi)e[`${t}ColumnWidth`]=Uo(`${t} column width`),e[`${t}ColumnPaddingLeft`]=Uo(`${t} column padding left`),e[`${t}ColumnPaddingRight`]=Uo(`${t} column padding right`),e[`${t}ColumnPaddingBottom`]=Uo(`${t} column padding bottom`);return e}function ol(e={}){const{typeBDefaults:t,...n}=e,i={wrapperWidth:1,columnsOrder:[...Xn]};for(const s of Qi)i[`${s}ColumnWidth`]=s==="A"?.0798:.32,i[`${s}ColumnPaddingLeft`]=0,i[`${s}ColumnPaddingRight`]=0,i[`${s}ColumnPaddingBottom`]=0;const o=n.type==="b"&&t?t:{};return{...i,...o,...n}}function Wf(e){const t={};if(e===An)t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...Ra]},enum:[...Ra]};else{const n=e.charAt(0);t[`${e}VerticalAlign`]={type:"string",scope:"layout",title:"",display:{type:"drop-down",label:"Vertical alignment",enum:[...il],filterBaselineByTopAnchor:!0,columnLetter:n},enum:[...il]}}return t[It(e,"textFontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0}},t[It(e,"textFontSettings")]={...ri.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0}},t[It(e,"textFontSize")]={...ri.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[It(e,"textLineHeight")]={...ri.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[It(e,"textLetterSpacing")]={...ri.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[It(e,"textWordSpacing")]={...ri.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[It(e,"textTextAlign")]={...ri.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[It(e,"textTextAppearance")]={...ri.textAppearance,scope:"layout",title:"",display:{type:"text-appearance"}},t}const _f=So.reduce((e,t)=>({...e,...Wf(t)}),{});function Hf(e){return{verticalAlign:e===An?"Center":"Top",textFontFamily:"Arial",textFontSettings:{fontWeight:400,fontStyle:"normal"},textLetterSpacing:0,textWordSpacing:0,textTextAlign:e===An?"center":"left",textTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}}function Nf(e,t={}){var n;return{...Hf(e),...t.default,...(n=t.byPrefix)==null?void 0:n[e]}}const rl=new Set(["textFontFamily","textFontSettings"]);function Of(e,t,n){const i=s=>n===void 0?!0:n==="common"?rl.has(s):!rl.has(s),o={};return i("verticalAlign")&&t.verticalAlign!==void 0&&(o[`${e}VerticalAlign`]=as(t.verticalAlign)),i("textFontFamily")&&t.textFontFamily!==void 0&&(o[It(e,"textFontFamily")]=t.textFontFamily),i("textFontSettings")&&t.textFontSettings!==void 0&&(o[It(e,"textFontSettings")]=t.textFontSettings),i("textFontSize")&&t.textFontSize!==void 0&&(o[It(e,"textFontSize")]=t.textFontSize),i("textLineHeight")&&t.textLineHeight!==void 0&&(o[It(e,"textLineHeight")]=t.textLineHeight),i("textLetterSpacing")&&t.textLetterSpacing!==void 0&&(o[It(e,"textLetterSpacing")]=t.textLetterSpacing),i("textWordSpacing")&&t.textWordSpacing!==void 0&&(o[It(e,"textWordSpacing")]=t.textWordSpacing),i("textTextAlign")&&t.textTextAlign!==void 0&&(o[It(e,"textTextAlign")]=t.textTextAlign),i("textTextAppearance")&&t.textTextAppearance!==void 0&&(o[It(e,"textTextAppearance")]=t.textTextAppearance),o}function sr(e={},t){return So.reduce((n,i)=>({...n,...Of(i,Nf(i,e),t)}),{})}const Df=sr(),jf=mf();function _c(e){return[It(e,"textFontFamily"),It(e,"textFontSettings"),It(e,"textFontSize"),It(e,"textLineHeight"),It(e,"textLetterSpacing"),It(e,"textWordSpacing"),It(e,"textTextAlign"),It(e,"textTextAppearance"),`${e}VerticalAlign`]}function zf(){const e=[];return rs.forEach((t,n)=>{const i=Xn[n],o=_c(t);for(let s=1;s<Xn.length;s+=1){const l=[{name:"columns",value:s},...Array.from({length:s},(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 Bf=["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"];_c(An);const Vf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`]),"rowPaddingTop","rowPaddingBottom"],ai=[{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"}],Gf=[{AColumn:"01",BColumnWidth:"Ethan Parker",CColumnWidth:"Midnight Atlas",DColumnWidth:"Portland, OR",EColumnWidth:"On Display",image:ai[0],link:""},{AColumn:"02",BColumnWidth:"Madison Reed",CColumnWidth:"Echoes in Vermilion",DColumnWidth:"Savannah, GA",EColumnWidth:"Scheduled",image:ai[1],link:""},{AColumn:"03",BColumnWidth:"Noah Bennett",CColumnWidth:"Paper and scissors",DColumnWidth:"Madison, WI",EColumnWidth:"On Display",image:ai[2],link:""},{AColumn:"04",BColumnWidth:"Olivia Carter",CColumnWidth:"The Quiet Frequency",DColumnWidth:"Boise, ID",EColumnWidth:"On Display",image:ai[3],link:""},{AColumn:"05",BColumnWidth:"Mason Brooks",CColumnWidth:"Sights of Tomorrow",DColumnWidth:"Tampa, FL",EColumnWidth:"Postponed",image:ai[4],link:""},{AColumn:"06",BColumnWidth:"Sophia Mitchell",CColumnWidth:"Velvet Horizons",DColumnWidth:"Albuquerque, NM",EColumnWidth:"Scheduled",image:ai[5],link:""},{AColumn:"07",BColumnWidth:"Jackson Turner",CColumnWidth:"Ink & Aurora",DColumnWidth:"Pittsburgh, PA",EColumnWidth:"On Display",image:ai[6],link:""}],qf=[...Qi.flatMap(e=>[`${e}ColumnWidth`,`${e}ColumnPaddingLeft`,`${e}ColumnPaddingRight`,`${e}ColumnPaddingBottom`]),"columnsOrder"],Uf={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:{...Af(),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:Gf},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"}},...Ff(),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"}},..._f,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",...Df,...sr({},"common"),backgroundColor:"#FFFFFF00",dividerColor:"#373737",backgroundHoverColor:"#000000",dividerHoverColor:"#000000"},layoutDefaults:{m:ol({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},...sr({default:{textFontSize:.0906,textLineHeight:.0426,textTextAlign:"left"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")}),d:ol({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},...sr({default:{textFontSize:.0333,textLineHeight:.0333,textLetterSpacing:-9e-4,textTextAlign:"left",verticalAlign:"center"},byPrefix:{cutLabel:{textTextAlign:"center"}}},"layout")})},displayRules:[...zf(),{if:{name:"type",value:"a"},then:{name:"properties.textPaddingLR.display.visible",value:!1}},...Vf.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}},...Qi.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",...qf]},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__",jf]}],paletteBookmark:{items:[...Bf],panelIds:["general","typeStyle"],stateItems:{default:["textColor","backgroundColor","dividerColor","textHoverColor","backgroundHoverColor","dividerHoverColor"]}}},Kf={element:Mf,id:"list",name:"Programme",category:"lists",layoutMode:"structured",normalizeLayoutSettingsUpdate:(e,t)=>Cf(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:[...So.map(e=>({path:`${It(e,"textFontFamily")}`}))]},fontRelations:{...So.reduce((e,t)=>({...e,[`${t}TextFontSettings`]:`${It(t,"textFontFamily")}`}),{})},schema:Uf,sourceCode:Pf},al=300,Nn=.004,Xf={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"},Yf=["hover","focus","filled","success","error"];function Zf(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function sl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function ll(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-text-leading-gap`]:$.scalingValue((o-t)/2,i)}}function Jf(e){return`
|
|
13270
13322
|
.${e}-wrapper {
|
|
13271
13323
|
box-sizing: border-box;
|
|
13272
13324
|
display: flex;
|
|
@@ -13356,7 +13408,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13356
13408
|
width: var(--${e}-icon-max-width);
|
|
13357
13409
|
height: var(--${e}-icon-max-width);
|
|
13358
13410
|
position: relative;
|
|
13359
|
-
transition: transform ${
|
|
13411
|
+
transition: transform ${al}ms ease;
|
|
13360
13412
|
}
|
|
13361
13413
|
.${e}-icon-custom {
|
|
13362
13414
|
display: flex;
|
|
@@ -13393,7 +13445,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13393
13445
|
.${e}-panel {
|
|
13394
13446
|
display: grid;
|
|
13395
13447
|
grid-template-rows: 0fr;
|
|
13396
|
-
transition: grid-template-rows ${
|
|
13448
|
+
transition: grid-template-rows ${al}ms ease;
|
|
13397
13449
|
}
|
|
13398
13450
|
.${e}-item-open .${e}-panel {
|
|
13399
13451
|
grid-template-rows: 1fr;
|
|
@@ -13431,7 +13483,7 @@ export function List({ settings, content, isEditor, isPreviewMode, isEditMode, a
|
|
|
13431
13483
|
pointer-events: none;
|
|
13432
13484
|
z-index: 2;
|
|
13433
13485
|
}
|
|
13434
|
-
`}function
|
|
13486
|
+
`}function cl(e,t,n,i,o,s,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:s??0,textAppearance:l,color:d??"#000000"}}function Qf({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,activeEvent:s}){const{prefix:l}=$.useScopedStyles(),d=o??!1,{wrapperWidth:c=1,cellMinHeight:u=0,dividerWidth:p=694e-6,dividerStyle:v="solid",entryHoverEffect:x="default",autoclose:g="off",icon:h,iconMaxWidth:m=.00833,iconPaddingRight:b=0,iconAnimation:I="rotate 45",questionColor:C="#000000",answerColor:R="#000000",dividerColor:K="#0000001F",iconColor:F="#000000",questionHoverColor:V="#666666",iconHoverColor:A="#666666",iconActiveColor:T="#000000",dividerHoverColor:j="#000000",questionFontFamily:y,questionFontSettings:W,questionFontSize:M,questionLineHeight:Y,questionLetterSpacing:P,questionWordSpacing:U,questionTextAppearance:z,answerFontFamily:B,answerFontSettings:te,answerFontSize:S,answerLineHeight:E,answerLetterSpacing:D,answerWordSpacing:se,answerTextAppearance:oe,questionPaddingLeft:L=0,questionPaddingTop:ue=0,questionPaddingBottom:k=0,answerPaddingLeft:ne=0,answerPaddingRight:X=0,answerPaddingTop:be=0,answerPaddingBottom:Ae=0}=e,fe=t??[],[le,q]=a.useState(()=>new Set),Q=!n||i;a.useEffect(()=>{q(new Set)},[g]),a.useEffect(()=>{n&&!o&&!i&&q(new Set)},[n,o,i]);const Z=He=>$.scalingValue(He,n??!1),Ne=Math.max(L,Nn),Te=Math.max(ue,Nn),We=Math.max(k,Nn),ce=Math.max(ne,Nn),ye=Math.max(X,Nn),$e=Math.max(be,Nn),G=Math.max(Ae,Nn),re=Math.max(0,(c??1)-b-m),pe=Math.max(0,(c??1)-X),Se=Math.max(0,(c??1)-ne),Pe=Math.max(b,Nn),Re=Math.max(0,(c??1)-L-m),H=a.useMemo(()=>le.size===0?0:Math.min(...le),[le]),ge=a.useCallback(He=>le.has(He),[le]),ie=Q&&x==="default"?`${l}-entry-hover-default`:"",_=h??"",ee=_!=="",Fe=I.replace(/^rotate /,""),ae=`${l}-icon-anim-${Fe}`,N=on(Kt(cl(y,W,M,Y,P,U,z,C),n)),qe=on(Kt(cl(B,te,S,E,D,se,oe,R),n)),je=sl(M,Y,`${l}-question`,`${l}-text-tight-leading`),st=sl(S,E,`${l}-answer-text`,`${l}-text-tight-leading`),et=ll(M,Y,l,n),pt=ll(S,E,l,n),rt=$.buildColorVars(l,{questionColor:C,answerColor:R,dividerColor:K,iconColor:F,questionHoverColor:V,iconHoverColor:A,iconActiveColor:T,dividerHoverColor:j},Xf,Yf),Ve=s&&s!=="default"?`${l}-state-${s}`:"",xe=a.useCallback(He=>{Q&&q(ve=>{if(ve.has(He)){const Me=new Set(ve);return Me.delete(He),Me}if(g==="on")return new Set([He]);const Ee=new Set(ve);return Ee.add(He),Ee})},[Q,g]),me=a.useMemo(()=>Jf(l),[l]),he={[`--${l}-divider-width`]:$.scalingValue(p,n??!1),[`--${l}-divider-style`]:v,[`--${l}-icon-max-width`]:$.scalingValue(m,n??!1),...u>0?{[`--${l}-question-min-height`]:$.scalingValue(u,n??!1)}:{}};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:me}}),r.jsx("div",{style:rt,children:r.jsx("div",{className:dt(`${l}-wrapper`,n&&!i&&`${l}-editor`,ie,Ve),style:{width:$.scalingValue(c,n??!1),maxWidth:"100%",...he},children:fe.map((He,ve)=>{var lt;const Ee=ge(ve),Me=((lt=He.question)==null?void 0:lt.trim())??"",Ge=He.answer,Ze=((Ge==null?void 0:Ge.length)??0)>0,Ue=d&&ve===H;return r.jsxs("div",{className:dt(`${l}-item`,Ee&&`${l}-item-open`),"data-faq-item":"",children:[r.jsxs("div",{className:`${l}-question-controls`,children:[Ue&&r.jsxs(r.Fragment,{children:[r.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:Z(Te)}}),r.jsx("div",{"data-controls":"questionPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Z(Ne),height:"100%"}}),r.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(Re),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Z(Pe),height:"100%"}})]}),r.jsxs("button",{type:"button",className:`${l}-question-button`,"aria-expanded":Ee,style:{...N,...et,paddingLeft:Z(L),paddingRight:Z(b)},onClick:()=>xe(ve),children:[ue>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(ue)},"aria-hidden":"true"}),r.jsxs("span",{className:`${l}-question-row`,children:[r.jsx("span",{className:je,children:Me}),Ze&&(ee?r.jsx("span",{className:`${l}-icon ${l}-icon-custom ${ae}`,"aria-hidden":"true",children:r.jsx(rn,{url:_,fill:`var(--${l}-icon-color)`,hoverFill:`var(--${l}-icon-hover-color, var(--${l}-icon-color))`,className:`${l}-icon-image`})}):r.jsx("span",{className:`${l}-icon ${l}-icon-default ${ae}`,"aria-hidden":"true"}))]}),k>0&&r.jsx("span",{className:`${l}-padding-handle`,style:{height:Z(k)},"aria-hidden":"true"})]}),Ue&&r.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:Z(We)}})]}),Ze&&Ge&&r.jsx("div",{className:`${l}-panel`,"aria-hidden":!Ee,children:r.jsx("div",{className:`${l}-panel-inner`,children:r.jsxs("div",{className:`${l}-answer-controls`,children:[Ue&&Ee&&r.jsxs(r.Fragment,{children:[r.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:Z($e)}}),r.jsx("div",{"data-controls":"answerPaddingLeft","data-controls-axis":"x","data-controls-variant":"column-padding","data-controls-min":"0","data-controls-max-fraction":String(pe),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,left:0,width:Z(ce),height:"100%"}}),r.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(Se),"data-controls-center-only-drag":"","data-controls-hit-placement":"center-x",className:`${l}-control-anchor`,style:{top:0,right:0,width:Z(ye),height:"100%"}})]}),be>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(be)}}),r.jsx("div",{className:`${l}-answer`,style:{...qe,...pt,paddingLeft:Z(ne),paddingRight:Z(X)},children:r.jsx("div",{className:st,children:r.jsx(yi,{content:Ge})})}),Ae>0&&r.jsx("div",{className:`${l}-padding-handle`,style:{height:Z(Ae)}}),Ue&&Ee&&r.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:Z(G)}})]})})})]},ve)})})})]})}const ey=`import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13435
13487
|
import cn from 'classnames';
|
|
13436
13488
|
import { CommonComponentProps } from '../props';
|
|
13437
13489
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils/index';
|
|
@@ -14179,7 +14231,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14179
14231
|
</>
|
|
14180
14232
|
);
|
|
14181
14233
|
}
|
|
14182
|
-
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ul={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ty=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],ny={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:On("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:{...ul.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:{...ul.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...ty],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},iy={element:Qf,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:ny,sourceCode:ey},Fn=e=>e.display==="cover",Ar=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},pl=100,oy=.2,ml=8,Nc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?pl:Math.max(pl,window.innerHeight*oy),[]),v=a.useCallback(w=>Math.max(0,1-w/(p*1.5)),[p]),y=a.useCallback(w=>Math.max(0,1-w/(p*.45)),[p]),g=a.useCallback(w=>{const P=typeof window<"u"?window.innerHeight:800,M=Math.max(.88,1-w/P*.12);return`translateY(${w}px) scale(${M})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),b=a.useCallback(()=>{const w=typeof window<"u"?window.innerHeight:800;d(!0),s(w),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),E=a.useCallback(w=>{!e||l||w.pointerType==="touch"&&(i!=null&&i(w.target)||(c.current={startX:w.clientX,startY:w.clientY,isLocked:null,pointerId:w.pointerId}))},[e,l,i]),L=a.useCallback(w=>{const P=c.current;if(!e||!P||w.pointerType!=="touch"||P.pointerId!==w.pointerId)return;const M=w.clientX-P.startX,X=w.clientY-P.startY;if(P.isLocked===null){if(Math.abs(M)<ml&&Math.abs(X)<ml)return;if(X>0&&X>Math.abs(M))P.isLocked=!0,w.currentTarget.setPointerCapture(w.pointerId);else{P.isLocked=!1,h();return}}if(!P.isLocked)return;w.preventDefault();const k=Math.max(0,X);u.current=k,s(k)},[e,h]),C=a.useCallback(w=>{const P=c.current;if(!e||!P||w.pointerType!=="touch"||P.pointerId!==w.pointerId)return;const M=P.isLocked===!0;if(w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId),!M){h();return}w.clientY-P.startY>=p?b():m()},[p,b,e,h,m]),K=a.useCallback(w=>{C(w)},[C]),W=a.useCallback(w=>{C(w)},[C]),B=o>0,A=l?`transform ${n}ms ease`:"none",T=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:B,backdropStyle:{opacity:v(o),transition:T},mediaAreaStyle:{transform:g(o),transition:A,touchAction:B?"none":void 0,willChange:B?"transform":void 0},overlayContentStyle:j?{opacity:y(o),transition:T}:void 0,swipeHandlers:e?{onPointerDown:E,onPointerMove:L,onPointerUp:K,onPointerCancel:W}:{},dismissAreaStyle:e?{touchAction:B?"none":"pan-x"}:void 0}},ry="[data-lightbox-scrollable]",Oc=()=>{a.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,s=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(ry)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},ay=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},sy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},ly=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},cy=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{sy(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const y=()=>{t.removeEventListener("transitionend",g),clearTimeout(v)},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)`,v=window.setTimeout(()=>{p||(p=!0,y(),u(n,!0))},i+64),()=>{p||(p=!0,y(),u(l-ly(t),!1))}},mo=300,dy=900,uy=1500,py="cubic-bezier(0.16, 1, 0.3, 1)",my=3e3,gy=2,hy=16,fy=.05,yy=1,Ko=.3,vy=50,xy=20,$i=.004,qi=["title1","title2","title3"],by={title1:"1",title2:"2",title3:"3"},wy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Sy={title1:.02,title2:.02,title3:.02},Xo=e=>`max(${e}, ${xy}px)`,$y=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]}},Cy=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=$y(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ty=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],Ly=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(qi.map(e=>[by[e],Ty(e)]))}),cs=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Dc=(e,t)=>cs(e,t),Yo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},gl=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:cs(e.length,n),effective:Dc(e.length,n)}},Ry=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},oa=(e,t)=>{const n=i=>{const o=jt(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[wy[t]]}},Iy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ra=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Sy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Kt(i,n)},Ey=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:y,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:b,thumbnailVisibility:E,thumbnailObjectFit:L,thumbnailActive:C,thumbnailActiveColor:K,title1Width:W,title2Width:B,title3Width:A,title1MarginLeft:T=0,title2MarginLeft:j=0,title3MarginLeft:w=0,titleRowMarginBottom:P=0,titleHeaderLayout:M="desktop",contentMarginTop:X,iconMarginLeft:k}=n,q=f=>$.scalingValue(f,i??!1),V=c??n.thumnailSize??.03,G=q(V),ie=q(u),S=q(p??.02),R=q(v??0),O=q(X??0),ae=Xo(O),se=q(k??0),[I,de]=a.useState(0),F=a.useRef(I);F.current=I;const te=t[I],{title1:Z,title2:ve,title3:Ae}=Cy(te),he=ra("title1",oa(n,"title1"),i),pe=ra("title2",oa(n,"title2"),i),U=ra("title3",oa(n,"title3"),i),ee=M==="mobile",Y=!o&&(!i||s),Oe=Y,$e=Y,He=Y,ue=Fn(L),me=ue?{"--image-aspect-ratio":Ar(L)}:void 0,be=!!(Z||ve||Ae),z=a.useMemo(()=>Ry(e,Z,ve,Ae,he,pe,U),[e,I,Z,ve,Ae,he,pe,U]),le=a.useMemo(()=>({title1Width:W,title2Width:B,title3Width:A}),[W,B,A]),ye=a.useMemo(()=>z.map(f=>le[f.widthKey]),[z,le]),we=a.useMemo(()=>cs(z.length,ye),[z.length,ye]),Pe=a.useMemo(()=>Dc(z.length,ye),[z.length,ye]),Ce=a.useMemo(()=>z.filter(f=>f.prefix==="title1"),[z]),_=a.useMemo(()=>z.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[z]),ge=a.useMemo(()=>gl(Ce,le),[Ce,le]),ne=a.useMemo(()=>gl(_,le),[_,le]),H=a.useCallback((f,D)=>{const J=z.indexOf(f);if(!ee||D==="single-row")return{effectiveWidth:Pe[J]??0,resolvedWidth:we[J]??0,maxWidth:Yo(J,we)};if(D==="two-row-top"){const je=Ce.indexOf(f);return{effectiveWidth:ge.effective[je]??0,resolvedWidth:ge.resolved[je]??0,maxWidth:Yo(je,ge.resolved)}}const Se=_.indexOf(f);return{effectiveWidth:ne.effective[Se]??0,resolvedWidth:ne.resolved[Se]??0,maxWidth:Yo(Se,ne.resolved)}},[_,ne,Pe,we,z,Ce,ge,ee]),Q=a.useCallback(f=>$.scalingValue(f,i??!1),[i]),Fe=Q(P??0),re=a.useMemo(()=>({title1MarginLeft:T,title2MarginLeft:j,title3MarginLeft:w}),[T,j,w]),N=a.useCallback(f=>z.slice(0,f+1).reduce((D,J,Se)=>D+(J!=null&&J.marginLeftKey?re[J.marginLeftKey]??0:0)+(we[Se]??0),0)+(ee?0:T??0),[z,re,we,ee,T]),qe=a.useCallback(()=>ee?0:T??0,[ee,T]),Be=a.useCallback(f=>_.slice(0,f).reduce((D,J,Se)=>D+(J.marginLeftKey?re[J.marginLeftKey]??0:0)+(ne.resolved[Se]??0),0),[_,ne.resolved,re]),at=a.useCallback(f=>{const D=_[f];return Be(f)+(D.marginLeftKey?re[D.marginLeftKey]??0:0)+(ne.resolved[f]??0)},[_,ne.resolved,Be,re]),et=(f,D)=>{const J=f.marginLeftKey?re[f.marginLeftKey]??0:0,{effectiveWidth:Se,resolvedWidth:je,maxWidth:Xe}=H(f,D),vt=o&&D==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...D==="single-row"?{gridArea:f.prefix}:{},width:Q(Se),...J>0?{marginLeft:Q(J)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),vt&&f.marginLeftKey&&r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:Q(-J),width:`max(${Q(J)}, 10px)`,height:"100%",pointerEvents:"auto"}}),vt&&r.jsx("div",{"data-controls":f.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:Q(-$i/2),width:Q($i),height:"100%",pointerEvents:"auto"}})]},f.className)},ut=()=>{const f=ee?-1:z.findIndex(Se=>Se.prefix==="title1"),D=!ee&&(o||(T??0)>0)?(()=>{const Se=T??0,je=f>=0?we[f]:W??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:0,width:`max(${Q(Se)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,J=z.flatMap((Se,je)=>{if(!Se.marginLeftKey)return[];const Xe=re[Se.marginLeftKey]??0,vt=Iy(z,we,re,je)+qe();return r.jsx("div",{"data-controls":Se.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(we[je]),style:{position:"absolute",top:0,left:Q(vt),width:`max(${Q(Xe)}, 10px)`,height:"100%",pointerEvents:"auto"}},Se.marginLeftKey)});return D?[D,...J]:J},ke=()=>z.map((f,D)=>{const J=Yo(D,we),je=N(D)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(J),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Q(je),width:Q($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ie=()=>_.flatMap((f,D)=>{if(!f.marginLeftKey)return[];const J=re[f.marginLeftKey]??0,Se=Be(D),{resolvedWidth:je}=H(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(je),style:{position:"absolute",top:0,left:Q(Se),width:`max(${Q(J)}, 10px)`,height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),oe=()=>_.map((f,D)=>{const{maxWidth:J}=H(f,"two-row-bottom"),je=at(D)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(J),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:Q(je),width:Q($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Te=a.useRef(null),Ee=a.useRef(null),De=a.useRef(null),fe=a.useRef(null),Me=a.useRef([]),_e=a.useRef([]),Ke=a.useRef(0),it=a.useRef(null),Ye=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),xt=a.useRef(null),ot=a.useRef(null),We=a.useRef(0),Ze=a.useRef("forward"),Ve=a.useRef(0),st=a.useRef(null),pt=a.useRef(!1),ct=t.length>1&&(!o||!!s),Et=ct?3:1,zt=a.useMemo(()=>Array.from({length:Et},()=>t).flat(),[t,Et]),[Xt,yt]=a.useState(!1),[bt,Nt]=a.useState(!1),[At,wt]=a.useState(!0),Ot=a.useRef(null),Ut=a.useRef(null),Zt=a.useRef(!1),tn=a.useRef(!1),Ct=a.useRef(null),Bt=a.useRef(null),cn=Oe&&!At,mt=a.useCallback(()=>{Oe&&(wt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{Ye.current.isActive||wt(!1)},my))},[Oe]),Le=a.useCallback(()=>{o||tn.current||(tn.current=!0,Nt(!1),Ct.current=setTimeout(()=>{l()},mo))},[o,l]),ze=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:$.scalingValue(g??0,i),height:$.scalingValue(g??0,i),marginRight:se,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:r.jsx(rn,{url:y,fill:h,hoverFill:i&&!s?h:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:se,height:"100%",pointerEvents:"auto"}})]}),tt=(f="two-row")=>r.jsx("div",{...f==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:Q(T??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&o?{pointerEvents:"auto"}:{}}}),gt=()=>{const f=z.find(Se=>Se.prefix==="title1"),D=z.filter(Se=>Se.prefix==="title2"||Se.prefix==="title3"),J=D.length>0||o||(P??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(T??0)>0||o?tt():null,f&&et(f,"two-row-top"),y&&ze()]}),J?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[D.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[D.map(Se=>et(Se,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Ie(),oe()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ht=()=>r.jsxs(r.Fragment,{children:[(T??0)>0||o?tt("single-row"):null,z.map(f=>et(f,"single-row")),o?r.jsxs(r.Fragment,{children:[ut(),ke()]}):null,y?ze():null]}),Rt=a.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:dt,backdropStyle:Dt,mediaAreaStyle:kt,overlayContentStyle:Pt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Nc({enabled:Y??!1,onClose:Le,animMs:mo,isBlockedTarget:Rt}),Wt=()=>{if(!ct||t.length===0)return Ke.current=0,0;const f=_e.current[0],D=_e.current[t.length];if(!f||!D)return Ke.current;const J=D.offsetLeft-f.offsetLeft;return J>0&&(Ke.current=J),Ke.current},_t=(f=!1)=>{if(!ct)return;const D=Ee.current,J=Wt();!D||J<=0||J<D.clientWidth*.25||(D.scrollLeft<=0?(D.scrollLeft+=J,f&&(Ye.current.scrollLeft+=J),pt.current&&(Ve.current+=J)):D.scrollLeft>=J*2&&(D.scrollLeft-=J,f&&(Ye.current.scrollLeft-=J),pt.current&&(Ve.current-=J)))},Ft=(f,D=(J=>(J=Ee.current)==null?void 0:J.scrollLeft)()??0)=>{if(!ct)return f;let Se=t.length+f,je=1/0;for(let Xe=0;Xe<Et;Xe++){const vt=Xe*t.length+f,Lt=_e.current[vt];if(!Lt)continue;const en=Math.abs(Lt.offsetLeft-D);en<je&&(je=en,Se=vt)}return Se},St=f=>{const D=Ee.current;return!f||!D?!1:f.offsetWidth>D.clientWidth+1},x=f=>{const D=Ee.current;if(!f||!D||!St(f))return!1;const J=f.offsetLeft,Se=J+f.offsetWidth;return D.scrollLeft>=J-1&&D.scrollLeft+D.clientWidth<=Se+1},xe=(f=(D=>(D=Ee.current)==null?void 0:D.scrollLeft)()??0)=>{for(let Se=0;Se<_e.current.length;Se+=1){const je=_e.current[Se];if(je&&x(je))return Se}let J={flatIndex:0,distance:1/0};return _e.current.forEach((Se,je)=>{if(!Se)return;const Xe=Math.abs(Se.offsetLeft-f);Xe<J.distance&&(J={flatIndex:je,distance:Xe})}),J.flatIndex},Re=f=>{Ee.current&&_e.current.forEach(D=>{D&&(D.style.scrollSnapAlign=St(D)&&f==="backward"?"end":"start")})},Ne=(f,D,J)=>{const Se=f-D,je=xe(D),Xe=_e.current[je];if(x(Xe))return xe(f)%t.length;const vt=_e.current[je+1],Lt=Xe?vt?vt.offsetLeft-Xe.offsetLeft:Xe.offsetWidth:0,en=Lt>0?Se>Lt*Ko?1:Se<-Lt*Ko?-1:0:0;return en===0?J:ct?(J+en+t.length)%t.length:Math.max(0,Math.min(t.length-1,J+en))},nt=a.useCallback((f=!1)=>{if(E!=="on"||o)return;const D=fe.current,J=F.current,Se=Me.current[J];if(!D||!Se||D.scrollWidth<=D.clientWidth)return;const je=D.scrollLeft,Xe=je+D.clientWidth,vt=Se.offsetLeft,Lt=vt+Se.offsetWidth;if(vt>=je&&Lt<=Xe)return;const en=D.scrollWidth-D.clientWidth;let Jt=je;if(!f&&Ot.current===null){const bi=Me.current[J-1],eo=Me.current[J+1],No=bi?Se.offsetLeft-bi.offsetLeft:eo?eo.offsetLeft-Se.offsetLeft:Se.offsetWidth;Lt>Xe?Jt+=No:vt<je&&(Jt-=No)}else Lt>Xe?Jt=Lt-D.clientWidth:Jt=vt;D.scrollLeft=Math.max(0,Math.min(en,Jt))},[o,E]),Mt=a.useCallback((f=!1)=>{f&&(Zt.current=!0),Ut.current===null&&(Ut.current=requestAnimationFrame(()=>{Ut.current=null;const D=Zt.current;Zt.current=!1,nt(D)}))},[nt]),Je=a.useCallback(f=>{if(f===F.current)return;const D=F.current;F.current=f;const J=Math.abs(f-D)>1,Se=ct&&t.length>1&&(D===t.length-1&&f===0||D===0&&f===t.length-1);de(f),Mt(J||Se)},[t.length,ct,Mt]),ft=()=>{if(!Ee.current||t.length===0||Ot.current!==null||Ye.current.isActive&&Ye.current.hasMoved)return;const f=Ee.current.scrollLeft,D=xe(f)%t.length;D!==F.current&&Je(D)},Ht=()=>{Ot.current=null},Tt=f=>{const D=Ee.current;D&&(D.style.scrollSnapType=f?"":"none")},nn=()=>{var f;(f=ot.current)==null||f.call(ot),ot.current=null},dn=()=>{st.current!==null&&(cancelAnimationFrame(st.current),st.current=null),pt.current=!1},ei=()=>{const f=Ee.current;if(!f){st.current=null,pt.current=!1;return}const D=Ve.current-f.scrollLeft;if(Math.abs(D)<.5){f.scrollLeft=Ve.current,_t(),ft(),st.current=null,pt.current=!1;return}f.scrollLeft+=D*fy,_t(),ft(),mt(),st.current=requestAnimationFrame(ei)},ti=()=>{const f=De.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Fo=(f,D,J,Se)=>{ti(),f.scrollLeft=D,We.current=f.scrollLeft,_t(),J!==void 0?(F.current=J,de(J)):ft(),Tt(!0),Se==null||Se()},Wo=(f,{behavior:D="smooth",activeIndex:J,onComplete:Se}={})=>{const je=Ee.current,Xe=De.current;if(!je||!Xe)return;if(dn(),nn(),Tt(!1),D==="auto"){Fo(je,f,J,Se);return}const vt=Math.abs(f-je.scrollLeft),Lt=ay(vt,dy,uy,je.clientWidth*.55);ot.current=cy(je,Xe,f,{duration:Lt,easing:py,onComplete:()=>{ot.current=null,Fo(je,f,J,Se)}})},Wr=(f="smooth")=>{const D=Ee.current;if(!D||t.length===0)return;const J=xe()%t.length,Se=Ft(J,D.scrollLeft),je=_e.current[Se];je&&Wo(je.offsetLeft,{behavior:f,activeIndex:J})},_r=(f,D="smooth",J,Se)=>{const je=Ee.current;if(!je||t.length===0)return;const Xe=(Se??je.scrollLeft)-f,vt=xe(f),Lt=_e.current[vt];if(x(Lt)){Tt(!0),ft();return}const en=_e.current[vt+1],Jt=Lt?en?en.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Xe>Jt*Ko?1:Xe<-Jt*Ko?-1:0:0)!==0){const Uc=J??vt%t.length,Kc=Ne(Se??je.scrollLeft,f,Uc);Sn(Kc,D);return}const eo=Se??je.scrollLeft,No=xe(eo),ds=_e.current[No];if(ds&&Math.abs(ds.offsetLeft-eo)<1){Tt(!0),ft();return}Wr("auto")},Sn=(f,D="smooth")=>{const J=Ee.current;if(!J||t.length===0)return;const Se=Ft(f,J.scrollLeft),je=_e.current[Se];je&&(D==="smooth"?Ot.current=f:Ot.current=null,F.current=f,de(f),Mt(!0),Wo(je.offsetLeft,{behavior:D,activeIndex:f,onComplete:D==="smooth"?Ht:void 0}))},xi=()=>{xt.current&&(window.removeEventListener("pointerup",xt.current),window.removeEventListener("pointercancel",xt.current),xt.current=null)},_o=(f,D,J,Se,je)=>{const Xe=J-f,vt=Se-D,Lt=Math.abs(Xe),en=Math.abs(vt);if(Lt<vy||Lt<=en)return!1;const Jt=Xe<0?1:-1,bi=ct?(je+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,je+Jt));return bi===je?!1:(Sn(bi),!0)},ni=f=>{if(!Ye.current.isActive)return;xi();const D=Ee.current;if(!D)return;const{scrollLeft:J,startActiveIndex:Se,hasMoved:je}=Ye.current,Xe=D.scrollLeft;_t(!0),Ye.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},yt(!1),f!==void 0&&D.hasPointerCapture(f)&&D.releasePointerCapture(f),je?_r(J,"smooth",Se,Xe):(Tt(!0),ft()),mt()},Ho=(f,D)=>{const J=it.current;it.current=null,J&&(_o(J.startX,J.startY,f,D,J.startActiveIndex),mt())},Hr=f=>{if(!$e)return;if(f.pointerType==="touch"){if(dn(),Tt(!0),Rt(f.target))return;it.current={startX:f.clientX,startY:f.clientY,startActiveIndex:F.current};return}if(f.pointerType!=="mouse"||f.button!==0||Rt(f.target))return;const D=Ee.current;if(!D)return;dn(),nn(),ti(),Ot.current=null,Ye.current={isActive:!0,startX:f.clientX,scrollLeft:D.scrollLeft,startActiveIndex:F.current,hasMoved:!1},Tt(!1),mt(),D.setPointerCapture(f.pointerId),xi();const J=Se=>{Se.pointerType==="mouse"&&ni(Se.pointerId)};xt.current=J,window.addEventListener("pointerup",J),window.addEventListener("pointercancel",J)},Nr=f=>{if(!$e||f.pointerType!=="mouse")return;const D=Ee.current;if(!D||!Ye.current.isActive)return;if(f.buttons===0){ni(f.pointerId);return}const J=f.clientX-Ye.current.startX;Math.abs(J)>yy&&(Ye.current.hasMoved=!0,yt(!0)),Ye.current.hasMoved&&(f.preventDefault(),D.scrollLeft=Ye.current.scrollLeft-J,_t(!0),ft(),mt())},ce=f=>{if($e){if(f.pointerType==="touch"){f.type==="pointerup"?Ho(f.clientX,f.clientY):it.current=null;return}f.pointerType==="mouse"&&ni(f.pointerId)}},Ge=f=>{!$e||f.pointerType!=="mouse"||ni(f.pointerId)};return Oc(),a.useEffect(()=>{const f=requestAnimationFrame(()=>Nt(!0));return()=>{cancelAnimationFrame(f),nn(),xi(),Ut.current!==null&&(cancelAnimationFrame(Ut.current),Ut.current=null),Ct.current&&clearTimeout(Ct.current),Bt.current&&clearTimeout(Bt.current)}},[]),a.useEffect(()=>{if(!Oe){wt(!0);return}mt();const f=Te.current;if(!f)return;const D=()=>mt();return f.addEventListener("pointermove",D),f.addEventListener("pointerdown",D),()=>{f.removeEventListener("pointermove",D),f.removeEventListener("pointerdown",D),Bt.current&&clearTimeout(Bt.current)}},[Oe,mt]),a.useEffect(()=>{const f=D=>{D.key==="Escape"&&Le()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Le]),a.useLayoutEffect(()=>{Wt()},[R,t.length,ct]),a.useLayoutEffect(()=>{o||Sn(F.current,"auto")},[R,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,ct]),a.useEffect(()=>{const f=Ee.current;if(!f||o||!Y)return;const D=J=>{if(J.preventDefault(),Math.abs(J.deltaY)<=Math.abs(J.deltaX))return;const Se=J.deltaMode===1?hy:J.deltaMode===2?f.clientHeight:1,je=J.deltaY*Se*gy;if(je!==0){if(nn(),pt.current||(pt.current=!0,Ve.current=f.scrollLeft,Ot.current=null,Tt(!1)),Ve.current+=je,!ct){const Xe=f.scrollWidth-f.clientWidth;Ve.current=Math.max(0,Math.min(Xe,Ve.current))}mt(),st.current===null&&(st.current=requestAnimationFrame(ei))}};return f.addEventListener("wheel",D,{passive:!1}),()=>{f.removeEventListener("wheel",D),dn()}},[o,Y,ct]),a.useEffect(()=>{const f=Ee.current;if(!f)return;const D=()=>{_t(Ye.current.isActive);const Se=f.scrollLeft,je=Se-We.current;We.current=Se;const Xe=Ke.current>0?Ke.current*.5:1/0;if(je!==0&&Math.abs(je)<Xe){const vt=je>0?"forward":"backward";vt!==Ze.current&&(Ze.current=vt,Re(vt))}Ye.current.isActive&&Ye.current.hasMoved||ft()};f.addEventListener("scroll",D,{passive:!0});const J=new ResizeObserver(()=>{Wt(),_t(Ye.current.isActive),Re(Ze.current),ft()});return J.observe(f),()=>{nn(),f.removeEventListener("scroll",D),J.disconnect()}},[t.length,ct]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{dt||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${mo}ms ease`,pointerEvents:bt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Dt}}),r.jsxs("div",{ref:Te,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:kt,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:Ee,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":$e&&t.length>0?"true":"false","data-mouse-dragging":Xt?"true":"false",onPointerDown:Hr,onPointerMove:Nr,onPointerUp:ce,onPointerCancel:ce,onLostPointerCapture:Ge,children:r.jsx("div",{ref:De,className:`${e}-lightbox-strip-track`,style:{gap:R},children:zt.map((f,D)=>{const J=f.image.objectFit??"contain",Se=D%t.length,je=Math.floor(D/t.length),Xe=Xo(R),vt=`calc(-0.5 * (${Xe} + ${R}))`;return r.jsxs("div",{ref:Lt=>_e.current[D]=Lt,className:`${e}-strip-item`,style:{height:M==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:J}}),o&&Se<t.length-1&&je===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:vt,width:Xe,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${je}-${f.image.url}-${Se}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:O,flexShrink:0,pointerEvents:"none"},children:o&&r.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}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${ee?` ${e}-lightbox-content-area-stacked`:""}`,children:(be||y)&&r.jsx("div",{className:`${e}-header ${ee?`${e}-header-two-row`:`${e}-header-single-row`}`,children:ee?gt():be||y?ht():null})})})]}),t.length>1&&E==="on"&&(()=>{const f=Xo(S),D=`calc(-0.5 * (${S} + ${f}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:S},children:r.jsx("div",{ref:fe,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:J=>J.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":C,style:{gap:ie,"--thumbnail-active-color":K},children:[t.map((J,Se)=>{const je=Xo(ie),Xe=`calc(-0.5 * (${je} + ${ie}))`;return r.jsxs("div",{ref:vt=>{Me.current[Se]=vt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":I===Se?"true":"false",onClick:()=>Y&&b==="click"&&Sn(Se),onMouseEnter:()=>He&&b==="hover"&&Sn(Se),"aria-label":J.image.name?`View ${J.image.name}`:`View image ${Se+1}`,"aria-current":I===Se?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ue?` ${e}-thumb-image-cover`:""}`,src:J.image.url,alt:"",draggable:!1,style:{...me,maxWidth:G,maxHeight:G,width:L.display==="cover"?"auto":"100%",height:"auto",objectFit:L.display==="cover"?"cover":"contain"}})}),o&&Se<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Xe,width:je,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${J.image.url}-${Se}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:D,height:f,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function My(e){return`
|
|
14234
|
+
`;function On(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const dl={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}}},ty=["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","iconHoverColor","iconActiveColor","dividerHoverColor"],ny={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:On("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:{...dl.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:{...dl.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:On("Question Padding Left"),questionPaddingTop:On("Question Padding Top"),questionPaddingBottom:On("Question Padding Bottom"),answerPaddingLeft:On("Answer Padding Left"),answerPaddingRight:On("Answer Padding Right"),answerPaddingTop:On("Answer Padding Top"),answerPaddingBottom:On("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:[...ty],panelIds:["general","typeStyle"],stateItems:{default:["questionColor","answerColor","dividerColor","iconColor","questionHoverColor","dividerHoverColor","iconHoverColor","iconActiveColor"]}}},iy={element:Qf,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:ny,sourceCode:ey},Fn=e=>e.display==="cover",Ar=e=>{const t=e.ratioValue??"1:1",n=e.reversed??!1,[i,o]=t.split(":").map(Number);return`${n?o:i} / ${n?i:o}`},ul=100,oy=.2,pl=8,Hc=({enabled:e,onClose:t,animMs:n=300,isBlockedTarget:i})=>{const[o,s]=a.useState(0),[l,d]=a.useState(!1),c=a.useRef(null),u=a.useRef(0);u.current=o;const p=a.useMemo(()=>typeof window>"u"?ul:Math.max(ul,window.innerHeight*oy),[]),v=a.useCallback(y=>Math.max(0,1-y/(p*1.5)),[p]),x=a.useCallback(y=>Math.max(0,1-y/(p*.45)),[p]),g=a.useCallback(y=>{const W=typeof window<"u"?window.innerHeight:800,M=Math.max(.88,1-y/W*.12);return`translateY(${y}px) scale(${M})`},[]),h=a.useCallback(()=>{c.current=null},[]),m=a.useCallback(()=>{d(!0),s(0),window.setTimeout(()=>d(!1),n),h()},[n,h]),b=a.useCallback(()=>{const y=typeof window<"u"?window.innerHeight:800;d(!0),s(y),window.setTimeout(()=>{t(),h(),d(!1)},Math.min(n,200))},[n,t,h]),I=a.useCallback(y=>{!e||l||y.pointerType==="touch"&&(i!=null&&i(y.target)||(c.current={startX:y.clientX,startY:y.clientY,isLocked:null,pointerId:y.pointerId}))},[e,l,i]),C=a.useCallback(y=>{const W=c.current;if(!e||!W||y.pointerType!=="touch"||W.pointerId!==y.pointerId)return;const M=y.clientX-W.startX,Y=y.clientY-W.startY;if(W.isLocked===null){if(Math.abs(M)<pl&&Math.abs(Y)<pl)return;if(Y>0&&Y>Math.abs(M))W.isLocked=!0,y.currentTarget.setPointerCapture(y.pointerId);else{W.isLocked=!1,h();return}}if(!W.isLocked)return;y.preventDefault();const P=Math.max(0,Y);u.current=P,s(P)},[e,h]),R=a.useCallback(y=>{const W=c.current;if(!e||!W||y.pointerType!=="touch"||W.pointerId!==y.pointerId)return;const M=W.isLocked===!0;if(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),!M){h();return}y.clientY-W.startY>=p?b():m()},[p,b,e,h,m]),K=a.useCallback(y=>{R(y)},[R]),F=a.useCallback(y=>{R(y)},[R]),V=o>0,A=l?`transform ${n}ms ease`:"none",T=l?`opacity ${n}ms ease`:"none",j=o>0||l;return{isSwipeDragging:V,backdropStyle:{opacity:v(o),transition:T},mediaAreaStyle:{transform:g(o),transition:A,touchAction:V?"none":void 0,willChange:V?"transform":void 0},overlayContentStyle:j?{opacity:x(o),transition:T}:void 0,swipeHandlers:e?{onPointerDown:I,onPointerMove:C,onPointerUp:K,onPointerCancel:F}:{},dismissAreaStyle:e?{touchAction:V?"none":"pan-x"}:void 0}},ry="[data-lightbox-scrollable]",Nc=()=>{a.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,s=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(ry)||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=s,window.scrollTo({top:e,left:0,behavior:"instant"})}},[])},ay=(e,t,n,i)=>{const o=Math.min(Math.abs(e)/Math.max(i,1),1);return t+(n-t)*o},sy=e=>{e.style.transition="",e.style.transform="",e.style.willChange=""},ly=e=>{const t=getComputedStyle(e).transform;return t==="none"?0:new DOMMatrixReadOnly(t).m41},cy=(e,t,n,{duration:i,easing:o,onComplete:s})=>{const l=e.scrollLeft,d=n-l,c=l-n,u=(h,m)=>{sy(t),e.scrollLeft=h,m&&(s==null||s())};if(Math.abs(d)<.5)return u(n,!0),()=>{};let p=!1,v=0;const x=()=>{t.removeEventListener("transitionend",g),clearTimeout(v)},g=h=>{h.target!==t||h.propertyName!=="transform"||p||(p=!0,x(),u(n,!0))};return t.addEventListener("transitionend",g),t.style.willChange="transform",t.style.transition="none",t.style.transform="translate3d(0, 0, 0)",t.offsetHeight,t.style.transition=`transform ${i}ms ${o}`,t.style.transform=`translate3d(${c}px, 0, 0)`,v=window.setTimeout(()=>{p||(p=!0,x(),u(n,!0))},i+64),()=>{p||(p=!0,x(),u(l-ly(t),!1))}},mo=300,dy=900,uy=1500,py="cubic-bezier(0.16, 1, 0.3, 1)",my=3e3,gy=2,hy=16,fy=.05,yy=1,Ko=.3,vy=50,xy=20,$i=.004,qi=["title1","title2","title3"],by={title1:"1",title2:"2",title3:"3"},wy={title1:"title1Color",title2:"title2Color",title3:"title3Color"},Sy={title1:.02,title2:.02,title3:.02},Xo=e=>`max(${e}, ${xy}px)`,$y=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]}},Cy=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=$y(e.text);return{title1:t.title1??"",title2:t.title2??"",title3:t.title3??""}},jt=(e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`,Ty=e=>[jt(e,"fontFamily"),jt(e,"fontSettings"),{type:"row",items:[jt(e,"fontSize"),jt(e,"lineHeight"),jt(e,"letterSpacing"),jt(e,"wordSpacing")]},jt(e,"textAlign"),jt(e,"textAppearance")],Ly=()=>({type:"tab",id:"stripTextStyle",tabs:Object.fromEntries(qi.map(e=>[by[e],Ty(e)]))}),cs=(e,t)=>{if(e<=0)return[];const n=t.slice(0,e),i=n.reduce((s,l)=>s+l,0);if(i<=1)return n;const{widths:o}=[...n].reverse().reduce(({overflow:s,widths:l},d)=>{if(s<=0||d<=0)return{overflow:s,widths:[d,...l]};const c=Math.min(s,d);return{overflow:s-c,widths:[d-c,...l]}},{overflow:i-1,widths:[]});return o},Oc=(e,t)=>cs(e,t),Yo=(e,t)=>{const n=t.filter((i,o)=>o!==e).reduce((i,o)=>i+o,0);return Math.max(1-n,0)},ml=(e,t)=>{const n=e.map(i=>t[i.widthKey]??0);return{resolved:cs(e.length,n),effective:Oc(e.length,n)}},Ry=(e,t,n,i,o,s,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:s,text:n}),i&&d.push({prefix:"title3",widthKey:"title3Width",marginLeftKey:"title3MarginLeft",className:`${e}-title3`,style:l,text:i}),d},oa=(e,t)=>{const n=i=>{const o=jt(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[wy[t]]}},Iy=(e,t,n,i)=>e.slice(0,i).reduce((o,s,l)=>o+(s!=null&&s.marginLeftKey?n[s.marginLeftKey]??0:0)+(t[l]??0),0),ra=(e,t,n)=>{var o,s;const i={fontSettings:{fontFamily:t.fontFamily,fontWeight:((o=t.fontSettings)==null?void 0:o.fontWeight)??400,fontStyle:((s=t.fontSettings)==null?void 0:s.fontStyle)??"normal"},fontSize:t.fontSize??Sy[e],lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,wordSpacing:t.wordSpacing,textAlign:t.textAlign,textAppearance:t.textAppearance,color:t.color??"#ffffff"};return Kt(i,n)},Ey=({prefix:e,images:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,onClose:l})=>{const{backgroundColor:d,thumbnailSize:c,thumbnailGap:u,thumbnailMarginBottom:p,imageGap:v,closeIcon:x,closeIconMaxWidth:g,closeIconColor:h,closeIconHoverColor:m,thumbnailTrigger:b,thumbnailVisibility:I,thumbnailObjectFit:C,thumbnailActive:R,thumbnailActiveColor:K,title1Width:F,title2Width:V,title3Width:A,title1MarginLeft:T=0,title2MarginLeft:j=0,title3MarginLeft:y=0,titleRowMarginBottom:W=0,titleHeaderLayout:M="desktop",contentMarginTop:Y,iconMarginLeft:P}=n,U=f=>$.scalingValue(f,i??!1),z=c??n.thumnailSize??.03,B=U(z),te=U(u),S=U(p??.02),E=U(v??0),D=U(Y??0),se=Xo(D),oe=U(P??0),[L,ue]=a.useState(0),k=a.useRef(L);k.current=L;const ne=t[L],{title1:X,title2:be,title3:Ae}=Cy(ne),fe=ra("title1",oa(n,"title1"),i),le=ra("title2",oa(n,"title2"),i),q=ra("title3",oa(n,"title3"),i),Q=M==="mobile",Z=!o&&(!i||s),Ne=Z,Te=Z,We=Z,ce=Fn(C),ye=ce?{"--image-aspect-ratio":Ar(C)}:void 0,$e=!!(X||be||Ae),G=a.useMemo(()=>Ry(e,X,be,Ae,fe,le,q),[e,L,X,be,Ae,fe,le,q]),re=a.useMemo(()=>({title1Width:F,title2Width:V,title3Width:A}),[F,V,A]),pe=a.useMemo(()=>G.map(f=>re[f.widthKey]),[G,re]),Se=a.useMemo(()=>cs(G.length,pe),[G.length,pe]),Pe=a.useMemo(()=>Oc(G.length,pe),[G.length,pe]),Re=a.useMemo(()=>G.filter(f=>f.prefix==="title1"),[G]),H=a.useMemo(()=>G.filter(f=>f.prefix==="title2"||f.prefix==="title3"),[G]),ge=a.useMemo(()=>ml(Re,re),[Re,re]),ie=a.useMemo(()=>ml(H,re),[H,re]),_=a.useCallback((f,O)=>{const J=G.indexOf(f);if(!Q||O==="single-row")return{effectiveWidth:Pe[J]??0,resolvedWidth:Se[J]??0,maxWidth:Yo(J,Se)};if(O==="two-row-top"){const De=Re.indexOf(f);return{effectiveWidth:ge.effective[De]??0,resolvedWidth:ge.resolved[De]??0,maxWidth:Yo(De,ge.resolved)}}const Ce=H.indexOf(f);return{effectiveWidth:ie.effective[Ce]??0,resolvedWidth:ie.resolved[Ce]??0,maxWidth:Yo(Ce,ie.resolved)}},[H,ie,Pe,Se,G,Re,ge,Q]),ee=a.useCallback(f=>$.scalingValue(f,i??!1),[i]),Fe=ee(W??0),ae=a.useMemo(()=>({title1MarginLeft:T,title2MarginLeft:j,title3MarginLeft:y}),[T,j,y]),N=a.useCallback(f=>G.slice(0,f+1).reduce((O,J,Ce)=>O+(J!=null&&J.marginLeftKey?ae[J.marginLeftKey]??0:0)+(Se[Ce]??0),0)+(Q?0:T??0),[G,ae,Se,Q,T]),qe=a.useCallback(()=>Q?0:T??0,[Q,T]),je=a.useCallback(f=>H.slice(0,f).reduce((O,J,Ce)=>O+(J.marginLeftKey?ae[J.marginLeftKey]??0:0)+(ie.resolved[Ce]??0),0),[H,ie.resolved,ae]),st=a.useCallback(f=>{const O=H[f];return je(f)+(O.marginLeftKey?ae[O.marginLeftKey]??0:0)+(ie.resolved[f]??0)},[H,ie.resolved,je,ae]),et=(f,O)=>{const J=f.marginLeftKey?ae[f.marginLeftKey]??0:0,{effectiveWidth:Ce,resolvedWidth:De,maxWidth:Ye}=_(f,O),wt=o&&O==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":f.prefix,style:{...O==="single-row"?{gridArea:f.prefix}:{},width:ee(Ce),...J>0?{marginLeft:ee(J)}:{}},children:[r.jsx("p",{className:f.className,style:f.style,children:f.text}),wt&&f.marginLeftKey&&r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De),style:{position:"absolute",top:0,left:ee(-J),width:`max(${ee(J)}, 10px)`,height:"100%",pointerEvents:"auto"}}),wt&&r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(Ye),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:ee(-$i/2),width:ee($i),height:"100%",pointerEvents:"auto"}})]},f.className)},pt=()=>{const f=Q?-1:G.findIndex(Ce=>Ce.prefix==="title1"),O=!Q&&(o||(T??0)>0)?(()=>{const Ce=T??0,De=f>=0?Se[f]:F??0;return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De),style:{position:"absolute",top:0,left:0,width:`max(${ee(Ce)}, 10px)`,height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,J=G.flatMap((Ce,De)=>{if(!Ce.marginLeftKey)return[];const Ye=ae[Ce.marginLeftKey]??0,wt=Iy(G,Se,ae,De)+qe();return r.jsx("div",{"data-controls":Ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se[De]),style:{position:"absolute",top:0,left:ee(wt),width:`max(${ee(Ye)}, 10px)`,height:"100%",pointerEvents:"auto"}},Ce.marginLeftKey)});return O?[O,...J]:J},rt=()=>G.map((f,O)=>{const J=Yo(O,Se),De=N(O)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(J),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(De),width:ee($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),Ve=()=>H.flatMap((f,O)=>{if(!f.marginLeftKey)return[];const J=ae[f.marginLeftKey]??0,Ce=je(O),{resolvedWidth:De}=_(f,"two-row-bottom");return r.jsx("div",{"data-controls":f.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(De),style:{position:"absolute",top:0,left:ee(Ce),width:`max(${ee(J)}, 10px)`,height:"100%",pointerEvents:"auto"}},f.marginLeftKey)}),xe=()=>H.map((f,O)=>{const{maxWidth:J}=_(f,"two-row-bottom"),De=st(O)-$i/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":f.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(J),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:ee(De),width:ee($i),height:"100%",pointerEvents:"auto"}})},`${f.widthKey}-junction`)}),me=a.useRef(null),he=a.useRef(null),He=a.useRef(null),ve=a.useRef(null),Ee=a.useRef([]),Me=a.useRef([]),Ge=a.useRef(0),Ze=a.useRef(null),Ue=a.useRef({isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1}),lt=a.useRef(null),tt=a.useRef(null),ke=a.useRef(0),Xe=a.useRef("forward"),Oe=a.useRef(0),ot=a.useRef(null),ct=a.useRef(!1),mt=t.length>1&&(!o||!!s),Mt=mt?3:1,Ut=a.useMemo(()=>Array.from({length:Mt},()=>t).flat(),[t,Mt]),[Yt,xt]=a.useState(!1),[bt,_t]=a.useState(!1),[kt,vt]=a.useState(!0),Ft=a.useRef(null),zt=a.useRef(null),Zt=a.useRef(!1),en=a.useRef(!1),Ct=a.useRef(null),Bt=a.useRef(null),cn=Ne&&!kt,gt=a.useCallback(()=>{Ne&&(vt(!0),Bt.current&&clearTimeout(Bt.current),Bt.current=setTimeout(()=>{Ue.current.isActive||vt(!1)},my))},[Ne]),Le=a.useCallback(()=>{o||en.current||(en.current=!0,_t(!1),Ct.current=setTimeout(()=>{l()},mo))},[o,l]),ze=()=>r.jsxs("div",{className:`${e}-close-icon`,"data-overlay-content-hidden":cn?"true":"false",style:{width:$.scalingValue(g??0,i),height:$.scalingValue(g??0,i),marginRight:oe,"--close-icon-hover-color":m},children:[r.jsx("button",{type:"button",className:`${e}-close-icon-inner`,onClick:Le,"aria-label":"Close",children:r.jsx(rn,{url:x,fill:h,hoverFill:i&&!s?h:m,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginLeft","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),nt=(f="two-row")=>r.jsx("div",{...f==="two-row"&&o?{"data-controls":"title1MarginLeft","data-controls-axis":"x"}:{},style:{width:ee(T??0),flexShrink:0,...f==="single-row"?{gridArea:"margin"}:{alignSelf:"stretch"},...f==="two-row"&&o?{pointerEvents:"auto"}:{}}}),ht=()=>{const f=G.find(Ce=>Ce.prefix==="title1"),O=G.filter(Ce=>Ce.prefix==="title2"||Ce.prefix==="title3"),J=O.length>0||o||(W??0)>0;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e}-header-row-top`,children:[(T??0)>0||o?nt():null,f&&et(f,"two-row-top"),x&&ze()]}),J?r.jsxs("div",{className:`${e}-header-row-bottom-wrap`,children:[O.length>0?r.jsxs("div",{className:`${e}-header-row-bottom`,children:[O.map(Ce=>et(Ce,"two-row-bottom")),o&&r.jsxs(r.Fragment,{children:[Ve(),xe()]})]}):null,r.jsx("div",{"data-controls":o?"titleRowMarginBottom":void 0,"data-controls-axis":o?"y":void 0,"data-controls-reverse":o?"":void 0,className:o?`${e}-control`:void 0,style:{height:Fe,width:"100%",flexShrink:0,pointerEvents:o?"auto":"none"}})]}):null]})},ft=()=>r.jsxs(r.Fragment,{children:[(T??0)>0||o?nt("single-row"):null,G.map(f=>et(f,"single-row")),o?r.jsxs(r.Fragment,{children:[pt(),rt()]}):null,x?ze():null]}),Rt=a.useCallback(f=>!!(f.closest("[data-controls]")||f.closest(`.${e}-thumbnails`)||f.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:ut,backdropStyle:Dt,mediaAreaStyle:At,overlayContentStyle:Pt,swipeHandlers:Vt,dismissAreaStyle:Gt}=Hc({enabled:Z??!1,onClose:Le,animMs:mo,isBlockedTarget:Rt}),Ht=()=>{if(!mt||t.length===0)return Ge.current=0,0;const f=Me.current[0],O=Me.current[t.length];if(!f||!O)return Ge.current;const J=O.offsetLeft-f.offsetLeft;return J>0&&(Ge.current=J),Ge.current},Nt=(f=!1)=>{if(!mt)return;const O=he.current,J=Ht();!O||J<=0||J<O.clientWidth*.25||(O.scrollLeft<=0?(O.scrollLeft+=J,f&&(Ue.current.scrollLeft+=J),ct.current&&(Oe.current+=J)):O.scrollLeft>=J*2&&(O.scrollLeft-=J,f&&(Ue.current.scrollLeft-=J),ct.current&&(Oe.current-=J)))},Wt=(f,O=(J=>(J=he.current)==null?void 0:J.scrollLeft)()??0)=>{if(!mt)return f;let Ce=t.length+f,De=1/0;for(let Ye=0;Ye<Mt;Ye++){const wt=Ye*t.length+f,Lt=Me.current[wt];if(!Lt)continue;const tn=Math.abs(Lt.offsetLeft-O);tn<De&&(De=tn,Ce=wt)}return Ce},St=f=>{const O=he.current;return!f||!O?!1:f.offsetWidth>O.clientWidth+1},w=f=>{const O=he.current;if(!f||!O||!St(f))return!1;const J=f.offsetLeft,Ce=J+f.offsetWidth;return O.scrollLeft>=J-1&&O.scrollLeft+O.clientWidth<=Ce+1},we=(f=(O=>(O=he.current)==null?void 0:O.scrollLeft)()??0)=>{for(let Ce=0;Ce<Me.current.length;Ce+=1){const De=Me.current[Ce];if(De&&w(De))return Ce}let J={flatIndex:0,distance:1/0};return Me.current.forEach((Ce,De)=>{if(!Ce)return;const Ye=Math.abs(Ce.offsetLeft-f);Ye<J.distance&&(J={flatIndex:De,distance:Ye})}),J.flatIndex},Ie=f=>{he.current&&Me.current.forEach(O=>{O&&(O.style.scrollSnapAlign=St(O)&&f==="backward"?"end":"start")})},_e=(f,O,J)=>{const Ce=f-O,De=we(O),Ye=Me.current[De];if(w(Ye))return we(f)%t.length;const wt=Me.current[De+1],Lt=Ye?wt?wt.offsetLeft-Ye.offsetLeft:Ye.offsetWidth:0,tn=Lt>0?Ce>Lt*Ko?1:Ce<-Lt*Ko?-1:0:0;return tn===0?J:mt?(J+tn+t.length)%t.length:Math.max(0,Math.min(t.length-1,J+tn))},it=a.useCallback((f=!1)=>{if(I!=="on"||o)return;const O=ve.current,J=k.current,Ce=Ee.current[J];if(!O||!Ce||O.scrollWidth<=O.clientWidth)return;const De=O.scrollLeft,Ye=De+O.clientWidth,wt=Ce.offsetLeft,Lt=wt+Ce.offsetWidth;if(wt>=De&&Lt<=Ye)return;const tn=O.scrollWidth-O.clientWidth;let Jt=De;if(!f&&Ft.current===null){const bi=Ee.current[J-1],eo=Ee.current[J+1],No=bi?Ce.offsetLeft-bi.offsetLeft:eo?eo.offsetLeft-Ce.offsetLeft:Ce.offsetWidth;Lt>Ye?Jt+=No:wt<De&&(Jt-=No)}else Lt>Ye?Jt=Lt-O.clientWidth:Jt=wt;O.scrollLeft=Math.max(0,Math.min(tn,Jt))},[o,I]),Et=a.useCallback((f=!1)=>{f&&(Zt.current=!0),zt.current===null&&(zt.current=requestAnimationFrame(()=>{zt.current=null;const O=Zt.current;Zt.current=!1,it(O)}))},[it]),Je=a.useCallback(f=>{if(f===k.current)return;const O=k.current;k.current=f;const J=Math.abs(f-O)>1,Ce=mt&&t.length>1&&(O===t.length-1&&f===0||O===0&&f===t.length-1);ue(f),Et(J||Ce)},[t.length,mt,Et]),yt=()=>{if(!he.current||t.length===0||Ft.current!==null||Ue.current.isActive&&Ue.current.hasMoved)return;const f=he.current.scrollLeft,O=we(f)%t.length;O!==k.current&&Je(O)},Ot=()=>{Ft.current=null},Tt=f=>{const O=he.current;O&&(O.style.scrollSnapType=f?"":"none")},nn=()=>{var f;(f=tt.current)==null||f.call(tt),tt.current=null},dn=()=>{ot.current!==null&&(cancelAnimationFrame(ot.current),ot.current=null),ct.current=!1},ei=()=>{const f=he.current;if(!f){ot.current=null,ct.current=!1;return}const O=Oe.current-f.scrollLeft;if(Math.abs(O)<.5){f.scrollLeft=Oe.current,Nt(),yt(),ot.current=null,ct.current=!1;return}f.scrollLeft+=O*fy,Nt(),yt(),gt(),ot.current=requestAnimationFrame(ei)},ti=()=>{const f=He.current;f&&(f.style.transition="",f.style.transform="",f.style.willChange="")},Fo=(f,O,J,Ce)=>{ti(),f.scrollLeft=O,ke.current=f.scrollLeft,Nt(),J!==void 0?(k.current=J,ue(J)):yt(),Tt(!0),Ce==null||Ce()},Wo=(f,{behavior:O="smooth",activeIndex:J,onComplete:Ce}={})=>{const De=he.current,Ye=He.current;if(!De||!Ye)return;if(dn(),nn(),Tt(!1),O==="auto"){Fo(De,f,J,Ce);return}const wt=Math.abs(f-De.scrollLeft),Lt=ay(wt,dy,uy,De.clientWidth*.55);tt.current=cy(De,Ye,f,{duration:Lt,easing:py,onComplete:()=>{tt.current=null,Fo(De,f,J,Ce)}})},Wr=(f="smooth")=>{const O=he.current;if(!O||t.length===0)return;const J=we()%t.length,Ce=Wt(J,O.scrollLeft),De=Me.current[Ce];De&&Wo(De.offsetLeft,{behavior:f,activeIndex:J})},_r=(f,O="smooth",J,Ce)=>{const De=he.current;if(!De||t.length===0)return;const Ye=(Ce??De.scrollLeft)-f,wt=we(f),Lt=Me.current[wt];if(w(Lt)){Tt(!0),yt();return}const tn=Me.current[wt+1],Jt=Lt?tn?tn.offsetLeft-Lt.offsetLeft:Lt.offsetWidth:0;if((Jt>0?Ye>Jt*Ko?1:Ye<-Jt*Ko?-1:0:0)!==0){const qc=J??wt%t.length,Uc=_e(Ce??De.scrollLeft,f,qc);Sn(Uc,O);return}const eo=Ce??De.scrollLeft,No=we(eo),ds=Me.current[No];if(ds&&Math.abs(ds.offsetLeft-eo)<1){Tt(!0),yt();return}Wr("auto")},Sn=(f,O="smooth")=>{const J=he.current;if(!J||t.length===0)return;const Ce=Wt(f,J.scrollLeft),De=Me.current[Ce];De&&(O==="smooth"?Ft.current=f:Ft.current=null,k.current=f,ue(f),Et(!0),Wo(De.offsetLeft,{behavior:O,activeIndex:f,onComplete:O==="smooth"?Ot:void 0}))},xi=()=>{lt.current&&(window.removeEventListener("pointerup",lt.current),window.removeEventListener("pointercancel",lt.current),lt.current=null)},_o=(f,O,J,Ce,De)=>{const Ye=J-f,wt=Ce-O,Lt=Math.abs(Ye),tn=Math.abs(wt);if(Lt<vy||Lt<=tn)return!1;const Jt=Ye<0?1:-1,bi=mt?(De+Jt+t.length)%t.length:Math.max(0,Math.min(t.length-1,De+Jt));return bi===De?!1:(Sn(bi),!0)},ni=f=>{if(!Ue.current.isActive)return;xi();const O=he.current;if(!O)return;const{scrollLeft:J,startActiveIndex:Ce,hasMoved:De}=Ue.current,Ye=O.scrollLeft;Nt(!0),Ue.current={isActive:!1,startX:0,scrollLeft:0,startActiveIndex:0,hasMoved:!1},xt(!1),f!==void 0&&O.hasPointerCapture(f)&&O.releasePointerCapture(f),De?_r(J,"smooth",Ce,Ye):(Tt(!0),yt()),gt()},Ho=(f,O)=>{const J=Ze.current;Ze.current=null,J&&(_o(J.startX,J.startY,f,O,J.startActiveIndex),gt())},Hr=f=>{if(!Te)return;if(f.pointerType==="touch"){if(dn(),Tt(!0),Rt(f.target))return;Ze.current={startX:f.clientX,startY:f.clientY,startActiveIndex:k.current};return}if(f.pointerType!=="mouse"||f.button!==0||Rt(f.target))return;const O=he.current;if(!O)return;dn(),nn(),ti(),Ft.current=null,Ue.current={isActive:!0,startX:f.clientX,scrollLeft:O.scrollLeft,startActiveIndex:k.current,hasMoved:!1},Tt(!1),gt(),O.setPointerCapture(f.pointerId),xi();const J=Ce=>{Ce.pointerType==="mouse"&&ni(Ce.pointerId)};lt.current=J,window.addEventListener("pointerup",J),window.addEventListener("pointercancel",J)},Nr=f=>{if(!Te||f.pointerType!=="mouse")return;const O=he.current;if(!O||!Ue.current.isActive)return;if(f.buttons===0){ni(f.pointerId);return}const J=f.clientX-Ue.current.startX;Math.abs(J)>yy&&(Ue.current.hasMoved=!0,xt(!0)),Ue.current.hasMoved&&(f.preventDefault(),O.scrollLeft=Ue.current.scrollLeft-J,Nt(!0),yt(),gt())},de=f=>{if(Te){if(f.pointerType==="touch"){f.type==="pointerup"?Ho(f.clientX,f.clientY):Ze.current=null;return}f.pointerType==="mouse"&&ni(f.pointerId)}},Be=f=>{!Te||f.pointerType!=="mouse"||ni(f.pointerId)};return Nc(),a.useEffect(()=>{const f=requestAnimationFrame(()=>_t(!0));return()=>{cancelAnimationFrame(f),nn(),xi(),zt.current!==null&&(cancelAnimationFrame(zt.current),zt.current=null),Ct.current&&clearTimeout(Ct.current),Bt.current&&clearTimeout(Bt.current)}},[]),a.useEffect(()=>{if(!Ne){vt(!0);return}gt();const f=me.current;if(!f)return;const O=()=>gt();return f.addEventListener("pointermove",O),f.addEventListener("pointerdown",O),()=>{f.removeEventListener("pointermove",O),f.removeEventListener("pointerdown",O),Bt.current&&clearTimeout(Bt.current)}},[Ne,gt]),a.useEffect(()=>{const f=O=>{O.key==="Escape"&&Le()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[Le]),a.useLayoutEffect(()=>{Ht()},[E,t.length,mt]),a.useLayoutEffect(()=>{o||Sn(k.current,"auto")},[E,o]),a.useLayoutEffect(()=>{Sn(0,"auto")},[t.length,mt]),a.useEffect(()=>{const f=he.current;if(!f||o||!Z)return;const O=J=>{if(J.preventDefault(),Math.abs(J.deltaY)<=Math.abs(J.deltaX))return;const Ce=J.deltaMode===1?hy:J.deltaMode===2?f.clientHeight:1,De=J.deltaY*Ce*gy;if(De!==0){if(nn(),ct.current||(ct.current=!0,Oe.current=f.scrollLeft,Ft.current=null,Tt(!1)),Oe.current+=De,!mt){const Ye=f.scrollWidth-f.clientWidth;Oe.current=Math.max(0,Math.min(Ye,Oe.current))}gt(),ot.current===null&&(ot.current=requestAnimationFrame(ei))}};return f.addEventListener("wheel",O,{passive:!1}),()=>{f.removeEventListener("wheel",O),dn()}},[o,Z,mt]),a.useEffect(()=>{const f=he.current;if(!f)return;const O=()=>{Nt(Ue.current.isActive);const Ce=f.scrollLeft,De=Ce-ke.current;ke.current=Ce;const Ye=Ge.current>0?Ge.current*.5:1/0;if(De!==0&&Math.abs(De)<Ye){const wt=De>0?"forward":"backward";wt!==Xe.current&&(Xe.current=wt,Ie(wt))}Ue.current.isActive&&Ue.current.hasMoved||yt()};f.addEventListener("scroll",O,{passive:!0});const J=new ResizeObserver(()=>{Ht(),Nt(Ue.current.isActive),Ie(Xe.current),yt()});return J.observe(f),()=>{nn(),f.removeEventListener("scroll",O),J.disconnect()}},[t.length,mt]),r.jsxs("div",{"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{ut||Le()},role:"dialog","aria-modal":"true","aria-label":"Image gallery",style:{opacity:bt?1:0,transition:`opacity ${mo}ms ease`,pointerEvents:bt?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:d,...Dt}}),r.jsxs("div",{ref:me,className:`${e}-lightbox-dismiss-area`,style:Gt,...Vt,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:At,onClick:f=>f.stopPropagation(),children:r.jsx("div",{ref:he,className:`${e}-lightbox-strip`,"data-lightbox-scrollable":"","data-mouse-draggable":Te&&t.length>0?"true":"false","data-mouse-dragging":Yt?"true":"false",onPointerDown:Hr,onPointerMove:Nr,onPointerUp:de,onPointerCancel:de,onLostPointerCapture:Be,children:r.jsx("div",{ref:He,className:`${e}-lightbox-strip-track`,style:{gap:E},children:Ut.map((f,O)=>{const J=f.image.objectFit??"contain",Ce=O%t.length,De=Math.floor(O/t.length),Ye=Xo(E),wt=`calc(-0.5 * (${Ye} + ${E}))`;return r.jsxs("div",{ref:Lt=>Me.current[O]=Lt,className:`${e}-strip-item`,style:{height:M==="mobile"?"calc(0.75 * var(--cntrl-viewport-height, 100vh))":"100%"},children:[r.jsx("img",{src:f.image.url,draggable:!1,style:{display:"block",maxWidth:"100%",height:"100%",objectFit:J}}),o&&Ce<t.length-1&&De===0&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:wt,width:Ye,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${De}-${f.image.url}-${Ce}`)})})})}),r.jsxs("div",{className:`${e}-lightbox-content-inner`,"data-overlay-content-hidden":cn?"true":"false",style:Pt,children:[r.jsx("div",{style:{position:"relative",width:"100%",height:D,flexShrink:0,pointerEvents:"none"},children:o&&r.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-handle-left-fraction":"0.05",style:{position:"absolute",left:0,right:0,top:0,height:se,pointerEvents:"auto",zIndex:3}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",flex:1,minHeight:0,pointerEvents:"none"},children:r.jsx("div",{className:`${e}-lightbox-content-area${Q?` ${e}-lightbox-content-area-stacked`:""}`,children:($e||x)&&r.jsx("div",{className:`${e}-header ${Q?`${e}-header-two-row`:`${e}-header-single-row`}`,children:Q?ht():$e||x?ft():null})})})]}),t.length>1&&I==="on"&&(()=>{const f=Xo(S),O=`calc(-0.5 * (${S} + ${f}))`;return r.jsx("div",{className:`${e}-thumbnails-wrap`,style:{bottom:S},children:r.jsx("div",{ref:ve,className:`${e}-thumbnails`,"data-lightbox-scrollable":"",onClick:J=>J.stopPropagation(),children:r.jsxs("div",{className:`${e}-thumbnails-track`,"data-thumbnail-active":R,style:{gap:te,"--thumbnail-active-color":K},children:[t.map((J,Ce)=>{const De=Xo(te),Ye=`calc(-0.5 * (${De} + ${te}))`;return r.jsxs("div",{ref:wt=>{Ee.current[Ce]=wt},style:{position:"relative",flex:"0 0 auto"},children:[r.jsx("button",{type:"button",className:`${e}-thumb`,"data-active":L===Ce?"true":"false",onClick:()=>Z&&b==="click"&&Sn(Ce),onMouseEnter:()=>We&&b==="hover"&&Sn(Ce),"aria-label":J.image.name?`View ${J.image.name}`:`View image ${Ce+1}`,"aria-current":L===Ce?"true":void 0,children:r.jsx("img",{className:`${e}-thumb-image${ce?` ${e}-thumb-image-cover`:""}`,src:J.image.url,alt:"",draggable:!1,style:{...ye,maxWidth:B,maxHeight:B,width:C.display==="cover"?"auto":"100%",height:"auto",objectFit:C.display==="cover"?"cover":"contain"}})}),o&&Ce<t.length-1&&r.jsx("div",{"data-controls":"thumbnailGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:Ye,width:De,height:"100%",pointerEvents:"auto",zIndex:3}})]},`thumb-${J.image.url}-${Ce}`)}),o&&r.jsx("div",{"data-controls":"thumbnailMarginBottom","data-controls-axis":"y","data-controls-reverse":o?"":void 0,style:{position:"absolute",left:0,right:0,bottom:O,height:f,pointerEvents:"auto",zIndex:3}})]})})})})()]})]})};function My(e){return`
|
|
14183
14235
|
.${e}-wrapper {
|
|
14184
14236
|
position: relative;
|
|
14185
14237
|
width: 100%;
|
|
@@ -14564,7 +14616,7 @@ export function FAQ({ settings, content, isEditor, isPreviewMode, isEditMode, ac
|
|
|
14564
14616
|
pointer-events: auto;
|
|
14565
14617
|
z-index: 10;
|
|
14566
14618
|
}
|
|
14567
|
-
`}const Py=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=$.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,v]=a.useState(!1),
|
|
14619
|
+
`}const Py=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s})=>{const{prefix:l}=$.useScopedStyles(),{cover:d,coverFit:c}=e,u=a.useRef(null),[p,v]=a.useState(!1),x=t??[],g=p&&x.length>0,h=()=>{x.length!==0&&v(!0)};return a.useEffect(()=>{!n||i||o||v(!1)},[n,i,o]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:u,className:`${l}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:My(l)}}),d&&r.jsx("div",{className:`${l}-cover ${Fn(c)?`${l}-ratio-wrapper-cover`:`${l}-ratio-wrapper-fit`}`,onClick:()=>h(),style:{...Fn(c)?{"--image-aspect-ratio":Ar(c)}:{}},"aria-label":"Open image gallery",children:r.jsx("img",{className:`${l}-cover-image ${Fn(c)?`${l}-cover-image-cover`:`${l}-cover-image-fit`}`,src:d,alt:"cover"})})]}),g&&typeof document<"u"&&(()=>{const m=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Ey,{prefix:l,images:x,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,onClose:()=>v(!1)}),m)})()]})},ky=`import { useEffect, useRef, useState, type MouseEvent } from 'react';
|
|
14568
14620
|
import { createPortal } from 'react-dom';
|
|
14569
14621
|
import { CommonComponentProps } from '../props';
|
|
14570
14622
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -15110,7 +15162,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15110
15162
|
</>
|
|
15111
15163
|
);
|
|
15112
15164
|
};
|
|
15113
|
-
`,Ay="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>'),si={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 Fy(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wy=qi.reduce((e,t)=>({...e,...Fy(t)}),{}),_y=qi.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const Hy=Ly(),Ny={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"}},...Wy,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:Ay,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",..._y},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,...aa({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,...aa({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,...aa({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:[Hy]}],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"}]}},Oy={element:Py,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:Ny,sourceCode:ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...qi.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},Dy=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:y,backgroundColor:g,imageGap:h,maxWidth:m,maxHeight:b,textTransition:E,title1Width:L,title2Width:C,title3Width:K,title1MarginLeft:W=0,title2MarginLeft:B=0,title3MarginLeft:A=0,titleRowMarginBottom:T=0,titleHeaderLayout:j="single-row",countCloseGap:w=0,closeIcon:P,closeIconMaxWidth:M,closeIconColor:X,closeIconHoverColor:k,contentMarginTop:q=0,iconMarginRight:V=0}=n,G=a.useCallback(ce=>$.scalingValue(ce,i??!1),[i]),ie=G(h??0),S=`${m}%`,R=`${b}%`,O=G(w),ae=G(q),se=G(V),I=pi("title1",ui(n,"title1"),i),de=pi("title2",ui(n,"title2"),i),F=pi("title3",ui(n,"title3"),i),te=pi("count",ui(n,"count"),i),Z=j==="mobile",ve=!i||!!s,Ae=!o&&(!i||!!s),he=a.useMemo(()=>rr(t,v),[t,v]),[pe,U]=a.useState(l),ee=he[pe],Y=ee==null?void 0:ee.entry,[Oe,$e]=a.useState(!1),[He,ue]=a.useState(null),[me,be]=a.useState(!1),[z,le]=a.useState(null),[ye,we]=a.useState(!1),[Pe,Ce]=a.useState(0),[_,ge]=a.useState(),[ne,H]=a.useState(),[Q,Fe]=a.useState(null),re=a.useRef(null),N=a.useRef(0),qe=a.useRef(0),Be=a.useRef(0),at=a.useRef(!1),et=a.useRef(null),ut=a.useRef(null),ke=a.useRef(null),Ie=a.useRef(null),oe=a.useRef(null),Te=a.useRef(null),Ee=a.useRef(null),De=a.useCallback(()=>{const ce=ut.current;if(!ce)return;const Ge=ce.closest(`.${e}-lightbox-content-area`);if(!Ge)return ce.getBoundingClientRect().width;const f=Array.from(Ge.children).reduce((D,J)=>!(J instanceof HTMLElement)||J.contains(ce)?D:D+J.getBoundingClientRect().width,0);return Ge.getBoundingClientRect().width-f},[e]),fe=a.useCallback(()=>{re.current&&(clearTimeout(re.current),re.current=null)},[]),Me=a.useCallback(ce=>{ce===N.current&&(le(null),we(!1))},[]),_e=a.useCallback(()=>{o||at.current||(at.current=!0,u==null||u(),$e(!1),et.current=setTimeout(()=>{p()},300))},[o,u,p]),Ke=a.useCallback(ce=>!!(ce.closest("[data-controls]")||ce.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:it,backdropStyle:Ye,mediaAreaStyle:xt,overlayContentStyle:ot,swipeHandlers:We,dismissAreaStyle:Ze}=Nc({enabled:Ae,onClose:_e,animMs:300,isBlockedTarget:Ke}),Ve=a.useCallback(ce=>{d&&bc(ce+1,c,!0)},[d,c]),st=a.useCallback(ce=>{if(ce)return ce.getBoundingClientRect().height},[]),pt=a.useCallback(ce=>{if(he.length===0)return;const Ge=(ce%he.length+he.length)%he.length;if(Ge===pe)return;const f=he[pe],D=he[Ge];N.current+=1;const J=N.current,Se=E==="fade"&&Bs(f==null?void 0:f.entry)!==Bs(D==null?void 0:D.entry),je=st(ke.current),Xe=Se?(()=>{const Lt=De();Yn.flushSync(()=>{Fe(D.entry)}),ke.current&&Lt&&(ke.current.style.width=`${Lt}px`);const en=st(ke.current);return ke.current&&(ke.current.style.width=""),{measuredIncomingTitlesHeight:en,incomingTitlesMeasureWidth:Lt}})():void 0,vt=Math.max(je??0,(Xe==null?void 0:Xe.measuredIncomingTitlesHeight)??0)||void 0;Ce(J),le(pe),we(!0),U(Ge),Ve(Ge),Be.current=Ge,Se?(fe(),vt&&ge(vt),Xe!=null&&Xe.incomingTitlesMeasureWidth&&H(Xe.incomingTitlesMeasureWidth),ue((f==null?void 0:f.entryIndex)??null),be(!0),qe.current=D.entryIndex,re.current=setTimeout(()=>{ue(null),be(!1),ge(void 0),H(void 0),Fe(null),re.current=null},400)):(fe(),ue(null),be(!1),ge(void 0),H(void 0),Fe(null),qe.current=D.entryIndex)},[pe,fe,De,st,he,Ve,E]),ct=a.useCallback(()=>{Ee.current=null},[]),Et=a.useCallback(ce=>{!ve||he.length<=1||ce.pointerType==="mouse"&&ce.button!==0||ce.target.closest("[data-controls]")||(Ee.current={startX:ce.clientX,startY:ce.clientY,pointerId:ce.pointerId})},[ve,he.length]),zt=a.useCallback(ce=>{var Lt;if(!ve||he.length<=1||ce.pointerType==="mouse"&&ce.button!==0)return;if(it){ct();return}const Ge=Ee.current;if(!Ge||Ge.pointerId!==ce.pointerId||(ct(),ce.target.closest("[data-controls]")))return;const D=ce.clientX-Ge.startX,J=ce.clientY-Ge.startY,Se=Math.abs(D),je=Math.abs(J);if(Se>=Zg&&Se>je){pt(D>0?pe-1:pe+1);return}if(Se>Os||je>Os)return;const Xe=(Lt=Ie.current)==null?void 0:Lt.getBoundingClientRect(),vt=Xe?Xe.left+Xe.width/2:window.innerWidth/2;pt(ce.clientX<vt?pe-1:pe+1)},[pe,ve,pt,it,ct,he.length]),Xt=a.useCallback(ce=>{const Ge=Ee.current;(Ge==null?void 0:Ge.pointerId)===ce.pointerId&&ct()},[ct]);Oc(),a.useEffect(()=>{Te.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const ce=requestAnimationFrame(()=>{$e(!0),requestAnimationFrame(()=>{oe.current?oe.current.focus():Ie.current&&Ie.current.focus()})});return()=>{cancelAnimationFrame(ce),et.current&&clearTimeout(et.current),re.current&&clearTimeout(re.current);const Ge=Te.current;Ge&&document.contains(Ge)&&Ge.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var ce;E!=="fade"&&(qe.current=((ce=he[pe])==null?void 0:ce.entryIndex)??0,fe(),ue(null),be(!1),ge(void 0),H(void 0))},[pe,fe,he,E]),a.useEffect(()=>{const ce=Ge=>{if(Ge.key==="Escape"){_e();return}if(Ge.key==="ArrowLeft"&&he.length>1){pt(pe-1);return}if(Ge.key==="ArrowRight"&&he.length>1){pt(pe+1);return}if(Ge.key==="Tab"&&Ie.current){const f=Ie.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),D=Array.from(f).filter(Xe=>!Xe.closest('[aria-hidden="true"]'));if(D.length===0)return;const J=D[0],Se=D[D.length-1],je=document.activeElement;Ge.shiftKey?(je===J||!Ie.current.contains(je))&&(Ge.preventDefault(),Se.focus()):(je===Se||!Ie.current.contains(je))&&(Ge.preventDefault(),J.focus())}};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[pt,_e,pe,he.length]),a.useLayoutEffect(()=>{fe(),N.current=0,Ce(0),le(null),we(!1),ue(null),be(!1),ge(void 0),H(void 0),Fe(null),U(ce=>{const Ge=Math.max(0,he.length-1);return Math.min(ce,Ge)})},[fe,t.length,v,he.length]),a.useLayoutEffect(()=>{var f;const ce=Math.max(0,he.length-1),Ge=Math.min(Math.max(0,l),ce);Be.current=Ge,qe.current=((f=he[Ge])==null?void 0:f.entryIndex)??0,U(Ge)},[l]);const yt=He!==null?t[He]:null,bt=z!==null?he[z]:null,Nt=(Y==null?void 0:Y.title1)||(Y==null?void 0:Y.title2)||(Y==null?void 0:Y.title3)||(yt==null?void 0:yt.title1)||(yt==null?void 0:yt.title2)||(yt==null?void 0:yt.title3),At=rh(v,he,t),wt=P!==null,Ot=Nt||At||wt,Ut=At&&wt?{gap:O}:void 0,Zt=`${e}-titles-stack${Z?` ${e}-titles-stack-stacked`:""}`,tn=`${e}-titles-layer-out${Z?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Bt=(W??0)>0||o,cn=G(T),mt=a.useMemo(()=>({title1Width:L??Fi.title1Width,title2Width:C??Fi.title2Width,title3Width:K??Fi.title3Width}),[L,C,K]),Le=a.useMemo(()=>({title2MarginLeft:B,title3MarginLeft:A}),[B,A]),ze=a.useMemo(()=>Y?Vn(e,Y,I,de,F):[],[e,Y,I,de,F]),tt=a.useMemo(()=>ze.map(ce=>mt[ce.widthKey]),[ze,mt]),gt=a.useMemo(()=>Di(ze.length,tt),[ze.length,tt]),ht=a.useMemo(()=>wo(ze.length,tt),[ze.length,tt]),Rt=a.useMemo(()=>ze.filter(ce=>ce.prefix==="title1"),[ze]),dt=a.useMemo(()=>ze.filter(ce=>ce.prefix==="title2"||ce.prefix==="title3"),[ze]),Dt=a.useMemo(()=>Gn(Rt,mt),[Rt,mt]),kt=a.useMemo(()=>Gn(dt,mt),[dt,mt]),Pt=a.useCallback((ce,Ge)=>{const f=ze.findIndex(J=>J.prefix===ce.prefix);if(!Z||Ge==="single-row")return{effectiveWidth:ht[f]??0,resolvedWidth:gt[f]??0,maxWidth:sn(f,gt)};if(Ge==="two-row-top"){const J=Rt.findIndex(Se=>Se.prefix===ce.prefix);return{effectiveWidth:Dt.effective[J]??0,resolvedWidth:Dt.resolved[J]??0,maxWidth:sn(J,Dt.resolved)}}const D=dt.findIndex(J=>J.prefix===ce.prefix);return{effectiveWidth:kt.effective[D]??0,resolvedWidth:kt.resolved[D]??0,maxWidth:sn(D,kt.resolved)}},[ze,dt,kt,ht,gt,Rt,Dt,Z]),Vt=a.useCallback(ce=>Cc(ze,gt,Le,ce)+(Z?0:W??0),[ze,gt,Le,Z,W]),Gt=a.useCallback(()=>Z?0:W??0,[Z,W]),Wt=a.useCallback(ce=>dt.slice(0,ce).reduce((Ge,f,D)=>Ge+(f.marginLeftKey?Le[f.marginLeftKey]??0:0)+(kt.resolved[D]??0),0),[dt,kt.resolved,Le]),_t=a.useCallback(ce=>{const Ge=dt[ce];return Wt(ce)+(Ge.marginLeftKey?Le[Ge.marginLeftKey]??0:0)+(kt.resolved[ce]??0)},[dt,kt.resolved,Wt,Le]),Ft=a.useCallback((ce,Ge,f)=>{if(!Z||f==="single-row"){const Xe=ce.findIndex(Jt=>Jt.prefix===Ge.prefix),vt=ce.map(Jt=>mt[Jt.widthKey]),Lt=Di(ce.length,vt);return{effectiveWidth:wo(ce.length,vt)[Xe]??0,resolvedWidth:Lt[Xe]??0,maxWidth:sn(Xe,Lt)}}if(f==="two-row-top"){const Xe=ce.filter(Jt=>Jt.prefix==="title1"),vt=Xe.findIndex(Jt=>Jt.prefix===Ge.prefix),{resolved:Lt,effective:en}=Gn(Xe,mt);return{effectiveWidth:en[vt]??0,resolvedWidth:Lt[vt]??0,maxWidth:sn(vt,Lt)}}const D=ce.filter(Xe=>Xe.prefix==="title2"||Xe.prefix==="title3"),J=D.findIndex(Xe=>Xe.prefix===Ge.prefix),{resolved:Se,effective:je}=Gn(D,mt);return{effectiveWidth:je[J]??0,resolvedWidth:Se[J]??0,maxWidth:sn(J,Se)}},[mt,Z]),St=(ce,Ge,f)=>{const D=ce.marginLeftKey?Le[ce.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Se,maxWidth:je}=f??Pt(ce,Ge),Xe=Math.max(D,Bn),vt=o&&Ge==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":ce.prefix,style:{width:G(J),...D>0?{marginLeft:G(D)}:{}},children:[r.jsx("p",{className:ce.className,style:ce.style,children:ce.text}),vt&&ce.marginLeftKey?r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se),style:{position:"absolute",top:0,left:G(-D),width:G(Xe),height:"100%",pointerEvents:"auto"}}):null,vt?r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(je),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:G(-gn/2),width:G(gn),height:"100%",pointerEvents:"auto"}}):null]},ce.className)},x=(ce="two-row")=>{const Ge=ze.findIndex(J=>J.prefix==="title1"),f=Ge>=0?gt[Ge]:mt.title1Width,D=ce==="two-row"&&o;return r.jsx("div",{...D?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f)}:{},style:{width:G(W??0),flexShrink:0,alignSelf:"stretch",...D?{pointerEvents:"auto"}:{}}})},xe=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:I,"aria-hidden":"true",children:" "}),Re=()=>r.jsx("span",{className:`${e}-entry-counter`,style:te,"aria-live":"polite","aria-atomic":"true",children:oh(he,pe,v,t)}),Ne=()=>At?o&&wt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Re(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Yr(O)} + ${O}))`,width:Yr(O),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Re():null,nt=()=>!At&&!wt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Ut,children:[Ne(),wt?ft():null]}),Mt=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Nt?xe():null,Bt?x("single-row"):null,Tt(Y),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),nt(),Sn()]}),Je=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[At||Nt?xe():null,Bt?x("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:me&&_?{minHeight:_}:void 0,children:[r.jsx("div",{ref:ke,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(Q||Y)}),r.jsxs("div",{ref:ut,className:Zt,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%",...me&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[yt&&me?r.jsx("div",{className:`${tn} ${e}-titles-fade-out`,children:ti(yt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Y)})]})]}),nt(),Sn()]}),ft=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(M??0,i),height:$.scalingValue(M??0,i),marginRight:se,"--close-icon-hover-color":k},children:[r.jsx("button",{ref:oe,type:"button",className:`${e}-close-icon-inner`,onClick:_e,"aria-label":"Close",children:r.jsx(rn,{url:P??"",fill:X,hoverFill:i&&!s?X:k,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:se,height:"100%",pointerEvents:"auto"}})]}),Ht=(ce,Ge)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[At||Nt?xe():null,Bt?x("two-row"):null,Ge!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Ge},children:ce}):r.jsxs(r.Fragment,{children:[ce,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),nt()]}),Tt=ce=>{if(!ce)return null;const Ge=Vn(e,ce,I,de,F);return r.jsx(r.Fragment,{children:Ge.map(f=>St(f,"single-row",Ft(Ge,f,"single-row")))})},nn=ce=>{if(!ce)return null;const Ge=Vn(e,ce,I,de,F),f=Ge.find(D=>D.prefix==="title1");return f?St(f,"two-row-top",Ft(Ge,f,"two-row-top")):null},dn=(ce,Ge=!1)=>{const f=ce?Vn(e,ce,I,de,F):[],D=f.filter(je=>je.prefix==="title2"||je.prefix==="title3"),J=o&&Ge;return D.length>0||J||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[D.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[D.map(je=>St(je,"two-row-bottom",Ft(f,je,"two-row-bottom"))),Ge&&o?r.jsxs(r.Fragment,{children:[Wr(),_r()]}):null]}):null,(T??0)>0||J?r.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},ei=(ce,Ge=!1)=>r.jsxs(r.Fragment,{children:[Ht(nn(ce)),dn(ce,Ge)]}),ti=ce=>Z?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(ce)}):ce?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(ce)}):null,Fo=()=>{const ce=Z?-1:ze.findIndex(D=>D.prefix==="title1"),Ge=!Z&&(o||(W??0)>0)?(()=>{const D=W??0,J=ce>=0?gt[ce]:mt.title1Width,Se=Math.max(D,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:G(Se),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,f=ze.flatMap((D,J)=>{if(!D.marginLeftKey)return[];const Se=Le[D.marginLeftKey]??0,je=$c(ze,gt,Le,J)+Gt(),Xe=Math.max(Se,Bn);return r.jsx("div",{"data-controls":D.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(gt[J]),style:{position:"absolute",top:0,left:G(je),width:G(Xe),height:"100%",pointerEvents:"auto"}},D.marginLeftKey)});return Ge?[Ge,...f]:f},Wo=()=>ze.map((ce,Ge)=>{const f=sn(Ge,gt),J=Vt(Ge)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(J),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Wr=()=>dt.flatMap((ce,Ge)=>{if(!ce.marginLeftKey)return[];const f=Le[ce.marginLeftKey]??0,D=Wt(Ge),J=Math.max(f,Bn),{resolvedWidth:Se}=Pt(ce,"two-row-bottom");return r.jsx("div",{"data-controls":ce.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Se),style:{position:"absolute",top:0,left:G(D),width:G(J),height:"100%",pointerEvents:"auto"}},ce.marginLeftKey)}),_r=()=>dt.map((ce,Ge)=>{const{maxWidth:f}=Pt(ce,"two-row-bottom"),J=_t(Ge)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":ce.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:G(J),width:G(gn),height:"100%",pointerEvents:"auto"}})},`${ce.widthKey}-junction`)}),Sn=()=>!o||Z?null:r.jsxs(r.Fragment,{children:[Fo(),Wo()]}),xi=ce=>{const Ge=!ce.objectFit&&Fn(y);return{className:`${e}-slide-image-cell${Ge?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:S,maxHeight:R,...Ge?{"--image-aspect-ratio":Ar(y)}:{}}}},_o=ce=>ce.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":ce.objectFit}}:Fn(y)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=ce=>{if(ce.length===0)return null;const Ge=ce.length>1,f=Yr(ie),D=`calc(-0.5 * (${f} + ${ie}))`;if(ce.length===1){const J=ce[0];return r.jsx("div",{...xi(J),children:r.jsx("img",{..._o(J),src:J.url,alt:J.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Ge?{gap:ie}:void 0,children:ce.map((J,Se)=>r.jsxs("div",{...xi(J),children:[r.jsx("img",{..._o(J),src:J.url,alt:J.name??"",draggable:!1}),o&&Ge&&Se<ce.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:D,width:f,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${J.url}-${Se}`))})},Ho=!!(Y!=null&&Y.title2||Y!=null&&Y.title3||yt!=null&&yt.title2||yt!=null&&yt.title3||(T??0)>0||o),Hr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:ke,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(Q||Y)}),r.jsxs("div",{ref:ut,className:`${e}-titles-row-two-row`,style:{...me&&_?{minHeight:_}:void 0,...me&&ne?{width:ne,maxWidth:"100%"}:void 0},children:[Ht(r.jsxs("div",{className:Zt,style:{position:me?"absolute":"relative",inset:me?0:void 0,width:"100%"},children:[yt&&me?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(yt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Y)})]}),me&&_?_:void 0),Ho?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[yt&&me?r.jsx("div",{className:`${tn} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(yt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${me?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${Z?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Y,!0)})]}):null]})]}),Nr=()=>{const ce=Ho;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...ce?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:ce?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Y,!0)}),Sn()]})};return r.jsxs("div",{ref:Ie,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{it||_e()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:wt?void 0:-1,style:{opacity:Oe?1:0,transition:"opacity 300ms ease",pointerEvents:Oe?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ye}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Ze,...We,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:xt,onClick:ce=>ce.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":ve&&he.length>1?"true":"false",onPointerDown:ve?Et:void 0,onPointerUp:ve?zt:void 0,onPointerCancel:ve?Xt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&ye?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:ce=>{ce.target===ce.currentTarget&&Me(Pe)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(bt.images)})},`slide-out-${Pe}`):null,r.jsx("div",{className:`${e}-slide-layer-in${ye?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:ee?ni(ee.images):null})},`slide-in-${Pe}-${pe}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:ot,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:ae,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...Z?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${Z?` ${e}-lightbox-content-area-stacked`:""}`,children:Ot&&r.jsx("div",{className:`${e}-text-bar-cell${Z?` ${e}-text-bar-cell-stacked`:""}`,style:Z?void 0:{flex:1,minWidth:0,width:"100%"},children:Z?E==="fade"?Hr():Nr():E==="fade"?Je():Mt()})})})]})]})]})};function jy(e){return`
|
|
15165
|
+
`,Ay="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>'),si={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 Fy(e){const t={};return t[jt(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSettings")]={...si.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[jt(e,"fontSize")]={...si.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[jt(e,"lineHeight")]={...si.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[jt(e,"letterSpacing")]={...si.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[jt(e,"wordSpacing")]={...si.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[jt(e,"textAlign")]={...si.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[jt(e,"textAppearance")]={...si.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Wy=qi.reduce((e,t)=>({...e,...Fy(t)}),{}),_y=qi.reduce((e,t)=>({...e,[jt(t,"fontFamily")]:"Goudy Bookletter 1911",[jt(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[jt(t,"letterSpacing")]:0,[jt(t,"wordSpacing")]:0,[jt(t,"textAlign")]:"left",[jt(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function aa(e){return qi.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[jt(n,"fontSize")]=i),o!==void 0&&(t[jt(n,"lineHeight")]=o),t},{})}const Hy=Ly(),Ny={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"}},...Wy,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:Ay,thumbnailObjectFit:{display:"fit",ratioValue:"16:9",reversed:!1},thumbnailTrigger:"click",thumbnailActive:"color",..._y},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,...aa({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,...aa({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,...aa({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:[Hy]}],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"}]}},Oy={element:Py,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:Ny,sourceCode:ky,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...qi.map(e=>({path:`${jt(e,"fontFamily")}`}))]},fontRelations:{...qi.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${jt(t,"fontFamily")}`}),{})}},Dy=({prefix:e,entries:t,settings:n,isEditor:i,isEditMode:o,isPreviewMode:s,initialSlideIndex:l=0,enableUrlSync:d=!1,journalItemId:c=null,onBeforeClose:u,onClose:p})=>{const{type:v,coverFit:x,backgroundColor:g,imageGap:h,maxWidth:m,maxHeight:b,textTransition:I,title1Width:C,title2Width:R,title3Width:K,title1MarginLeft:F=0,title2MarginLeft:V=0,title3MarginLeft:A=0,titleRowMarginBottom:T=0,titleHeaderLayout:j="single-row",countCloseGap:y=0,closeIcon:W,closeIconMaxWidth:M,closeIconColor:Y,closeIconHoverColor:P,contentMarginTop:U=0,iconMarginRight:z=0}=n,B=a.useCallback(de=>$.scalingValue(de,i??!1),[i]),te=B(h??0),S=`${m}%`,E=`${b}%`,D=B(y),se=B(U),oe=B(z),L=pi("title1",ui(n,"title1"),i),ue=pi("title2",ui(n,"title2"),i),k=pi("title3",ui(n,"title3"),i),ne=pi("count",ui(n,"count"),i),X=j==="mobile",be=!i||!!s,Ae=!o&&(!i||!!s),fe=a.useMemo(()=>rr(t,v),[t,v]),[le,q]=a.useState(l),Q=fe[le],Z=Q==null?void 0:Q.entry,[Ne,Te]=a.useState(!1),[We,ce]=a.useState(null),[ye,$e]=a.useState(!1),[G,re]=a.useState(null),[pe,Se]=a.useState(!1),[Pe,Re]=a.useState(0),[H,ge]=a.useState(),[ie,_]=a.useState(),[ee,Fe]=a.useState(null),ae=a.useRef(null),N=a.useRef(0),qe=a.useRef(0),je=a.useRef(0),st=a.useRef(!1),et=a.useRef(null),pt=a.useRef(null),rt=a.useRef(null),Ve=a.useRef(null),xe=a.useRef(null),me=a.useRef(null),he=a.useRef(null),He=a.useCallback(()=>{const de=pt.current;if(!de)return;const Be=de.closest(`.${e}-lightbox-content-area`);if(!Be)return de.getBoundingClientRect().width;const f=Array.from(Be.children).reduce((O,J)=>!(J instanceof HTMLElement)||J.contains(de)?O:O+J.getBoundingClientRect().width,0);return Be.getBoundingClientRect().width-f},[e]),ve=a.useCallback(()=>{ae.current&&(clearTimeout(ae.current),ae.current=null)},[]),Ee=a.useCallback(de=>{de===N.current&&(re(null),Se(!1))},[]),Me=a.useCallback(()=>{o||st.current||(st.current=!0,u==null||u(),Te(!1),et.current=setTimeout(()=>{p()},300))},[o,u,p]),Ge=a.useCallback(de=>!!(de.closest("[data-controls]")||de.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ze,backdropStyle:Ue,mediaAreaStyle:lt,overlayContentStyle:tt,swipeHandlers:ke,dismissAreaStyle:Xe}=Hc({enabled:Ae,onClose:Me,animMs:300,isBlockedTarget:Ge}),Oe=a.useCallback(de=>{d&&xc(de+1,c,!0)},[d,c]),ot=a.useCallback(de=>{if(de)return de.getBoundingClientRect().height},[]),ct=a.useCallback(de=>{if(fe.length===0)return;const Be=(de%fe.length+fe.length)%fe.length;if(Be===le)return;const f=fe[le],O=fe[Be];N.current+=1;const J=N.current,Ce=I==="fade"&&zs(f==null?void 0:f.entry)!==zs(O==null?void 0:O.entry),De=ot(rt.current),Ye=Ce?(()=>{const Lt=He();Yn.flushSync(()=>{Fe(O.entry)}),rt.current&&Lt&&(rt.current.style.width=`${Lt}px`);const tn=ot(rt.current);return rt.current&&(rt.current.style.width=""),{measuredIncomingTitlesHeight:tn,incomingTitlesMeasureWidth:Lt}})():void 0,wt=Math.max(De??0,(Ye==null?void 0:Ye.measuredIncomingTitlesHeight)??0)||void 0;Re(J),re(le),Se(!0),q(Be),Oe(Be),je.current=Be,Ce?(ve(),wt&&ge(wt),Ye!=null&&Ye.incomingTitlesMeasureWidth&&_(Ye.incomingTitlesMeasureWidth),ce((f==null?void 0:f.entryIndex)??null),$e(!0),qe.current=O.entryIndex,ae.current=setTimeout(()=>{ce(null),$e(!1),ge(void 0),_(void 0),Fe(null),ae.current=null},400)):(ve(),ce(null),$e(!1),ge(void 0),_(void 0),Fe(null),qe.current=O.entryIndex)},[le,ve,He,ot,fe,Oe,I]),mt=a.useCallback(()=>{he.current=null},[]),Mt=a.useCallback(de=>{!be||fe.length<=1||de.pointerType==="mouse"&&de.button!==0||de.target.closest("[data-controls]")||(he.current={startX:de.clientX,startY:de.clientY,pointerId:de.pointerId})},[be,fe.length]),Ut=a.useCallback(de=>{var Lt;if(!be||fe.length<=1||de.pointerType==="mouse"&&de.button!==0)return;if(Ze){mt();return}const Be=he.current;if(!Be||Be.pointerId!==de.pointerId||(mt(),de.target.closest("[data-controls]")))return;const O=de.clientX-Be.startX,J=de.clientY-Be.startY,Ce=Math.abs(O),De=Math.abs(J);if(Ce>=Zg&&Ce>De){ct(O>0?le-1:le+1);return}if(Ce>Ns||De>Ns)return;const Ye=(Lt=Ve.current)==null?void 0:Lt.getBoundingClientRect(),wt=Ye?Ye.left+Ye.width/2:window.innerWidth/2;ct(de.clientX<wt?le-1:le+1)},[le,be,ct,Ze,mt,fe.length]),Yt=a.useCallback(de=>{const Be=he.current;(Be==null?void 0:Be.pointerId)===de.pointerId&&mt()},[mt]);Nc(),a.useEffect(()=>{me.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const de=requestAnimationFrame(()=>{Te(!0),requestAnimationFrame(()=>{xe.current?xe.current.focus():Ve.current&&Ve.current.focus()})});return()=>{cancelAnimationFrame(de),et.current&&clearTimeout(et.current),ae.current&&clearTimeout(ae.current);const Be=me.current;Be&&document.contains(Be)&&Be.focus({preventScroll:!0})}},[]),a.useEffect(()=>{var de;I!=="fade"&&(qe.current=((de=fe[le])==null?void 0:de.entryIndex)??0,ve(),ce(null),$e(!1),ge(void 0),_(void 0))},[le,ve,fe,I]),a.useEffect(()=>{const de=Be=>{if(Be.key==="Escape"){Me();return}if(Be.key==="ArrowLeft"&&fe.length>1){ct(le-1);return}if(Be.key==="ArrowRight"&&fe.length>1){ct(le+1);return}if(Be.key==="Tab"&&Ve.current){const f=Ve.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),O=Array.from(f).filter(Ye=>!Ye.closest('[aria-hidden="true"]'));if(O.length===0)return;const J=O[0],Ce=O[O.length-1],De=document.activeElement;Be.shiftKey?(De===J||!Ve.current.contains(De))&&(Be.preventDefault(),Ce.focus()):(De===Ce||!Ve.current.contains(De))&&(Be.preventDefault(),J.focus())}};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[ct,Me,le,fe.length]),a.useLayoutEffect(()=>{ve(),N.current=0,Re(0),re(null),Se(!1),ce(null),$e(!1),ge(void 0),_(void 0),Fe(null),q(de=>{const Be=Math.max(0,fe.length-1);return Math.min(de,Be)})},[ve,t.length,v,fe.length]),a.useLayoutEffect(()=>{var f;const de=Math.max(0,fe.length-1),Be=Math.min(Math.max(0,l),de);je.current=Be,qe.current=((f=fe[Be])==null?void 0:f.entryIndex)??0,q(Be)},[l]);const xt=We!==null?t[We]:null,bt=G!==null?fe[G]:null,_t=(Z==null?void 0:Z.title1)||(Z==null?void 0:Z.title2)||(Z==null?void 0:Z.title3)||(xt==null?void 0:xt.title1)||(xt==null?void 0:xt.title2)||(xt==null?void 0:xt.title3),kt=rh(v,fe,t),vt=W!==null,Ft=_t||kt||vt,zt=kt&&vt?{gap:D}:void 0,Zt=`${e}-titles-stack${X?` ${e}-titles-stack-stacked`:""}`,en=`${e}-titles-layer-out${X?` ${e}-titles-layer-out-stacked`:""}`,Ct=`${e}-titles-layer-out`,Bt=(F??0)>0||o,cn=B(T),gt=a.useMemo(()=>({title1Width:C??Fi.title1Width,title2Width:R??Fi.title2Width,title3Width:K??Fi.title3Width}),[C,R,K]),Le=a.useMemo(()=>({title2MarginLeft:V,title3MarginLeft:A}),[V,A]),ze=a.useMemo(()=>Z?Vn(e,Z,L,ue,k):[],[e,Z,L,ue,k]),nt=a.useMemo(()=>ze.map(de=>gt[de.widthKey]),[ze,gt]),ht=a.useMemo(()=>Di(ze.length,nt),[ze.length,nt]),ft=a.useMemo(()=>wo(ze.length,nt),[ze.length,nt]),Rt=a.useMemo(()=>ze.filter(de=>de.prefix==="title1"),[ze]),ut=a.useMemo(()=>ze.filter(de=>de.prefix==="title2"||de.prefix==="title3"),[ze]),Dt=a.useMemo(()=>Gn(Rt,gt),[Rt,gt]),At=a.useMemo(()=>Gn(ut,gt),[ut,gt]),Pt=a.useCallback((de,Be)=>{const f=ze.findIndex(J=>J.prefix===de.prefix);if(!X||Be==="single-row")return{effectiveWidth:ft[f]??0,resolvedWidth:ht[f]??0,maxWidth:sn(f,ht)};if(Be==="two-row-top"){const J=Rt.findIndex(Ce=>Ce.prefix===de.prefix);return{effectiveWidth:Dt.effective[J]??0,resolvedWidth:Dt.resolved[J]??0,maxWidth:sn(J,Dt.resolved)}}const O=ut.findIndex(J=>J.prefix===de.prefix);return{effectiveWidth:At.effective[O]??0,resolvedWidth:At.resolved[O]??0,maxWidth:sn(O,At.resolved)}},[ze,ut,At,ft,ht,Rt,Dt,X]),Vt=a.useCallback(de=>$c(ze,ht,Le,de)+(X?0:F??0),[ze,ht,Le,X,F]),Gt=a.useCallback(()=>X?0:F??0,[X,F]),Ht=a.useCallback(de=>ut.slice(0,de).reduce((Be,f,O)=>Be+(f.marginLeftKey?Le[f.marginLeftKey]??0:0)+(At.resolved[O]??0),0),[ut,At.resolved,Le]),Nt=a.useCallback(de=>{const Be=ut[de];return Ht(de)+(Be.marginLeftKey?Le[Be.marginLeftKey]??0:0)+(At.resolved[de]??0)},[ut,At.resolved,Ht,Le]),Wt=a.useCallback((de,Be,f)=>{if(!X||f==="single-row"){const Ye=de.findIndex(Jt=>Jt.prefix===Be.prefix),wt=de.map(Jt=>gt[Jt.widthKey]),Lt=Di(de.length,wt);return{effectiveWidth:wo(de.length,wt)[Ye]??0,resolvedWidth:Lt[Ye]??0,maxWidth:sn(Ye,Lt)}}if(f==="two-row-top"){const Ye=de.filter(Jt=>Jt.prefix==="title1"),wt=Ye.findIndex(Jt=>Jt.prefix===Be.prefix),{resolved:Lt,effective:tn}=Gn(Ye,gt);return{effectiveWidth:tn[wt]??0,resolvedWidth:Lt[wt]??0,maxWidth:sn(wt,Lt)}}const O=de.filter(Ye=>Ye.prefix==="title2"||Ye.prefix==="title3"),J=O.findIndex(Ye=>Ye.prefix===Be.prefix),{resolved:Ce,effective:De}=Gn(O,gt);return{effectiveWidth:De[J]??0,resolvedWidth:Ce[J]??0,maxWidth:sn(J,Ce)}},[gt,X]),St=(de,Be,f)=>{const O=de.marginLeftKey?Le[de.marginLeftKey]??0:0,{effectiveWidth:J,resolvedWidth:Ce,maxWidth:De}=f??Pt(de,Be),Ye=Math.max(O,Bn),wt=o&&Be==="two-row-top";return r.jsxs("div",{className:`${e}-title-cell`,"data-title":de.prefix,style:{width:B(J),...O>0?{marginLeft:B(O)}:{}},children:[r.jsx("p",{className:de.className,style:de.style,children:de.text}),wt&&de.marginLeftKey?r.jsx("div",{"data-controls":de.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:B(-O),width:B(Ye),height:"100%",pointerEvents:"auto"}}):null,wt?r.jsx("div",{"data-controls":de.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,right:B(-gn/2),width:B(gn),height:"100%",pointerEvents:"auto"}}):null]},de.className)},w=(de="two-row")=>{const Be=ze.findIndex(J=>J.prefix==="title1"),f=Be>=0?ht[Be]:gt.title1Width,O=de==="two-row"&&o;return r.jsx("div",{...O?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f)}:{},style:{width:B(F??0),flexShrink:0,alignSelf:"stretch",...O?{pointerEvents:"auto"}:{}}})},we=()=>r.jsx("span",{className:`${e}-titles-baseline-strut`,style:L,"aria-hidden":"true",children:" "}),Ie=()=>r.jsx("span",{className:`${e}-entry-counter`,style:ne,"aria-live":"polite","aria-atomic":"true",children:oh(fe,le,v,t)}),_e=()=>kt?o&&vt?r.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[Ie(),r.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${Yr(D)} + ${D}))`,width:Yr(D),height:"100%",pointerEvents:"auto",zIndex:3}})]}):Ie():null,it=()=>!kt&&!vt?null:r.jsxs("div",{className:`${e}-titles-row-header-controls`,style:zt,children:[_e(),vt?yt():null]}),Et=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[kt||_t?we():null,Bt?w("single-row"):null,Tt(Z),r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),it(),Sn()]}),Je=()=>r.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[kt||_t?we():null,Bt?w("single-row"):null,r.jsxs("div",{className:`${e}-titles-row-titles`,style:ye&&H?{minHeight:H}:void 0,children:[r.jsx("div",{ref:rt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ti(ee||Z)}),r.jsxs("div",{ref:pt,className:Zt,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%",...ye&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[xt&&ye?r.jsx("div",{className:`${en} ${e}-titles-fade-out`,children:ti(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:ti(Z)})]})]}),it(),Sn()]}),yt=()=>r.jsxs("div",{className:`${e}-close-icon`,style:{width:$.scalingValue(M??0,i),height:$.scalingValue(M??0,i),marginRight:oe,"--close-icon-hover-color":P},children:[r.jsx("button",{ref:xe,type:"button",className:`${e}-close-icon-inner`,onClick:Me,"aria-label":"Close",children:r.jsx(rn,{url:W??"",fill:Y,hoverFill:i&&!s?Y:P,className:`${e}-close-icon-img`})}),o&&r.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:oe,height:"100%",pointerEvents:"auto"}})]}),Ot=(de,Be)=>r.jsxs("div",{className:`${e}-titles-row-top`,children:[kt||_t?we():null,Bt?w("two-row"):null,Be!==void 0?r.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:Be},children:de}):r.jsxs(r.Fragment,{children:[de,r.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),it()]}),Tt=de=>{if(!de)return null;const Be=Vn(e,de,L,ue,k);return r.jsx(r.Fragment,{children:Be.map(f=>St(f,"single-row",Wt(Be,f,"single-row")))})},nn=de=>{if(!de)return null;const Be=Vn(e,de,L,ue,k),f=Be.find(O=>O.prefix==="title1");return f?St(f,"two-row-top",Wt(Be,f,"two-row-top")):null},dn=(de,Be=!1)=>{const f=de?Vn(e,de,L,ue,k):[],O=f.filter(De=>De.prefix==="title2"||De.prefix==="title3"),J=o&&Be;return O.length>0||J||(T??0)>0?r.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[O.length>0?r.jsxs("div",{className:`${e}-titles-row-bottom`,children:[O.map(De=>St(De,"two-row-bottom",Wt(f,De,"two-row-bottom"))),Be&&o?r.jsxs(r.Fragment,{children:[Wr(),_r()]}):null]}):null,(T??0)>0||J?r.jsx("div",{"data-controls":J?"titleRowMarginBottom":void 0,"data-controls-axis":J?"y":void 0,"data-controls-reverse":J?"":void 0,className:J?`${e}-control`:void 0,style:{height:cn,width:"100%",flexShrink:0,pointerEvents:J?"auto":"none"}}):null]}):null},ei=(de,Be=!1)=>r.jsxs(r.Fragment,{children:[Ot(nn(de)),dn(de,Be)]}),ti=de=>X?r.jsx("div",{className:`${e}-titles-row-two-row`,children:ei(de)}):de?r.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:Tt(de)}):null,Fo=()=>{const de=X?-1:ze.findIndex(O=>O.prefix==="title1"),Be=!X&&(o||(F??0)>0)?(()=>{const O=F??0,J=de>=0?ht[de]:gt.title1Width,Ce=Math.max(O,Bn);return r.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(J),style:{position:"absolute",top:0,left:0,width:B(Ce),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,f=ze.flatMap((O,J)=>{if(!O.marginLeftKey)return[];const Ce=Le[O.marginLeftKey]??0,De=Sc(ze,ht,Le,J)+Gt(),Ye=Math.max(Ce,Bn);return r.jsx("div",{"data-controls":O.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(ht[J]),style:{position:"absolute",top:0,left:B(De),width:B(Ye),height:"100%",pointerEvents:"auto"}},O.marginLeftKey)});return Be?[Be,...f]:f},Wo=()=>ze.map((de,Be)=>{const f=sn(Be,ht),J=Vt(Be)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":de.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(J),width:B(gn),height:"100%",pointerEvents:"auto"}})},`${de.widthKey}-junction`)}),Wr=()=>ut.flatMap((de,Be)=>{if(!de.marginLeftKey)return[];const f=Le[de.marginLeftKey]??0,O=Ht(Be),J=Math.max(f,Bn),{resolvedWidth:Ce}=Pt(de,"two-row-bottom");return r.jsx("div",{"data-controls":de.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(Ce),style:{position:"absolute",top:0,left:B(O),width:B(J),height:"100%",pointerEvents:"auto"}},de.marginLeftKey)}),_r=()=>ut.map((de,Be)=>{const{maxWidth:f}=Pt(de,"two-row-bottom"),J=Nt(Be)-gn/2;return r.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:r.jsx("div",{"data-controls":de.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(f),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:B(J),width:B(gn),height:"100%",pointerEvents:"auto"}})},`${de.widthKey}-junction`)}),Sn=()=>!o||X?null:r.jsxs(r.Fragment,{children:[Fo(),Wo()]}),xi=de=>{const Be=!de.objectFit&&Fn(x);return{className:`${e}-slide-image-cell${Be?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:S,maxHeight:E,...Be?{"--image-aspect-ratio":Ar(x)}:{}}}},_o=de=>de.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":de.objectFit}}:Fn(x)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},ni=de=>{if(de.length===0)return null;const Be=de.length>1,f=Yr(te),O=`calc(-0.5 * (${f} + ${te}))`;if(de.length===1){const J=de[0];return r.jsx("div",{...xi(J),children:r.jsx("img",{..._o(J),src:J.url,alt:J.name??"",draggable:!1})})}return r.jsx("div",{className:`${e}-slide-inner`,style:Be?{gap:te}:void 0,children:de.map((J,Ce)=>r.jsxs("div",{...xi(J),children:[r.jsx("img",{..._o(J),src:J.url,alt:J.name??"",draggable:!1}),o&&Be&&Ce<de.length-1&&r.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:O,width:f,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${J.url}-${Ce}`))})},Ho=!!(Z!=null&&Z.title2||Z!=null&&Z.title3||xt!=null&&xt.title2||xt!=null&&xt.title3||(T??0)>0||o),Hr=()=>r.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[r.jsx("div",{ref:rt,className:Zt,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:ei(ee||Z)}),r.jsxs("div",{ref:pt,className:`${e}-titles-row-two-row`,style:{...ye&&H?{minHeight:H}:void 0,...ye&&ie?{width:ie,maxWidth:"100%"}:void 0},children:[Ot(r.jsxs("div",{className:Zt,style:{position:ye?"absolute":"relative",inset:ye?0:void 0,width:"100%"},children:[xt&&ye?r.jsx("div",{className:`${Ct} ${e}-titles-fade-out`,children:nn(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:nn(Z)})]}),ye&&H?H:void 0),Ho?r.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[xt&&ye?r.jsx("div",{className:`${en} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:dn(xt)}):null,r.jsx("div",{className:`${e}-titles-layer-in${ye?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${X?` ${e}-titles-layer-in-stacked`:""}`,children:dn(Z,!0)})]}):null]})]}),Nr=()=>{const de=Ho;return r.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...de?{flex:1,height:"100%"}:{}},children:[r.jsx("div",{className:`${e}-titles-row-two-row`,style:de?void 0:{flex:"0 0 auto",height:"auto"},children:ei(Z,!0)}),Sn()]})};return r.jsxs("div",{ref:Ve,"data-selection":"none",className:`${e}-lightbox${i?` ${e}-lightbox-editor`:""}${o?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ze||Me()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:vt?void 0:-1,style:{opacity:Ne?1:0,transition:"opacity 300ms ease",pointerEvents:Ne?"auto":"none"},children:[r.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:g,...Ue}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Xe,...ke,children:[r.jsx("div",{className:`${e}-lightbox-content`,style:lt,onClick:de=>de.stopPropagation(),children:r.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":be&&fe.length>1?"true":"false",onPointerDown:be?Mt:void 0,onPointerUp:be?Ut:void 0,onPointerCancel:be?Yt:void 0,children:r.jsxs("div",{className:`${e}-slide-stack`,children:[bt&&pe?r.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:de=>{de.target===de.currentTarget&&Ee(Pe)},children:r.jsx("div",{className:`${e}-slide-area`,children:ni(bt.images)})},`slide-out-${Pe}`):null,r.jsx("div",{className:`${e}-slide-layer-in${pe?` ${e}-slide-fade-in`:""}`,children:r.jsx("div",{className:`${e}-slide-area`,children:Q?ni(Q.images):null})},`slide-in-${Pe}-${le}`)]})})}),r.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:tt,children:[r.jsx("div",{"data-controls":o?"contentMarginTop":void 0,className:o?`${e}-control`:void 0,style:{height:se,width:"100%"}}),r.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...X?{flex:1,minHeight:0}:{}},children:r.jsx("div",{className:`${e}-lightbox-content-area${X?` ${e}-lightbox-content-area-stacked`:""}`,children:Ft&&r.jsx("div",{className:`${e}-text-bar-cell${X?` ${e}-text-bar-cell-stacked`:""}`,style:X?void 0:{flex:1,minWidth:0,width:"100%"},children:X?I==="fade"?Hr():Nr():I==="fade"?Je():Et()})})})]})]})]})};function jy(e){return`
|
|
15114
15166
|
.${e}-wrapper {
|
|
15115
15167
|
position: relative;
|
|
15116
15168
|
width: 100%;
|
|
@@ -15632,7 +15684,7 @@ export const LightboxStrip = ({ settings, content, isEditor, isEditMode, isPrevi
|
|
|
15632
15684
|
pointer-events: auto;
|
|
15633
15685
|
z-index: 10;
|
|
15634
15686
|
}
|
|
15635
|
-
`}const zy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=$.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,
|
|
15687
|
+
`}const zy=({settings:e,content:t,isEditor:n,isEditMode:i,isPreviewMode:o,portalId:s,metadata:l})=>{const{prefix:d}=$.useScopedStyles(),c=(l==null?void 0:l.itemId)??null,{cover:u,coverFit:p,type:v}=e,x=a.useRef(null),[g,h]=a.useState(!1),[m,b]=a.useState(0),I=a.useRef(!1),C=a.useRef(!1),R=a.useRef(!1),K=a.useMemo(()=>(t??[]).filter(y=>Oi(y).length>0),[t]),F=g&&K.length>0,V=!n,A=a.useCallback(()=>{V&&(R.current=!0,Qg(C.current,c),C.current=!1)},[V,c]),T=(y=0)=>{if(K.length===0||n&&!i&&!o)return;const W=rr(K,v),M=Math.max(0,Math.min(y,W.length-1));if(b(M),V){const Y=bc();xc(M+1,c,Y),C.current=!Y}h(!0)},j=a.useCallback(()=>{h(!1),R.current=!1},[]);return a.useEffect(()=>{!n||i||o||h(!1)},[n,i,o]),a.useEffect(()=>{if(!V||I.current)return;I.current=!0;const y=Ds(c);if(!y)return;const W=js(y,rr(K,v).length);W<0||(b(W),h(!0))},[K,c,V,v]),a.useEffect(()=>{if(!V)return;const y=()=>{if(R.current){R.current=!1,h(!1);return}const W=Ds(c);if(!W){h(!1);return}const M=js(W,rr(K,v).length);if(M<0){h(!1);return}C.current=!1,b(M),h(!0)};return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[K,c,V,v]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:x,className:`${d}-wrapper`,children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:jy(d)}}),u?r.jsx("button",{type:"button",className:`${d}-cover ${Fn(p)?`${d}-ratio-wrapper-cover`:`${d}-ratio-wrapper-fit`}`,onClick:()=>T(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:n&&!i&&!o?"none":void 0,...Fn(p)?{"--image-aspect-ratio":Ar(p)}:{}},"aria-label":"Open journal gallery",children:r.jsx("img",{className:`${d}-cover-image ${Fn(p)?`${d}-cover-image-cover`:`${d}-cover-image-fit`}`,src:u,alt:"cover"})}):null]}),F&&typeof document<"u"&&(()=>{const y=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx(Dy,{prefix:d,entries:K,settings:e,isEditor:n,isEditMode:i,isPreviewMode:o,initialSlideIndex:m,enableUrlSync:V,journalItemId:c,onBeforeClose:A,onClose:j}),y)})()]})},By=`import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent } from 'react';
|
|
15636
15688
|
import { createPortal } from 'react-dom';
|
|
15637
15689
|
import { CommonComponentProps } from '../props';
|
|
15638
15690
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -16388,7 +16440,7 @@ export type LightboxJournalSettings = {
|
|
|
16388
16440
|
closeIconColor: string;
|
|
16389
16441
|
closeIconHoverColor: string;
|
|
16390
16442
|
};
|
|
16391
|
-
`,Vy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Gy(e){const t={};return t[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const qy=Kn.reduce((e,t)=>({...e,...Gy(t)}),{}),Uy=Kn.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Goudy Bookletter 1911",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function sa(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const Ky=ah(),Xy={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"}},...qy,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:Vy,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Uy,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,...sa({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,...sa({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,...sa({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:[Ky]}],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"}]}]}},Yy={element:zy,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:Xy,sourceCode:By,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})}},Zy={sizeType:"custom",value:700,min:400,max:700};function fr(e,t){return{widthPx:e,heightPx:e*t}}function Ia(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function hl(e,t,n,i){const{heightPx:o}=fr(n,i);return Ia(e/2,t/2,e,t,n,o)}function jc(e,t,n){for(const i of n){const{heightPx:o}=fr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Jy(e,t,n,i,o,s,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":jc(e,t,n)||s==="area"?l??"none":d??"none"}function fl(e,t,n){var d;const{sizeType:i,value:o,min:s,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-s)+s)}function Qy(e){return`
|
|
16443
|
+
`,Vy="data:image/svg+xml,"+encodeURIComponent('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.959 0.40332L0.402635 15.9597" stroke="#000000" stroke-width="1.14"/><path d="M15.959 15.9594L0.402635 0.403002" stroke="#000000" stroke-width="1.14"/></svg>'),li={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},fontSize:{type:"number",display:{type:"font-size"}},lineHeight:{type:"number",display:{type:"line-height-input"}},letterSpacing:{type:"number",display:{type:"letter-spacing-input"}},wordSpacing:{type:"number",display:{type:"word-spacing-input"}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}},textAppearance:{type:"object",display:{type:"text-appearance",useTabDesign:!0},properties:{textTransform:{type:"string",enum:["none","uppercase","lowercase","capitalize"]},textDecoration:{type:"string",enum:["none","underline"]},fontVariant:{type:"string",enum:["normal","small-caps"]}}}};function Gy(e){const t={};return t[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...li.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...li.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...li.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...li.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...li.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...li.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...li.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const qy=Kn.reduce((e,t)=>({...e,...Gy(t)}),{}),Uy=Kn.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Goudy Bookletter 1911",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function sa(e){return Kn.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const Ky=ah(),Xy={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"}},...qy,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:Vy,backgroundColor:"rgb(255, 255, 255)",closeIconColor:"#000000",closeIconHoverColor:"#cccccc",textTransition:"fade",title1Color:"#000000",title2Color:"#000000",title3Color:"#000000",countColor:"#000000",...Uy,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,...sa({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,...sa({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,...sa({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:[Ky]}],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"}]}]}},Yy={element:zy,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:Xy,sourceCode:By,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"cover",placeholderEnabled:!0}]},fontSettingsPaths:{content:[],parameters:[...Kn.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{...Kn.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})}},Zy={sizeType:"custom",value:700,min:400,max:700};function fr(e,t){return{widthPx:e,heightPx:e*t}}function Ia(e,t,n,i,o,s){return{x:Math.min(Math.max(e,o/2),n-o/2),y:Math.min(Math.max(t,s/2),i-s/2)}}function gl(e,t,n,i){const{heightPx:o}=fr(n,i);return Ia(e/2,t/2,e,t,n,o)}function Dc(e,t,n){for(const i of n){const{heightPx:o}=fr(i.widthPx,i.aspectRatio),s=i.widthPx/2,l=o/2;if(e>=i.x-s&&e<=i.x+s&&t>=i.y-l&&t<=i.y+l)return!0}return!1}function Jy(e,t,n,i,o,s,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":Dc(e,t,n)||s==="area"?l??"none":d??"none"}function hl(e,t,n){var d;const{sizeType:i,value:o,min:s,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-s)+s)}function Qy(e){return`
|
|
16392
16444
|
.${e}-root {
|
|
16393
16445
|
position: absolute;
|
|
16394
16446
|
top: 0;
|
|
@@ -16423,7 +16475,7 @@ export type LightboxJournalSettings = {
|
|
|
16423
16475
|
width: 32px;
|
|
16424
16476
|
height: 32px;
|
|
16425
16477
|
}
|
|
16426
|
-
`}function ev(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 tv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await ev(i)]));return new Map(n)}function nv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=$.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[v,
|
|
16478
|
+
`}function ev(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 tv(e){const t=[...new Set(e.filter(Boolean))],n=await Promise.all(t.map(async i=>[i,await ev(i)]));return new Map(n)}function nv({settings:e,content:t=[],isEditor:n}){const{prefix:i}=$.useScopedStyles(),[o,s]=a.useState(null),[l,d]=a.useState([]),[c,u]=a.useState(0),p=a.useRef(0),[v,x]=a.useState({x:0,y:0}),[g,h]=a.useState("none"),m=a.useRef({x:0,y:0}),[b,I]=a.useState(!1),[C,R]=a.useState(!1),K=a.useRef(new Map),{imageSize:F=Zy,cursor:V="system",target:A="area",position:T="random",visible:j="all",defaultCursor:y=null,hoverCursor:W=null}=e,M=t.filter(S=>{var E;return!!((E=S==null?void 0:S.image)!=null&&E.url)}),Y=a.useMemo(()=>Qy(i),[i]),P=a.useCallback((S,E,D=l)=>{if(!o)return;const se=o.getBoundingClientRect(),oe=S-se.left,L=E-se.top;x({x:oe,y:L}),h(Jy(oe,L,D,o,V,A,W,y))},[o,l,V,A,W,y]);a.useEffect(()=>{const S=[...M.map(D=>D.image.url),y,W].filter(D=>!!D);if(S.length===0){K.current=new Map,R(!0);return}let E=!1;return R(!1),tv(S).then(D=>{E||(K.current=D,R(!0))}),()=>{E=!0}},[t,y,W]),a.useEffect(()=>{if(!o)return;const S=D=>{D.stopPropagation(),m.current={x:D.clientX,y:D.clientY},P(D.clientX,D.clientY)},E=()=>{b&&P(m.current.x,m.current.y)};return o.addEventListener("mousemove",S),window.addEventListener("scroll",E,!0),()=>{o.removeEventListener("mousemove",S),window.removeEventListener("scroll",E,!0)}},[o,b,P]),a.useEffect(()=>{!o||!b||P(m.current.x,m.current.y)},[l,o,b,P]),a.useEffect(()=>{b||h("none")},[b]);const U=(S,E,D,se={})=>{var X,be;if(!((X=S==null?void 0:S.image)!=null&&X.url))return null;const oe=((be=K.current.get(S.image.url))==null?void 0:be.aspectRatio)??1,L=hl(S.image.url,F,K.current),{heightPx:ue}=fr(L,oe);let k=0,ne=0;return T==="same"?{x:k,y:ne}=gl(E,D,L,oe):(k=se.x??Math.random()*E,ne=se.y??Math.random()*D,{x:k,y:ne}=Ia(k,ne,E,D,L,ue)),{id:p.current++,url:S.image.url,link:S.link,name:S.image.name,x:k,y:ne,xRatio:k/E,yRatio:ne/D,aspectRatio:oe,widthPx:L}},z=()=>{if(!o)return;const S=o.getBoundingClientRect(),E=S.width,D=S.height;E===0||D===0||d(se=>se.length===0?se:se.map(oe=>{const L=F.sizeType==="random"?oe.widthPx:hl(oe.url,F,K.current),{heightPx:ue}=fr(L,oe.aspectRatio);if(T==="same"){const{x:X,y:be}=gl(E,D,L,oe.aspectRatio);return{...oe,x:X,y:be,widthPx:L}}const{x:k,y:ne}=Ia(oe.xRatio*E,oe.yRatio*D,E,D,L,ue);return{...oe,x:k,y:ne,widthPx:L}}))};a.useEffect(()=>{if(!o||M.length===0||!C)return;const S=o.getBoundingClientRect(),E=S.width,D=S.height,se=U(M[0],E,D);se&&(d([se]),u(M.length>1?1:0))},[F,T,o,t,C]),a.useEffect(()=>{if(!o)return;z();const S=new ResizeObserver(z);return S.observe(o),window.addEventListener("resize",z),()=>{S.disconnect(),window.removeEventListener("resize",z)}},[o,T,F,l.length]),a.useEffect(()=>{j==="last One"&&d(S=>S.length>0?[S[S.length-1]]:[])},[j]);const B=S=>{if(!o||M.length===0||!C)return;const E=o.getBoundingClientRect(),D=S.clientX-E.left,se=S.clientY-E.top;if(A==="image"&&!Dc(D,se,l))return;let oe=0,L=0;T==="on Click"?(oe=D,L=se):T==="same"?(oe=E.width/2,L=E.height/2):(oe=Math.random()*E.width,L=Math.random()*E.height);const ue=M[c%M.length],k=U(ue,E.width,E.height,{x:oe,y:L});if(!k)return;const ne=j==="all"?[...l,k]:[k];d(ne),u(X=>(X+1)%M.length),P(S.clientX,S.clientY,ne)},te=V==="custom"&&g!=="none";return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:Y}}),r.jsxs("div",{ref:s,onClick:B,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),className:`${i}-root`,style:{cursor:te?"none":"default"},children:[l.map(S=>r.jsx("div",{className:`${i}-wrapper`,style:{top:`${S.y}px`,left:`${S.x}px`,width:`${S.widthPx}px`,cursor:te?"none":"default"},children:A==="area"&&S.link?r.jsx("a",{href:S.link,target:"_blank",rel:"noreferrer",className:`${i}-link`,children:r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})}):r.jsx("img",{src:S.url,alt:S.name,className:`${i}-image`})},S.id)),b&&te&&r.jsx("div",{className:`${i}-cursor`,style:{left:`${v.x}px`,top:`${v.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${g}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}const iv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16427
16479
|
import { CommonComponentProps } from '../props';
|
|
16428
16480
|
import { useScopedStyles } from '../utils/index';
|
|
16429
16481
|
|
|
@@ -17063,7 +17115,7 @@ export function ClickGallerie({ settings, content = [], isEditor }: ClickGalleri
|
|
|
17063
17115
|
display: block;
|
|
17064
17116
|
pointer-events: none;
|
|
17065
17117
|
}
|
|
17066
|
-
`}function cv(e){return e==="blur"?sv:e==="greyscale"?av:0}function io(e,t=1,n=1){const i=cv(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
|
|
17118
|
+
`}function cv(e){return e==="blur"?sv:e==="greyscale"?av:0}function io(e,t=1,n=1){const i=cv(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 fl(e){return e<=1?{backgroundIndex:0,activeIndex:0}:{backgroundIndex:0,activeIndex:1}}function dv(e,t){return t<=1?0:(e-1+t)%t}function uv(e,t=1){return!e||e.height===0?t:e.width/e.height}function pv(e,t,n,i,o){if(e<=0||t<=0)return{widthPercent:i,heightPercent:o};const s=e*i/100,l=t*o/100;let d=s,c=d/n;return c>l&&(c=l,d=c*n),{widthPercent:d/e*100,heightPercent:c/t*100}}function yl(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 jc(e){return{width:`${e.widthPercent}%`,height:`${e.heightPercent}%`}}function vl(e,t,n){return{...jc(e),[`--${n}-stage-scale`]:t}}function mv(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 gv({settings:e,content:t,isEditor:n,isPreviewMode:i}){var $e,G,re,pe,Se,Pe,Re;const{prefix:o}=$.useScopedStyles(),s=a.useMemo(()=>lv(o),[o]),{imageSize:l,maxWidth:d,maxHeight:c,transition:u=1e3,bgImage:p="greyscale"}=e,v=t??[],x=fl(v.length),[g,h]=a.useState(x.activeIndex),[m,b]=a.useState(x.backgroundIndex),[I,C]=a.useState(!1),[R,K]=a.useState(!1),[F,V]=a.useState(null),[A,T]=a.useState(null),[j,y]=a.useState(0),[W,M]=a.useState(1),[Y,P]=a.useState("none"),[U,z]=a.useState("next"),[B,te]=a.useState({}),[S,E]=a.useState({width:0,height:0}),D=a.useRef(null),se=a.useRef(null),oe=!n||!!i,L=l??60,ue=Math.max(10,Math.min(100,d??L)),k=Math.max(10,Math.min(100,c??L)),ne=Math.max(100,u),X=io(p),be=a.useCallback(H=>{const ge=uv(H?B[H]:void 0);return pv(S.width,S.height,ge,ue,k)},[S.height,S.width,B,k,ue]);a.useEffect(()=>{const H=se.current;if(!H)return;const ge=new ResizeObserver(([ie])=>{const{width:_,height:ee}=ie.contentRect;E({width:_,height:ee})});return ge.observe(H),()=>ge.disconnect()},[]),a.useEffect(()=>{const H=(t??[]).map(ge=>{var ie;return(ie=ge.image)==null?void 0:ie.url}).filter(ge=>!!ge);mv(H,(ge,ie)=>{te(_=>{var ee,Fe;return((ee=_[ge])==null?void 0:ee.width)===ie.width&&((Fe=_[ge])==null?void 0:Fe.height)===ie.height?_:{..._,[ge]:ie}})})},[t]),a.useEffect(()=>{const{backgroundIndex:H,activeIndex:ge}=fl(v.length);h(ge),b(H),C(!1),K(!1),V(null),T(null),y(0),M(1),P("none"),z("next")},[v.length,t]),a.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const Ae=a.useCallback(H=>{var ae,N,qe,je;if(!oe||I||v.length<=1)return;const ge=H==="next"?(g+1)%v.length:(g-1+v.length)%v.length,ie=be((N=(ae=v[g])==null?void 0:ae.image)==null?void 0:N.url),_=be((je=(qe=v[ge])==null?void 0:qe.image)==null?void 0:je.url),ee=yl(S.width,S.height,ie),Fe=yl(S.width,S.height,_);D.current&&clearTimeout(D.current),z(H),K(!0),C(!0),H==="next"?(V(g),T(ge),y(0),M(1),P(io(p,0,1))):(b(dv(ge,v.length)),V(ge),T(g),y(1),M(Fe),P(io(p,1,Fe))),requestAnimationFrame(()=>{K(!1),requestAnimationFrame(()=>{H==="next"?(y(1),M(ee),P(io(p,1,ee))):(y(0),M(1),P(io(p,0,1)))})}),D.current=setTimeout(()=>{H==="next"&&b(g),h(ge),V(null),T(null),C(!1)},ne)},[g,p,S.height,S.width,be,I,oe,v,ne]),fe=v[g],le=m!==null?v[m]:null,q=F!==null?v[F]:null,Q=A!==null?v[A]:null,Z=v.length<=1?0:(g-1+v.length)%v.length,Ne=v.length<=1?0:(g+1)%v.length,Te=be(($e=fe==null?void 0:fe.image)==null?void 0:$e.url),We=be((G=q==null?void 0:q.image)==null?void 0:G.url),ce=be((re=Q==null?void 0:Q.image)==null?void 0:re.url),ye={[`--${o}-transition-ms`]:`${ne}ms`};return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:s}}),r.jsxs("div",{ref:se,className:dt(`${o}-wrapper`,R&&`${o}-snap`,n&&!i&&`${o}-editor`),style:ye,"aria-label":"Zoom gallery",children:[((pe=le==null?void 0:le.image)==null?void 0:pe.url)&&r.jsx("div",{className:`${o}-background`,"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:le.image.url,alt:"",style:{filter:X}})}),I&&((Se=q==null?void 0:q.image)==null?void 0:Se.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-outgoing`,`${o}-outgoing-${U}`),style:vl(We,W,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-effect-image`,src:q.image.url,alt:"",style:{filter:Y}})}),I&&((Pe=Q==null?void 0:Q.image)==null?void 0:Pe.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-incoming`,`${o}-incoming-${U}`),style:vl(ce,j,o),"aria-hidden":"true",children:r.jsx("img",{className:`${o}-image`,src:Q.image.url,alt:""})}),!I&&((Re=fe==null?void 0:fe.image)==null?void 0:Re.url)&&r.jsx("div",{className:dt(`${o}-stage`,`${o}-foreground`),style:jc(Te),children:r.jsx("img",{className:`${o}-image`,src:fe.image.url,alt:fe.image.name??""})}),oe&&v.length>1&&!I&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:dt(`${o}-nav`,`${o}-nav-prev`),onClick:()=>Ae("prev"),"aria-label":`Show previous image (${Z+1} of ${v.length})`}),r.jsx("button",{type:"button",className:dt(`${o}-nav`,`${o}-nav-next`),onClick:()=>Ae("next"),"aria-label":`Show next image (${Ne+1} of ${v.length})`})]})]})]})}const hv=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17067
17119
|
import cn from 'classnames';
|
|
17068
17120
|
import { CommonComponentProps } from '../props';
|
|
17069
17121
|
import { useScopedStyles } from '../utils/useScopedStyles';
|
|
@@ -17582,7 +17634,7 @@ export function Scale({ settings, content, isEditor, isPreviewMode }: ScaleProps
|
|
|
17582
17634
|
</>
|
|
17583
17635
|
);
|
|
17584
17636
|
}
|
|
17585
|
-
`,fv={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:""}}]}},yv={element:gv,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:fv,sourceCode:hv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},vv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},xv=["hover","active"],la={left:"flex-start",center:"center",right:"flex-end"};function bv(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 wv(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 Sv(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))`,s=`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}, ${s}`,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}`,v=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,
|
|
17637
|
+
`,fv={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:""}}]}},yv={element:gv,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:fv,sourceCode:hv,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},vv={backgroundColor:"background-color",textColor:"text-color",borderColor:"border-color",iconColor:"icon-color",boxShadowColor:"box-shadow-color",innerBoxShadowColor:"inner-box-shadow-color"},xv=["hover","active"],la={left:"flex-start",center:"center",right:"flex-end"};function bv(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 wv(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 Sv(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))`,s=`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}, ${s}`,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}`,v=`.${e}-button:focus-visible, a:focus-visible .${e}-button`,x=`.${e}-button:hover, ${v}`,g=h=>`.${e}-hover-effect-${h}:hover, .${e}-hover-effect-${h}:focus-visible, a:focus-visible .${e}-hover-effect-${h}`;return`
|
|
17586
17638
|
.${e}-root {
|
|
17587
17639
|
line-height: 0;
|
|
17588
17640
|
}
|
|
@@ -17743,7 +17795,7 @@ a:focus-visible .${e}-hover-effect-content-roll .${e}-content-roll-layer-hover,
|
|
|
17743
17795
|
transform: translateY(-50%);
|
|
17744
17796
|
opacity: 1;
|
|
17745
17797
|
}
|
|
17746
|
-
${
|
|
17798
|
+
${x} {
|
|
17747
17799
|
background-color: var(--${e}-hover-background-color, var(--${e}-background-color));
|
|
17748
17800
|
color: var(--${e}-hover-text-color, var(--${e}-text-color));
|
|
17749
17801
|
border-color: var(--${e}-hover-border-color, var(--${e}-border-color));
|
|
@@ -17822,7 +17874,7 @@ a:active .${e}-button .${e}-icon-image,
|
|
|
17822
17874
|
height: calc(1em * var(--${e}-icon-scale, 1));
|
|
17823
17875
|
width: calc(1em * var(--${e}-icon-scale, 1));
|
|
17824
17876
|
}
|
|
17825
|
-
`}function ca(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function
|
|
17877
|
+
`}function ca(e,t,n="",i,o){const s=t();return r.jsxs("span",{className:`${e}-content-roll-wrap ${n}`.trim(),style:i,children:[r.jsx("span",{className:`${e}-content-roll-spacer`,"aria-hidden":"true",style:o,children:s}),r.jsxs("span",{className:`${e}-content-roll-viewport`,children:[r.jsx("span",{className:`${e}-content-roll-layer`,style:o,children:t()}),r.jsx("span",{className:`${e}-content-roll-layer ${e}-content-roll-layer-hover`,"aria-hidden":"true",style:o,children:t()})]})]})}function xl(e,t,n="fill",i=100,o=0,s){if(!t)return null;const l=r.jsx(rn,{url:t,fill:`var(--${e}-icon-color)`,hoverFill:`var(--${e}-icon-color)`,className:`${e}-icon-image`});if(n==="inline")return r.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=$.scalingValue(o,s);return r.jsx("span",{className:`${e}-icon`,style:{width:d,height:d},"aria-hidden":"true",children:l})}return r.jsx("span",{className:`${e}-icon ${e}-icon-fill`,"aria-hidden":"true",children:l})}function $v({settings:e,isEditor:t,isPreviewMode:n,activeEvent:i,hasLink:o}){const{prefix:s}=$.useScopedStyles(),l=a.useMemo(()=>Sv(s),[s]),{type:d="a",label:c="Button",icon:u,alignment:p="center",alignA:v,order:x="text-icon",gap:g=0,iconSize:h=0,iconWidthC:m=0,dimensions:b=!1,padding:I={top:0,right:0,bottom:0,left:0},cornerRadius:C=0,boxShadow:R={top:0,left:0,right:0,bottom:0},boxShadowColor:K="rgba(0, 0, 0, 0)",innerBoxShadow:F={top:0,left:0,right:0,bottom:0},innerBoxShadowColor:V="rgba(0, 0, 0, 0)",stroke:A=0,backgroundColor:T="#000000",textColor:j="#ffffff",borderColor:y="#ffffff",iconColor:W="#ffffff",hoverEffect:M="none",fontFamily:Y,fontSettings:P,fontSize:U,lineHeight:z,letterSpacing:B=0,wordSpacing:te=0,textAppearance:S,stateOverrides:E,minWidth:D=0,minHeight:se=0,width:oe=0,height:L=0}=e,ue=$.buildColorVars(s,{backgroundColor:T,textColor:j,borderColor:y,iconColor:W,boxShadowColor:K,innerBoxShadowColor:V},vv,xv,E),k=i&&i!=="default"?`${s}-state-${i}`:"",ne=t&&!n?`${s}-editing`:"",X=M!=="none"&&(!t||n||i==="hover")?`${s}-hover-effect-${M}`:"",be=M==="reveal"||M==="swipe",Ae=M==="content-roll",fe=M==="reveal"&&(!t||n),le=b===!0,Q=d==="a"?v??p:p,Z=d==="c",Ne=d!=="b",Te={fontSettings:{fontFamily:Y,fontWeight:(P==null?void 0:P.fontWeight)??400,fontStyle:(P==null?void 0:P.fontStyle)??"normal"},fontSize:U??.01,lineHeight:z,letterSpacing:B,wordSpacing:te,textAppearance:S,color:j},ce={...Ne?on(Kt(Te,t)):{},[`--${s}-box-shadow-x`]:$.scalingValue(R.left,t),[`--${s}-box-shadow-y`]:$.scalingValue(R.top,t),[`--${s}-box-shadow-blur`]:$.scalingValue(R.right,t),[`--${s}-box-shadow-spread`]:$.scalingValue(R.bottom,t),[`--${s}-inner-box-shadow-x`]:$.scalingValue(F.left,t),[`--${s}-inner-box-shadow-y`]:$.scalingValue(F.top,t),[`--${s}-inner-box-shadow-blur`]:$.scalingValue(F.right,t),[`--${s}-inner-box-shadow-spread`]:$.scalingValue(F.bottom,t),paddingTop:$.scalingValue(I.top,t),paddingRight:$.scalingValue(I.right,t),paddingBottom:$.scalingValue(I.bottom,t),paddingLeft:$.scalingValue(I.left,t),borderRadius:$.scalingValue(C,t),borderWidth:$.scalingValue(A,t),...Z?{}:{justifyContent:la[Q],textAlign:Q},...Z&&!Ae?{gap:$.scalingValue(g,t)}:{},...le?{width:$.scalingValue(oe,t),height:$.scalingValue(L,t)}:{minWidth:$.scalingValue(D,t),minHeight:$.scalingValue(se,t),...Z?{width:"100%"}:{}}};let ye;const $e={display:"inline-flex",alignItems:"center",justifyContent:Z?la[Q]:la[d==="a"?Q:"center"],gap:Z?$.scalingValue(g,t):void 0,width:"100%",height:"100%",...d==="a"?{textAlign:Q}:{}};if(d==="b"){const pe=()=>xl(s,u,h>0?"fixed":"fill",100,h,t);ye=Ae?ca(s,pe,`${s}-icon-roll`,void 0,$e):pe()}else if(d==="c"){const pe=()=>{const Se=r.jsx("span",{className:`${s}-text`,style:{textAlign:Q},children:c}),Pe=xl(s,u,m>0?"fixed":"fill",100,m,t);return x==="icon-text"?r.jsxs(r.Fragment,{children:[Pe,Se]}):r.jsxs(r.Fragment,{children:[Se,Pe]})};ye=Ae?ca(s,pe,`${s}-icon-text-roll`,void 0,$e):pe()}else ye=Ae?ca(s,()=>c,`${s}-label-roll`,void 0,$e):be?r.jsx("span",{className:`${s}-button-inner`,children:c}):c;const G=fe?pe=>bv(pe,s):void 0,re=fe?pe=>wv(pe,s):void 0;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:l}}),r.jsx("div",{className:`${s}-root`,style:ue,children:r.jsx("div",{className:`${s}-wrapper ${k} ${ne}`.trim(),children:r.jsx("div",{className:`${s}-button ${X}`.trim(),style:ce,onMouseEnter:G,onMouseLeave:re,role:"button",tabIndex:o||t&&!n?void 0:0,children:ye})})})]})}const Cv=`import { useMemo, type CSSProperties, type MouseEvent, type ReactNode } from 'react';
|
|
17826
17878
|
import { SvgImage } from '../helpers/SvgImage/SvgImage';
|
|
17827
17879
|
import { CommonComponentProps } from '../props';
|
|
17828
17880
|
import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
|
|
@@ -18647,7 +18699,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18647
18699
|
pointer-events: auto;
|
|
18648
18700
|
flex-shrink: 0;
|
|
18649
18701
|
}
|
|
18650
|
-
`}const Cn=500,oo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Mv=72,Pv=50,kv=1e4,Av=650,Fv=500;function Wv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function Bc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 _v(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?Bc(i,n):null}function Hv(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 so(e,t,n){var o;if(e.length<=1)return null;const i=(t+n+e.length)%e.length;return((o=e[i])==null?void 0:o.items[0])??null}function wl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return so(e,i,n)}const Nv=.03;function Vc(e){return e.width*Nv}const da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function Sl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ov(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ea(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Dv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ea(e,t.width,t.height)}function jv(e,t){if(Fr(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 zv(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 Bv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Fr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Vc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function yr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function Vv(e,t,n){const{left:i,width:o}=n,s=Vc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Gc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(e,"right",i),l=yr(e,"left",i),d=yr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Gv(e,t,n,i){const{start:o,end:s}=Gc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function qv(e,t,n){const i=Ui(e,t,n),o=yr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Uv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Fr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Kv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:y,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const E=a.useRef(null),L=a.useRef(null),C=a.useRef(null),K=a.useRef(new Map),[W,B]=a.useState(0),A=a.useRef(null),T=a.useRef(0),j=a.useRef(0),w=a.useRef("none"),P=a.useRef(!1),M=a.useRef(!1),X=a.useRef(!1),k=a.useRef(null),q=a.useRef(null),V=a.useRef(null),G=a.useRef(()=>{}),ie=a.useRef(null),S=a.useRef(null),R=a.useRef(null),O=a.useRef(!1),[ae,se]=a.useState(null),[I,de]=a.useState(da),[F,te]=a.useState(0),[Z,ve]=a.useState("opening"),[Ae,he]=a.useState(0),[pe,U]=a.useState(0),[ee,Y]=a.useState(!1),[Oe,$e]=a.useState(null),[He,ue]=a.useState(null),[me,be]=a.useState(null),[z,le]=a.useState(!1),[ye,we]=a.useState(null),[Pe,Ce]=a.useState(!1),_=a.useRef(!1),[ge,ne]=a.useState(!1),[H,Q]=a.useState(!1),Fe=a.useRef(n),re=a.useRef(void 0),N=t[n],qe=N?Fr(N):!1,Be=pe!==0||ee,at=!l&&(!s||!!d),et=c&&!l,ut=u.length>1,ke=a.useCallback((x,xe)=>t.length<=1?null:t[(x+xe+t.length)%t.length]??null,[t]),Ie=ut?so(u,p,-1):ke(n,-1),oe=ut?so(u,p,1):ke(n,1),Te=Oe===-1&&Be?ut&&He!==null?so(u,He,-1):me!==null?ke(me,-1):null:null,Ee=Oe===1&&Be?ut&&He!==null?so(u,He,1):me!==null?ke(me,1):null:null,De=Te&&Te.url!==(Ie==null?void 0:Ie.url)?Te:null,fe=Ee&&Ee.url!==(oe==null?void 0:oe.url)?Ee:null,Me=Ie&&et?(()=>{const x=ut?wl(u,p,-1):t.length>2?ke((n-1+t.length)%t.length,-1):null;return x&&x.url!==Ie.url?x:null})():null,_e=oe&&et?(()=>{const x=ut?wl(u,p,1):t.length>2?ke((n+1)%t.length,1):null;return x&&x.url!==oe.url?x:null})():null,Ke=De??Me,it=fe??_e,Ye=a.useCallback((x,xe,Re)=>{if(!x||!xe||!Re)return;const Ne=K.current,nt=Ne.get(x);(nt==null?void 0:nt.width)===xe&&(nt==null?void 0:nt.height)===Re||(Ne.set(x,{width:xe,height:Re}),B(Mt=>Mt+1))},[]),xt=a.useCallback(x=>{if(!(x!=null&&x.url))return null;const xe=K.current.get(x.url);return Dv(L.current,xe)},[W,F]),ot=a.useCallback(()=>{if(!N)return;const x=xt(N);if(x){se(x);return}const xe=L.current;xe&&se(Sl(xe))},[N,xt]),We=a.useCallback(x=>{if(ut){const xe=u.length;ue((p+x+xe)%xe),be(null);return}t.length>1&&(be((n+x+t.length)%t.length),ue(null))},[ut,u.length,p,t.length,n]),Ze=a.useCallback(x=>{X.current=x,Y(x)},[]),Ve=a.useCallback(()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)},[]),st=a.useCallback(()=>{Ve(),k.current=window.setTimeout(()=>{Ve(),Ze(!1)},oo+32)},[Ve,Ze]),pt=a.useCallback(()=>{const x=E.current;if(!x){de({left:0,top:0,width:typeof window<"u"?window.innerWidth:da.width,height:typeof window<"u"?window.innerHeight:da.height});return}const xe=x.getBoundingClientRect();de({left:xe.left,top:xe.top,width:xe.width,height:xe.height})},[]),ct=a.useCallback((x,xe)=>{if(Be){if(ge&&!ee)return`translate(${pe}px, 0px)`;if(ee&&Oe!==null){const Re=xt(x);if(!Re)return;const{x:Ne,y:nt}=Gv(Re,xe,Oe,I);return`translate(${Ne}px, ${nt}px)`}if(ee)return"translate(0px, 0px)"}},[Be,ge,ee,pe,Oe,I,xt]),Et=a.useCallback(()=>{const x=q.current;q.current=null,Ve(),Ze(!1),$e(null),ue(null),be(null),U(0),ne(!1),P.current=!1,j.current=0,w.current="none",x===-1?m():x===1&&b()},[Ve,Ze,m,b]),zt=a.useCallback(()=>{Ve(),k.current=window.setTimeout(()=>{q.current!==null&&Et()},oo+32)},[Ve,Et]),Xt=a.useCallback(()=>{Ve(),q.current=null,Ze(!1),$e(null),ue(null),be(null),U(0),ne(!1),P.current=!1,j.current=0,w.current="none"},[Ve,Ze]),yt=a.useCallback(x=>{if(!(!et||!ae)){if(X.current){if(q.current===x){V.current=x,Et();return}Xt()}Ve(),We(x),q.current=x,$e(x),Ze(!0),zt()}},[et,ae,Et,Xt,Ve,We,Ze,zt]);G.current=yt;const bt=a.useCallback(()=>{ie.current=null,O.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),R.current!==null&&(window.clearTimeout(R.current),R.current=null)},[]),Nt=a.useCallback(x=>{S.current!==null&&window.clearInterval(S.current);const xe=O.current?Fv:Av;S.current=window.setInterval(()=>{G.current(x)},xe)},[]),At=a.useCallback(x=>{ie.current!==x&&(bt(),ie.current=x,O.current=!1,G.current(x),Nt(x),R.current=window.setTimeout(()=>{R.current=null,ie.current===x&&(O.current=!0,Nt(x))},kv))},[bt,Nt]),wt=a.useCallback(()=>{const x=L.current;if(!x)return;const xe=N==null?void 0:N.url,Re=xe?K.current.get(xe):void 0;if(Re!=null&&Re.width&&(Re!=null&&Re.height)){se(Ea(x,Re.width,Re.height));return}const Ne=C.current;if(Ne&&xe&&(Ne.src===xe||Ne.currentSrc===xe)){const{width:Mt,height:Je}=Ov(Ne);if(Mt&&Je){Ye(xe,Mt,Je),se(Ea(x,Mt,Je));return}}const nt=Sl(x);!nt.width||!nt.height||se(nt)},[N==null?void 0:N.url,Ye]),Ot=a.useCallback(x=>{if(C.current=x,!!x){if(x instanceof HTMLVideoElement){x.readyState>=1&&x.videoWidth>0&&wt();return}x.complete&&x.naturalWidth>0&&wt()}},[wt]),Ut=a.useCallback(()=>{pt(),wt(),te(x=>x+1)},[pt,wt]);a.useEffect(()=>{Ut();const x=L.current,xe=E.current,Re=new ResizeObserver(()=>Ut());return x&&Re.observe(x),xe&&Re.observe(xe),window.addEventListener("resize",Ut),()=>{Re.disconnect(),window.removeEventListener("resize",Ut)}},[Ut,n,v]),a.useLayoutEffect(()=>{if(!N)return;const x=C.current;if(x){if(x instanceof HTMLImageElement&&x.complete&&x.naturalWidth>0){wt();return}x instanceof HTMLVideoElement&&x.readyState>=1&&x.videoWidth>0&&wt()}},[N==null?void 0:N.url,n,wt]),a.useEffect(()=>{ot()},[ot,W]),a.useEffect(()=>{const x=new Set,xe=[],Re=Ne=>{!(Ne!=null&&Ne.url)||x.has(Ne.url)||(x.add(Ne.url),xe.push(Ne))};t.forEach(Re),u.forEach(Ne=>Ne.items.forEach(Re)),xe.forEach(Ne=>{K.current.has(Ne.url)||jv(Ne,Ye)})},[t,u,Ye]),a.useEffect(()=>{if(Z!=="opening"||!ae)return;if(!y){ve("open");return}le(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{le(!0),ve("open")})});return()=>cancelAnimationFrame(x)},[Z,ae,y]),a.useEffect(()=>{if(Z!=="closing")return;const x=setTimeout(()=>h(),Cn);return()=>clearTimeout(x)},[Z,h]),a.useEffect(()=>()=>{Ve()},[Ve]),a.useLayoutEffect(()=>{Fe.current===n&&re.current===(N==null?void 0:N.url)||(Ve(),q.current=null,$e(null),ue(null),be(null),he(0),U(0),Ze(!1),Q(!1),ne(!1),T.current=0,j.current=0,w.current="none",P.current=!1,A.current=null,M.current=!1,C.current=null,ot(),Fe.current=n,re.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,Ze,Ve,ot]),a.useLayoutEffect(()=>{const x=V.current;x!==null&&(V.current=null,requestAnimationFrame(()=>{G.current(x)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(Z==="opening"){_.current=!1,Ce(!1);return}if(Z!=="open"||_.current)return;if(!Ie&&!oe){_.current=!0;return}Ce(!1);const x=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ce(!0),_.current=!0})});return()=>cancelAnimationFrame(x)},[Z,Ie==null?void 0:Ie.url,oe==null?void 0:oe.url]),a.useEffect(()=>{if(Z!=="open")return;const x=()=>{const Je=ft=>{ft.stopPropagation(),ft.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},xe=Je=>{const ft=Je<0?1:-1;Ve(),We(ft),q.current=ft,$e(ft),Ze(!0),zt()},Re=Je=>{if(Math.abs(Je)>Pv&&et){xe(Je);return}q.current=null,$e(null),ue(null),be(null),Ze(!0),U(0),st()},Ne=Je=>{if(Je.touches.length!==1||X.current)return;const ft=Je.touches[0];M.current=!0,A.current={x:ft.clientX,y:ft.clientY},w.current="none",j.current=0,P.current=!1},nt=Je=>{if(!A.current||Je.touches.length!==1||X.current)return;const ft=Je.touches[0],Ht=ft.clientX-A.current.x,Tt=ft.clientY-A.current.y;if(w.current==="none"){if(Math.abs(Ht)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ht)>Math.abs(Tt)){if(!et)return;w.current="horizontal"}else if(Tt>0){if(!at)return;w.current="vertical"}else return}if(w.current==="horizontal"){P.current=!0,ne(!0),j.current=Ht,U(Ht),Je.preventDefault();return}w.current==="vertical"&&(P.current=!0,ne(!0),T.current=Tt,he(Tt),Je.preventDefault())},Mt=()=>{if(!A.current)return;const Je=w.current,ft=P.current;if(ft&&Je==="horizontal")Re(j.current),x();else if(ft&&Je==="vertical"){const Ht=T.current;if(at&&Ht>Mv){const Tt=window.innerHeight;T.current=Tt,Q(!0),he(Tt),ve("closing")}else T.current=0,he(0);x()}else Je==="horizontal"&&Math.abs(j.current)>0&&(Re(j.current),x());A.current=null,w.current="none",j.current=0,P.current=!1,ne(!1)};return document.addEventListener("touchstart",Ne,{passive:!0}),document.addEventListener("touchmove",nt,{passive:!1}),document.addEventListener("touchend",Mt),document.addEventListener("touchcancel",Mt),()=>{document.removeEventListener("touchstart",Ne),document.removeEventListener("touchmove",nt),document.removeEventListener("touchend",Mt),document.removeEventListener("touchcancel",Mt)}},[Z,et,Ze,st,Ve,at,zt,We]);const Zt=a.useCallback(()=>{const x=(g==null?void 0:g())??y??null;x&&ae&&(we(x),le(!0)),ve("closing")},[g,y,ae]);a.useEffect(()=>{const x=Ne=>{if(Ne.key==="Escape"){if(s&&d||Z==="closing")return;bt(),Zt();return}if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight"||Z!=="open"||!et)return;Ne.preventDefault();const nt=Ne.key==="ArrowLeft"?-1:1;Ne.repeat&&ie.current===nt||At(nt)},xe=Ne=>{if(Ne.key!=="ArrowLeft"&&Ne.key!=="ArrowRight")return;const nt=Ne.key==="ArrowLeft"?-1:1;ie.current===nt&&bt()},Re=()=>{bt()};return window.addEventListener("keydown",x),window.addEventListener("keyup",xe),window.addEventListener("blur",Re),()=>{window.removeEventListener("keydown",x),window.removeEventListener("keyup",xe),window.removeEventListener("blur",Re),bt()}},[Z,s,d,Zt,et,At,bt]),a.useEffect(()=>{Z!=="open"&&bt()},[Z,bt]);const tn=()=>{Z==="closing"||l||Zt()},Ct=Z==="open",Bt=Z==="closing",cn=Ae>0?Math.max(0,1-Ae/500):1,mt=Ae>0?Math.max(.35,1-Ae/500):1,Le=a.useCallback(x=>{if(!(x.propertyName!=="transform"||!X.current)){if(q.current!==null){Et();return}Ve(),Ze(!1)}},[Ve,Ze,Et]),ze=Z==="closing"?ye??y:y,tt=ze&&ae&&(Z==="opening"||Bt)?Wv(ze,ae):void 0,gt=Be&&N?ct(N,"center"):Ae>0?`translateY(${Ae}px)`:tt,ht=ae?Zo(ae,I):null,Rt=!!(ze&&ae),dt=Rt&&(Z==="closing"||Z==="open"&&z),Dt={position:"absolute",top:ht==null?void 0:ht.top,left:ht==null?void 0:ht.left,width:ht==null?void 0:ht.width,height:ht==null?void 0:ht.height,objectFit:"contain",transformOrigin:"top left",transform:gt,opacity:Ae>0?mt:Rt?1:Z==="opening"||Bt?0:1,transition:ge&&!ee?"none":ee?`transform ${oo}ms ${pn}`:H?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:dt?`transform ${Cn}ms ${pn}`:Z==="opening"||Bt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:qe&&Ct&&!Be?"auto":"none",touchAction:qe&&Ct?"none":void 0,zIndex:1,overflow:qe?"hidden":void 0},kt={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!Be?"auto":"none"},Pt=(x,xe,Re="adjacent")=>{const Ne=xt(x);if(!Ne)return{display:"none"};const nt=Re==="far"?xe==="left"?"far-left":"far-right":xe==="left"?"left-adjacent":"right-adjacent",{start:Mt}=Oe!==null?Gc(Ne,nt,Oe,I):{start:Re==="far"?yr(Ne,xe,I):Ui(Ne,xe,I)},Je=Zo(Mt,I),ft=ct(x,nt),Ht=!Be&&Re==="adjacent"&&Ct&&!Pe?qv(Ne,xe,I):null,Tt=Re==="far"&&Be&&Oe===(xe==="left"?-1:1),nn=ge&&!ee?!1:ee,dn=Re==="adjacent"&&Ct&&Pe&&!Be;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:ft??(Ht?`translate(${Ht.x}px, ${Ht.y}px)`:void 0),opacity:Re==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Re==="far"?`transform ${oo}ms ${pn}`:`transform ${oo}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:Z==="opening"||Bt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(x,xe)=>{const Re=xt(x);return Re?Vv(Ui(Re,xe,I),xe,I):null},Gt=x=>xe=>{if(!l){if(M.current){M.current=!1;return}xe.stopPropagation(),yt(x)}},Wt=Ie?Vt(Ie,"left"):null,_t=oe?Vt(oe,"right"):null,Ft=Wt?Zo(Wt,I):null,St=_t?Zo(_t,I):null;return r.jsxs("div",{ref:E,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:Z==="open"?"none":void 0},onClick:tn,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:ge?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:L,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ge?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Tc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:tn})})]}),Ct&&Ke&&r.jsx(Jo,{media:Ke,style:Pt(Ke,"left","far"),onMeasure:Ye,onTransitionEnd:Le},`far-prev-${Ke.url}`),Ct&&Ie&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:Ie,style:Pt(Ie,"left"),onMeasure:Ye,onTransitionEnd:Le},`prev-${Ie.url}`),Ft&&r.jsx("div",{style:{position:"absolute",top:Ft.top,left:Ft.left,width:Ft.width,height:Ft.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&oe&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:oe,style:Pt(oe,"right"),onMeasure:Ye,onTransitionEnd:Le},`next-${oe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&it&&r.jsx(Jo,{media:it,style:Pt(it,"right","far"),onMeasure:Ye,onTransitionEnd:Le},`far-next-${it.url}`),ae&&N&&(qe?r.jsx(Uv,{src:N.url,phase:Z,onMediaElement:Ot,wrapperStyle:Dt,videoStyle:kt,onLoadedMetadata:wt,onTransitionEnd:Le},`${n}-${N.url}`):r.jsx("img",{ref:Ot,src:N.url,alt:N.name,onLoad:wt,onTransitionEnd:Le,style:Dt},`${n}-${N.url}`))]})}const Xv=20,Yv=.18;function Zv(e){return`
|
|
18702
|
+
`}const Cn=500,oo=650,pn="cubic-bezier(0.22, 1, 0.36, 1)",Mv=72,Pv=50,kv=1e4,Av=650,Fv=500;function Wv(e,t){const n=e.width/t.width,i=e.height/t.height,o=e.left-t.left,s=e.top-t.top;return`translate(${o}px, ${s}px) scale(${n}, ${i})`}function zc(e,t){if(t==="contain"&&e instanceof HTMLImageElement){const i=mr(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 _v(e,t,n){const i=e.querySelector(`[data-waterfall-index="${t}"]`);return i instanceof HTMLElement?zc(i,n):null}function Hv(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 so(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 bl(e,t,n){if(e.length<=2)return null;const i=(t+n+e.length)%e.length;return so(e,i,n)}const Nv=.03;function Bc(e){return e.width*Nv}const da={left:0,top:0,width:typeof window<"u"?window.innerWidth:1440,height:typeof window<"u"?window.innerHeight:900};function Zo(e,t){return{left:e.left-t.left,top:e.top-t.top,width:e.width,height:e.height}}function wl(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function Ov(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}function Ea(e,t,n){const i=e.getBoundingClientRect(),o=i.width,s=i.height,l=t/n,d=o/s;if(l>d){const u=o/l;return{width:o,height:u,left:i.left,top:i.top+(s-u)/2}}const c=s*l;return{width:c,height:s,left:i.left+(o-c)/2,top:i.top}}function Dv(e,t){return!e||!(t!=null&&t.width)||!(t!=null&&t.height)?null:Ea(e,t.width,t.height)}function jv(e,t){if(Fr(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 zv(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 Bv({mediaList:e}){return e.length===0?null:r.jsx("div",{"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:e.map(t=>Fr(t)?r.jsx("video",{src:t.url,preload:"auto",muted:!0,playsInline:!0},t.url):r.jsx("img",{src:t.url,alt:""},t.url))})}function Ui(e,t,n){const{width:i,height:o,top:s}=e,{left:l,width:d}=n,c=Bc(n);return t==="left"?{left:l+c-i,top:s,width:i,height:o}:{left:l+d-c,top:s,width:i,height:o}}function yr(e,t,n){const i=Ui(e,t,n);return{...i,left:2*i.left-e.left}}function Vv(e,t,n){const{left:i,width:o}=n,s=Bc(n);return t==="left"?{left:i,top:e.top,width:s,height:e.height}:{left:i+o-s,top:e.top,width:s,height:e.height}}function Vc(e,t,n,i){const o=Ui(e,"left",i),s=Ui(e,"right",i),l=yr(e,"left",i),d=yr(e,"right",i);if(n===1)switch(t){case"center":return{start:e,end:o};case"right-adjacent":return{start:s,end:e};case"left-adjacent":return{start:o,end:l};case"far-right":return{start:d,end:s};default:return{start:e,end:e}}switch(t){case"center":return{start:e,end:s};case"left-adjacent":return{start:o,end:e};case"right-adjacent":return{start:s,end:d};case"far-left":return{start:l,end:o};default:return{start:e,end:e}}}function Gv(e,t,n,i){const{start:o,end:s}=Vc(e,t,n,i);return{x:s.left-o.left,y:s.top-o.top}}function qv(e,t,n){const i=Ui(e,t,n),o=yr(e,t,n);return{x:o.left-i.left,y:o.top-i.top}}function Fr(e){return e.type==="video"?!0:/\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(e.url)}function Uv({src:e,phase:t,onMediaElement:n,wrapperStyle:i,videoStyle:o,onLoadedMetadata:s,onTransitionEnd:l}){const d=a.useRef(null);return a.useEffect(()=>{const c=d.current;return n==null||n(c??null),()=>{c==null||c.pause(),n==null||n(null)}},[e,n]),r.jsx("div",{style:i,onTransitionEnd:l,children:r.jsx("video",{ref:d,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:s,onClick:c=>c.stopPropagation(),style:o},e)})}function Jo({media:e,style:t,onTransitionEnd:n,onMeasure:i}){return Fr(e)?r.jsx("video",{src:e.url,muted:!0,playsInline:!0,preload:"auto",style:t,onLoadedMetadata:o=>{const s=o.currentTarget;s.videoWidth>0&&s.videoHeight>0&&(i==null||i(e.url,s.videoWidth,s.videoHeight))},onTransitionEnd:n}):r.jsx("img",{src:e.url,alt:e.name,style:t,onLoad:o=>{const s=o.currentTarget;s.naturalWidth>0&&s.naturalHeight>0&&(i==null||i(e.url,s.naturalWidth,s.naturalHeight))},onTransitionEnd:n})}function Kv({prefix:e,items:t,index:n,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,canNavigate:c,lightboxEntries:u,entryIdx:p,layoutId:v,sourceRect:x,resolveCloseSourceRect:g,onClose:h,onPrev:m,onNext:b}){const I=a.useRef(null),C=a.useRef(null),R=a.useRef(null),K=a.useRef(new Map),[F,V]=a.useState(0),A=a.useRef(null),T=a.useRef(0),j=a.useRef(0),y=a.useRef("none"),W=a.useRef(!1),M=a.useRef(!1),Y=a.useRef(!1),P=a.useRef(null),U=a.useRef(null),z=a.useRef(null),B=a.useRef(()=>{}),te=a.useRef(null),S=a.useRef(null),E=a.useRef(null),D=a.useRef(!1),[se,oe]=a.useState(null),[L,ue]=a.useState(da),[k,ne]=a.useState(0),[X,be]=a.useState("opening"),[Ae,fe]=a.useState(0),[le,q]=a.useState(0),[Q,Z]=a.useState(!1),[Ne,Te]=a.useState(null),[We,ce]=a.useState(null),[ye,$e]=a.useState(null),[G,re]=a.useState(!1),[pe,Se]=a.useState(null),[Pe,Re]=a.useState(!1),H=a.useRef(!1),[ge,ie]=a.useState(!1),[_,ee]=a.useState(!1),Fe=a.useRef(n),ae=a.useRef(void 0),N=t[n],qe=N?Fr(N):!1,je=le!==0||Q,st=!l&&(!s||!!d),et=c&&!l,pt=u.length>1,rt=a.useCallback((w,we)=>t.length<=1?null:t[(w+we+t.length)%t.length]??null,[t]),Ve=pt?so(u,p,-1):rt(n,-1),xe=pt?so(u,p,1):rt(n,1),me=Ne===-1&&je?pt&&We!==null?so(u,We,-1):ye!==null?rt(ye,-1):null:null,he=Ne===1&&je?pt&&We!==null?so(u,We,1):ye!==null?rt(ye,1):null:null,He=me&&me.url!==(Ve==null?void 0:Ve.url)?me:null,ve=he&&he.url!==(xe==null?void 0:xe.url)?he:null,Ee=Ve&&et?(()=>{const w=pt?bl(u,p,-1):t.length>2?rt((n-1+t.length)%t.length,-1):null;return w&&w.url!==Ve.url?w:null})():null,Me=xe&&et?(()=>{const w=pt?bl(u,p,1):t.length>2?rt((n+1)%t.length,1):null;return w&&w.url!==xe.url?w:null})():null,Ge=He??Ee,Ze=ve??Me,Ue=a.useCallback((w,we,Ie)=>{if(!w||!we||!Ie)return;const _e=K.current,it=_e.get(w);(it==null?void 0:it.width)===we&&(it==null?void 0:it.height)===Ie||(_e.set(w,{width:we,height:Ie}),V(Et=>Et+1))},[]),lt=a.useCallback(w=>{if(!(w!=null&&w.url))return null;const we=K.current.get(w.url);return Dv(C.current,we)},[F,k]),tt=a.useCallback(()=>{if(!N)return;const w=lt(N);if(w){oe(w);return}const we=C.current;we&&oe(wl(we))},[N,lt]),ke=a.useCallback(w=>{if(pt){const we=u.length;ce((p+w+we)%we),$e(null);return}t.length>1&&($e((n+w+t.length)%t.length),ce(null))},[pt,u.length,p,t.length,n]),Xe=a.useCallback(w=>{Y.current=w,Z(w)},[]),Oe=a.useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[]),ot=a.useCallback(()=>{Oe(),P.current=window.setTimeout(()=>{Oe(),Xe(!1)},oo+32)},[Oe,Xe]),ct=a.useCallback(()=>{const w=I.current;if(!w){ue({left:0,top:0,width:typeof window<"u"?window.innerWidth:da.width,height:typeof window<"u"?window.innerHeight:da.height});return}const we=w.getBoundingClientRect();ue({left:we.left,top:we.top,width:we.width,height:we.height})},[]),mt=a.useCallback((w,we)=>{if(je){if(ge&&!Q)return`translate(${le}px, 0px)`;if(Q&&Ne!==null){const Ie=lt(w);if(!Ie)return;const{x:_e,y:it}=Gv(Ie,we,Ne,L);return`translate(${_e}px, ${it}px)`}if(Q)return"translate(0px, 0px)"}},[je,ge,Q,le,Ne,L,lt]),Mt=a.useCallback(()=>{const w=U.current;U.current=null,Oe(),Xe(!1),Te(null),ce(null),$e(null),q(0),ie(!1),W.current=!1,j.current=0,y.current="none",w===-1?m():w===1&&b()},[Oe,Xe,m,b]),Ut=a.useCallback(()=>{Oe(),P.current=window.setTimeout(()=>{U.current!==null&&Mt()},oo+32)},[Oe,Mt]),Yt=a.useCallback(()=>{Oe(),U.current=null,Xe(!1),Te(null),ce(null),$e(null),q(0),ie(!1),W.current=!1,j.current=0,y.current="none"},[Oe,Xe]),xt=a.useCallback(w=>{if(!(!et||!se)){if(Y.current){if(U.current===w){z.current=w,Mt();return}Yt()}Oe(),ke(w),U.current=w,Te(w),Xe(!0),Ut()}},[et,se,Mt,Yt,Oe,ke,Xe,Ut]);B.current=xt;const bt=a.useCallback(()=>{te.current=null,D.current=!1,S.current!==null&&(window.clearInterval(S.current),S.current=null),E.current!==null&&(window.clearTimeout(E.current),E.current=null)},[]),_t=a.useCallback(w=>{S.current!==null&&window.clearInterval(S.current);const we=D.current?Fv:Av;S.current=window.setInterval(()=>{B.current(w)},we)},[]),kt=a.useCallback(w=>{te.current!==w&&(bt(),te.current=w,D.current=!1,B.current(w),_t(w),E.current=window.setTimeout(()=>{E.current=null,te.current===w&&(D.current=!0,_t(w))},kv))},[bt,_t]),vt=a.useCallback(()=>{const w=C.current;if(!w)return;const we=N==null?void 0:N.url,Ie=we?K.current.get(we):void 0;if(Ie!=null&&Ie.width&&(Ie!=null&&Ie.height)){oe(Ea(w,Ie.width,Ie.height));return}const _e=R.current;if(_e&&we&&(_e.src===we||_e.currentSrc===we)){const{width:Et,height:Je}=Ov(_e);if(Et&&Je){Ue(we,Et,Je),oe(Ea(w,Et,Je));return}}const it=wl(w);!it.width||!it.height||oe(it)},[N==null?void 0:N.url,Ue]),Ft=a.useCallback(w=>{if(R.current=w,!!w){if(w instanceof HTMLVideoElement){w.readyState>=1&&w.videoWidth>0&&vt();return}w.complete&&w.naturalWidth>0&&vt()}},[vt]),zt=a.useCallback(()=>{ct(),vt(),ne(w=>w+1)},[ct,vt]);a.useEffect(()=>{zt();const w=C.current,we=I.current,Ie=new ResizeObserver(()=>zt());return w&&Ie.observe(w),we&&Ie.observe(we),window.addEventListener("resize",zt),()=>{Ie.disconnect(),window.removeEventListener("resize",zt)}},[zt,n,v]),a.useLayoutEffect(()=>{if(!N)return;const w=R.current;if(w){if(w instanceof HTMLImageElement&&w.complete&&w.naturalWidth>0){vt();return}w instanceof HTMLVideoElement&&w.readyState>=1&&w.videoWidth>0&&vt()}},[N==null?void 0:N.url,n,vt]),a.useEffect(()=>{tt()},[tt,F]),a.useEffect(()=>{const w=new Set,we=[],Ie=_e=>{!(_e!=null&&_e.url)||w.has(_e.url)||(w.add(_e.url),we.push(_e))};t.forEach(Ie),u.forEach(_e=>_e.items.forEach(Ie)),we.forEach(_e=>{K.current.has(_e.url)||jv(_e,Ue)})},[t,u,Ue]),a.useEffect(()=>{if(X!=="opening"||!se)return;if(!x){be("open");return}re(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{re(!0),be("open")})});return()=>cancelAnimationFrame(w)},[X,se,x]),a.useEffect(()=>{if(X!=="closing")return;const w=setTimeout(()=>h(),Cn);return()=>clearTimeout(w)},[X,h]),a.useEffect(()=>()=>{Oe()},[Oe]),a.useLayoutEffect(()=>{Fe.current===n&&ae.current===(N==null?void 0:N.url)||(Oe(),U.current=null,Te(null),ce(null),$e(null),fe(0),q(0),Xe(!1),ee(!1),ie(!1),T.current=0,j.current=0,y.current="none",W.current=!1,A.current=null,M.current=!1,R.current=null,tt(),Fe.current=n,ae.current=N==null?void 0:N.url)},[n,N==null?void 0:N.url,Xe,Oe,tt]),a.useLayoutEffect(()=>{const w=z.current;w!==null&&(z.current=null,requestAnimationFrame(()=>{B.current(w)}))},[n,p,N==null?void 0:N.url]),a.useLayoutEffect(()=>{if(X==="opening"){H.current=!1,Re(!1);return}if(X!=="open"||H.current)return;if(!Ve&&!xe){H.current=!0;return}Re(!1);const w=requestAnimationFrame(()=>{requestAnimationFrame(()=>{Re(!0),H.current=!0})});return()=>cancelAnimationFrame(w)},[X,Ve==null?void 0:Ve.url,xe==null?void 0:xe.url]),a.useEffect(()=>{if(X!=="open")return;const w=()=>{const Je=yt=>{yt.stopPropagation(),yt.preventDefault(),document.removeEventListener("click",Je,!0)};document.addEventListener("click",Je,!0)},we=Je=>{const yt=Je<0?1:-1;Oe(),ke(yt),U.current=yt,Te(yt),Xe(!0),Ut()},Ie=Je=>{if(Math.abs(Je)>Pv&&et){we(Je);return}U.current=null,Te(null),ce(null),$e(null),Xe(!0),q(0),ot()},_e=Je=>{if(Je.touches.length!==1||Y.current)return;const yt=Je.touches[0];M.current=!0,A.current={x:yt.clientX,y:yt.clientY},y.current="none",j.current=0,W.current=!1},it=Je=>{if(!A.current||Je.touches.length!==1||Y.current)return;const yt=Je.touches[0],Ot=yt.clientX-A.current.x,Tt=yt.clientY-A.current.y;if(y.current==="none"){if(Math.abs(Ot)<10&&Math.abs(Tt)<10)return;if(Math.abs(Ot)>Math.abs(Tt)){if(!et)return;y.current="horizontal"}else if(Tt>0){if(!st)return;y.current="vertical"}else return}if(y.current==="horizontal"){W.current=!0,ie(!0),j.current=Ot,q(Ot),Je.preventDefault();return}y.current==="vertical"&&(W.current=!0,ie(!0),T.current=Tt,fe(Tt),Je.preventDefault())},Et=()=>{if(!A.current)return;const Je=y.current,yt=W.current;if(yt&&Je==="horizontal")Ie(j.current),w();else if(yt&&Je==="vertical"){const Ot=T.current;if(st&&Ot>Mv){const Tt=window.innerHeight;T.current=Tt,ee(!0),fe(Tt),be("closing")}else T.current=0,fe(0);w()}else Je==="horizontal"&&Math.abs(j.current)>0&&(Ie(j.current),w());A.current=null,y.current="none",j.current=0,W.current=!1,ie(!1)};return document.addEventListener("touchstart",_e,{passive:!0}),document.addEventListener("touchmove",it,{passive:!1}),document.addEventListener("touchend",Et),document.addEventListener("touchcancel",Et),()=>{document.removeEventListener("touchstart",_e),document.removeEventListener("touchmove",it),document.removeEventListener("touchend",Et),document.removeEventListener("touchcancel",Et)}},[X,et,Xe,ot,Oe,st,Ut,ke]);const Zt=a.useCallback(()=>{const w=(g==null?void 0:g())??x??null;w&&se&&(Se(w),re(!0)),be("closing")},[g,x,se]);a.useEffect(()=>{const w=_e=>{if(_e.key==="Escape"){if(s&&d||X==="closing")return;bt(),Zt();return}if(_e.key!=="ArrowLeft"&&_e.key!=="ArrowRight"||X!=="open"||!et)return;_e.preventDefault();const it=_e.key==="ArrowLeft"?-1:1;_e.repeat&&te.current===it||kt(it)},we=_e=>{if(_e.key!=="ArrowLeft"&&_e.key!=="ArrowRight")return;const it=_e.key==="ArrowLeft"?-1:1;te.current===it&&bt()},Ie=()=>{bt()};return window.addEventListener("keydown",w),window.addEventListener("keyup",we),window.addEventListener("blur",Ie),()=>{window.removeEventListener("keydown",w),window.removeEventListener("keyup",we),window.removeEventListener("blur",Ie),bt()}},[X,s,d,Zt,et,kt,bt]),a.useEffect(()=>{X!=="open"&&bt()},[X,bt]);const en=()=>{X==="closing"||l||Zt()},Ct=X==="open",Bt=X==="closing",cn=Ae>0?Math.max(0,1-Ae/500):1,gt=Ae>0?Math.max(.35,1-Ae/500):1,Le=a.useCallback(w=>{if(!(w.propertyName!=="transform"||!Y.current)){if(U.current!==null){Mt();return}Oe(),Xe(!1)}},[Oe,Xe,Mt]),ze=X==="closing"?pe??x:x,nt=ze&&se&&(X==="opening"||Bt)?Wv(ze,se):void 0,ht=je&&N?mt(N,"center"):Ae>0?`translateY(${Ae}px)`:nt,ft=se?Zo(se,L):null,Rt=!!(ze&&se),ut=Rt&&(X==="closing"||X==="open"&&G),Dt={position:"absolute",top:ft==null?void 0:ft.top,left:ft==null?void 0:ft.left,width:ft==null?void 0:ft.width,height:ft==null?void 0:ft.height,objectFit:"contain",transformOrigin:"top left",transform:ht,opacity:Ae>0?gt:Rt?1:X==="opening"||Bt?0:1,transition:ge&&!Q?"none":Q?`transform ${oo}ms ${pn}`:_?`transform ${Cn}ms ${pn}, opacity ${Cn}ms ${pn}`:ut?`transform ${Cn}ms ${pn}`:X==="opening"||Bt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:qe&&Ct&&!je?"auto":"none",touchAction:qe&&Ct?"none":void 0,zIndex:1,overflow:qe?"hidden":void 0},At={width:"100%",height:"100%",display:"block",objectFit:"contain",pointerEvents:Ct&&!je?"auto":"none"},Pt=(w,we,Ie="adjacent")=>{const _e=lt(w);if(!_e)return{display:"none"};const it=Ie==="far"?we==="left"?"far-left":"far-right":we==="left"?"left-adjacent":"right-adjacent",{start:Et}=Ne!==null?Vc(_e,it,Ne,L):{start:Ie==="far"?yr(_e,we,L):Ui(_e,we,L)},Je=Zo(Et,L),yt=mt(w,it),Ot=!je&&Ie==="adjacent"&&Ct&&!Pe?qv(_e,we,L):null,Tt=Ie==="far"&&je&&Ne===(we==="left"?-1:1),nn=ge&&!Q?!1:Q,dn=Ie==="adjacent"&&Ct&&Pe&&!je;return{position:"absolute",top:Je.top,left:Je.left,width:Je.width,height:Je.height,objectFit:"contain",transform:yt??(Ot?`translate(${Ot.x}px, ${Ot.y}px)`:void 0),opacity:Ie==="far"?Ct&&Tt?1:0:Ct?1:0,transition:nn?Ie==="far"?`transform ${oo}ms ${pn}`:`transform ${oo}ms ${pn}, opacity ${Cn}ms ${pn}`:dn?`transform ${Cn}ms ${pn}`:X==="opening"||Bt?`opacity ${Cn}ms ${pn}`:"none",pointerEvents:"none",zIndex:1}},Vt=(w,we)=>{const Ie=lt(w);return Ie?Vv(Ui(Ie,we,L),we,L):null},Gt=w=>we=>{if(!l){if(M.current){M.current=!1;return}we.stopPropagation(),xt(w)}},Ht=Ve?Vt(Ve,"left"):null,Nt=xe?Vt(xe,"right"):null,Wt=Ht?Zo(Ht,L):null,St=Nt?Zo(Nt,L):null;return r.jsxs("div",{ref:I,className:[`${e}-lightbox`,s?`${e}-lightbox-editor`:"",l?`${e}-lightbox-edit-mode`:""].filter(Boolean).join(" "),style:{touchAction:X==="open"?"none":void 0},onClick:en,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:o.backgroundColor??"#FFFFFF",opacity:Ct?cn:0,transition:ge?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"}}),r.jsxs("div",{className:`${e}-lightbox-dismiss-area`,children:[r.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:C,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{height:"10%"}})]}),r.jsx("div",{style:{position:"absolute",inset:0,opacity:Ct?1:0,transition:ge?"none":`opacity ${Cn}ms ${pn}`,pointerEvents:"none"},children:r.jsx(Cc,{prefix:e,entry:i,settings:o,isEditor:s,isEditMode:l,isPreviewMode:d,onClose:en})})]}),Ct&&Ge&&r.jsx(Jo,{media:Ge,style:Pt(Ge,"left","far"),onMeasure:Ue,onTransitionEnd:Le},`far-prev-${Ge.url}`),Ct&&Ve&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:Ve,style:Pt(Ve,"left"),onMeasure:Ue,onTransitionEnd:Le},`prev-${Ve.url}`),Wt&&r.jsx("div",{style:{position:"absolute",top:Wt.top,left:Wt.left,width:Wt.width,height:Wt.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(-1)})]}),Ct&&xe&&r.jsxs(r.Fragment,{children:[r.jsx(Jo,{media:xe,style:Pt(xe,"right"),onMeasure:Ue,onTransitionEnd:Le},`next-${xe.url}`),St&&r.jsx("div",{style:{position:"absolute",top:St.top,left:St.left,width:St.width,height:St.height,cursor:l||ge?"default":"pointer",pointerEvents:l||ge?"none":"auto",zIndex:3},onClick:Gt(1)})]}),Ct&&Ze&&r.jsx(Jo,{media:Ze,style:Pt(Ze,"right","far"),onMeasure:Ue,onTransitionEnd:Le},`far-next-${Ze.url}`),se&&N&&(qe?r.jsx(Uv,{src:N.url,phase:X,onMediaElement:Ft,wrapperStyle:Dt,videoStyle:At,onLoadedMetadata:vt,onTransitionEnd:Le},`${n}-${N.url}`):r.jsx("img",{ref:Ft,src:N.url,alt:N.name,onLoad:vt,onTransitionEnd:Le,style:Dt},`${n}-${N.url}`))]})}const Xv=20,Yv=.18;function Zv(e){return`
|
|
18651
18703
|
.${e}-wrapper {
|
|
18652
18704
|
box-sizing: border-box;
|
|
18653
18705
|
max-width: 100%;
|
|
@@ -18735,7 +18787,7 @@ export function SimpleButton({ settings, isEditor, isPreviewMode, activeEvent, h
|
|
|
18735
18787
|
pointer-events: auto;
|
|
18736
18788
|
}
|
|
18737
18789
|
${Ev(e)}
|
|
18738
|
-
`}function Jv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function Qv(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 e0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:$.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:$.scalingValue(i*Yv,n??!1),[`--${t}-image-aspect`]:Jv(e)}}function t0(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 Kt(n,t)}function n0(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 i0(e,t,n,i,o,s){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);s(n,d?
|
|
18790
|
+
`}function Jv(e){const{imageDisplay:t}=e??{},n=(t==null?void 0:t.ratioValue)??"1:1",i=(t==null?void 0:t.reversed)??!1,[o,s]=n.split(":").map(Number),l=i?s:o,d=i?o:s;return d>0?l/d:1}function Qv(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 e0(e,t,n){const i=(e==null?void 0:e.titleFontSize)??.07,o=(e==null?void 0:e.titleLineHeight)??i;return{[`--${t}-line-height`]:$.scalingValue(o,n??!1),[`--${t}-image-inline-gap`]:$.scalingValue(i*Yv,n??!1),[`--${t}-image-aspect`]:Jv(e)}}function t0(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 Kt(n,t)}function n0(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 i0(e,t,n,i,o,s){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);s(n,d?zc(d,o):void 0)}}function o0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,layoutId:s,portalId:l}){const{prefix:d}=$.useScopedStyles(),c=a.useMemo(()=>Zv(d),[d]),u=t??[],p=(e==null?void 0:e.type)??"a",v=typeof(e==null?void 0:e.wrapperWidth)=="number"?e.wrapperWidth:1,x=typeof(e==null?void 0:e.horizontalGap)=="number"?e.horizontalGap:0,g=$.scalingValue(x,n??!1),h=`max(${g}, ${Xv}px)`,{objectFitMode:m,imageStyle:b}=n0(e),I=t0(e,n),C=a.useRef(null),[R,K]=a.useState(!1),[F,V]=a.useState([]),[A,T]=a.useState(0),[j,y]=a.useState(0),[W,M]=a.useState(null),[Y,P]=a.useState({title1:"",title2:"",title3:""}),U=(!n||i)&&!R,z=(e==null?void 0:e.imageHoverEffect)??{sizeType:"none",value:120},B=z.sizeType??"none",te=U&&B!=="none"?`${d}-item-image-hover-${B}`:void 0,S=(z.value??120)/100,E=a.useCallback(le=>{!le||B!=="scale"||(le.style.transformOrigin=Jp(le))},[B]),D=a.useCallback(le=>{if(le){if(m==="contain"){const q=Qv(le);if(q){const Q=le.closest(`.${d}-item-image`);Q instanceof HTMLElement&&Q.style.setProperty(`--${d}-item-media-aspect`,String(q))}}E(le)}},[d,E,m]),se={width:$.scalingValue(v,n??!1),...I,...e0(e,d,n),[`--${d}-image-hover-scale`]:String(S)},oe=(()=>{const le={},q=C.current?getComputedStyle(C.current).getPropertyValue("--cntrl-article-width").trim():"";return q&&(le["--cntrl-article-width"]=q),le})(),L=((e==null?void 0:e.lightbox)??"on")==="on"&&(!n||i||o),ue=a.useMemo(()=>Hv(u),[u]),k=a.useMemo(()=>zv(u),[u]),ne=(le,q)=>{if(((e==null?void 0:e.lightbox)??"on")==="off"||n&&!o&&!i)return;const Q=ue.findIndex(Ne=>Ne.gridIndex===le);if(Q<0)return;const Z=ue[Q];y(Q),V(Z.items),T(0),P(Z.entry),M(q??null),K(!0)},X=a.useCallback(()=>{K(!1),M(null)},[]),be=a.useCallback(()=>{const le=ue[j];return!le||!C.current?W:_v(C.current,le.gridIndex,m)??W},[ue,j,W,m]),Ae=a.useCallback(le=>{if(ue.length>1){const q=ue.length,Q=(j+le+q)%q,Z=ue[Q];y(Q),V(Z.items),T(0),P(Z.entry);return}T(q=>(q+le+F.length)%F.length)},[ue,j,F.length]),fe=ue.length>1||F.length>1;return a.useEffect(()=>{if(!R||typeof document>"u")return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[R]),a.useEffect(()=>{!n||o||i||K(!1)},[n,o,i]),a.useEffect(()=>{((e==null?void 0:e.lightbox)??"on")==="off"&&K(!1)},[e==null?void 0:e.lightbox]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:c}}),r.jsx(Bv,{mediaList:k}),r.jsx("div",{ref:C,className:`${d}-wrapper ${d}-type-${p}`,style:se,children:u.map((le,q)=>{var Ne,Te;const Q=!!((Ne=le.image)!=null&&Ne.url),Z=i0(!!L,Q,q,d,m,ne);return r.jsxs("div",{className:`${d}-item`,children:[le.title?r.jsx("span",{className:`${d}-item-title`,onClick:Z,style:Z?{cursor:"pointer"}:void 0,children:le.title}):null,(Te=le.image)!=null&&Te.url?r.jsx("span",{className:[`${d}-item-image`,m==="contain"?`${d}-item-image-fit`:void 0,te].filter(Boolean).join(" "),children:le.image.type==="video"?r.jsx("video",{ref:D,src:le.image.url,"data-waterfall-index":q,style:b,playsInline:!0,muted:!0,loop:!0,autoPlay:!0,onClick:Z,onLoadedData:We=>D(We.currentTarget)}):r.jsx("img",{ref:D,src:le.image.url,alt:le.image.name??"","data-waterfall-index":q,style:b,onClick:Z,onLoad:We=>D(We.currentTarget)})}):null,q<u.length-1&&r.jsx("div",{className:`${d}-item-gap-host`,style:{width:g},children:o&&!R&&r.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%"}})})]},q)})}),R&&((e==null?void 0:e.lightbox)??"on")==="on"&&typeof document<"u"&&e&&(()=>{const le=(l?document.getElementById(l):null)??document.body;return Yn.createPortal(r.jsx("div",{style:oe,"data-selection":"none",children:r.jsx(Kv,{prefix:d,items:F,index:A,entry:Y,settings:e,isEditor:n,isEditMode:o,isPreviewMode:i,canNavigate:fe,lightboxEntries:ue,entryIdx:j,layoutId:s,sourceRect:W,resolveCloseSourceRect:be,onClose:X,onPrev:()=>Ae(-1),onNext:()=>Ae(1)})}),le)})()]})}const r0=`import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18739
18791
|
import type React from 'react';
|
|
18740
18792
|
import { createPortal } from 'react-dom';
|
|
18741
18793
|
import { CommonComponentProps } from '../props';
|
|
@@ -19249,7 +19301,7 @@ export function Waterfall({
|
|
|
19249
19301
|
</>
|
|
19250
19302
|
);
|
|
19251
19303
|
}
|
|
19252
|
-
`,a0="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>'),jn={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[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ki=Kn.filter(e=>e!=="count"),l0=Ki.reduce((e,t)=>({...e,...s0(t)}),{}),c0=Ki.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Arial",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ua(e){return Ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const d0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ki.map(e=>[ts[e],ns(e)]))},Qo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},u0=[{title:"Salton Sea from Above",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],p0={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:u0},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:{...jn.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"]}}},...l0},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:a0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...c0},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,...ua({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,...ua({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,...ua({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:[d0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},m0={element:o0,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"},...Ki.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ki.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})},schema:p0,sourceCode:r0},Wi=500,qc="cubic-bezier(0.25, 1, 0.5, 1)",g0=300,h0=5,f0=.15,y0=.4,v0=100,Ci=100,$l={color:"#000000",hover:"#cccccc"},ro={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},x0={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}},pa={offset:{x:0,y:0},linkColor:"#cccccc"},Cl={sizeType:"drag",value:3},b0="left";function w0(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:b0,color:(e==null?void 0:e.titleColor)??"#000000"};return Kt(n,t)}function Ti(e,t,n){return`${e}: ${$.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function S0(e,t,n,i){if(!i)return{position:lo(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 $0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function C0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const y=n.getBoundingClientRect();return{x:y.left,y:y.top}},o=i(0,0),s=i(Ci,0),l=i(0,Ci);e.removeChild(n);const d={x:(s.x-o.x)/Ci,y:(s.y-o.y)/Ci},c={x:(l.x-o.x)/Ci,y:(l.y-o.y)/Ci},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function T0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function L0(e,t){return`
|
|
19304
|
+
`,a0="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>'),jn={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[Qe(e,"fontFamily")]={type:"string",scope:"common",title:"",display:{type:"font-family-select",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSettings")]={...jn.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight",hideLabel:!0,useTabDesign:!0}},t[Qe(e,"fontSize")]={...jn.fontSize,scope:"layout",title:"",display:{type:"font-size"}},t[Qe(e,"lineHeight")]={...jn.lineHeight,scope:"layout",title:"",display:{type:"line-height-input"}},t[Qe(e,"letterSpacing")]={...jn.letterSpacing,scope:"layout",title:"",display:{type:"letter-spacing-input"}},t[Qe(e,"wordSpacing")]={...jn.wordSpacing,scope:"layout",title:"",display:{type:"word-spacing-input"}},t[Qe(e,"textAlign")]={...jn.textAlign,scope:"layout",title:"",display:{type:"vertical-text-aligh-options"}},t[Qe(e,"textAppearance")]={...jn.textAppearance,scope:"layout",title:"",display:{type:"text-appearance",useTabDesign:!0}},t}const Ki=Kn.filter(e=>e!=="count"),l0=Ki.reduce((e,t)=>({...e,...s0(t)}),{}),c0=Ki.reduce((e,t)=>({...e,[Qe(t,"fontFamily")]:"Arial",[Qe(t,"fontSettings")]:{fontWeight:400,fontStyle:"normal"},[Qe(t,"letterSpacing")]:0,[Qe(t,"wordSpacing")]:0,[Qe(t,"textAlign")]:"left",[Qe(t,"textAppearance")]:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}}),{});function ua(e){return Ki.reduce((t,n)=>{const i=e[`${n}FontSize`],o=e[`${n}LineHeight`];return i!==void 0&&(t[Qe(n,"fontSize")]=i),o!==void 0&&(t[Qe(n,"lineHeight")]=o),t},{})}const d0={type:"tab",id:"journalTextStyle",tabs:Object.fromEntries(Ki.map(e=>[ts[e],ns(e)]))},Qo={subtitle:"NASA",caption:"Apollo 9 Mission, 1969"},u0=[{title:"Salton Sea from Above",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-11.jpg",objectFit:"cover"}},{title:"Lunar Module Pilot",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-3.jpg",objectFit:"cover"}},{title:"CSM and Lunar Module LM",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-6.jpg",objectFit:"cover"}},{title:"David R. Scott During EVA",...Qo,image:{url:"https://cdn.cntrl.site/component-assets/Component-default-7.jpg",objectFit:"cover"}}],p0={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:u0},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:{...jn.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"]}}},...l0},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:a0,closeIconColor:"#000000",closeIconHoverColor:"#999999",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},...c0},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,...ua({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,...ua({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,...ua({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:[d0]}]}],paletteBookmark:{items:["titleColor","title1Color","title2Color","title3Color","backgroundColor","closeIconColor","closeIconHoverColor"],panelIds:["general","imageSettings","typeStyle"]}},m0={element:o0,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"},...Ki.map(e=>({path:`${Qe(e,"fontFamily")}`}))]},fontRelations:{titleFontSettings:"titleFontFamily",...Ki.reduce((e,t)=>({...e,[`${t}FontSettings`]:`${Qe(t,"fontFamily")}`}),{})},schema:p0,sourceCode:r0},Wi=500,Gc="cubic-bezier(0.25, 1, 0.5, 1)",g0=300,h0=5,f0=.15,y0=.4,v0=100,Ci=100,Sl={color:"#000000",hover:"#cccccc"},ro={offset:{x:0,y:0},colors:{pagination:"#cccccc",inactive:"#cccccc",background:"#000000"}},x0={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}},pa={offset:{x:0,y:0},linkColor:"#cccccc"},$l={sizeType:"drag",value:3},b0="left";function w0(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:b0,color:(e==null?void 0:e.titleColor)??"#000000"};return Kt(n,t)}function Ti(e,t,n){return`${e}: ${$.scalingValue(t/1440,n)};`}function lo(e,t){return t<=0?0:(e%t+t)%t}function S0(e,t,n,i){if(!i)return{position:lo(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 $0(e,t){const n=new DOMMatrixReadOnly(window.getComputedStyle(e).transform);return t?n.m41:n.m42}function C0(e,t){const n=document.createElement("div");n.className=t,n.setAttribute("aria-hidden","true"),e.appendChild(n);const i=(p,v)=>{n.style.transform=`translate(${p}px, ${v}px)`;const x=n.getBoundingClientRect();return{x:x.left,y:x.top}},o=i(0,0),s=i(Ci,0),l=i(0,Ci);e.removeChild(n);const d={x:(s.x-o.x)/Ci,y:(s.y-o.y)/Ci},c={x:(l.x-o.x)/Ci,y:(l.y-o.y)/Ci},u=d.x*c.y-c.x*d.y;return{ex:d,ey:c,det:u}}function T0(e,t,n){const{ex:i,ey:o,det:s}=e;return{x:(t*o.y-n*o.x)/s,y:(i.x*n-i.y*t)/s}}function L0(e,t){return`
|
|
19253
19305
|
.${e}-wrapper {
|
|
19254
19306
|
position: relative;
|
|
19255
19307
|
width: 100%;
|
|
@@ -19321,7 +19373,7 @@ export function Waterfall({
|
|
|
19321
19373
|
top: 0;
|
|
19322
19374
|
left: 0;
|
|
19323
19375
|
opacity: 0;
|
|
19324
|
-
transition: opacity ${Wi}ms ${
|
|
19376
|
+
transition: opacity ${Wi}ms ${Gc};
|
|
19325
19377
|
}
|
|
19326
19378
|
.${e}-list-fade .${e}-slide.${e}-is-active {
|
|
19327
19379
|
opacity: 1;
|
|
@@ -19519,7 +19571,7 @@ export function Waterfall({
|
|
|
19519
19571
|
from { clip-path: inset(100% 0 0 0); }
|
|
19520
19572
|
to { clip-path: inset(0 0 0 0); }
|
|
19521
19573
|
}
|
|
19522
|
-
`}function R0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=$.useScopedStyles(),l=w0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??Cl,p=u.sizeType??"drag",v=u.value??Cl.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",m=(e==null?void 0:e.navSize)??"m",b=x0[m],E=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,L=oe=>$.scalingValue(oe*E,n),C=(e==null?void 0:e.show)??"always",K=(e==null?void 0:e.controls)??null,W=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,B=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,A=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,T=(e==null?void 0:e.controlsColor)??$l.color,j=(e==null?void 0:e.controlsHoverColor)??$l.hover,w=(e==null?void 0:e.navColor)??ro.colors.inactive,P=(e==null?void 0:e.navPaginationColor)??ro.colors.pagination,M=(e==null?void 0:e.navBackgroundColor)??ro.colors.background,X=(e==null?void 0:e.linkColor)??pa.linkColor,k=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,q=y==="horizontal",V=p==="click",G=p==="drag",ie=p==="auto"&&(!n||!!i),S=!n,R=g==="slide",O=h==="classic",ae=C!=="never",se=C==="on hover",I=$.scalingValue(W,n),de={width:I,height:I,maxWidth:I},F=R&&c>1,[te,Z]=a.useState(0),[ve,Ae]=a.useState(F?1:0),[he,pe]=a.useState(!1),[U,ee]=a.useState(!1),[Y,Oe]=a.useState(!1),[$e,He]=a.useState(0),[ue,me]=a.useState(!1),[be,z]=a.useState(!1),le=a.useRef(!1),ye=a.useRef(ve);ye.current=ve;const we=a.useRef(null),Pe=a.useRef(0),Ce=a.useRef(null),_=a.useRef(null),ge=a.useRef(null),ne=a.useRef(null),H=a.useCallback(oe=>{le.current=oe,pe(oe)},[]),Q=a.useCallback(oe=>{if(c<2||oe===0)return;const Te=oe>0?1:-1,Ee=Math.abs(oe);if(me(!0),H(!0),!R){Z(it=>lo(it+oe,c));return}let De=ye.current;const fe=F&&(De===0||De===c+1),Me=fe?te+1:null;fe&&(De=te+1);let _e=Ee;for(;_e>0;){const it=S0(De,Te,c,F);if(De=it.position,_e-=1,it.hitBoundary){Pe.current=_e*Te;break}}const Ke=Ee-_e;if(Ke>0&&Z(it=>lo(it+Ke*Te,c)),ye.current=De,Me!==null){if(ye.current=Me,De===Me){ee(!0),Ae(De);return}we.current=De,ee(!0),Ae(Me);return}ee(!1),Ae(De)},[te,c,F,R,H]),Fe=a.useCallback(oe=>{Q(oe)},[Q]),re=a.useCallback(oe=>{if(c<2)return;const Te=lo(oe,c);if(!(Te===te&&!le.current)&&(me(!0),H(!0),Z(Te),R)){const Ee=Te+(F?1:0);we.current=null,Pe.current=0,ye.current=Ee,ee(!1),Ae(Ee)}},[te,c,F,R,H]);a.useEffect(()=>{if(!he)return;const oe=window.setTimeout(()=>{if(F&&(ve===0||ve===c+1)){we.current=null,ee(!0),Ae(te+1);return}H(!1)},Wi);return()=>window.clearTimeout(oe)},[te,c,F,he,H,ve]),a.useEffect(()=>{if(!U)return;let oe=0;const Te=requestAnimationFrame(()=>{oe=requestAnimationFrame(()=>{const Ee=we.current;we.current=null;const De=Pe.current;if(Pe.current=0,ee(!1),Ee!==null){ye.current=Ee,Ae(Ee);return}if(De!==0){Q(De);return}H(!1)})});return()=>{cancelAnimationFrame(Te),cancelAnimationFrame(oe)}},[Q,H,U]);const N=`${F}:${c}`,qe=a.useRef(N);a.useEffect(()=>{if(qe.current===N)return;qe.current=N;const oe=c>0?Math.min(te,c-1):0;ge.current=null,ne.current=null,Oe(!1),He(0),Z(oe),ee(!0),Ae(oe+(F?1:0))},[te,c,F,N]),a.useEffect(()=>{if(!ue)return;const oe=window.setTimeout(()=>me(!1),g0);return()=>window.clearTimeout(oe)},[ue,te]),a.useEffect(()=>{if(!ie||c<2)return;const oe=Math.max(v,.1)*1e3,Te=window.setInterval(()=>{S&&be||Fe(1)},oe);return()=>window.clearInterval(Te)},[v,c,Fe,ie,be,S]);const Be=a.useCallback(oe=>{const Te=ge.current;if(!Te||Te.pointerId!==oe.pointerId)return;ge.current=null,ne.current=null;const Ee=Ce.current;if(Ee!=null&&Ee.hasPointerCapture(oe.pointerId)&&Ee.releasePointerCapture(oe.pointerId),!Te.isActive){R&&He(0);return}const fe=!(oe.timeStamp-Te.lastTime>v0)&&Math.abs(Te.velocity)>y0,Me=Te.size>0&&Math.abs(Te.offset-Te.baseOffset)>Te.size*f0;if(Oe(!1),!fe&&!Me){He(0);return}const _e=Me?Te.offset-Te.baseOffset:Te.velocity;let Ke=1;Me&&Te.size>0&&(Ke=Math.max(1,Math.round(Math.abs(_e)/Te.size))),He(0),Q(_e<0?Ke:-Ke)},[Q,R]);a.useEffect(()=>{const oe=Te=>{ne.current===null||Te.pointerId!==ne.current||Be(Te)};return window.addEventListener("pointerup",oe),window.addEventListener("pointercancel",oe),()=>{window.removeEventListener("pointerup",oe),window.removeEventListener("pointercancel",oe)}},[Be]);const at=oe=>{const Te=Ce.current;if(!G||c<2||!Te||oe.pointerType==="mouse"&&oe.button!==0)return;we.current=null,Pe.current=0,le.current&&H(!1);let Ee=0;const De=_.current;if(R&&De){const fe=q?De.offsetWidth:De.offsetHeight;if(fe>0){const Me=$0(De,q);let _e=ye.current;F&&(_e===0||_e===c+1)?(_e=te+1,ye.current=_e,ee(!0),Ae(_e),Ee=0):Ee=Me+_e*fe,He(Ee)}}Te.setPointerCapture(oe.pointerId),ne.current=oe.pointerId,ge.current={pointerId:oe.pointerId,startClientX:oe.clientX,startClientY:oe.clientY,axes:C0(Te,`${s}-axis-probe`),size:q?Te.offsetWidth:Te.offsetHeight,isActive:!1,baseOffset:Ee,offset:Ee,lastTime:oe.timeStamp,velocity:0}},et=oe=>{const Te=ge.current;if(!Te||Te.pointerId!==oe.pointerId)return;if(oe.pointerType==="mouse"&&oe.buttons===0){Be(oe);return}const Ee=oe.clientX-Te.startClientX,De=oe.clientY-Te.startClientY,fe=Te.axes?T0(Te.axes,Ee,De):{x:Ee,y:De},Me=q?fe.x:fe.y,_e=q?fe.y:fe.x,Ke=Te.baseOffset+Me;if(!Te.isActive){if(Math.max(Math.abs(Me),Math.abs(_e))<h0)return;if(Math.abs(_e)>Math.abs(Me)){const Ye=Ce.current;Ye!=null&&Ye.hasPointerCapture(Te.pointerId)&&Ye.releasePointerCapture(Te.pointerId),ge.current=null,ne.current=null,R&&He(0);return}Te.isActive=!0,Oe(!0)}const it=oe.timeStamp-Te.lastTime;it>0&&(Te.velocity=(Ke-Te.offset)/it,Te.lastTime=oe.timeStamp),Te.offset=Ke,R&&He(Ke)},ut=oe=>{Be(oe)},ke=q?`translate3d(calc(${-ve*100}% + ${$e}px), 0, 0)`:`translate3d(0, calc(${-ve*100}% + ${$e}px), 0)`,Ie=F?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:L0(s,n)}}),r.jsxs("div",{className:lt(`${s}-wrapper`,{[`${s}-transition-reveal`]:g==="reveal",[`${s}-transition-reveal-vertical`]:g==="reveal"&&!q}),onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Ce,className:lt(`${s}-track`,{[`${s}-track-draggable`]:G,[`${s}-track-draggable-vertical`]:G&&!q}),onPointerDown:at,onPointerMove:et,onPointerUp:ut,onPointerCancel:ut,onLostPointerCapture:oe=>{ne.current===oe.pointerId&&Be(oe)},children:r.jsx("div",{ref:_,className:lt(`${s}-list`,{[`${s}-list-slide`]:R,[`${s}-list-slide-vertical`]:R&&!q,[`${s}-list-fade`]:!R}),style:R?{transform:ke,transition:Y||U?"none":`transform ${Wi}ms ${qc}`}:void 0,children:Ie.map((oe,Te)=>{const Ee=F?lo(Te-1,c):Te,fe=F&&(Te===0||Te===c+1)?`clone-${Te===0?"start":"end"}`:`slide-${Ee}`;return r.jsx("div",{className:lt(`${s}-slide`,{[`${s}-is-active`]:!R&&Ee===te}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:lt(`${s}-slider-image`,{[`${s}-contain`]:oe.image.objectFit==="contain",[`${s}-cover`]:oe.image.objectFit==="cover"}),src:oe.image.url,alt:oe.image.name??"",draggable:!1})})})},fe)})})}),ae&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:lt(`${s}-arrow`,{[`${s}-arrow-prev`]:q,[`${s}-arrow-prev-vertical`]:!q,[`${s}-hover-arrow`]:se}),style:{color:T,"--arrow-hover-color":j,...de},children:r.jsxs("button",{onClick:oe=>{oe.stopPropagation(),Fe(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${$.scalingValue(B,n)}, ${$.scalingValue(A*(q?1:-1),n)}) rotate(${q?"0deg":"90deg"})`},children:[K&&r.jsx(rn,{url:K,fill:T,hoverFill:j,className:lt(`${s}-arrow-img`,`${s}-mirror`),style:de}),!K&&r.jsx(Tl,{color:T,className:lt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:lt(`${s}-arrow`,{[`${s}-arrow-next`]:q,[`${s}-arrow-next-vertical`]:!q,[`${s}-hover-arrow`]:se}),style:{color:T,"--arrow-hover-color":j,...de},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:oe=>{oe.stopPropagation(),Fe(1)},style:{transform:`translate(${$.scalingValue(B*(q?-1:1),n)}, ${$.scalingValue(A,n)}) rotate(${q?"0deg":"90deg"})`},children:[K&&r.jsx(rn,{url:K,fill:T,hoverFill:j,className:`${s}-arrow-img`,style:de}),!K&&r.jsx(Tl,{color:T,className:lt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),V&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Fe(1)}),O&&r.jsx("div",{className:lt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:q,[`${s}-pagination-inside-left`]:!q}),style:q?{bottom:L(b.inset)}:{left:L(b.inset)},children:r.jsx("div",{className:lt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!q,[`${s}-animate-dots`]:ue}),style:{backgroundColor:M,gap:L(b.gapInactive-b.activeDot+b.dot),...q?{height:L(b.activeDot+b.paddingY*2),paddingTop:L(b.paddingY),paddingBottom:L(b.paddingY),paddingLeft:L(b.paddingActive),paddingRight:L(b.paddingActive)}:{width:L(b.activeDot+b.paddingY*2),paddingLeft:L(b.paddingY),paddingRight:L(b.paddingY),paddingTop:L(b.paddingActive),paddingBottom:L(b.paddingActive)},borderRadius:L(b.borderRadius),transform:`translate(${$.scalingValue(ro.offset.x,n)}, ${$.scalingValue(ro.offset.y,n)})`},children:d.map((oe,Te)=>{const Ee=Te===te,De=Ee?b.activeDot:b.dot;return r.jsx("button",{onClick:()=>re(Te),className:`${s}-pagination-item`,style:{width:L(b.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:Ee?P:w,width:L(De)}})},Te)})},`${m}-${y}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:$.scalingValue(k,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((oe,Te)=>r.jsx("div",{className:lt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:Te===te&&n,[`${s}-active`]:Te===te}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Wi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":X,"--link-hover-color":X,position:"relative",top:$.scalingValue(pa.offset.y,n),left:$.scalingValue(pa.offset.x,n)},children:r.jsx(yi,{content:oe.imageCaption})})},Te))})]})]})]})}function Tl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 I0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19574
|
+
`}function R0({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o}){const{prefix:s}=$.useScopedStyles(),l=w0(e,n),d=t??[],c=d.length,u=(e==null?void 0:e.trigger)??$l,p=u.sizeType??"drag",v=u.value??$l.value,x=(e==null?void 0:e.direction)??"horizontal",g=(e==null?void 0:e.transition)??"slide",h=(e==null?void 0:e.nav)??"classic",m=(e==null?void 0:e.navSize)??"m",b=x0[m],I=typeof(e==null?void 0:e.navUnit)=="number"?e.navUnit:1/1440,C=xe=>$.scalingValue(xe*I,n),R=(e==null?void 0:e.show)??"always",K=(e==null?void 0:e.controls)??null,F=typeof(e==null?void 0:e.controlsMaxWidth)=="number"?e.controlsMaxWidth:65/1440,V=typeof(e==null?void 0:e.paddingX)=="number"?e.paddingX:0,A=typeof(e==null?void 0:e.paddingY)=="number"?e.paddingY:0,T=(e==null?void 0:e.controlsColor)??Sl.color,j=(e==null?void 0:e.controlsHoverColor)??Sl.hover,y=(e==null?void 0:e.navColor)??ro.colors.inactive,W=(e==null?void 0:e.navPaginationColor)??ro.colors.pagination,M=(e==null?void 0:e.navBackgroundColor)??ro.colors.background,Y=(e==null?void 0:e.linkColor)??pa.linkColor,P=typeof(e==null?void 0:e.captionMarginTop)=="number"?e.captionMarginTop:0,U=x==="horizontal",z=p==="click",B=p==="drag",te=p==="auto"&&(!n||!!i),S=!n,E=g==="slide",D=h==="classic",se=R!=="never",oe=R==="on hover",L=$.scalingValue(F,n),ue={width:L,height:L,maxWidth:L},k=E&&c>1,[ne,X]=a.useState(0),[be,Ae]=a.useState(k?1:0),[fe,le]=a.useState(!1),[q,Q]=a.useState(!1),[Z,Ne]=a.useState(!1),[Te,We]=a.useState(0),[ce,ye]=a.useState(!1),[$e,G]=a.useState(!1),re=a.useRef(!1),pe=a.useRef(be);pe.current=be;const Se=a.useRef(null),Pe=a.useRef(0),Re=a.useRef(null),H=a.useRef(null),ge=a.useRef(null),ie=a.useRef(null),_=a.useCallback(xe=>{re.current=xe,le(xe)},[]),ee=a.useCallback(xe=>{if(c<2||xe===0)return;const me=xe>0?1:-1,he=Math.abs(xe);if(ye(!0),_(!0),!E){X(Ze=>lo(Ze+xe,c));return}let He=pe.current;const ve=k&&(He===0||He===c+1),Ee=ve?ne+1:null;ve&&(He=ne+1);let Me=he;for(;Me>0;){const Ze=S0(He,me,c,k);if(He=Ze.position,Me-=1,Ze.hitBoundary){Pe.current=Me*me;break}}const Ge=he-Me;if(Ge>0&&X(Ze=>lo(Ze+Ge*me,c)),pe.current=He,Ee!==null){if(pe.current=Ee,He===Ee){Q(!0),Ae(He);return}Se.current=He,Q(!0),Ae(Ee);return}Q(!1),Ae(He)},[ne,c,k,E,_]),Fe=a.useCallback(xe=>{ee(xe)},[ee]),ae=a.useCallback(xe=>{if(c<2)return;const me=lo(xe,c);if(!(me===ne&&!re.current)&&(ye(!0),_(!0),X(me),E)){const he=me+(k?1:0);Se.current=null,Pe.current=0,pe.current=he,Q(!1),Ae(he)}},[ne,c,k,E,_]);a.useEffect(()=>{if(!fe)return;const xe=window.setTimeout(()=>{if(k&&(be===0||be===c+1)){Se.current=null,Q(!0),Ae(ne+1);return}_(!1)},Wi);return()=>window.clearTimeout(xe)},[ne,c,k,fe,_,be]),a.useEffect(()=>{if(!q)return;let xe=0;const me=requestAnimationFrame(()=>{xe=requestAnimationFrame(()=>{const he=Se.current;Se.current=null;const He=Pe.current;if(Pe.current=0,Q(!1),he!==null){pe.current=he,Ae(he);return}if(He!==0){ee(He);return}_(!1)})});return()=>{cancelAnimationFrame(me),cancelAnimationFrame(xe)}},[ee,_,q]);const N=`${k}:${c}`,qe=a.useRef(N);a.useEffect(()=>{if(qe.current===N)return;qe.current=N;const xe=c>0?Math.min(ne,c-1):0;ge.current=null,ie.current=null,Ne(!1),We(0),X(xe),Q(!0),Ae(xe+(k?1:0))},[ne,c,k,N]),a.useEffect(()=>{if(!ce)return;const xe=window.setTimeout(()=>ye(!1),g0);return()=>window.clearTimeout(xe)},[ce,ne]),a.useEffect(()=>{if(!te||c<2)return;const xe=Math.max(v,.1)*1e3,me=window.setInterval(()=>{S&&$e||Fe(1)},xe);return()=>window.clearInterval(me)},[v,c,Fe,te,$e,S]);const je=a.useCallback(xe=>{const me=ge.current;if(!me||me.pointerId!==xe.pointerId)return;ge.current=null,ie.current=null;const he=Re.current;if(he!=null&&he.hasPointerCapture(xe.pointerId)&&he.releasePointerCapture(xe.pointerId),!me.isActive){E&&We(0);return}const ve=!(xe.timeStamp-me.lastTime>v0)&&Math.abs(me.velocity)>y0,Ee=me.size>0&&Math.abs(me.offset-me.baseOffset)>me.size*f0;if(Ne(!1),!ve&&!Ee){We(0);return}const Me=Ee?me.offset-me.baseOffset:me.velocity;let Ge=1;Ee&&me.size>0&&(Ge=Math.max(1,Math.round(Math.abs(Me)/me.size))),We(0),ee(Me<0?Ge:-Ge)},[ee,E]);a.useEffect(()=>{const xe=me=>{ie.current===null||me.pointerId!==ie.current||je(me)};return window.addEventListener("pointerup",xe),window.addEventListener("pointercancel",xe),()=>{window.removeEventListener("pointerup",xe),window.removeEventListener("pointercancel",xe)}},[je]);const st=xe=>{const me=Re.current;if(!B||c<2||!me||xe.pointerType==="mouse"&&xe.button!==0)return;Se.current=null,Pe.current=0,re.current&&_(!1);let he=0;const He=H.current;if(E&&He){const ve=U?He.offsetWidth:He.offsetHeight;if(ve>0){const Ee=$0(He,U);let Me=pe.current;k&&(Me===0||Me===c+1)?(Me=ne+1,pe.current=Me,Q(!0),Ae(Me),he=0):he=Ee+Me*ve,We(he)}}me.setPointerCapture(xe.pointerId),ie.current=xe.pointerId,ge.current={pointerId:xe.pointerId,startClientX:xe.clientX,startClientY:xe.clientY,axes:C0(me,`${s}-axis-probe`),size:U?me.offsetWidth:me.offsetHeight,isActive:!1,baseOffset:he,offset:he,lastTime:xe.timeStamp,velocity:0}},et=xe=>{const me=ge.current;if(!me||me.pointerId!==xe.pointerId)return;if(xe.pointerType==="mouse"&&xe.buttons===0){je(xe);return}const he=xe.clientX-me.startClientX,He=xe.clientY-me.startClientY,ve=me.axes?T0(me.axes,he,He):{x:he,y:He},Ee=U?ve.x:ve.y,Me=U?ve.y:ve.x,Ge=me.baseOffset+Ee;if(!me.isActive){if(Math.max(Math.abs(Ee),Math.abs(Me))<h0)return;if(Math.abs(Me)>Math.abs(Ee)){const Ue=Re.current;Ue!=null&&Ue.hasPointerCapture(me.pointerId)&&Ue.releasePointerCapture(me.pointerId),ge.current=null,ie.current=null,E&&We(0);return}me.isActive=!0,Ne(!0)}const Ze=xe.timeStamp-me.lastTime;Ze>0&&(me.velocity=(Ge-me.offset)/Ze,me.lastTime=xe.timeStamp),me.offset=Ge,E&&We(Ge)},pt=xe=>{je(xe)},rt=U?`translate3d(calc(${-be*100}% + ${Te}px), 0, 0)`:`translate3d(0, calc(${-be*100}% + ${Te}px), 0)`,Ve=k?[d[c-1],...d,d[0]]:d;return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:L0(s,n)}}),r.jsxs("div",{className:dt(`${s}-wrapper`,{[`${s}-transition-reveal`]:g==="reveal",[`${s}-transition-reveal-vertical`]:g==="reveal"&&!U}),onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),children:[r.jsxs("div",{className:`${s}-slider-inner`,style:{backgroundColor:"transparent"},children:[r.jsx("div",{ref:Re,className:dt(`${s}-track`,{[`${s}-track-draggable`]:B,[`${s}-track-draggable-vertical`]:B&&!U}),onPointerDown:st,onPointerMove:et,onPointerUp:pt,onPointerCancel:pt,onLostPointerCapture:xe=>{ie.current===xe.pointerId&&je(xe)},children:r.jsx("div",{ref:H,className:dt(`${s}-list`,{[`${s}-list-slide`]:E,[`${s}-list-slide-vertical`]:E&&!U,[`${s}-list-fade`]:!E}),style:E?{transform:rt,transition:Z||q?"none":`transform ${Wi}ms ${Gc}`}:void 0,children:Ve.map((xe,me)=>{const he=k?lo(me-1,c):me,ve=k&&(me===0||me===c+1)?`clone-${me===0?"start":"end"}`:`slide-${he}`;return r.jsx("div",{className:dt(`${s}-slide`,{[`${s}-is-active`]:!E&&he===ne}),children:r.jsx("div",{className:`${s}-slider-item`,children:r.jsx("div",{className:`${s}-img-wrapper`,children:r.jsx("img",{className:dt(`${s}-slider-image`,{[`${s}-contain`]:xe.image.objectFit==="contain",[`${s}-cover`]:xe.image.objectFit==="cover"}),src:xe.image.url,alt:xe.image.name??"",draggable:!1})})})},ve)})})}),se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-prev`]:U,[`${s}-arrow-prev-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:T,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{onClick:xe=>{xe.stopPropagation(),Fe(-1)},className:`${s}-arrow-inner`,style:{transform:`translate(${$.scalingValue(V,n)}, ${$.scalingValue(A*(U?1:-1),n)}) rotate(${U?"0deg":"90deg"})`},children:[K&&r.jsx(rn,{url:K,fill:T,hoverFill:j,className:dt(`${s}-arrow-img`,`${s}-mirror`),style:ue}),!K&&r.jsx(Cl,{color:T,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`,`${s}-mirror`)})]})}),r.jsx("div",{className:dt(`${s}-arrow`,{[`${s}-arrow-next`]:U,[`${s}-arrow-next-vertical`]:!U,[`${s}-hover-arrow`]:oe}),style:{color:T,"--arrow-hover-color":j,...ue},children:r.jsxs("button",{className:`${s}-arrow-inner`,onClick:xe=>{xe.stopPropagation(),Fe(1)},style:{transform:`translate(${$.scalingValue(V*(U?-1:1),n)}, ${$.scalingValue(A,n)}) rotate(${U?"0deg":"90deg"})`},children:[K&&r.jsx(rn,{url:K,fill:T,hoverFill:j,className:`${s}-arrow-img`,style:ue}),!K&&r.jsx(Cl,{color:T,className:dt(`${s}-arrow-icon`,`${s}-arrow-img`)})]})})]}),z&&r.jsx("div",{className:`${s}-click-overlay`,onClick:()=>Fe(1)}),D&&r.jsx("div",{className:dt(`${s}-pagination`,{[`${s}-pagination-inside-bottom`]:U,[`${s}-pagination-inside-left`]:!U}),style:U?{bottom:C(b.inset)}:{left:C(b.inset)},children:r.jsx("div",{className:dt(`${s}-pagination-inner`,{[`${s}-pagination-vertical`]:!U,[`${s}-animate-dots`]:ce}),style:{backgroundColor:M,gap:C(b.gapInactive-b.activeDot+b.dot),...U?{height:C(b.activeDot+b.paddingY*2),paddingTop:C(b.paddingY),paddingBottom:C(b.paddingY),paddingLeft:C(b.paddingActive),paddingRight:C(b.paddingActive)}:{width:C(b.activeDot+b.paddingY*2),paddingLeft:C(b.paddingY),paddingRight:C(b.paddingY),paddingTop:C(b.paddingActive),paddingBottom:C(b.paddingActive)},borderRadius:C(b.borderRadius),transform:`translate(${$.scalingValue(ro.offset.x,n)}, ${$.scalingValue(ro.offset.y,n)})`},children:d.map((xe,me)=>{const he=me===ne,He=he?b.activeDot:b.dot;return r.jsx("button",{onClick:()=>ae(me),className:`${s}-pagination-item`,style:{width:C(b.activeDot)},children:r.jsx("div",{className:`${s}-dot`,style:{backgroundColor:he?W:y,width:C(He)}})},me)})},`${m}-${x}`)})]}),r.jsxs("div",{className:`${s}-caption-block`,children:[r.jsx("div",{"data-controls":o?"captionMarginTop":void 0,className:o?`${s}-control`:void 0,style:{height:$.scalingValue(P,n)}}),r.jsx("div",{className:`${s}-caption-text-wrapper`,children:d.map((xe,me)=>r.jsx("div",{className:dt(`${s}-caption-text`,{[`${s}-with-pointer-events`]:me===ne&&n,[`${s}-active`]:me===ne}),style:{...l,width:"max-content",transitionDuration:`${Math.round(Wi/2)}ms`},children:r.jsx("div",{className:`${s}-caption-text-inner`,style:{"--link-color":Y,"--link-hover-color":Y,position:"relative",top:$.scalingValue(pa.offset.y,n),left:$.scalingValue(pa.offset.x,n)},children:r.jsx(yi,{content:xe.imageCaption})})},me))})]})]})]})}function Cl({color:e,className:t}){return r.jsx("svg",{viewBox:"0 0 10 18",className:t,children:r.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:r.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 I0=`import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
19523
19575
|
import cn from 'classnames';
|
|
19524
19576
|
import { RichTextRenderer } from '../helpers/RichTextRenderer/RichTextRenderer';
|
|
19525
19577
|
import { scalingValue } from '../utils/scalingValue';
|
|
@@ -20700,7 +20752,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20700
20752
|
</svg>
|
|
20701
20753
|
);
|
|
20702
20754
|
}
|
|
20703
|
-
`,E0={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"}]}]}]}},M0={element:R0,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:E0,sourceCode:I0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Mi=300/1440,P0=8/1440,di=.004;function k0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function
|
|
20755
|
+
`,E0={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"}]}]}]}},M0={element:R0,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:E0,sourceCode:I0,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[{path:"controls"}]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily"}},Mi=300/1440,P0=8/1440,di=.004;function k0(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Tl(e,t,n,i){return t!==void 0&&t<(e??.01)?`${n} ${i}`:n}function Ll(e,t,n,i){const o=e??.01;return t===void 0||t>=o?{}:{[`--${n}-title-leading-gap`]:$.scalingValue((o-t)/2,i)}}function A0(e){return`
|
|
20704
20756
|
.${e}-wrapper {
|
|
20705
20757
|
box-sizing: border-box;
|
|
20706
20758
|
display: flex;
|
|
@@ -20917,7 +20969,7 @@ function ArrowIcon({ color, className }: { color: string, className: string }) {
|
|
|
20917
20969
|
width: var(--cntrl-article-width, 100vw) !important;
|
|
20918
20970
|
height: var(--cntrl-viewport-height, 100vh) !important;
|
|
20919
20971
|
}
|
|
20920
|
-
`}const F0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",W0=72,_0=50,H0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},N0=[];function O0(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 D0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function j0(e){const[t]=e.media;return t!=null&&t.url?t:null}function z0(e){if(!Array.isArray(e)||e.length===0)return[];if(O0(e)){const t=[];for(const n of e){const i=D0(n);if(!i)continue;const o=j0(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 Ma(e){return e.type==="video"}function B0(e){e.pause(),e.removeAttribute("src"),e.load()}function er(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function V0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const G0=1140/1440;function q0(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 U0(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 K0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function X0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{B0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function Y0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",y=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),E=a.useRef("none"),L=a.useRef(!1),C=a.useRef(!1),K=a.useRef(!1),W=a.useRef(null),[B,A]=a.useState(null),[T,j]=a.useState("opening"),[w,P]=a.useState(0),[M,X]=a.useState(0),[k,q]=a.useState(!1),[V,G]=a.useState(!1),[ie,S]=a.useState(!1),R=a.useRef(n),O=t[n],ae=O?Ma(O):!1,se=M!==0||k,I=a.useCallback(ue=>{K.current=ue,q(ue)},[]),de=a.useCallback(()=>{W.current!==null&&(window.clearTimeout(W.current),W.current=null)},[]),F=a.useCallback(()=>{de(),W.current=window.setTimeout(()=>{de(),I(!1)},In+32)},[de,I]),te=a.useCallback(()=>{const ue=y.current,me=g.current;if(!ue)return;const be=ue.getBoundingClientRect(),z=be.width,le=be.height;if(!z||!le)return;if(i==="cover"){A({width:z,height:le,left:be.left,top:be.top});return}if(!me){A(er(ue));return}const{width:ye,height:we}=V0(me);if(!ye||!we){A(er(ue));return}const Pe=ye/we,Ce=z/le;if(Pe>Ce){const _=z/Pe;A({width:z,height:_,left:be.left,top:be.top+(le-_)/2})}else{const _=le*Pe;A({width:_,height:le,left:be.left+(z-_)/2,top:be.top})}},[i]);a.useEffect(()=>{te();const ue=y.current;if(!ue)return;const me=new ResizeObserver(()=>te());return me.observe(ue),()=>me.disconnect()},[te,n]),a.useEffect(()=>{T==="opening"&&B&&j("open")},[T,B]),a.useEffect(()=>{if(T!=="closing")return;const ue=setTimeout(()=>s(),In);return()=>clearTimeout(ue)},[T,s]),a.useEffect(()=>()=>{de()},[de]),a.useLayoutEffect(()=>{if(R.current===n)return;de(),P(0),X(0),I(!1),S(!1),G(!1),m.current=0,b.current=0,E.current="none",L.current=!1,h.current=null,C.current=!1;const ue=y.current;ue&&A(er(ue)),R.current=n},[n,I,de]),a.useEffect(()=>{if(T!=="open")return;let ue=null;const me=()=>{ue&&(document.removeEventListener("click",ue,!0),ue=null)},be=()=>{me(),ue=Ce=>{Ce.stopPropagation(),Ce.preventDefault(),me()},document.addEventListener("click",ue,!0)},z=Ce=>{de(),K.current=!1,q(!1),X(0),G(!1),L.current=!1,b.current=0,E.current="none";const _=y.current;_&&A(er(_)),Ce<0?d():l()},le=Ce=>{if(Math.abs(Ce)>_0&&t.length>1){z(Ce);return}I(!0),X(0),F()},ye=Ce=>{if(Ce.touches.length!==1||K.current)return;const _=Ce.touches[0];C.current=!0,h.current={x:_.clientX,y:_.clientY},E.current="none",b.current=0,L.current=!1},we=Ce=>{if(!h.current||Ce.touches.length!==1||K.current)return;const _=Ce.touches[0],ge=_.clientX-h.current.x,ne=_.clientY-h.current.y;if(E.current==="none"){if(Math.abs(ge)<10&&Math.abs(ne)<10)return;if(Math.abs(ge)>Math.abs(ne)){if(t.length<=1)return;E.current="horizontal"}else if(ne>0)E.current="vertical";else return}if(E.current==="horizontal"){L.current=!0,G(!0),b.current=ge,X(ge),Ce.preventDefault();return}E.current==="vertical"&&(L.current=!0,G(!0),m.current=ne,P(ne),Ce.preventDefault())},Pe=()=>{if(!h.current)return;const Ce=E.current,_=L.current;if(_&&Ce==="horizontal")le(b.current),be();else if(_&&Ce==="vertical")if(m.current>W0){const ne=window.innerHeight;m.current=ne,S(!0),P(ne),j("closing")}else m.current=0,P(0),be();else Ce==="horizontal"&&Math.abs(b.current)>0&&(le(b.current),be());h.current=null,E.current="none",b.current=0,L.current=!1,G(!1)};return document.addEventListener("touchstart",ye,{passive:!0}),document.addEventListener("touchmove",we,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",ye),document.removeEventListener("touchmove",we),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),me()}},[T,t.length,d,l,I,F,de]),a.useEffect(()=>{const ue=me=>{me.key==="Escape"&&(me.preventDefault(),me.stopPropagation(),T!=="closing"&&j("closing"))};return window.addEventListener("keydown",ue,!0),()=>window.removeEventListener("keydown",ue,!0)},[T]);const Z=()=>{T!=="closing"&&j("closing")},ve=T==="open",Ae=T==="closing",he=w>0?Math.max(0,1-w/500):1,pe=w>0?Math.max(.35,1-w/500):1,U=ue=>{if(ue.stopPropagation(),C.current){C.current=!1;return}if(t.length<=1)return;const me=ue.currentTarget.getBoundingClientRect(),be=ue.clientY-me.top,z=Math.min(52,me.height*.2);if(!(be>me.height-z)){if(ue.clientX-me.left<me.width/2){l();return}d()}},ee=ue=>{if(t.length<=1)return;const me=ue.currentTarget.getBoundingClientRect(),be=ue.clientX-me.left,z=ue.clientY-me.top,le=Math.min(52,me.height*.2);if(z>me.height-le){ue.currentTarget.style.cursor="default";return}ue.currentTarget.style.cursor=be<me.width/2?"w-resize":"e-resize"},Y=a.useCallback(ue=>{ue.propertyName!=="transform"||!K.current||(de(),I(!1))},[de,I]),Oe=se?`translateX(${M}px)`:w>0?`translateY(${w}px)`:void 0,$e={position:"fixed",top:B==null?void 0:B.top,left:B==null?void 0:B.left,width:B==null?void 0:B.width,height:B==null?void 0:B.height,objectFit:i==="cover"?"cover":"contain",transform:Oe,opacity:w>0?pe:T==="opening"||Ae?0:1,transition:V&&!k?"none":k?`transform ${In}ms ${ci}`:ie?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:T==="opening"||Ae?`opacity ${In}ms ${ci}`:"none",pointerEvents:ae&&ve&&!se?"auto":"none",touchAction:ae&&ve?"none":void 0,zIndex:9998},He=B?{position:"fixed",top:B.top,height:B.height,width:B.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:T==="open"?"none":void 0},onClick:Z,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:ve?he:0,transition:V?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,style:{position:"absolute",inset:0}}),r.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:ve?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),B&&O&&(ae?r.jsx(X0,{src:O.url,phase:T,mediaRef:g,mediaStyle:$e,onLoadedMetadata:te,onClick:U,onMouseMove:ee,onTransitionEnd:Y},`${n}-${O.url}`):r.jsx("img",{ref:g,src:O.url,alt:O.name,onLoad:te,onTransitionEnd:Y,style:$e},`${n}-${O.url}`)),ve&&He&&t.length>1&&!ae&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...He,left:B.left,cursor:"w-resize",pointerEvents:se?"none":"auto"},onClick:ue=>{if(C.current){C.current=!1;return}ue.stopPropagation(),l()}}),r.jsx("div",{style:{...He,left:B.left+B.width/2,cursor:"e-resize",pointerEvents:se?"none":"auto"},onClick:ue=>{if(C.current){C.current=!1;return}ue.stopPropagation(),d()}})]})]})}function Il({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Ma(t)?"video":"image"}`,y=s.display==="cover",g=U0(s),h=T=>$.scalingValue(T,l??!1),m=n??Mi,b=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},E=i?{borderRadius:h(i)}:{},L={...b,...y?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...E},C={...y?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...y?{}:E},W={className:v,style:C,onClick:p?T=>{T.stopPropagation(),p()}:void 0},B=Math.max(d,di),A=Ma(t)?r.jsx("video",{...W,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...W,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[y?r.jsx("div",{style:L,children:A}):A,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.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(B)}})]})}function Z0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,y=v>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&y&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function J0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function El({P:e,scaled:t,height:n,paired:i}){return r.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 Ml({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ma({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[v,y]=a.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const b=()=>y(m.offsetHeight);b();const E=new ResizeObserver(b);return E.observe(m),()=>E.disconnect()},[g,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Pl=45;function kl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function Q0(e){const t=kl(e,"--cntrl-viewport-height",window.innerHeight),n=kl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function ex(e,t,n){const{top:i,centerY:o}=Q0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function tx(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=ex(u,n,c);return Math.exp(-(p*p)/(2*Pl*Pl))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function nx(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(tx(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:s}}function ix(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function ox({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var st;const{prefix:l}=$.useScopedStyles(),d=a.useMemo(()=>A0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Mi,y=(e==null?void 0:e.titleWidth)??G0,g=q0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??P0,m=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,E=(e==null?void 0:e.titleLeftPadding)??0,L=(e==null?void 0:e.titleRightPadding)??0,C=J0(e==null?void 0:e.transition),K=(e==null?void 0:e.lightbox)??"on",W=p==="b",B=C==="fade"||C==="retype",{setTitleRef:A,dominantIndex:T}=nx(c.length,B,m),j=((st=c[T])==null?void 0:st.title)??"",w=ix(j,C==="retype"),P=C==="fade"||C==="retype",M=C==="retype"?w:j,X=W?void 0:{width:$.scalingValue(v,n??!1)},k=K==="on"&&(!n||i||o),q=o??!1,V=(e==null?void 0:e.galleryPaddingRight)??0,G=(e==null?void 0:e.galleryPaddingLeft)??0,ie=(e==null?void 0:e.galleryPaddingBetween)??0,S=pt=>$.scalingValue(pt,n??!1),O={width:S(y)},ae=p==="a"?V:G,se=W?{width:"100%"}:{width:`calc(100% - ${S(v)} - ${S(ae)})`,...p==="c"?{marginLeft:"auto"}:{}},I=Math.max(V,di),de=Math.max(G,di),F=Math.max(ie,di),te=Math.max(b,di),Z=Math.max(E,di),ve=Math.max(L,di),Ae=Math.max(0,(u??1)-(v??Mi)),he=p==="a"?Math.max(0,(u??1)-(v??Mi)-V):p==="c"?Math.max(0,(u??1)-(v??Mi)-G):p==="b"?u??1:1,pe=q&&(p==="a"||p==="b"||p==="c")&&m==="top",U=q&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),ee=q&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Y=c.length>1,Oe=W?void 0:S((p==="c"?G:V)+(v??Mi)),$e=p==="c"&&Oe?{left:Oe}:void 0,He=p==="a"&&Oe?{right:Oe}:void 0,ue=W?{left:0,width:"100%"}:p==="a"?{right:S(V),width:S(v)}:{left:S(G),width:S(v)},{titleColor:me,titleFontFamily:be,titleFontSettings:z,titleFontSize:le,titleLineHeight:ye,titleLetterSpacing:we,titleWordSpacing:Pe,titleAlign:Ce,titleTextAppearance:_,lightboxCounterColor:ge,lightboxCounterFontFamily:ne,lightboxCounterFontSettings:H,lightboxCounterFontSize:Q,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:re,lightboxCounterWordSpacing:N,lightboxCounterTextAppearance:qe}=e??{},Be={fontSettings:{fontFamily:be,fontWeight:(z==null?void 0:z.fontWeight)??400,fontStyle:(z==null?void 0:z.fontStyle)??"normal"},fontSize:le??.01,lineHeight:ye,letterSpacing:we??0,wordSpacing:Pe??0,textAlign:Ce??"left",textAppearance:_,color:me??"#000000"},et=on(Kt(Be,n)),ut=O,ke=Rl(le,ye,l,n),Ie=Ll(le,ye,`${l}-title`,`${l}-text-tight-leading`),oe={fontSettings:{fontFamily:ne,fontWeight:(H==null?void 0:H.fontWeight)??400,fontStyle:(H==null?void 0:H.fontStyle)??"normal"},fontSize:Q??.01,lineHeight:Fe,letterSpacing:re??0,wordSpacing:N??0,textAppearance:qe,color:ge??"#DEDDDD"},Ee={...on(Kt(oe,n)),...Rl(Q,Fe,l,n)},De=Ll(Q,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),fe=$.buildColorVars(l,{titleColor:me??"#000000",lightboxCounterColor:ge??"#DEDDDD"},H0,N0),Me=a.useRef(null),[_e,Ke]=a.useState(!1),[it,Ye]=a.useState([]),[xt,ot]=a.useState(0),We=a.useCallback((pt,ct)=>{k&&(Ye(pt),ot(ct),Ke(!0))},[k]),Ze=a.useCallback(()=>{Ke(!1)},[]),Ve=a.useMemo(()=>{const pt={...fe},ct=Me.current?getComputedStyle(Me.current).getPropertyValue("--cntrl-article-width").trim():"";return ct&&(pt["--cntrl-article-width"]=ct),pt},[fe,_e]);return a.useEffect(()=>{if(!_e||K!=="on"||typeof document>"u")return;const pt=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=pt}},[_e,K]),a.useEffect(()=>{!n||o||i||Ke(!1)},[n,o,i]),a.useEffect(()=>{K==="off"&&Ke(!1)},[K]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:fe,children:r.jsxs("div",{ref:Me,className:`${l}-wrapper`,style:{width:$.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?S(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?S(E):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?S(L):void 0},children:[P&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ma,{P:l,title:M,position:m,titleRef:()=>{},titleClassName:`${Ie} ${l}-single-title`,titleContainerStyle:{...ke,...se},titleTextBoxStyle:ut,titleStyle:et,showTextBoxOutline:q,topPaddingControl:pe?El({P:l,scaled:S,height:te,paired:!1}):void 0})}),c.map((pt,ct)=>{const Et=z0(pt.gallery),zt=ct<c.length-1,Xt=Et.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),yt={P:l,position:m,titleRef:A(ct),titleClassName:Ie,titleContainerStyle:ke,titleTextBoxStyle:P?{maxWidth:"100%"}:ut,titleStyle:et,showTextBoxOutline:q&&!P,topPaddingControl:pe&&!P?El({P:l,scaled:S,height:te,paired:Y}):void 0};return r.jsxs("div",{"data-item-index":ct,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:zt?S(ie):void 0},children:[U&&Ml({P:l,controlKey:"titleLeftPadding",scaled:S,width:Z,maxFraction:he,side:"left",paired:Y,anchorStyle:$e}),ee&&Ml({P:l,controlKey:"titleRightPadding",scaled:S,width:ve,maxFraction:he,side:"right",paired:Y,anchorStyle:He}),q&&zt&&r.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:S(F),...ue}}),W?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:Et.map(({displayMedia:bt,lightboxMedia:Nt},At)=>{const wt=Nt?Xt.findIndex(Ot=>Ot.url===Nt.url):-1;return r.jsx(Il,{P:l,media:bt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<Et.length-1,showControls:q,onMediaClick:k&&wt>=0?()=>We(Xt,wt):void 0},`${bt.url}-${At}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ma,{...yt,title:P?"":pt.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ma,{...yt,title:P?"":pt.title}),Et.length>0&&r.jsx(Z0,{P:l,layoutType:p,galleryWidthStyle:X,galleryPaddingRight:V,galleryPaddingLeft:G,galleryPaddingRightWidth:I,galleryPaddingLeftWidth:de,galleryPaddingMaxFraction:Ae,showControls:q,scaled:S,children:Et.map(({displayMedia:bt,lightboxMedia:Nt},At)=>{const wt=Nt?Xt.findIndex(Ot=>Ot.url===Nt.url):-1;return r.jsx(Il,{P:l,media:bt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:ie,showPaddingAfter:At<Et.length-1,showControls:q,onMediaClick:k&&wt>=0?()=>We(Xt,wt):void 0},`${bt.url}-${At}`)})})]})]},ct)})]})}),_e&&K==="on"&&typeof document<"u"&&e&&(()=>{const pt=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Ve,"data-selection":"none",children:r.jsx(Y0,{prefix:l,items:it,index:xt,imageDisplay:K0(e.lightboxImageDisplay),isEditor:n,onClose:Ze,onPrev:()=>ot(ct=>(ct-1+it.length)%it.length),onNext:()=>ot(ct=>(ct+1)%it.length),counterClassName:De,counterStyle:Ee,backgroundColor:e.backgroundColor??F0})}),pt)})()]})}const rx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20972
|
+
`}const F0="rgba(28,31,34,0.9)",In=500,ci="cubic-bezier(0.22, 1, 0.36, 1)",W0=72,_0=50,H0={titleColor:"title-color",lightboxCounterColor:"lightbox-counter-color"},N0=[];function O0(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 D0(e){const[t,n]=e.media;return n!=null&&n.url?n:t!=null&&t.url?t:null}function j0(e){const[t]=e.media;return t!=null&&t.url?t:null}function z0(e){if(!Array.isArray(e)||e.length===0)return[];if(O0(e)){const t=[];for(const n of e){const i=D0(n);if(!i)continue;const o=j0(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 Ma(e){return e.type==="video"}function B0(e){e.pause(),e.removeAttribute("src"),e.load()}function er(e){const t=e.getBoundingClientRect();return{width:t.width,height:t.height,left:t.left,top:t.top}}function V0(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.naturalWidth,height:e.naturalHeight}}const G0=1140/1440;function q0(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 U0(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 K0(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function X0({src:e,phase:t,mediaRef:n,mediaStyle:i,onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d}){return a.useEffect(()=>{const c=n.current;if(c)return()=>{B0(c)}},[e,n]),r.jsx("video",{ref:n,src:e,controls:t==="open",playsInline:!0,preload:"auto",onLoadedMetadata:o,onClick:s,onMouseMove:l,onTransitionEnd:d,style:i})}function Y0({prefix:e,items:t,index:n,imageDisplay:i,isEditor:o,onClose:s,onPrev:l,onNext:d,counterClassName:c,counterStyle:u,backgroundColor:p}){const v=i==="cover",x=a.useRef(null),g=a.useRef(null),h=a.useRef(null),m=a.useRef(0),b=a.useRef(0),I=a.useRef("none"),C=a.useRef(!1),R=a.useRef(!1),K=a.useRef(!1),F=a.useRef(null),[V,A]=a.useState(null),[T,j]=a.useState("opening"),[y,W]=a.useState(0),[M,Y]=a.useState(0),[P,U]=a.useState(!1),[z,B]=a.useState(!1),[te,S]=a.useState(!1),E=a.useRef(n),D=t[n],se=D?Ma(D):!1,oe=M!==0||P,L=a.useCallback(ce=>{K.current=ce,U(ce)},[]),ue=a.useCallback(()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null)},[]),k=a.useCallback(()=>{ue(),F.current=window.setTimeout(()=>{ue(),L(!1)},In+32)},[ue,L]),ne=a.useCallback(()=>{const ce=x.current,ye=g.current;if(!ce)return;const $e=ce.getBoundingClientRect(),G=$e.width,re=$e.height;if(!G||!re)return;if(i==="cover"){A({width:G,height:re,left:$e.left,top:$e.top});return}if(!ye){A(er(ce));return}const{width:pe,height:Se}=V0(ye);if(!pe||!Se){A(er(ce));return}const Pe=pe/Se,Re=G/re;if(Pe>Re){const H=G/Pe;A({width:G,height:H,left:$e.left,top:$e.top+(re-H)/2})}else{const H=re*Pe;A({width:H,height:re,left:$e.left+(G-H)/2,top:$e.top})}},[i]);a.useEffect(()=>{ne();const ce=x.current;if(!ce)return;const ye=new ResizeObserver(()=>ne());return ye.observe(ce),()=>ye.disconnect()},[ne,n]),a.useEffect(()=>{T==="opening"&&V&&j("open")},[T,V]),a.useEffect(()=>{if(T!=="closing")return;const ce=setTimeout(()=>s(),In);return()=>clearTimeout(ce)},[T,s]),a.useEffect(()=>()=>{ue()},[ue]),a.useLayoutEffect(()=>{if(E.current===n)return;ue(),W(0),Y(0),L(!1),S(!1),B(!1),m.current=0,b.current=0,I.current="none",C.current=!1,h.current=null,R.current=!1;const ce=x.current;ce&&A(er(ce)),E.current=n},[n,L,ue]),a.useEffect(()=>{if(T!=="open")return;let ce=null;const ye=()=>{ce&&(document.removeEventListener("click",ce,!0),ce=null)},$e=()=>{ye(),ce=Re=>{Re.stopPropagation(),Re.preventDefault(),ye()},document.addEventListener("click",ce,!0)},G=Re=>{ue(),K.current=!1,U(!1),Y(0),B(!1),C.current=!1,b.current=0,I.current="none";const H=x.current;H&&A(er(H)),Re<0?d():l()},re=Re=>{if(Math.abs(Re)>_0&&t.length>1){G(Re);return}L(!0),Y(0),k()},pe=Re=>{if(Re.touches.length!==1||K.current)return;const H=Re.touches[0];R.current=!0,h.current={x:H.clientX,y:H.clientY},I.current="none",b.current=0,C.current=!1},Se=Re=>{if(!h.current||Re.touches.length!==1||K.current)return;const H=Re.touches[0],ge=H.clientX-h.current.x,ie=H.clientY-h.current.y;if(I.current==="none"){if(Math.abs(ge)<10&&Math.abs(ie)<10)return;if(Math.abs(ge)>Math.abs(ie)){if(t.length<=1)return;I.current="horizontal"}else if(ie>0)I.current="vertical";else return}if(I.current==="horizontal"){C.current=!0,B(!0),b.current=ge,Y(ge),Re.preventDefault();return}I.current==="vertical"&&(C.current=!0,B(!0),m.current=ie,W(ie),Re.preventDefault())},Pe=()=>{if(!h.current)return;const Re=I.current,H=C.current;if(H&&Re==="horizontal")re(b.current),$e();else if(H&&Re==="vertical")if(m.current>W0){const ie=window.innerHeight;m.current=ie,S(!0),W(ie),j("closing")}else m.current=0,W(0),$e();else Re==="horizontal"&&Math.abs(b.current)>0&&(re(b.current),$e());h.current=null,I.current="none",b.current=0,C.current=!1,B(!1)};return document.addEventListener("touchstart",pe,{passive:!0}),document.addEventListener("touchmove",Se,{passive:!1}),document.addEventListener("touchend",Pe),document.addEventListener("touchcancel",Pe),()=>{document.removeEventListener("touchstart",pe),document.removeEventListener("touchmove",Se),document.removeEventListener("touchend",Pe),document.removeEventListener("touchcancel",Pe),ye()}},[T,t.length,d,l,L,k,ue]),a.useEffect(()=>{const ce=ye=>{ye.key==="Escape"&&(ye.preventDefault(),ye.stopPropagation(),T!=="closing"&&j("closing"))};return window.addEventListener("keydown",ce,!0),()=>window.removeEventListener("keydown",ce,!0)},[T]);const X=()=>{T!=="closing"&&j("closing")},be=T==="open",Ae=T==="closing",fe=y>0?Math.max(0,1-y/500):1,le=y>0?Math.max(.35,1-y/500):1,q=ce=>{if(ce.stopPropagation(),R.current){R.current=!1;return}if(t.length<=1)return;const ye=ce.currentTarget.getBoundingClientRect(),$e=ce.clientY-ye.top,G=Math.min(52,ye.height*.2);if(!($e>ye.height-G)){if(ce.clientX-ye.left<ye.width/2){l();return}d()}},Q=ce=>{if(t.length<=1)return;const ye=ce.currentTarget.getBoundingClientRect(),$e=ce.clientX-ye.left,G=ce.clientY-ye.top,re=Math.min(52,ye.height*.2);if(G>ye.height-re){ce.currentTarget.style.cursor="default";return}ce.currentTarget.style.cursor=$e<ye.width/2?"w-resize":"e-resize"},Z=a.useCallback(ce=>{ce.propertyName!=="transform"||!K.current||(ue(),L(!1))},[ue,L]),Ne=oe?`translateX(${M}px)`:y>0?`translateY(${y}px)`:void 0,Te={position:"fixed",top:V==null?void 0:V.top,left:V==null?void 0:V.left,width:V==null?void 0:V.width,height:V==null?void 0:V.height,objectFit:i==="cover"?"cover":"contain",transform:Ne,opacity:y>0?le:T==="opening"||Ae?0:1,transition:z&&!P?"none":P?`transform ${In}ms ${ci}`:te?`transform ${In}ms ${ci}, opacity ${In}ms ${ci}`:T==="opening"||Ae?`opacity ${In}ms ${ci}`:"none",pointerEvents:se&&be&&!oe?"auto":"none",touchAction:se&&be?"none":void 0,zIndex:9998},We=V?{position:"fixed",top:V.top,height:V.height,width:V.width/2,zIndex:9999}:null;return r.jsxs("div",{className:[`${e}-lightbox`,o?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:T==="open"?"none":void 0},onClick:X,children:[r.jsx("div",{style:{position:"absolute",inset:0,background:p,opacity:be?fe:0,transition:z?"none":`opacity ${In}ms ${ci}`,pointerEvents:"none"}}),r.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:v?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:x,style:{position:"absolute",inset:0}}),r.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 ${In}ms ${ci}`,pointerEvents:"none",zIndex:9999},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:"10%"}}),r.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("div",{ref:x,style:{width:"100%",height:"100%"}})}),r.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:be?1:0,transition:`opacity ${In}ms ${ci}`},children:t.length>1&&r.jsxs("p",{className:c,style:u,children:[n+1," / ",t.length]})})]})}),V&&D&&(se?r.jsx(X0,{src:D.url,phase:T,mediaRef:g,mediaStyle:Te,onLoadedMetadata:ne,onClick:q,onMouseMove:Q,onTransitionEnd:Z},`${n}-${D.url}`):r.jsx("img",{ref:g,src:D.url,alt:D.name,onLoad:ne,onTransitionEnd:Z,style:Te},`${n}-${D.url}`)),be&&We&&t.length>1&&!se&&r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{...We,left:V.left,cursor:"w-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(R.current){R.current=!1;return}ce.stopPropagation(),l()}}),r.jsx("div",{style:{...We,left:V.left+V.width/2,cursor:"e-resize",pointerEvents:oe?"none":"auto"},onClick:ce=>{if(R.current){R.current=!1;return}ce.stopPropagation(),d()}})]})]})}function Rl({P:e,media:t,imgWidth:n,cornerRadius:i,fillGalleryWidth:o,imageDisplay:s,isEditor:l,galleryPaddingBetween:d=0,showPaddingAfter:c=!1,showControls:u=!1,onMediaClick:p}){const v=`${e}-gallery-${Ma(t)?"video":"image"}`,x=s.display==="cover",g=U0(s),h=T=>$.scalingValue(T,l??!1),m=n??Mi,b=o?{width:"100%",maxWidth:"100%"}:{width:h(m),maxWidth:"100%"},I=i?{borderRadius:h(i)}:{},C={...b,...x?{aspectRatio:g,height:"auto",overflow:"hidden"}:{},...I},R={...x?{display:"block",width:"100%",height:"100%",objectFit:"cover",maxWidth:"100%"}:{display:"block",maxWidth:"100%",height:"auto",width:o?"100%":h(m)},...p?{cursor:"pointer",pointerEvents:"auto"}:{},...x?{}:I},F={className:v,style:R,onClick:p?T=>{T.stopPropagation(),p()}:void 0},V=Math.max(d,di),A=Ma(t)?r.jsx("video",{...F,src:t.url,muted:!0,autoPlay:!0,loop:!0,playsInline:!0}):r.jsx("img",{...F,src:t.url,alt:t.name??""});return r.jsxs("div",{className:`${e}-gallery-item`,children:[x?r.jsx("div",{style:C,children:A}):A,c&&d>0&&r.jsx("div",{className:`${e}-padding-handle`,style:{height:h(d)},"aria-hidden":"true"}),u&&c&&r.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(V)}})]})}function Z0({P:e,layoutType:t,galleryWidthStyle:n,galleryPaddingRight:i,galleryPaddingLeft:o,galleryPaddingRightWidth:s,galleryPaddingLeftWidth:l,galleryPaddingMaxFraction:d,showControls:c,scaled:u,children:p}){const v=t==="a"?i:t==="c"?o:0,x=v>0||c;return r.jsxs("div",{className:`${e}-gallery-controls`,children:[t==="c"&&x&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="c"&&r.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%"}}),r.jsx("div",{className:`${e}-gallery`,style:n,children:p}),t==="a"&&x&&r.jsx("div",{className:`${e}-gallery-edge-spacer`,style:{width:u(v)},"aria-hidden":"true"}),c&&t==="a"&&r.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(s),height:"100%"}})]})}function J0(e){switch(e){case"fade":case"retype":case"scroll":return e;case"default":return"scroll";default:return"scroll"}}function Il({P:e,scaled:t,height:n,paired:i}){return r.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 El({P:e,controlKey:t,scaled:n,width:i,maxFraction:o,side:s,paired:l,anchorStyle:d}){return r.jsx("div",{"data-controls":t,...l?{"data-controls-paired":""}:{},"data-controls-axis":"x","data-controls-variant":"column-padding",...s==="right"?{"data-controls-reverse":""}:{},"data-controls-min":"0","data-controls-max-fraction":String(o),className:`${e}-control-anchor`,style:{top:0,...s==="left"?{left:0}:{right:0},width:n(i),height:"100%",...d}})}function ma({P:e,title:t,position:n,titleRef:i,titleClassName:o,titleContainerStyle:s,titleTextBoxStyle:l,titleStyle:d,showTextBoxOutline:c=!1,topPaddingControl:u}){const p=a.useRef(null),[v,x]=a.useState(0),g=t??"",h=n==="left"||n==="center"||n==="right";return a.useLayoutEffect(()=>{if(!h)return;const m=p.current;if(!m||typeof ResizeObserver>"u")return;const b=()=>x(m.offsetHeight);b();const I=new ResizeObserver(b);return I.observe(m),()=>I.disconnect()},[g,h]),r.jsx("div",{ref:m=>{p.current=m,i(m)},className:[o,`${e}-title-position-${n}`].join(" "),style:{...h?{[`--${e}-title-height`]:`${v}px`}:{},...s},children:r.jsxs("div",{className:`${e}-title-text-stack`,style:l,children:[u,r.jsx("div",{className:c?`${e}-title-text-inner`:`${e}-title-text-inner-hidden`,style:{width:"100%"},children:r.jsx("span",{className:`${e}-title-text`,style:d,children:g})})]})})}const Ml=45;function Pl(e,t,n){let i=e;for(;i;){const o=getComputedStyle(i).getPropertyValue(t).trim();if(o){const s=parseFloat(o);if(!Number.isNaN(s))return s}i=i.parentElement}return n}function Q0(e){const t=Pl(e,"--cntrl-viewport-height",window.innerHeight),n=Pl(e,"--cntrl-article-top",0);return{top:n,centerY:n+t/2}}function ex(e,t,n){const{top:i,centerY:o}=Q0(n);if(t==="top"){const l=n&&parseFloat(getComputedStyle(n).top)||i;return Math.abs(e.top-l)}const s=e.top+e.height/2;return Math.abs(s-o)}function tx(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=ex(u,n,c);return Math.exp(-(p*p)/(2*Ml*Ml))});let o=0,s=-1;return i.forEach((l,d)=>{l>s&&(s=l,o=d)}),{opacities:i,dominantIndex:o}}function nx(e,t,n){const i=a.useRef([]),[{opacities:o,dominantIndex:s},l]=a.useState(()=>({opacities:Array.from({length:e},(c,u)=>u===0?1:0),dominantIndex:0}));return a.useLayoutEffect(()=>{if(!t||e===0){l({opacities:Array.from({length:e},()=>1),dominantIndex:0});return}let c=0;const u=()=>{l(tx(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:s}}function ix(e,t){const[n,i]=a.useState(e),o=a.useRef(e);return a.useEffect(()=>{if(!t){o.current=e,i(e);return}const s=Array.from(o.current),l=Array.from(e),d=Math.max(s.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),...s.slice(c)].join("");o.current=p,i(p),c>=d&&window.clearInterval(u)},35);return()=>window.clearInterval(u)},[t,e]),n}function ox({settings:e,content:t,isEditor:n,isPreviewMode:i,isEditMode:o,portalId:s}){var ot;const{prefix:l}=$.useScopedStyles(),d=a.useMemo(()=>A0(l),[l]),c=t??[],u=(e==null?void 0:e.wrapperWidth)??1,p=(e==null?void 0:e.type)??"a",v=(e==null?void 0:e.imgWidth)??Mi,x=(e==null?void 0:e.titleWidth)??G0,g=q0(e==null?void 0:e.imageDisplay),h=(e==null?void 0:e.cornerRadius)??P0,m=(e==null?void 0:e.position)??"center",b=(e==null?void 0:e.titleTopPadding)??0,I=(e==null?void 0:e.titleLeftPadding)??0,C=(e==null?void 0:e.titleRightPadding)??0,R=J0(e==null?void 0:e.transition),K=(e==null?void 0:e.lightbox)??"on",F=p==="b",V=R==="fade"||R==="retype",{setTitleRef:A,dominantIndex:T}=nx(c.length,V,m),j=((ot=c[T])==null?void 0:ot.title)??"",y=ix(j,R==="retype"),W=R==="fade"||R==="retype",M=R==="retype"?y:j,Y=F?void 0:{width:$.scalingValue(v,n??!1)},P=K==="on"&&(!n||i||o),U=o??!1,z=(e==null?void 0:e.galleryPaddingRight)??0,B=(e==null?void 0:e.galleryPaddingLeft)??0,te=(e==null?void 0:e.galleryPaddingBetween)??0,S=ct=>$.scalingValue(ct,n??!1),D={width:S(x)},se=p==="a"?z:B,oe=F?{width:"100%"}:{width:`calc(100% - ${S(v)} - ${S(se)})`,...p==="c"?{marginLeft:"auto"}:{}},L=Math.max(z,di),ue=Math.max(B,di),k=Math.max(te,di),ne=Math.max(b,di),X=Math.max(I,di),be=Math.max(C,di),Ae=Math.max(0,(u??1)-(v??Mi)),fe=p==="a"?Math.max(0,(u??1)-(v??Mi)-z):p==="c"?Math.max(0,(u??1)-(v??Mi)-B):p==="b"?u??1:1,le=U&&(p==="a"||p==="b"||p==="c")&&m==="top",q=U&&((p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")),Q=U&&((p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"),Z=c.length>1,Ne=F?void 0:S((p==="c"?B:z)+(v??Mi)),Te=p==="c"&&Ne?{left:Ne}:void 0,We=p==="a"&&Ne?{right:Ne}:void 0,ce=F?{left:0,width:"100%"}:p==="a"?{right:S(z),width:S(v)}:{left:S(B),width:S(v)},{titleColor:ye,titleFontFamily:$e,titleFontSettings:G,titleFontSize:re,titleLineHeight:pe,titleLetterSpacing:Se,titleWordSpacing:Pe,titleAlign:Re,titleTextAppearance:H,lightboxCounterColor:ge,lightboxCounterFontFamily:ie,lightboxCounterFontSettings:_,lightboxCounterFontSize:ee,lightboxCounterLineHeight:Fe,lightboxCounterLetterSpacing:ae,lightboxCounterWordSpacing:N,lightboxCounterTextAppearance:qe}=e??{},je={fontSettings:{fontFamily:$e,fontWeight:(G==null?void 0:G.fontWeight)??400,fontStyle:(G==null?void 0:G.fontStyle)??"normal"},fontSize:re??.01,lineHeight:pe,letterSpacing:Se??0,wordSpacing:Pe??0,textAlign:Re??"left",textAppearance:H,color:ye??"#000000"},et=on(Kt(je,n)),pt=D,rt=Ll(re,pe,l,n),Ve=Tl(re,pe,`${l}-title`,`${l}-text-tight-leading`),xe={fontSettings:{fontFamily:ie,fontWeight:(_==null?void 0:_.fontWeight)??400,fontStyle:(_==null?void 0:_.fontStyle)??"normal"},fontSize:ee??.01,lineHeight:Fe,letterSpacing:ae??0,wordSpacing:N??0,textAppearance:qe,color:ge??"#DEDDDD"},he={...on(Kt(xe,n)),...Ll(ee,Fe,l,n)},He=Tl(ee,Fe,`${l}-lightbox-counter`,`${l}-text-tight-leading`),ve=$.buildColorVars(l,{titleColor:ye??"#000000",lightboxCounterColor:ge??"#DEDDDD"},H0,N0),Ee=a.useRef(null),[Me,Ge]=a.useState(!1),[Ze,Ue]=a.useState([]),[lt,tt]=a.useState(0),ke=a.useCallback((ct,mt)=>{P&&(Ue(ct),tt(mt),Ge(!0))},[P]),Xe=a.useCallback(()=>{Ge(!1)},[]),Oe=a.useMemo(()=>{const ct={...ve},mt=Ee.current?getComputedStyle(Ee.current).getPropertyValue("--cntrl-article-width").trim():"";return mt&&(ct["--cntrl-article-width"]=mt),ct},[ve,Me]);return a.useEffect(()=>{if(!Me||K!=="on"||typeof document>"u")return;const ct=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=ct}},[Me,K]),a.useEffect(()=>{!n||o||i||Ge(!1)},[n,o,i]),a.useEffect(()=>{K==="off"&&Ge(!1)},[K]),r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),r.jsx("div",{style:ve,children:r.jsxs("div",{ref:Ee,className:`${l}-wrapper`,style:{width:$.scalingValue(u,n??!1),[`--${l}-title-top-padding`]:(p==="a"||p==="b"||p==="c")&&m==="top"?S(b):void 0,[`--${l}-title-left-padding`]:(p==="a"||p==="b")&&(m==="left"||m==="top")||p==="c"&&(m==="left"||m==="top")?S(I):void 0,[`--${l}-title-right-padding`]:(p==="c"||p==="b")&&m==="right"||p==="a"&&m==="right"?S(C):void 0},children:[W&&r.jsx("div",{className:`${l}-single-title-layer`,children:r.jsx(ma,{P:l,title:M,position:m,titleRef:()=>{},titleClassName:`${Ve} ${l}-single-title`,titleContainerStyle:{...rt,...oe},titleTextBoxStyle:pt,titleStyle:et,showTextBoxOutline:U,topPaddingControl:le?Il({P:l,scaled:S,height:ne,paired:!1}):void 0})}),c.map((ct,mt)=>{const Mt=z0(ct.gallery),Ut=mt<c.length-1,Yt=Mt.filter(bt=>bt.lightboxMedia).map(bt=>bt.lightboxMedia),xt={P:l,position:m,titleRef:A(mt),titleClassName:Ve,titleContainerStyle:rt,titleTextBoxStyle:W?{maxWidth:"100%"}:pt,titleStyle:et,showTextBoxOutline:U&&!W,topPaddingControl:le&&!W?Il({P:l,scaled:S,height:ne,paired:Z}):void 0};return r.jsxs("div",{"data-item-index":mt,className:`${l}-item ${l}-item-${p}`,style:{paddingBottom:Ut?S(te):void 0},children:[q&&El({P:l,controlKey:"titleLeftPadding",scaled:S,width:X,maxFraction:fe,side:"left",paired:Z,anchorStyle:Te}),Q&&El({P:l,controlKey:"titleRightPadding",scaled:S,width:be,maxFraction:fe,side:"right",paired:Z,anchorStyle:We}),U&&Ut&&r.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:S(k),...ce}}),F?r.jsxs("div",{className:`${l}-gallery`,children:[r.jsx("div",{className:`${l}-gallery-media`,children:Mt.map(({displayMedia:bt,lightboxMedia:_t},kt)=>{const vt=_t?Yt.findIndex(Ft=>Ft.url===_t.url):-1;return r.jsx(Rl,{P:l,media:bt,imgWidth:v||void 0,cornerRadius:h||void 0,imageDisplay:g,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:kt<Mt.length-1,showControls:U,onMediaClick:P&&vt>=0?()=>ke(Yt,vt):void 0},`${bt.url}-${kt}`)})}),r.jsx("div",{className:`${l}-title-layer`,children:r.jsx(ma,{...xt,title:W?"":ct.title})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ma,{...xt,title:W?"":ct.title}),Mt.length>0&&r.jsx(Z0,{P:l,layoutType:p,galleryWidthStyle:Y,galleryPaddingRight:z,galleryPaddingLeft:B,galleryPaddingRightWidth:L,galleryPaddingLeftWidth:ue,galleryPaddingMaxFraction:Ae,showControls:U,scaled:S,children:Mt.map(({displayMedia:bt,lightboxMedia:_t},kt)=>{const vt=_t?Yt.findIndex(Ft=>Ft.url===_t.url):-1;return r.jsx(Rl,{P:l,media:bt,cornerRadius:h||void 0,fillGalleryWidth:!0,imageDisplay:g,isEditor:n,galleryPaddingBetween:te,showPaddingAfter:kt<Mt.length-1,showControls:U,onMediaClick:P&&vt>=0?()=>ke(Yt,vt):void 0},`${bt.url}-${kt}`)})})]})]},mt)})]})}),Me&&K==="on"&&typeof document<"u"&&e&&(()=>{const ct=(s?document.getElementById(s):null)??document.body;return Yn.createPortal(r.jsx("div",{style:Oe,"data-selection":"none",children:r.jsx(Y0,{prefix:l,items:Ze,index:lt,imageDisplay:K0(e.lightboxImageDisplay),isEditor:n,onClose:Xe,onPrev:()=>tt(mt=>(mt-1+Ze.length)%Ze.length),onNext:()=>tt(mt=>(mt+1)%Ze.length),counterClassName:He,counterStyle:he,backgroundColor:e.backgroundColor??F0})}),ct)})()]})}const rx=`import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20921
20973
|
import { createPortal } from 'react-dom';
|
|
20922
20974
|
import type React from 'react';
|
|
20923
20975
|
import { CommonComponentProps } from '../props';
|
|
@@ -22967,4 +23019,4 @@ export function Mercury({
|
|
|
22967
23019
|
</>
|
|
22968
23020
|
);
|
|
22969
23021
|
}
|
|
22970
|
-
`;function Li(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},ax={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:Li("Gallery Padding Right"),galleryPaddingLeft:Li("Gallery Padding Left"),galleryPaddingBetween:Li("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:Li("Title Top Padding"),titleLeftPadding:Li("Title Left Padding"),titleRightPadding:Li("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ga.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleAlign:{...ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ga.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},sx={element:ox,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:ax,sourceCode:rx,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},lx=[op,up,rv,im,pm,Sm,jm,ug,vg,Tg,Yg,Bh,Kf,iy,Oy,Yy,yv,m0,Iv,M0,sx];exports.components=lx;exports.isSchemaV1=Xc;
|
|
23022
|
+
`;function Li(e){return{type:"number",scope:"layout",title:e,min:0,max:100,display:{type:"range-control"}}}const ga={fontSettings:{type:"object",display:{type:"font-settings-weight"},properties:{fontWeight:{type:"number"},fontStyle:{type:"string"}}},textAlign:{type:"string",enum:["left","center","right","justify"],display:{type:"vertical-text-aligh-options"}}},ax={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:Li("Gallery Padding Right"),galleryPaddingLeft:Li("Gallery Padding Left"),galleryPaddingBetween:Li("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:Li("Title Top Padding"),titleLeftPadding:Li("Title Left Padding"),titleRightPadding:Li("Title Right Padding"),transition:{type:"string",scope:"common",title:"Transition",display:{type:"toggle-cycle",enum:["fade","retype","scroll"]}},titleColor:{type:"string",scope:"common",title:"Title",display:{type:"palette-color-picker"}},titleFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},titleFontSettings:{...ga.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},titleFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},titleLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},titleLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},titleWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},titleAlign:{...ga.textAlign,scope:"layout",title:"Align"},titleTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}},lightbox:{type:"boolean",scope:"common",title:"Lightbox",display:{type:"toggle-cycle",enum:["on","off"]}},lightboxImageDisplay:{type:"string",scope:"common",title:"Display",display:{type:"toggle-cycle",enum:["fit","cover"]}},backgroundColor:{type:"string",scope:"common",title:"BG Lightbox",display:{type:"settings-color-picker"}},lightboxCounterColor:{type:"string",scope:"common",title:"Counter Lightbox",display:{type:"palette-color-picker"}},lightboxCounterFontFamily:{type:"string",scope:"common",title:"Font family",display:{type:"font-family-select"}},lightboxCounterFontSettings:{...ga.fontSettings,scope:"common",title:"",display:{type:"font-settings-weight"}},lightboxCounterFontSize:{type:"number",scope:"layout",title:"Input Font Size",display:{type:"font-size"}},lightboxCounterLineHeight:{type:"number",scope:"layout",title:"Input Line Height",display:{type:"line-height-input"}},lightboxCounterLetterSpacing:{type:"number",scope:"layout",title:"Input Letter Spacing",display:{type:"letter-spacing-input"}},lightboxCounterWordSpacing:{type:"number",scope:"layout",title:"Input Word Spacing",display:{type:"word-spacing-input"}},lightboxCounterTextAppearance:{type:"object",scope:"layout",title:"Input Text Appearance",display:{type:"text-appearance"}}},defaults:{type:"a",position:"left",transition:"scroll",titleColor:"#000000",titleFontFamily:"Goudy Bookletter 1911",titleFontSettings:{fontWeight:400,fontStyle:"normal"},titleLetterSpacing:0,titleWordSpacing:0,titleAlign:"center",titleTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"},lightbox:"on",imageDisplay:{display:"fit",ratioValue:"2:3",reversed:!1},lightboxImageDisplay:"fit",backgroundColor:"rgba(28,31,34,0.9)",lightboxCounterColor:"#DEDDDD",lightboxCounterFontFamily:"Goudy Bookletter 1911",lightboxCounterFontSettings:{fontWeight:400,fontStyle:"normal"},lightboxCounterLetterSpacing:0,lightboxCounterWordSpacing:0,lightboxCounterTextAppearance:{textTransform:"none",textDecoration:"none",fontVariant:"normal"}},layoutDefaults:{d:{defaultPaddingTop:30/1440,wrapperWidth:1,imgWidth:600/1440,titleWidth:400/1440,galleryPaddingRight:30/1440,galleryPaddingLeft:30/1440,galleryPaddingBetween:30/1440,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:4/1440,position:"center",titleFontSize:73/1440,titleLineHeight:66/1440,lightboxCounterFontSize:.01,lightboxCounterLineHeight:.01},m:{defaultPaddingTop:10/375,wrapperWidth:1,imgWidth:170/375,titleWidth:150/375,galleryPaddingRight:10/375,galleryPaddingLeft:10/375,galleryPaddingBetween:10/375,titleTopPadding:0,titleLeftPadding:10/375,titleRightPadding:10/375,cornerRadius:8/375,position:"left",titleFontSize:30/375,titleLineHeight:25/375,lightboxCounterFontSize:14/375,lightboxCounterLineHeight:14/375},t:{defaultPaddingTop:20/768,wrapperWidth:1,imgWidth:300/768,titleWidth:320/768,galleryPaddingRight:20/768,galleryPaddingLeft:20/768,galleryPaddingBetween:20/768,titleTopPadding:0,titleLeftPadding:0,titleRightPadding:0,cornerRadius:8/768,position:"center",titleFontSize:58/768,titleLineHeight:48/768,lightboxCounterFontSize:8/768,lightboxCounterLineHeight:8/768}},displayRules:[{if:{name:"lightbox",value:"off"},then:{name:"properties.lightboxImageDisplay.display.enabled",value:!1}}],layout:["__componentName__","type","wrapperWidth","imgWidth","titleWidth","imageDisplay","cornerRadius","position","transition","lightbox","lightboxImageDisplay"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__","type",{type:"row",items:["wrapperWidth","imgWidth"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",title:"Title",items:["position","transition"]},"titleWidth",{type:"row",title:"Lightbox",items:["lightbox","lightboxImageDisplay"]},{type:"row",items:["backgroundColor"]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:[{type:"group",title:"Title",items:["titleFontFamily","titleFontSettings",{type:"row",items:["titleFontSize","titleLineHeight","titleLetterSpacing","titleWordSpacing"]},"titleAlign","titleTextAppearance"]},{type:"group",title:"Lightbox Counter",items:["lightboxCounterFontFamily","lightboxCounterFontSettings",{type:"row",items:["lightboxCounterFontSize","lightboxCounterLineHeight","lightboxCounterLetterSpacing","lightboxCounterWordSpacing"]},"lightboxCounterTextAppearance"]}]}],paletteBookmark:{items:["titleColor","backgroundColor","lightboxCounterColor"],panelIds:["general","typeStyle"]}},sx={element:ox,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:ax,sourceCode:rx,assetsPaths:{content:[{path:"gallery.media.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[{path:"titleFontFamily"},{path:"lightboxCounterFontFamily"}]},fontRelations:{titleFontSettings:"titleFontFamily",lightboxCounterFontSettings:"lightboxCounterFontFamily"}},lx=[ip,dp,rv,nm,um,wm,Dm,ug,vg,Tg,Yg,Bh,Kf,iy,Oy,Yy,yv,m0,Iv,M0,sx];exports.components=lx;exports.isSchemaV1=Kc;
|