@cntrl-site/components 1.0.1-alpha.7 → 1.0.1-alpha.8

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.
@@ -39,7 +39,7 @@ export type OnelinerFormSettings = {
39
39
  fontFamily?: string;
40
40
  input?: TextStyles;
41
41
  button?: TextStyles;
42
- height: number;
42
+ minHeight: number;
43
43
  corners: number;
44
44
  stroke: number;
45
45
  inputPadding: {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Version : 4.1.3
4
4
  * License : MIT
5
5
  * Copyright: 2022 Naotoshi Fujita
6
- */const Yi="RichTextRenderer-module__link___BWeZ2",qi={link:Yi},Hr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?S.jsx("a",{className:qi.link,href:r.value,target:r.target,children:t(r.children)},o):S.jsx("span",{style:Xi(r),children:r.text},o));return S.jsx(S.Fragment,{children:e.map((n,r)=>{const o=n.children;return S.jsx("div",{children:t(o)},r)})})};function Xi(e){return{...e.fontFamily&&{fontFamily: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 Ki="SvgImage-module__svg___q3xE-",Ji="SvgImage-module__img___VsTm-",qn={svg:Ki,img:Ji},ct=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=D.useState(!0);return D.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!o?S.jsx("img",{src:e,alt:"",className:pe(qn.img,r)}):S.jsx("span",{"data-supports-mask":o,className:pe(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Zi={"top-left":q.topLeftAlignment,"top-center":q.topCenterAlignment,"top-right":q.topRightAlignment,"middle-left":q.middleLeftAlignment,"middle-center":q.middleCenterAlignment,"middle-right":q.middleRightAlignment,"bottom-left":q.bottomLeftAlignment,"bottom-center":q.bottomCenterAlignment,"bottom-right":q.bottomRightAlignment};function Qi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:_,textAppearance:m,color:y}=n.imageCaption,[u,g]=D.useState(void 0),[$,E]=D.useState(null),[d,h]=D.useState(0),[W,M]=D.useState(0),{direction:w,transition:v,controls:T,pagination:N,imageCaption:z,triggers:L}=e,O=D.useRef(v.type),{x:F,y:G}=e.controls.offset,H=f=>{o&&o.go(f)};return D.useEffect(()=>{if(!$)return;const f=new ResizeObserver(R=>{if(!o)return;const[A]=R;g({width:Math.round(A.contentRect.width),height:Math.round(A.contentRect.height)})});return f.observe($),()=>f.unobserve($)},[$]),D.useEffect(()=>{!o||O.current===v.type||(M(f=>f+1),O.current=v.type)},[v.type]),S.jsx("div",{className:pe(q.wrapper,{[q.editor]:r}),ref:E,children:S.jsxs("div",{className:q.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:pe(q.captionBlock),children:S.jsx("div",{className:q.captionTextWrapper,children:t.map((f,R)=>S.jsx("div",{className:pe(q.captionText,Zi[z.alignment],{[q.withPointerEvents]:R===d&&r,[q.active]:R===d}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,r),letterSpacing:k.scalingValue(l,r),wordSpacing:k.scalingValue(c,r),textAlign:p,fontSize:k.scalingValue(_.fontSize,r),lineHeight:k.scalingValue(_.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:y,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:q.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:k.scalingValue(z.offset.y,r),left:k.scalingValue(z.offset.x,r)},children:S.jsx(Hr,{content:f.imageCaption})})},R))})}),S.jsx(Wr,{onMove:f=>{h(f.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:w==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,R)=>S.jsx(Pr,{children:S.jsx("div",{className:q.sliderItem,children:S.jsx("div",{className:q.imgWrapper,children:S.jsx("img",{className:pe(q.sliderImage,{[q.contain]:f.image.objectFit==="contain",[q.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},R))},W),T.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(q.arrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{onClick:()=>{H("-1")},className:q.arrowInner,style:{transform:`translate(${k.scalingValue(F,r)}, ${k.scalingValue(G*(w==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:pe(q.arrowImg,q.mirror)}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg,q.mirror)})]})}),S.jsx("div",{className:pe(q.arrow,q.nextArrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{className:q.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${k.scalingValue(F*(w==="horiz"?-1:1),r)}, ${k.scalingValue(G,r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:q.arrowImg}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg)})]})})]}),L.triggersList.click&&S.jsx("div",{className:q.clickOverlay,onClick:()=>{o&&o.go("+1")}}),N.isActive&&S.jsx("div",{className:pe(q.pagination,{[q.paginationInsideBottom]:N.position==="inside-1"&&w==="horiz",[q.paginationInsideTop]:N.position==="inside-2"&&w==="horiz",[q.paginationOutsideBottom]:N.position==="outside-1"&&w==="horiz",[q.paginationOutsideTop]:N.position==="outside-2"&&w==="horiz",[q.paginationInsideLeft]:N.position==="inside-1"&&w==="vert",[q.paginationInsideRight]:N.position==="inside-2"&&w==="vert",[q.paginationOutsideLeft]:N.position==="outside-1"&&w==="vert",[q.paginationOutsideRight]:N.position==="outside-2"&&w==="vert",[q.paginationVertical]:w==="vert"}),children:S.jsx("div",{className:q.paginationInner,style:{backgroundColor:N.colors[2],transform:`scale(${N.scale/100}) translate(${k.scalingValue(N.offset.x,r)}, ${k.scalingValue(N.offset.y,r)}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:t.map((f,R)=>S.jsx("button",{onClick:()=>{o&&o.go(R)},className:pe(q.paginationItem),children:S.jsx("div",{className:pe(q.dot,{[q.activeDot]:R===d}),style:{backgroundColor:R===d?N.colors[0]:N.colors[1],"--pagination-hover-color":N.hover}})},R))})})]})})}function Xn({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 ea={element:Qi,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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"]}},ta="ImageRevealSlider-module__imageRevealSlider___UE5Ob",na="ImageRevealSlider-module__image___Qjt-e",ra="ImageRevealSlider-module__link___N-iLG",oa="ImageRevealSlider-module__cursor___2U03d",qe={imageRevealSlider:ta,image:na,link:ra,cursor:oa};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ia(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function aa({settings:e,content:t,isEditor:n}){const[r,o]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),p=D.useRef(0),[c,_]=D.useState({x:0,y:0}),[m,y]=D.useState(1),[u,g]=D.useState("none"),$=D.useRef({x:0,y:0}),[E,d]=D.useState(!1),{sizeType:h,imageWidth:W,randomRangeImageWidth:M}=e.imageSize,{revealPosition:w,visible:v}=e.position,{cursorType:T,target:N,defaultCursorScale:z,defaultCursor:L,hoverCursorScale:O,hoverCursor:F}=e.cursor;D.useEffect(()=>{if(!r)return;const f=(b,C)=>{const j=r.getBoundingClientRect(),Z=b-j.left,te=C-j.top;if(_({x:Z,y:te}),T==="system"){g("none"),y(1);return}const ee=Z,ge=te,I=document.elementFromPoint(j.left+ee,j.top+ge);if(I&&I.closest("a")){g("none"),y(1);return}const X=Kn(ee,ge,a)||N==="area"?{img:F??"none",scale:O}:{img:L??"none",scale:z};g(X.img),y(X.scale)},R=b=>{b.stopPropagation(),$.current={x:b.clientX,y:b.clientY},f(b.clientX,b.clientY)},A=()=>{E&&f($.current.x,$.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",A,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",A,!0)}},[r,E,c,T,N,F,L,O,z,a]),D.useEffect(()=>{E||(g("none"),y(0))},[E]);const G=async(f,R,A,b={})=>{const{width:C,height:j,finalWidth:Z}=await ia(f.image.url,h,W,M);let te=0,ee=0;w==="same"?(te=R/2,ee=A/2):(te=b.x??Math.random()*R,ee=b.y??Math.random()*A);const ge=Math.min(Math.max(te,C/2),R-C/2),I=Math.min(Math.max(ee,j/2),A-j/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:ge,y:I,width:Z}};D.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),R=f.width,A=f.height,b=[];(async()=>{const j=t[0],Z=await G(j,R,A);b.push(Z),i(b),l(1)})()},[h,W,M,w,r]),D.useEffect(()=>{v==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[v]);const H=async f=>{if(!r)return;const R=r.getBoundingClientRect(),A=f.clientX-R.left,b=f.clientY-R.top;if(N==="image"&&!Kn(A,b,a))return;let C=0,j=0;w==="on Click"?(C=A,j=b):w==="same"?(C=R.width/2,j=R.height/2):(C=Math.random()*R.width,j=Math.random()*R.height);const Z=t[s],te=await G(Z,R.width,R.height,{x:C,y:j});i(ee=>v==="all"?[...ee,te]:[te]),l(ee=>ee>=t.length-1?0:ee+1)};return S.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:qe.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>S.jsx("div",{className:qe.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:N==="area"&&f.link?S.jsx("a",{href:f.link,target:"_blank",className:qe.link,children:S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)}):S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)},f.id)),E&&S.jsx("div",{className:qe.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const la={element:aa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryPreview.png"},defaultSize:{width:"100%",height:"100%"},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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:""}]}}}},sa="LightBox-module__hidden___9s-9x",ca="LightBox-module__heroImage___sTxNF",ua="LightBox-module__background___rm9ml",pa="LightBox-module__editor___4ACaY",da="LightBox-module__contentStyle___Bgnsq",ga="LightBox-module__imageStyle___tLIlB",fa="LightBox-module__imgWrapper___LuFUp",ma="LightBox-module__contain___8-yaS",ya="LightBox-module__cover___hNvOG",va="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",ba="LightBox-module__lightboxSplide___XFuWC",xa="LightBox-module__arrow___iz38X",Ca="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",_a="LightBox-module__arrowInner___p48sW",wa="LightBox-module__arrowIcon___3VaFf",$a="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Ta="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",La="LightBox-module__thumbsAlignStart___MO6tY",ka="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",Na="LightBox-module__thumbItem___HvnF3",Va="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Fa="LightBox-module__slideInRight___S-pPp",Ba="LightBox-module__slideInTop___DFdAj",Ma="LightBox-module__slideInBottom___m27kZ",za="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",Wa="LightBox-module__slideOutRight___SK7eC",Pa="LightBox-module__slideOutTop___Vgg0z",Ha="LightBox-module__slideOutBottom___nJ0Ef",Ua="LightBox-module__scaleSlide___vZriG",B={hidden:sa,heroImage:ca,background:ua,editor:pa,contentStyle:da,imageStyle:ga,imgWrapper:fa,contain:ma,cover:ya,caption:va,captionTextInner:ha,lightboxSplide:ba,arrow:xa,arrowVertical:Ca,nextArrow:Sa,arrowInner:_a,arrowIcon:wa,arrowImg:$a,mirror:Ea,thumbsWrapper:Ta,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:La,thumbsAlignCenter:ka,thumbsAlignEnd:Ra,thumbItem:Na,closeButton:Va,fadeIn:Oa,slideInLeft:ja,slideInRight:Fa,slideInTop:Ba,slideInBottom:Ma,fadeOut:za,slideOutLeft:Da,slideOutRight:Wa,slideOutTop:Pa,slideOutBottom:Ha,scaleSlide:Ua},At=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:r.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,r};function Ur(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 Jn(e){const t=e.getBoundingClientRect(),n=Ur(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const _=t.left+n.left,m=t.top+n.top,y=(r-p)/2+_,u=(o-c)/2+m;return{x:y,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Ur(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ga(e,t){const n=(()=>{if(e==="fade in")return B.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return B.fadeIn;if(e==="slide in")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return B.fadeOut;if(e==="slide in")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})(),a=(()=>{if(e==="fade in")return B.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ya=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),S.jsx(qa,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},qa=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var V;const[l,p]=D.useState(0),[c,_]=D.useState(0),[m,y]=D.useState(!1),[u,g]=D.useState(!1),[$,E]=D.useState({}),d=D.useRef(null),h=D.useRef(null),W=D.useRef(null),M=D.useRef(!1),w=D.useRef(null),v=D.useRef(null),T=D.useRef(null),N=D.useRef(null),z=D.useRef(!1),L=D.useRef(null),[O,F]=D.useState(!1),{appear:G,triggers:H,slider:f,thumbnail:R,controls:A,area:b,caption:C,layout:j}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:te,backdropDisappearClass:ee,disappearClass:ge}=Ga(G.type,G.direction),I=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const x=()=>{setTimeout(()=>{var U,K;(K=(U=d.current)==null?void 0:U.splide)==null||K.refresh()},16)},P=()=>{_(U=>U+1)};return window.addEventListener("ArticleEditor.Layout:change",x),window.addEventListener("ArticleEditor.ComponentContent:change",P),()=>{window.removeEventListener("ArticleEditor.Layout:change",x),window.removeEventListener("ArticleEditor.ComponentContent:change",P)}},[]),D.useEffect(()=>{if(!e||!R.isActive){F(!1);return}const x=L.current;if(!x)return;const P=()=>{f.direction==="horiz"?F(x.scrollWidth>x.clientWidth):F(x.scrollHeight>x.clientHeight)};P();const U=new ResizeObserver(P);return U.observe(x),()=>U.disconnect()},[e,R.isActive,n.length,$,f.direction]);const X=D.useCallback(()=>{const x=window.matchMedia("(max-width: 768px)").matches,P=Qn(b.color);x&&!i&&P>.9&&(document.body.style.backgroundColor=""),y(!0),M.current=!0;const U=K=>{K.target===w.current&&K.animationName&&(w.current&&v.current&&w.current.removeEventListener("animationend",v.current),v.current=null,M.current&&(M.current=!1,t()),y(!1))};w.current&&(v.current=U,w.current.addEventListener("animationend",U))},[t,b.color,i]),ce=(x,P,U)=>{var K,re;if(x){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?X():(K=d.current)==null||K.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Y=x.getBoundingClientRect(),J=P-Y.left,oe=U-Y.top,le=Y.width,ie=Y.height;let ye;f.direction==="horiz"?ye=J<le/2?"-1":"+1":ye=oe<ie/2?"-1":"+1",(re=d.current)==null||re.go(ye)}}},ae=x=>{if(z.current){z.current=!1;return}const P=n[l],U=(P==null?void 0:P.image.objectFit)==="cover";let K,re;if("changedTouches"in x&&x.changedTouches.length>0)K=x.changedTouches[0].clientX,re=x.changedTouches[0].clientY;else if("clientX"in x)K=x.clientX,re=x.clientY;else return;let Y;if(U&&W.current){const J=Zn(W.current);Y=K>=J.left&&K<=J.right&&re>=J.top&&re<=J.bottom}else{const J=W.current?Jn(W.current):null;if(!J){x.target===x.currentTarget&&X();return}Y=K>=J.x&&K<=J.x+J.width&&re>=J.y&&re<=J.y+J.height}Y?ce(W.current,K,re):X()},ue=x=>{const P=x.target;(P.classList.contains(B.thumbsWrapper)||P.classList.contains(B.thumbsContainer))&&ae(x)};D.useEffect(()=>{if(!e)return;const x=P=>{var U,K;if(P.key==="Escape"){X();return}if(P.key==="ArrowRight"){p(re=>(re+1)%Math.max(n.length,1)),(U=d.current)==null||U.go("+1");return}P.key==="ArrowLeft"&&(p(re=>(re-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=d.current)==null||K.go("-1"))};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}},[e,X,n.length]),D.useEffect(()=>{if(e){if(p(0),_(P=>P+1),M.current=!1,y(!1),g(!1),E({}),!I)return;const x=new CustomEvent("page-overlay",{detail:{itemId:I}});window.dispatchEvent(x)}return()=>{w.current&&v.current&&(w.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,I]),D.useEffect(()=>{h.current!==null&&h.current!==f.type&&_(x=>x+1),h.current=f.type},[f.type]),D.useEffect(()=>{if(!e)return;const x=document.body.style.overflow,P=window.matchMedia("(max-width: 768px)").matches,U=Qn(b.color);document.body.style.overflow="hidden",g(!1);const K=Y=>{Y.target===w.current&&!M.current&&Y.animationName&&(P&&!i&&U>.9&&(document.body.style.backgroundColor=b.color),g(!0),w.current&&T.current&&w.current.removeEventListener("animationend",T.current),T.current=null)};w.current&&(T.current=K,w.current.addEventListener("animationend",K));const re=Y=>{const J=Y.target;J&&(J.closest(`.${B.thumbsWrapper}`)||J.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&Y.preventDefault()};return document.addEventListener("touchmove",re,{passive:!1}),()=>{document.body.style.overflow=x,document.removeEventListener("touchmove",re),w.current&&T.current&&(w.current.removeEventListener("animationend",T.current),T.current=null),g(!1)}},[e,i,b.color,f.type]),D.useEffect(()=>{if(!e)return;const x=P=>{var K,re;if(M.current){P.stopPropagation();return}if(z.current){z.current=!1;return}const U=P.target;if(!(U&&(U.closest(`.${B.thumbsContainer}`)||U.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((re=(K=d.current)==null?void 0:K.splide)!=null&&re.root)){const Y=d.current.splide.root;if(U&&(Y.contains(U)||Y===U))return}if(P.touches.length===0&&P.changedTouches.length>0){const Y=n[l],J=(Y==null?void 0:Y.image.objectFit)==="cover",oe=P.changedTouches[0];let le;if(J&&W.current){const ie=Zn(W.current);le=oe.clientX>=ie.left&&oe.clientX<=ie.right&&oe.clientY>=ie.top&&oe.clientY<=ie.bottom}else{const ie=W.current?Jn(W.current):null;if(!ie)return;le=oe.clientX>=ie.x&&oe.clientX<=ie.x+ie.width&&oe.clientY>=ie.y&&oe.clientY<=ie.y+ie.height}if(!le){P.stopPropagation(),M.current=!0;const ie=ye=>{ye.stopPropagation(),ye.preventDefault(),document.removeEventListener("click",ie,!0)};document.addEventListener("click",ie,!0),X()}}}};return document.addEventListener("touchend",x,{passive:!0}),()=>{document.removeEventListener("touchend",x)}},[e,X,l,n]);const Se=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";D.useEffect(()=>{var ye,$t;if(!e||!Se||!(($t=(ye=d.current)==null?void 0:ye.splide)!=null&&$t.root))return;const x=d.current.splide.root,P=30,U=(ne,fe)=>{if(N.current){const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);(Ie>0||Et>0)&&(z.current=!0)}},K=ne=>{N.current&&(ne.preventDefault(),U(ne.clientX,ne.clientY))},re=ne=>{N.current&&ne.touches.length>0&&(ne.preventDefault(),U(ne.touches[0].clientX,ne.touches[0].clientY))},Y=(ne,fe)=>{if(!N.current||!d.current){N.current=null;return}const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);Et>P&&Et>Ie&&d.current.go(fe<N.current.y?"+1":"-1"),N.current=null},J=ne=>{N.current&&Y(ne.clientX,ne.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",K)},oe=ne=>{if(N.current){if(ne.changedTouches.length>0){const fe=ne.changedTouches[0];Y(fe.clientX,fe.clientY)}document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.removeEventListener("touchmove",re)}},le=ne=>{N.current={x:ne.clientX,y:ne.clientY},z.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},ie=ne=>{ne.touches.length>0&&(N.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe))};return x.addEventListener("pointerdown",le),x.addEventListener("touchstart",ie),()=>{x.removeEventListener("pointerdown",le),x.removeEventListener("touchstart",ie),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),N.current=null,z.current=!1}},[e,Se,c]);const je={backgroundColor:b.color,backdropFilter:`blur(${b.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Gr.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:w,className:pe(B.background,m?ee:te,{[B.editor]:i},{[B.hidden]:!e}),style:{...je,...u&&!i&&!m?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?w:null,className:pe(B.contentStyle,m?ge:Z,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Wr,{onMove:x=>p(x.index),ref:d,className:B.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((x,P)=>{const U=At(j.position,j.offset,i),K=`${k.scalingValue(j.padding.top,i)} ${k.scalingValue(j.padding.right,i)} ${k.scalingValue(j.padding.bottom,i)} ${k.scalingValue(j.padding.left,i)}`,re=f.type==="scale"?(()=>{const{transform:Y,...J}=U;return{...J,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":Y||"none"}})():{...U,position:"absolute",padding:K,boxSizing:"border-box"};return S.jsx(Pr,{children:S.jsx("div",{className:B.imgWrapper,onClick:ae,children:S.jsx("img",{ref:P===l?W:null,className:pe(B.imageStyle,{[B.contain]:x.image.objectFit==="contain",[B.cover]:x.image.objectFit==="cover",[B.scaleSlide]:f.type==="scale"}),src:x.image.url,alt:x.image.name??"",style:{...re,pointerEvents:x.image.objectFit==="contain"?"none":"auto"}})})},P)})},c),A.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x,i)}, ${k.scalingValue(A.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:pe(B.arrowImg,B.mirror)}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg,B.mirror)})]})}),S.jsx("div",{className:pe(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x*(f.direction==="horiz"?-1:1),i)}, ${k.scalingValue(A.offset.y,i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:B.arrowImg}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg)})]})})]}),b.closeIconUrl&&(()=>{const x=At(b.closeIconAlign,b.closeIconOffset,i),P=`scale(${b.closeIconScale})`,U=x.transform?`${x.transform} ${P}`:P;return S.jsx("button",{className:B.closeButton,style:{...x,transform:U},onClick:X,"aria-label":"Close lightbox",children:S.jsx(ct,{url:b.closeIconUrl,fill:b.closeIconColor??"#000000",hoverFill:b.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&r.imageCaption&&((V=n[l])==null?void 0:V.imageCaption)&&(()=>{const{widthSettings:x,fontSettings:P,letterSpacing:U,textAlign:K,wordSpacing:re,fontSizeLineHeight:Y,textAppearance:J,color:oe}=r.imageCaption;return S.jsx("div",{className:B.caption,style:{...At(C.alignment,C.offset,i),fontFamily:P.fontFamily,fontWeight:P.fontWeight,fontStyle:P.fontStyle,width:x.sizing==="auto"?"max-content":k.scalingValue(x.width,i),letterSpacing:k.scalingValue(U,i),wordSpacing:k.scalingValue(re,i),textAlign:K,fontSize:k.scalingValue(Y.fontSize,i),lineHeight:k.scalingValue(Y.lineHeight,i),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:oe},onClick:le=>le.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:S.jsx(Hr,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[x,P]=R.position.split("-"),U=f.direction==="horiz"?`${x}-left`:R.position,K=At(U,R.offset,i),re=()=>{if(f.direction==="horiz"){if(P==="left")return"flex-start";if(P==="center")return"center";if(P==="right")return"flex-end"}else{if(x==="top")return"flex-start";if(x==="middle")return"center";if(x==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:L,className:B.thumbsWrapper,onClick:Y=>ue(Y),style:{position:i?"absolute":"fixed",...K,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:pe(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:R.align==="start",[B.thumbsAlignCenter]:R.align==="center",[B.thumbsAlignEnd]:R.align==="end"}),style:{gap:k.scalingValue(R.grid.gap,i),justifyContent:O?"flex-start":re()},children:n.map((Y,J)=>{const oe=J===l,le=$[J],ye=R.grid.size*(oe?R.activeState.scale:1),$t=()=>{if(R.fit!=="fit")return{};if(!le)return f.direction==="horiz"?{height:k.scalingValue(ye,i)}:{width:k.scalingValue(ye,i)};const ne=le.width/le.height;if(f.direction==="horiz"){const fe=ye,Ie=fe*ne;return{width:k.scalingValue(Ie,i),height:k.scalingValue(fe,i)}}else{const fe=ye,Ie=fe/ne;return{width:k.scalingValue(fe,i),height:k.scalingValue(Ie,i)}}};return S.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&R.fit!=="fit"?{height:k.scalingValue(ye,i)}:{},...f.direction==="vert"&&R.fit!=="fit"?{width:k.scalingValue(ye,i)}:{},...R.fit==="cover"?{width:k.scalingValue(ye,i),height:k.scalingValue(ye,i)}:{},...$t(),transition:oe?"all 0.25s ease-out":"none",opacity:oe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:ne=>{var fe;ne.stopPropagation(),p(J),(fe=d.current)==null||fe.go(J)},onMouseEnter:()=>{var ne;R.triggers==="hov"&&((ne=d.current)==null||ne.go(J))},children:S.jsx("img",{src:Y.image.url,alt:Y.image.name??"",onLoad:ne=>{const fe=ne.currentTarget;fe.naturalWidth&&fe.naturalHeight&&E(Ie=>({...Ie,[J]:{width:fe.naturalWidth,height:fe.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Y.image.name}-${J}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 Xa={element:Ya,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},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",minWidth:300,maxWidth:550}}},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 Xe(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ka(e){return`
6
+ */const Yi="RichTextRenderer-module__link___BWeZ2",qi={link:Yi},Hr=({content:e})=>{const t=n=>n.map((r,o)=>r.type==="link"?S.jsx("a",{className:qi.link,href:r.value,target:r.target,children:t(r.children)},o):S.jsx("span",{style:Xi(r),children:r.text},o));return S.jsx(S.Fragment,{children:e.map((n,r)=>{const o=n.children;return S.jsx("div",{children:t(o)},r)})})};function Xi(e){return{...e.fontFamily&&{fontFamily: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 Ki="SvgImage-module__svg___q3xE-",Ji="SvgImage-module__img___VsTm-",qn={svg:Ki,img:Ji},ct=({url:e,fill:t="#000000",hoverFill:n="#CCCCCC",className:r=""})=>{const[o,a]=D.useState(!0);return D.useEffect(()=>{if(typeof window<"u"&&window.CSS){const i=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');a(i)}},[]),!e.endsWith(".svg")||!o?S.jsx("img",{src:e,alt:"",className:pe(qn.img,r)}):S.jsx("span",{"data-supports-mask":o,className:pe(qn.svg,r),style:{"--svg":`url(${e})`,"--fill":t,"--hover-fill":n}})},Zi={"top-left":q.topLeftAlignment,"top-center":q.topCenterAlignment,"top-right":q.topRightAlignment,"middle-left":q.middleLeftAlignment,"middle-center":q.middleCenterAlignment,"middle-right":q.middleRightAlignment,"bottom-left":q.bottomLeftAlignment,"bottom-center":q.bottomCenterAlignment,"bottom-right":q.bottomRightAlignment};function Qi({settings:e,content:t,styles:n,isEditor:r}){const[o,a]=D.useState(null),{widthSettings:i,fontSettings:s,letterSpacing:l,textAlign:p,wordSpacing:c,fontSizeLineHeight:_,textAppearance:m,color:y}=n.imageCaption,[u,g]=D.useState(void 0),[$,E]=D.useState(null),[d,h]=D.useState(0),[W,M]=D.useState(0),{direction:w,transition:v,controls:T,pagination:N,imageCaption:z,triggers:L}=e,O=D.useRef(v.type),{x:F,y:G}=e.controls.offset,H=f=>{o&&o.go(f)};return D.useEffect(()=>{if(!$)return;const f=new ResizeObserver(R=>{if(!o)return;const[A]=R;g({width:Math.round(A.contentRect.width),height:Math.round(A.contentRect.height)})});return f.observe($),()=>f.unobserve($)},[$]),D.useEffect(()=>{!o||O.current===v.type||(M(f=>f+1),O.current=v.type)},[v.type]),S.jsx("div",{className:pe(q.wrapper,{[q.editor]:r}),ref:E,children:S.jsxs("div",{className:q.sliderInner,style:{width:u?u.width:"100%",height:u?u.height:"100%",backgroundColor:v.backgroundColor&&v.type==="fade in"?v.backgroundColor:"transparent"},children:[e.imageCaption.isActive&&S.jsx("div",{className:pe(q.captionBlock),children:S.jsx("div",{className:q.captionTextWrapper,children:t.map((f,R)=>S.jsx("div",{className:pe(q.captionText,Zi[z.alignment],{[q.withPointerEvents]:R===d&&r,[q.active]:R===d}),style:{fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,width:i.sizing==="auto"?"max-content":k.scalingValue(i.width,r),letterSpacing:k.scalingValue(l,r),wordSpacing:k.scalingValue(c,r),textAlign:p,fontSize:k.scalingValue(_.fontSize,r),lineHeight:k.scalingValue(_.lineHeight,r),textTransform:m.textTransform??"none",textDecoration:m.textDecoration??"none",fontVariant:m.fontVariant??"normal",color:y,transitionDuration:v.duration?`${Math.round(parseInt(v.duration)/2)}ms`:"500ms"},children:S.jsx("div",{"data-styles":"imageCaption",className:q.captionTextInner,style:{"--link-hover-color":z.linkHoverColor,"--link-color":z.linkColor,position:"relative",top:k.scalingValue(z.offset.y,r),left:k.scalingValue(z.offset.x,r)},children:S.jsx(Hr,{content:f.imageCaption})})},R))})}),S.jsx(Wr,{onMove:f=>{h(f.index)},ref:a,options:{arrows:!1,speed:v.duration?parseInt(v.duration):500,autoplay:L.autoPlay!==null,...L.autoPlay!==null&&{interval:parseInt(L.autoPlay)*1e3},direction:w==="horiz"||v.type==="fade in"?"ltr":"ttb",pagination:!1,drag:L.triggersList.drag,perPage:1,width:u?u.width:"100%",height:u?u.height:"100%",type:v.type==="fade in"?"fade":"loop",rewind:!0},children:t.map((f,R)=>S.jsx(Pr,{children:S.jsx("div",{className:q.sliderItem,children:S.jsx("div",{className:q.imgWrapper,children:S.jsx("img",{className:pe(q.sliderImage,{[q.contain]:f.image.objectFit==="contain",[q.cover]:f.image.objectFit==="cover"}),src:f.image.url,alt:f.image.name??""})})})},R))},W),T.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(q.arrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{onClick:()=>{H("-1")},className:q.arrowInner,style:{transform:`translate(${k.scalingValue(F,r)}, ${k.scalingValue(G*(w==="horiz"?1:-1),r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:pe(q.arrowImg,q.mirror)}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg,q.mirror)})]})}),S.jsx("div",{className:pe(q.arrow,q.nextArrow,{[q.arrowVertical]:w==="vert",[q.hoverArrow]:T.show==="on hover"}),style:{color:T.color,"--arrow-hover-color":T.hover},children:S.jsxs("button",{className:q.arrowInner,onClick:()=>H("+1"),style:{transform:`translate(${k.scalingValue(F*(w==="horiz"?-1:1),r)}, ${k.scalingValue(G,r)}) scale(${e.controls.scale/100}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:[T.arrowsImgUrl&&S.jsx(ct,{url:T.arrowsImgUrl,fill:T.color,hoverFill:T.hover,className:q.arrowImg}),!T.arrowsImgUrl&&S.jsx(Xn,{color:T.color,className:pe(q.arrowIcon,q.arrowImg)})]})})]}),L.triggersList.click&&S.jsx("div",{className:q.clickOverlay,onClick:()=>{o&&o.go("+1")}}),N.isActive&&S.jsx("div",{className:pe(q.pagination,{[q.paginationInsideBottom]:N.position==="inside-1"&&w==="horiz",[q.paginationInsideTop]:N.position==="inside-2"&&w==="horiz",[q.paginationOutsideBottom]:N.position==="outside-1"&&w==="horiz",[q.paginationOutsideTop]:N.position==="outside-2"&&w==="horiz",[q.paginationInsideLeft]:N.position==="inside-1"&&w==="vert",[q.paginationInsideRight]:N.position==="inside-2"&&w==="vert",[q.paginationOutsideLeft]:N.position==="outside-1"&&w==="vert",[q.paginationOutsideRight]:N.position==="outside-2"&&w==="vert",[q.paginationVertical]:w==="vert"}),children:S.jsx("div",{className:q.paginationInner,style:{backgroundColor:N.colors[2],transform:`scale(${N.scale/100}) translate(${k.scalingValue(N.offset.x,r)}, ${k.scalingValue(N.offset.y,r)}) rotate(${w==="horiz"?"0deg":"90deg"})`},children:t.map((f,R)=>S.jsx("button",{onClick:()=>{o&&o.go(R)},className:pe(q.paginationItem),children:S.jsx("div",{className:pe(q.dot,{[q.activeDot]:R===d}),style:{backgroundColor:R===d?N.colors[0]:N.colors[1],"--pagination-hover-color":N.hover}})},R))})})]})})}function Xn({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 ea={element:Qi,id:"control-slider",name:"Slider",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/sliderImg.png"},defaultSize:{width:400,height:400},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:"outside-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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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"]}},ta="ImageRevealSlider-module__imageRevealSlider___UE5Ob",na="ImageRevealSlider-module__image___Qjt-e",ra="ImageRevealSlider-module__link___N-iLG",oa="ImageRevealSlider-module__cursor___2U03d",qe={imageRevealSlider:ta,image:na,link:ra,cursor:oa};function Kn(e,t,n){for(const r of n){const o=new Image;o.src=r.url;const a=r.width?Number.parseFloat(r.width):o.naturalWidth,i=o.naturalHeight/o.naturalWidth*a,s=a/2,l=i/2;if(e>=r.x-s&&e<=r.x+s&&t>=r.y-l&&t<=r.y+l)return!0}return!1}function en(e){return new Promise(t=>{const n=new Image;n.src=e,n.onload=()=>{t({width:n.naturalWidth,height:n.naturalHeight})}})}async function ia(e,t,n,r){let o,a;if(t==="custom"){o=n;const i=await en(e);a=i.height/i.width*o}else if(t==="random"){o=Math.random()*(r.max-r.min)+r.min;const i=await en(e);a=i.height/i.width*o}else{const i=await en(e);o=i.width,a=i.height}return{width:o,height:a,finalWidth:`${o}px`}}function aa({settings:e,content:t,isEditor:n}){const[r,o]=D.useState(null),[a,i]=D.useState([]),[s,l]=D.useState(0),p=D.useRef(0),[c,_]=D.useState({x:0,y:0}),[m,y]=D.useState(1),[u,g]=D.useState("none"),$=D.useRef({x:0,y:0}),[E,d]=D.useState(!1),{sizeType:h,imageWidth:W,randomRangeImageWidth:M}=e.imageSize,{revealPosition:w,visible:v}=e.position,{cursorType:T,target:N,defaultCursorScale:z,defaultCursor:L,hoverCursorScale:O,hoverCursor:F}=e.cursor;D.useEffect(()=>{if(!r)return;const f=(b,C)=>{const j=r.getBoundingClientRect(),Z=b-j.left,te=C-j.top;if(_({x:Z,y:te}),T==="system"){g("none"),y(1);return}const ee=Z,ge=te,I=document.elementFromPoint(j.left+ee,j.top+ge);if(I&&I.closest("a")){g("none"),y(1);return}const X=Kn(ee,ge,a)||N==="area"?{img:F??"none",scale:O}:{img:L??"none",scale:z};g(X.img),y(X.scale)},R=b=>{b.stopPropagation(),$.current={x:b.clientX,y:b.clientY},f(b.clientX,b.clientY)},A=()=>{E&&f($.current.x,$.current.y)};return r.addEventListener("mousemove",R),window.addEventListener("scroll",A,!0),()=>{r.removeEventListener("mousemove",R),window.removeEventListener("scroll",A,!0)}},[r,E,c,T,N,F,L,O,z,a]),D.useEffect(()=>{E||(g("none"),y(0))},[E]);const G=async(f,R,A,b={})=>{const{width:C,height:j,finalWidth:Z}=await ia(f.image.url,h,W,M);let te=0,ee=0;w==="same"?(te=R/2,ee=A/2):(te=b.x??Math.random()*R,ee=b.y??Math.random()*A);const ge=Math.min(Math.max(te,C/2),R-C/2),I=Math.min(Math.max(ee,j/2),A-j/2);return{id:p.current++,url:f.image.url,link:f.link,name:f.image.name,x:ge,y:I,width:Z}};D.useEffect(()=>{if(!r||t.length===0)return;const f=r.getBoundingClientRect(),R=f.width,A=f.height,b=[];(async()=>{const j=t[0],Z=await G(j,R,A);b.push(Z),i(b),l(1)})()},[h,W,M,w,r]),D.useEffect(()=>{v==="last One"&&i(f=>f.length>0?[f[f.length-1]]:[])},[v]);const H=async f=>{if(!r)return;const R=r.getBoundingClientRect(),A=f.clientX-R.left,b=f.clientY-R.top;if(N==="image"&&!Kn(A,b,a))return;let C=0,j=0;w==="on Click"?(C=A,j=b):w==="same"?(C=R.width/2,j=R.height/2):(C=Math.random()*R.width,j=Math.random()*R.height);const Z=t[s],te=await G(Z,R.width,R.height,{x:C,y:j});i(ee=>v==="all"?[...ee,te]:[te]),l(ee=>ee>=t.length-1?0:ee+1)};return S.jsxs("div",{ref:o,onClick:H,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:qe.imageRevealSlider,style:{cursor:u==="none"?"default":"none"},children:[a.map(f=>S.jsx("div",{className:qe.wrapper,style:{top:`${f.y}px`,left:`${f.x}px`,position:"absolute",transform:"translate(-50%, -50%)",width:f.width??"auto",height:"auto",cursor:u==="none"?"default":"none"},children:N==="area"&&f.link?S.jsx("a",{href:f.link,target:"_blank",className:qe.link,children:S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)}):S.jsx("img",{src:f.url,alt:f.name,className:qe.image},f.id)},f.id)),E&&S.jsx("div",{className:qe.cursor,style:{left:`${c.x}px`,top:`${c.y}px`,transform:`translate(-50%, -50%) scale(${m})`,backgroundImage:`url('${u}')`,backgroundSize:"cover",backgroundPosition:"center",position:"absolute",pointerEvents:"none"}})]})}const la={element:aa,id:"control-image-reveal",name:"Click Gallery",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/clickGalleryImg.png"},defaultSize:{width:"100%",height:"100%"},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,minWidth:58,maxWidth:108,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",minWidth:300,maxWidth:550}}},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:""}]}}}},sa="LightBox-module__hidden___9s-9x",ca="LightBox-module__heroImage___sTxNF",ua="LightBox-module__background___rm9ml",pa="LightBox-module__editor___4ACaY",da="LightBox-module__contentStyle___Bgnsq",ga="LightBox-module__imageStyle___tLIlB",fa="LightBox-module__imgWrapper___LuFUp",ma="LightBox-module__contain___8-yaS",ya="LightBox-module__cover___hNvOG",va="LightBox-module__caption___b6L2I",ha="LightBox-module__captionTextInner___rCGNH",ba="LightBox-module__lightboxSplide___XFuWC",xa="LightBox-module__arrow___iz38X",Ca="LightBox-module__arrowVertical___Zfz81",Sa="LightBox-module__nextArrow___zkAQN",_a="LightBox-module__arrowInner___p48sW",wa="LightBox-module__arrowIcon___3VaFf",$a="LightBox-module__arrowImg___pNV88",Ea="LightBox-module__mirror___pjeXc",Ta="LightBox-module__thumbsWrapper___GB-nU",Aa="LightBox-module__thumbsContainerVertical___wttk5",Ia="LightBox-module__thumbsContainer___osSma",La="LightBox-module__thumbsAlignStart___MO6tY",ka="LightBox-module__thumbsAlignCenter___Q4sUx",Ra="LightBox-module__thumbsAlignEnd___p4y9R",Na="LightBox-module__thumbItem___HvnF3",Va="LightBox-module__closeButton___g2khP",Oa="LightBox-module__fadeIn___0m5GW",ja="LightBox-module__slideInLeft___gPYwC",Fa="LightBox-module__slideInRight___S-pPp",Ba="LightBox-module__slideInTop___DFdAj",Ma="LightBox-module__slideInBottom___m27kZ",za="LightBox-module__fadeOut___55qBR",Da="LightBox-module__slideOutLeft___NvU7P",Wa="LightBox-module__slideOutRight___SK7eC",Pa="LightBox-module__slideOutTop___Vgg0z",Ha="LightBox-module__slideOutBottom___nJ0Ef",Ua="LightBox-module__scaleSlide___vZriG",B={hidden:sa,heroImage:ca,background:ua,editor:pa,contentStyle:da,imageStyle:ga,imgWrapper:fa,contain:ma,cover:ya,caption:va,captionTextInner:ha,lightboxSplide:ba,arrow:xa,arrowVertical:Ca,nextArrow:Sa,arrowInner:_a,arrowIcon:wa,arrowImg:$a,mirror:Ea,thumbsWrapper:Ta,thumbsContainerVertical:Aa,thumbsContainer:Ia,thumbsAlignStart:La,thumbsAlignCenter:ka,thumbsAlignEnd:Ra,thumbItem:Na,closeButton:Va,fadeIn:Oa,slideInLeft:ja,slideInRight:Fa,slideInTop:Ba,slideInBottom:Ma,fadeOut:za,slideOutLeft:Da,slideOutRight:Wa,slideOutTop:Pa,slideOutBottom:Ha,scaleSlide:Ua},At=(e,t,n)=>{const r={},[o,a]=e.split("-");return o==="top"?(r.top="0",r.bottom="auto"):o==="middle"?(r.top="50%",r.bottom="auto"):o==="bottom"&&(r.top="auto",r.bottom="0"),a==="left"?(r.left="0",r.right="auto"):a==="center"?(r.left="50%",r.right="auto"):a==="right"&&(r.left="auto",r.right="0"),o==="middle"&&a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), calc(-50% + ${k.scalingValue(t.y,n)}))`:o==="middle"?r.transform=`translate(${k.scalingValue(t.x,n)}, calc(-50% + ${k.scalingValue(t.y,n)}))`:a==="center"?r.transform=`translate(calc(-50% + ${k.scalingValue(t.x,n)}), ${k.scalingValue(t.y,n)})`:r.transform=`translate(${k.scalingValue(t.x,n)}, ${k.scalingValue(t.y,n)})`,r};function Ur(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 Jn(e){const t=e.getBoundingClientRect(),n=Ur(e),r=Math.max(0,t.width-n.left-n.right),o=Math.max(0,t.height-n.top-n.bottom),a=e.naturalWidth,i=e.naturalHeight,s=r/o,l=a/i;let p,c;l>s?(p=r,c=r/l):(c=o,p=o*l);const _=t.left+n.left,m=t.top+n.top,y=(r-p)/2+_,u=(o-c)/2+m;return{x:y,y:u,width:p,height:c}}function Zn(e){const t=e.getBoundingClientRect(),n=Ur(e);return{left:t.left+n.left,right:t.right-n.right,top:t.top+n.top,bottom:t.bottom-n.bottom}}function Qn(e){const t=e.match(/rgba?\(([^)]+)\)/);if(t){const r=t[1].split(",").map(o=>parseFloat(o.trim()));return r.length===4?r[3]:1}const n=e.match(/^#([0-9a-fA-F]{8})$/);if(n){const r=n[1].substring(6,8);return parseInt(r,16)/255}return e.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/),1}function Ga(e,t){const n=(()=>{if(e==="fade in")return B.fadeIn;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),r=(()=>{if(e==="fade in"||e==="mix")return B.fadeIn;if(e==="slide in")switch(t){case"left":return B.slideInLeft;case"right":return B.slideInRight;case"top":return B.slideInTop;case"bottom":return B.slideInBottom;default:return B.slideInRight}return B.fadeIn})(),o=(()=>{if(e==="fade in"||e==="mix")return B.fadeOut;if(e==="slide in")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})(),a=(()=>{if(e==="fade in")return B.fadeOut;if(e==="slide in"||e==="mix")switch(t){case"left":return B.slideOutLeft;case"right":return B.slideOutRight;case"top":return B.slideOutTop;case"bottom":return B.slideOutBottom;default:return B.slideOutRight}return B.fadeOut})();return{appearClass:n,backdropAppearClass:r,backdropDisappearClass:o,disappearClass:a}}const Ya=({settings:e,content:t,styles:n,portalId:r,activeEvent:o,isEditor:a})=>{const[i,s]=D.useState(!1),{url:l}=e.thumbnailBlock.cover;return D.useEffect(()=>{o==="close"&&s(!1),o==="open"&&s(!0)},[o]),S.jsxs(S.Fragment,{children:[S.jsx("img",{src:l,alt:"Cover",className:B.heroImage,onClick:()=>s(!0)}),S.jsx(qa,{isOpen:i,onClose:()=>s(!1),content:t,settings:e,lightboxStyles:n,portalId:r,isEditor:a})]})},qa=({isOpen:e,onClose:t,content:n,lightboxStyles:r,settings:o,portalId:a,isEditor:i,metadata:s})=>{var V;const[l,p]=D.useState(0),[c,_]=D.useState(0),[m,y]=D.useState(!1),[u,g]=D.useState(!1),[$,E]=D.useState({}),d=D.useRef(null),h=D.useRef(null),W=D.useRef(null),M=D.useRef(!1),w=D.useRef(null),v=D.useRef(null),T=D.useRef(null),N=D.useRef(null),z=D.useRef(!1),L=D.useRef(null),[O,F]=D.useState(!1),{appear:G,triggers:H,slider:f,thumbnail:R,controls:A,area:b,caption:C,layout:j}=o.lightboxBlock,{appearClass:Z,backdropAppearClass:te,backdropDisappearClass:ee,disappearClass:ge}=Ga(G.type,G.direction),I=(s==null?void 0:s.itemId)??null;D.useEffect(()=>{const x=()=>{setTimeout(()=>{var U,K;(K=(U=d.current)==null?void 0:U.splide)==null||K.refresh()},16)},P=()=>{_(U=>U+1)};return window.addEventListener("ArticleEditor.Layout:change",x),window.addEventListener("ArticleEditor.ComponentContent:change",P),()=>{window.removeEventListener("ArticleEditor.Layout:change",x),window.removeEventListener("ArticleEditor.ComponentContent:change",P)}},[]),D.useEffect(()=>{if(!e||!R.isActive){F(!1);return}const x=L.current;if(!x)return;const P=()=>{f.direction==="horiz"?F(x.scrollWidth>x.clientWidth):F(x.scrollHeight>x.clientHeight)};P();const U=new ResizeObserver(P);return U.observe(x),()=>U.disconnect()},[e,R.isActive,n.length,$,f.direction]);const X=D.useCallback(()=>{const x=window.matchMedia("(max-width: 768px)").matches,P=Qn(b.color);x&&!i&&P>.9&&(document.body.style.backgroundColor=""),y(!0),M.current=!0;const U=K=>{K.target===w.current&&K.animationName&&(w.current&&v.current&&w.current.removeEventListener("animationend",v.current),v.current=null,M.current&&(M.current=!1,t()),y(!1))};w.current&&(v.current=U,w.current.addEventListener("animationend",U))},[t,b.color,i]),ce=(x,P,U)=>{var K,re;if(x){if(H.type==="click"&&H.switch==="image")H.repeat==="close"&&l===n.length-1?X():(K=d.current)==null||K.go("+1");else if(H.type==="click"&&H.switch==="50/50"){const Y=x.getBoundingClientRect(),J=P-Y.left,oe=U-Y.top,le=Y.width,ie=Y.height;let ye;f.direction==="horiz"?ye=J<le/2?"-1":"+1":ye=oe<ie/2?"-1":"+1",(re=d.current)==null||re.go(ye)}}},ae=x=>{if(z.current){z.current=!1;return}const P=n[l],U=(P==null?void 0:P.image.objectFit)==="cover";let K,re;if("changedTouches"in x&&x.changedTouches.length>0)K=x.changedTouches[0].clientX,re=x.changedTouches[0].clientY;else if("clientX"in x)K=x.clientX,re=x.clientY;else return;let Y;if(U&&W.current){const J=Zn(W.current);Y=K>=J.left&&K<=J.right&&re>=J.top&&re<=J.bottom}else{const J=W.current?Jn(W.current):null;if(!J){x.target===x.currentTarget&&X();return}Y=K>=J.x&&K<=J.x+J.width&&re>=J.y&&re<=J.y+J.height}Y?ce(W.current,K,re):X()},ue=x=>{const P=x.target;(P.classList.contains(B.thumbsWrapper)||P.classList.contains(B.thumbsContainer))&&ae(x)};D.useEffect(()=>{if(!e)return;const x=P=>{var U,K;if(P.key==="Escape"){X();return}if(P.key==="ArrowRight"){p(re=>(re+1)%Math.max(n.length,1)),(U=d.current)==null||U.go("+1");return}P.key==="ArrowLeft"&&(p(re=>(re-1+Math.max(n.length,1))%Math.max(n.length,1)),(K=d.current)==null||K.go("-1"))};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x)}},[e,X,n.length]),D.useEffect(()=>{if(e){if(p(0),_(P=>P+1),M.current=!1,y(!1),g(!1),E({}),!I)return;const x=new CustomEvent("page-overlay",{detail:{itemId:I}});window.dispatchEvent(x)}return()=>{w.current&&v.current&&(w.current.removeEventListener("animationend",v.current),v.current=null),g(!1)}},[e,I]),D.useEffect(()=>{h.current!==null&&h.current!==f.type&&_(x=>x+1),h.current=f.type},[f.type]),D.useEffect(()=>{if(!e)return;const x=document.body.style.overflow,P=window.matchMedia("(max-width: 768px)").matches,U=Qn(b.color);document.body.style.overflow="hidden",g(!1);const K=Y=>{Y.target===w.current&&!M.current&&Y.animationName&&(P&&!i&&U>.9&&(document.body.style.backgroundColor=b.color),g(!0),w.current&&T.current&&w.current.removeEventListener("animationend",T.current),T.current=null)};w.current&&(T.current=K,w.current.addEventListener("animationend",K));const re=Y=>{const J=Y.target;J&&(J.closest(`.${B.thumbsWrapper}`)||J.closest(`.${B.thumbsContainer}`))||f.type!=="slide"&&Y.preventDefault()};return document.addEventListener("touchmove",re,{passive:!1}),()=>{document.body.style.overflow=x,document.removeEventListener("touchmove",re),w.current&&T.current&&(w.current.removeEventListener("animationend",T.current),T.current=null),g(!1)}},[e,i,b.color,f.type]),D.useEffect(()=>{if(!e)return;const x=P=>{var K,re;if(M.current){P.stopPropagation();return}if(z.current){z.current=!1;return}const U=P.target;if(!(U&&(U.closest(`.${B.thumbsContainer}`)||U.closest(`.${B.thumbItem}`)))){if(f.type==="slide"&&H.type==="drag"&&((re=(K=d.current)==null?void 0:K.splide)!=null&&re.root)){const Y=d.current.splide.root;if(U&&(Y.contains(U)||Y===U))return}if(P.touches.length===0&&P.changedTouches.length>0){const Y=n[l],J=(Y==null?void 0:Y.image.objectFit)==="cover",oe=P.changedTouches[0];let le;if(J&&W.current){const ie=Zn(W.current);le=oe.clientX>=ie.left&&oe.clientX<=ie.right&&oe.clientY>=ie.top&&oe.clientY<=ie.bottom}else{const ie=W.current?Jn(W.current):null;if(!ie)return;le=oe.clientX>=ie.x&&oe.clientX<=ie.x+ie.width&&oe.clientY>=ie.y&&oe.clientY<=ie.y+ie.height}if(!le){P.stopPropagation(),M.current=!0;const ie=ye=>{ye.stopPropagation(),ye.preventDefault(),document.removeEventListener("click",ie,!0)};document.addEventListener("click",ie,!0),X()}}}};return document.addEventListener("touchend",x,{passive:!0}),()=>{document.removeEventListener("touchend",x)}},[e,X,l,n]);const Se=(f.type==="scale"||f.type==="fade")&&f.direction==="vert"&&H.type==="drag";D.useEffect(()=>{var ye,$t;if(!e||!Se||!(($t=(ye=d.current)==null?void 0:ye.splide)!=null&&$t.root))return;const x=d.current.splide.root,P=30,U=(ne,fe)=>{if(N.current){const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);(Ie>0||Et>0)&&(z.current=!0)}},K=ne=>{N.current&&(ne.preventDefault(),U(ne.clientX,ne.clientY))},re=ne=>{N.current&&ne.touches.length>0&&(ne.preventDefault(),U(ne.touches[0].clientX,ne.touches[0].clientY))},Y=(ne,fe)=>{if(!N.current||!d.current){N.current=null;return}const Ie=Math.abs(ne-N.current.x),Et=Math.abs(fe-N.current.y);Et>P&&Et>Ie&&d.current.go(fe<N.current.y?"+1":"-1"),N.current=null},J=ne=>{N.current&&Y(ne.clientX,ne.clientY),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("pointermove",K)},oe=ne=>{if(N.current){if(ne.changedTouches.length>0){const fe=ne.changedTouches[0];Y(fe.clientX,fe.clientY)}document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.removeEventListener("touchmove",re)}},le=ne=>{N.current={x:ne.clientX,y:ne.clientY},z.current=!1,document.addEventListener("pointermove",K,{passive:!1}),document.addEventListener("pointerup",J),document.addEventListener("pointercancel",J)},ie=ne=>{ne.touches.length>0&&(N.current={x:ne.touches[0].clientX,y:ne.touches[0].clientY},z.current=!1,document.addEventListener("touchmove",re,{passive:!1}),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe))};return x.addEventListener("pointerdown",le),x.addEventListener("touchstart",ie),()=>{x.removeEventListener("pointerdown",le),x.removeEventListener("touchstart",ie),document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",J),document.removeEventListener("pointercancel",J),document.removeEventListener("touchmove",re),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),N.current=null,z.current=!1}},[e,Se,c]);const je={backgroundColor:b.color,backdropFilter:`blur(${b.blur}px)`,animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return document.getElementById(a)?Gr.createPortal(S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:i?null:w,className:pe(B.background,m?ee:te,{[B.editor]:i},{[B.hidden]:!e}),style:{...je,...u&&!i&&!m?{position:"absolute"}:{}}}),S.jsxs("div",{ref:i?w:null,className:pe(B.contentStyle,m?ge:Z,{[B.editor]:i},{[B.hidden]:!e}),style:{animationDuration:`${parseInt(G.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[S.jsx(Wr,{onMove:x=>p(x.index),ref:d,className:B.lightboxSplide,options:{arrows:!1,speed:f.duration?parseInt(f.duration):500,direction:f.direction==="horiz"||f.type==="fade"||f.type==="scale"?"ltr":"ttb",pagination:!1,drag:H.type==="drag"&&!Se,perPage:1,width:"100%",height:"100%",type:f.type==="fade"||f.type==="scale"?"fade":"loop",padding:0,rewind:H.repeat!=="close",start:0},style:{"--splide-speed":f.duration},children:n.map((x,P)=>{const U=At(j.position,j.offset,i),K=`${k.scalingValue(j.padding.top,i)} ${k.scalingValue(j.padding.right,i)} ${k.scalingValue(j.padding.bottom,i)} ${k.scalingValue(j.padding.left,i)}`,re=f.type==="scale"?(()=>{const{transform:Y,...J}=U;return{...J,position:"absolute",padding:K,boxSizing:"border-box","--position-transform":Y||"none"}})():{...U,position:"absolute",padding:K,boxSizing:"border-box"};return S.jsx(Pr,{children:S.jsx("div",{className:B.imgWrapper,onClick:ae,children:S.jsx("img",{ref:P===l?W:null,className:pe(B.imageStyle,{[B.contain]:x.image.objectFit==="contain",[B.cover]:x.image.objectFit==="cover",[B.scaleSlide]:f.type==="scale"}),src:x.image.url,alt:x.image.name??"",style:{...re,pointerEvents:x.image.objectFit==="contain"?"none":"auto"}})})},P)})},c),A.isActive&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:pe(B.arrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x,i)}, ${k.scalingValue(A.offset.y*(f.direction==="horiz"?1:-1),i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("-1")},"aria-label":"Previous",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:pe(B.arrowImg,B.mirror)}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg,B.mirror)})]})}),S.jsx("div",{className:pe(B.arrow,B.nextArrow,{[B.arrowVertical]:f.direction==="vert"}),style:{color:A.color,"--arrow-hover-color":A.hover},children:S.jsxs("button",{className:B.arrowInner,style:{transform:`translate(${k.scalingValue(A.offset.x*(f.direction==="horiz"?-1:1),i)}, ${k.scalingValue(A.offset.y,i)}) scale(${A.scale}) rotate(${f.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var x;return(x=d.current)==null?void 0:x.go("+1")},"aria-label":"Next",children:[A.arrowsImgUrl&&S.jsx(ct,{url:A.arrowsImgUrl,fill:A.color,hoverFill:A.hover,className:B.arrowImg}),!A.arrowsImgUrl&&S.jsx(er,{color:A.color,className:pe(B.arrowIcon,B.arrowImg)})]})})]}),b.closeIconUrl&&(()=>{const x=At(b.closeIconAlign,b.closeIconOffset,i),P=`scale(${b.closeIconScale})`,U=x.transform?`${x.transform} ${P}`:P;return S.jsx("button",{className:B.closeButton,style:{...x,transform:U},onClick:X,"aria-label":"Close lightbox",children:S.jsx(ct,{url:b.closeIconUrl,fill:b.closeIconColor??"#000000",hoverFill:b.closeIconHover??"#cccccc"})})})(),C&&C.isActive&&r.imageCaption&&((V=n[l])==null?void 0:V.imageCaption)&&(()=>{const{widthSettings:x,fontSettings:P,letterSpacing:U,textAlign:K,wordSpacing:re,fontSizeLineHeight:Y,textAppearance:J,color:oe}=r.imageCaption;return S.jsx("div",{className:B.caption,style:{...At(C.alignment,C.offset,i),fontFamily:P.fontFamily,fontWeight:P.fontWeight,fontStyle:P.fontStyle,width:x.sizing==="auto"?"max-content":k.scalingValue(x.width,i),letterSpacing:k.scalingValue(U,i),wordSpacing:k.scalingValue(re,i),textAlign:K,fontSize:k.scalingValue(Y.fontSize,i),lineHeight:k.scalingValue(Y.lineHeight,i),textTransform:J.textTransform??"none",textDecoration:J.textDecoration??"none",fontVariant:J.fontVariant??"normal",color:oe},onClick:le=>le.stopPropagation(),children:S.jsx("div",{"data-styles":"imageCaption",className:B.captionTextInner,style:{"--link-color":C.linkColor,"--link-hover-color":C.linkHoverColor},children:S.jsx(Hr,{content:n[l].imageCaption})})})})(),R.isActive&&(()=>{const[x,P]=R.position.split("-"),U=f.direction==="horiz"?`${x}-left`:R.position,K=At(U,R.offset,i),re=()=>{if(f.direction==="horiz"){if(P==="left")return"flex-start";if(P==="center")return"center";if(P==="right")return"flex-end"}else{if(x==="top")return"flex-start";if(x==="middle")return"center";if(x==="bottom")return"flex-end"}return"flex-start"};return S.jsx("div",{ref:L,className:B.thumbsWrapper,onClick:Y=>ue(Y),style:{position:i?"absolute":"fixed",...K,...f.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:S.jsx("div",{className:pe(B.thumbsContainer,{[B.thumbsContainerVertical]:f.direction==="vert",[B.thumbsAlignStart]:R.align==="start",[B.thumbsAlignCenter]:R.align==="center",[B.thumbsAlignEnd]:R.align==="end"}),style:{gap:k.scalingValue(R.grid.gap,i),justifyContent:O?"flex-start":re()},children:n.map((Y,J)=>{const oe=J===l,le=$[J],ye=R.grid.size*(oe?R.activeState.scale:1),$t=()=>{if(R.fit!=="fit")return{};if(!le)return f.direction==="horiz"?{height:k.scalingValue(ye,i)}:{width:k.scalingValue(ye,i)};const ne=le.width/le.height;if(f.direction==="horiz"){const fe=ye,Ie=fe*ne;return{width:k.scalingValue(Ie,i),height:k.scalingValue(fe,i)}}else{const fe=ye,Ie=fe/ne;return{width:k.scalingValue(fe,i),height:k.scalingValue(Ie,i)}}};return S.jsx("button",{className:B.thumbItem,style:{...f.direction==="horiz"&&R.fit!=="fit"?{height:k.scalingValue(ye,i)}:{},...f.direction==="vert"&&R.fit!=="fit"?{width:k.scalingValue(ye,i)}:{},...R.fit==="cover"?{width:k.scalingValue(ye,i),height:k.scalingValue(ye,i)}:{},...$t(),transition:oe?"all 0.25s ease-out":"none",opacity:oe?R.activeState.opacity/100:R.opacity/100,"--thumb-hover":R.activeState.opacity/100},onClick:ne=>{var fe;ne.stopPropagation(),p(J),(fe=d.current)==null||fe.go(J)},onMouseEnter:()=>{var ne;R.triggers==="hov"&&((ne=d.current)==null||ne.go(J))},children:S.jsx("img",{src:Y.image.url,alt:Y.image.name??"",onLoad:ne=>{const fe=ne.currentTarget;fe.naturalWidth&&fe.naturalHeight&&E(Ie=>({...Ie,[J]:{width:fe.naturalWidth,height:fe.naturalHeight}}))},style:{objectFit:R.fit==="cover"?"cover":"contain",...R.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},...R.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${Y.image.name}-${J}`)})})})})()]})]}),document.getElementById(a)):null};function er({color:e,className:t}){return S.jsx("svg",{viewBox:"0 0 10 18",className:t,children:S.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:S.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 Xa={element:Ya,id:"lightbox",name:"Lightbox",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/lightboxImg.png"},defaultSize:{width:440,height:550},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,defaultWidth:500},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{type:"media-input",minWidth:58,maxWidth:108},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",minWidth:300,maxWidth:550}}},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 Xe(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function Ka(e){return`
7
7
  .${e}-wrapper {
8
8
  display: flex;
9
9
  flex-direction: column;
@@ -779,4 +779,4 @@ function textStylesToCss(textStyles: TextStyles, isEditor?: boolean): React.CSSP
779
779
  font-size: ${It(14)};
780
780
  color: var(--${e}-error-error-color, var(--${e}-error-color));
781
781
  }
782
- `}const al=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=k.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:p,fieldsToShow:c=1,fontFamily:_,input:m,button:y,height:u,corners:g,stroke:$,stateOverrides:E,inputPadding:d,buttonPadding:h,successMessage:W="Thanks for subscribing!",errorMessage:M="Please, fill all required fields."}=e,w=a.slice(0,Math.min(c,a.length)),[v,T]=D.useState(()=>Object.fromEntries(w.map(V=>[V.name,""]))),[N,z]=D.useState("idle"),[L,O]=D.useState(null),F=r==="success"?"success":r==="error"?"error":N,G=r==="error"?M:L,H=r==="filled"?Object.fromEntries(w.map(V=>[V.name,"Filled"])):v,f=F==="error"?k.getFormFieldValidationError(w,H):null,R=r&&r!=="default"?`${o}-state-${r}`:"",A=n==null?void 0:n.submitUrl,b=i,C=(b==null?void 0:b.mode)==="Icon"||(b==null?void 0:b.mode)==="Label"?b.mode:s==="Icon"?"Icon":"Label",j=b===void 0?l:b.label!==void 0?b.label:l,Z=b===void 0?p:b.icon!==void 0?b.icon:p,te=j??"",ee=Z??"",ge=C==="Icon",I=te||"Submit",X=m?rr({...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily}},t):void 0,ce=y?rr({...y,fontSettings:{...y.fontSettings,fontFamily:_??y.fontSettings.fontFamily}},t):void 0,ae=sl(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(m==null?void 0:m.color)??"#111111",buttonTextColor:e.buttonTextColor??(y==null?void 0:y.color)??"#ffffff"},E),ue={borderRadius:k.scalingValue(g,t),borderWidth:k.scalingValue($,t),borderStyle:"solid",borderColor:`var(--${o}-stroke-color)`},Se={borderLeftWidth:k.scalingValue($,t)},je=async V=>{V.preventDefault();const x=Object.fromEntries(w.map(U=>{var K;return[U.name,((K=v[U.name])==null?void 0:K.trim())??""]}).filter(([,U])=>U));if(!A||Object.keys(x).length===0)return;const P=k.getFormFieldValidationError(w,v);if(P){z("error"),O(P);return}z("submitting"),O(null);try{const U=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!U.ok){const K=await U.text();throw new Error(K||`Request failed: ${U.status}`)}z("success"),T(Object.fromEntries(w.map(K=>[K.name,""])))}catch(U){z("error"),O(U instanceof Error?U.message:"Something went wrong")}};return S.jsxs("div",{className:`${o}-wrapper ${R}`.trim(),style:ae,children:[S.jsx("style",{children:il(o)}),S.jsxs("form",{onSubmit:je,className:`${o}-form`,style:{...ue,height:k.scalingValue(u,t)},children:[S.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:w.map(V=>S.jsx("input",{type:V.type==="email"?"email":V.type==="phone"?"tel":"text",name:V.name,autoComplete:"off",value:H[V.name]??"",onChange:x=>T(P=>({...P,[V.name]:x.target.value})),placeholder:V.placeholder,required:V.type==="email",className:`${o}-input`,style:{...X,paddingRight:k.scalingValue(d.right,t),paddingLeft:k.scalingValue(d.left,t),paddingTop:k.scalingValue(d.top,t),paddingBottom:k.scalingValue(d.bottom,t)}},V.name))}),S.jsx("div",{className:`${o}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":I,style:{...ce,...Se,paddingRight:k.scalingValue(h.right,t),paddingLeft:k.scalingValue(h.left,t),paddingTop:k.scalingValue(h.top,t),paddingBottom:k.scalingValue(h.bottom,t)},children:N==="submitting"?"...":ge?ee?S.jsx("img",{src:ee,alt:"",draggable:!1}):null:te})})]}),F==="success"&&S.jsx("p",{className:`${o}-success`,style:{...X,lineHeight:X==null?void 0:X.fontSize},children:W}),F==="error"&&S.jsx("p",{className:`${o}-error`,style:{...X,lineHeight:X==null?void 0:X.fontSize},role:"alert",children:f??G??M})]})},nr={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"},ll=["hover","focus","filled","success","error"];function sl(e,t,n){const r={};for(const[o,a]of Object.entries(nr))r[`--${e}-${a}`]=t[o];if(n)for(const o of ll){const a=n[o];if(a)for(const[i,s]of Object.entries(nr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function rr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:k.scalingValue(e.letterSpacing,t),wordSpacing:k.scalingValue(e.wordSpacing,t),fontSize:k.scalingValue(e.fontSize,t)}}const cl=[{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."}],or={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"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},ul=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],ir=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),pl={type:"object",version:1,settings:{properties:{fieldsToShow:{type:"number",scope:"layout",title:"Fields",display:{type:"number"},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","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonContent:{type:"object",scope:"common",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["Label","Icon"]},label:{type:["string","null"],title:"Label",message:"Subscribe",display:{type:"text-input"}},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},height:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:100},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"layout",title:"Border Color",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},input:{type:"object",scope:"layout",title:"Input",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:cl,fieldsToShow:1,buttonContent:{mode:"Label",label:"Submit",icon:null},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.01,bottom:.01},height:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",inputTextColor:"#999999",placeholderColor:"#cccccc",buttonColor:"#cccccc",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},input:ir(400),button:ir(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["height","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},states:["default","hover","focus","filled","success","error"]},dl={element:al,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:"30%",height:60},schema:pl},gl=[ea,la,Xa,ol,dl];exports.components=gl;exports.isSchemaV1=Yr;
782
+ `}const al=({settings:e,isEditor:t,metadata:n,activeEvent:r})=>{const{prefix:o}=k.useScopedStyles(),{fields:a=[{name:"email",type:"email",placeholder:"Your email"}],buttonContent:i,submitButtonContent:s,buttonLabel:l,buttonIcon:p,fieldsToShow:c=1,fontFamily:_,input:m,button:y,minHeight:u,corners:g,stroke:$,stateOverrides:E,inputPadding:d,buttonPadding:h,successMessage:W="Thanks for subscribing!",errorMessage:M="Please, fill all required fields."}=e,w=a.slice(0,Math.min(c,a.length)),[v,T]=D.useState(()=>Object.fromEntries(w.map(V=>[V.name,""]))),[N,z]=D.useState("idle"),[L,O]=D.useState(null),F=r==="success"?"success":r==="error"?"error":N,G=r==="error"?M:L,H=r==="filled"?Object.fromEntries(w.map(V=>[V.name,"Filled"])):v,f=F==="error"?k.getFormFieldValidationError(w,H):null,R=r&&r!=="default"?`${o}-state-${r}`:"",A=n==null?void 0:n.submitUrl,b=i,C=(b==null?void 0:b.mode)==="Icon"||(b==null?void 0:b.mode)==="Label"?b.mode:s==="Icon"?"Icon":"Label",j=b===void 0?l:b.label!==void 0?b.label:l,Z=b===void 0?p:b.icon!==void 0?b.icon:p,te=j??"",ee=Z??"",ge=C==="Icon",I=te||"Submit",X=m?rr({...m,fontSettings:{...m.fontSettings,fontFamily:_??m.fontSettings.fontFamily}},t):void 0,ce=y?rr({...y,fontSettings:{...y.fontSettings,fontFamily:_??y.fontSettings.fontFamily}},t):void 0,ae=sl(o,{strokeColor:e.strokeColor,inputColor:e.inputColor,placeholderColor:e.placeholderColor,buttonColor:e.buttonColor,successColor:e.successColor,errorColor:e.errorColor,inputTextColor:e.inputTextColor??(m==null?void 0:m.color)??"#111111",buttonTextColor:e.buttonTextColor??(y==null?void 0:y.color)??"#ffffff"},E),ue={borderRadius:k.scalingValue(g,t),borderWidth:k.scalingValue($,t),borderStyle:"solid",borderColor:`var(--${o}-stroke-color)`},Se={borderLeftWidth:k.scalingValue($,t)},je=async V=>{V.preventDefault();const x=Object.fromEntries(w.map(U=>{var K;return[U.name,((K=v[U.name])==null?void 0:K.trim())??""]}).filter(([,U])=>U));if(!A||Object.keys(x).length===0)return;const P=k.getFormFieldValidationError(w,v);if(P){z("error"),O(P);return}z("submitting"),O(null);try{const U=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!U.ok){const K=await U.text();throw new Error(K||`Request failed: ${U.status}`)}z("success"),T(Object.fromEntries(w.map(K=>[K.name,""])))}catch(U){z("error"),O(U instanceof Error?U.message:"Something went wrong")}};return S.jsxs("div",{className:`${o}-wrapper ${R}`.trim(),style:ae,children:[S.jsx("style",{children:il(o)}),S.jsxs("form",{onSubmit:je,className:`${o}-form`,style:{...ue,minHeight:k.scalingValue(u,t)},children:[S.jsx("div",{className:`${o}-inputWrap ${o}-overlayAnchor`,style:{flex:1,minWidth:0},children:w.map(V=>S.jsx("input",{type:V.type==="email"?"email":V.type==="phone"?"tel":"text",name:V.name,autoComplete:"off",value:H[V.name]??"",onChange:x=>T(P=>({...P,[V.name]:x.target.value})),placeholder:V.placeholder,required:V.type==="email",className:`${o}-input`,style:{...X,paddingRight:k.scalingValue(d.right,t),paddingLeft:k.scalingValue(d.left,t),paddingTop:k.scalingValue(d.top,t),paddingBottom:k.scalingValue(d.bottom,t)}},V.name))}),S.jsx("div",{className:`${o}-overlayAnchor`,children:S.jsx("button",{type:"submit",className:`${o}-submitBtn`,"aria-label":I,style:{...ce,...Se,paddingRight:k.scalingValue(h.right,t),paddingLeft:k.scalingValue(h.left,t),paddingTop:k.scalingValue(h.top,t),paddingBottom:k.scalingValue(h.bottom,t)},children:N==="submitting"?"...":ge?ee?S.jsx("img",{src:ee,alt:"",draggable:!1}):null:te})})]}),F==="success"&&S.jsx("p",{className:`${o}-success`,style:{...X,lineHeight:X==null?void 0:X.fontSize},children:W}),F==="error"&&S.jsx("p",{className:`${o}-error`,style:{...X,lineHeight:X==null?void 0:X.fontSize},role:"alert",children:f??G??M})]})},nr={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"},ll=["hover","focus","filled","success","error"];function sl(e,t,n){const r={};for(const[o,a]of Object.entries(nr))r[`--${e}-${a}`]=t[o];if(n)for(const o of ll){const a=n[o];if(a)for(const[i,s]of Object.entries(nr)){const l=a[i];l!==void 0&&(r[`--${e}-${o}-${s}`]=l)}}return r}function rr(e,t){return{fontFamily:e.fontSettings.fontFamily,fontWeight:e.fontSettings.fontWeight,fontStyle:e.fontSettings.fontStyle,letterSpacing:k.scalingValue(e.letterSpacing,t),wordSpacing:k.scalingValue(e.wordSpacing,t),fontSize:k.scalingValue(e.fontSize,t)}}const cl=[{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."}],or={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"}},color:{type:"string",title:"Text Color",display:{type:"palette-color-picker"}}},ul=["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor","successColor","errorColor"],ir=e=>({fontSettings:{fontWeight:e,fontStyle:"normal"},letterSpacing:0,wordSpacing:0,fontSize:.01,lineHeight:.01,color:"#111111"}),pl={type:"object",version:1,settings:{sizing:"auto manual",properties:{fieldsToShow:{type:"number",scope:"layout",title:"Fields",display:{type:"number"},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","textarea","phone","email"]},placeholder:{type:"string"},label:{type:"string"},isRequired:{type:"boolean"},error:{type:"string"}}}},buttonContent:{type:"object",scope:"common",display:{type:"button-content-switch"},properties:{mode:{type:"string",enum:["Label","Icon"]},label:{type:["string","null"],title:"Label",message:"Subscribe",display:{type:"text-input"}},icon:{type:["string","null"],title:"Icon",display:{type:"settings-image-input"}}}},fontFamily:{type:"string",scope:"layout",title:"Font family",display:{type:"font-family-select"}},inputPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},buttonPadding:{type:"object",scope:"layout",title:"",display:{type:"padding-controls"}},minHeight:{type:"number",scope:"layout",title:"min Height",display:{type:"range-control"},min:0,max:200},corners:{type:"number",scope:"layout",title:"Corners",display:{type:"range-control"},min:0,max:100},stroke:{type:"number",scope:"layout",title:"Stroke",display:{type:"range-control"},min:0,max:20},strokeColor:{type:"string",scope:"layout",title:"Border Color",display:{type:"palette-color-picker"}},inputColor:{type:"string",scope:"layout",title:"Input Color",display:{type:"palette-color-picker"}},inputTextColor:{type:"string",scope:"layout",title:"Input Text Color",display:{type:"palette-color-picker"}},placeholderColor:{type:"string",scope:"layout",title:"Placeholder Color",display:{type:"palette-color-picker"}},buttonColor:{type:"string",scope:"layout",title:"Button Color",display:{type:"palette-color-picker"}},buttonTextColor:{type:"string",scope:"layout",title:"Button Text Color",display:{type:"palette-color-picker"}},successColor:{type:"string",scope:"layout",title:"Success Message Color",display:{type:"palette-color-picker"}},errorColor:{type:"string",scope:"layout",title:"Error Message Color",display:{type:"palette-color-picker"}},successMessage:{type:"string",scope:"layout",title:"Success Message",display:{type:"text-input"}},errorMessage:{type:"string",scope:"layout",title:"Error Message",display:{type:"text-input"}},stateOverrides:{type:"object",scope:"layout"},input:{type:"object",scope:"layout",title:"Input",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]},button:{type:"object",scope:"layout",title:"Button",properties:or,layout:["fontSettings",{type:"row",items:["fontSize","lineHeight","letterSpacing","wordSpacing"]}]}},defaults:{fields:cl,fieldsToShow:1,buttonContent:{mode:"Label",label:"Submit",icon:null},fontFamily:"Arial",inputPadding:{right:.01,left:.01,top:.01,bottom:.01},buttonPadding:{right:.01,left:.01,top:.01,bottom:.01},minHeight:.028,corners:.05,stroke:.001,strokeColor:"#cccccc",inputColor:"#ffffff",inputTextColor:"#999999",placeholderColor:"#cccccc",buttonColor:"#cccccc",buttonTextColor:"#ffffff",errorColor:"#ef4444",successColor:"#22c55e",successMessage:"Thanks for subscribing!",errorMessage:"Please, fill all required fields.",stateOverrides:{},input:ir(400),button:ir(400)}},panels:[{id:"general",icon:"cursor",title:"General",tooltip:"General Settings",layout:[{type:"row",items:["__componentName__","fieldsToShow"]},{type:"row",items:["minHeight","corners"]},{type:"row",items:[{type:"group",title:"",items:["stroke","buttonContent"]},{type:"switcher",title:"Padding",options:{Input:["inputPadding"],Button:["buttonPadding"]}}]}]},{id:"typeStyle",icon:"text-icon",title:"Type Style",tooltip:"Typography",layout:["fontFamily",{type:"row",title:"Input",items:["input"]},{type:"row",title:"Button",items:["button"]}]},{id:"fields",icon:"layers",title:"Fields",tooltip:"Fields",layout:["fields","successMessage","errorMessage"]}],paletteBookmark:{items:[...ul],panelIds:["general","typeStyle"],stateItems:{default:["strokeColor","inputColor","inputTextColor","placeholderColor","buttonColor","buttonTextColor"],hover:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],focus:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],filled:["strokeColor","inputColor","inputTextColor","buttonColor","buttonTextColor"],success:["successColor"],error:["errorColor"]}},states:["default","hover","focus","filled","success","error"]},dl={element:al,id:"oneliner-form",name:"Newsletter Single Line",version:1,preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/onelinerImg.png"},defaultSize:{width:"30%",height:60},schema:pl},gl=[ea,la,Xa,ol,dl];exports.components=gl;exports.isSchemaV1=Yr;
package/dist/index.mjs CHANGED
@@ -2904,7 +2904,7 @@ const ga = {
2904
2904
  name: "Click Gallery",
2905
2905
  preview: {
2906
2906
  type: "image",
2907
- url: "https://cdn.cntrl.site/component-assets/clickGalleryPreview.png"
2907
+ url: "https://cdn.cntrl.site/component-assets/clickGalleryImg.png"
2908
2908
  },
2909
2909
  defaultSize: {
2910
2910
  width: "100%",
@@ -6434,7 +6434,7 @@ const fl = ({ settings: e, isEditor: t, metadata: r, activeEvent: n }) => {
6434
6434
  fontFamily: S,
6435
6435
  input: m,
6436
6436
  button: y,
6437
- height: u,
6437
+ minHeight: u,
6438
6438
  corners: f,
6439
6439
  stroke: w,
6440
6440
  stateOverrides: $,
@@ -6508,53 +6508,61 @@ const fl = ({ settings: e, isEditor: t, metadata: r, activeEvent: n }) => {
6508
6508
  };
6509
6509
  return /* @__PURE__ */ he("div", { className: `${o}-wrapper ${L}`.trim(), style: ie, children: [
6510
6510
  /* @__PURE__ */ N("style", { children: dl(o) }),
6511
- /* @__PURE__ */ he("form", { onSubmit: De, className: `${o}-form`, style: { ...ue, height: F(u, t) }, children: [
6512
- /* @__PURE__ */ N(
6513
- "div",
6514
- {
6515
- className: `${o}-inputWrap ${o}-overlayAnchor`,
6516
- style: { flex: 1, minWidth: 0 },
6517
- children: x.map((R) => /* @__PURE__ */ N(
6518
- "input",
6511
+ /* @__PURE__ */ he(
6512
+ "form",
6513
+ {
6514
+ onSubmit: De,
6515
+ className: `${o}-form`,
6516
+ style: { ...ue, minHeight: F(u, t) },
6517
+ children: [
6518
+ /* @__PURE__ */ N(
6519
+ "div",
6520
+ {
6521
+ className: `${o}-inputWrap ${o}-overlayAnchor`,
6522
+ style: { flex: 1, minWidth: 0 },
6523
+ children: x.map((R) => /* @__PURE__ */ N(
6524
+ "input",
6525
+ {
6526
+ type: R.type === "email" ? "email" : R.type === "phone" ? "tel" : "text",
6527
+ name: R.name,
6528
+ autoComplete: "off",
6529
+ value: U[R.name] ?? "",
6530
+ onChange: (C) => E((j) => ({ ...j, [R.name]: C.target.value })),
6531
+ placeholder: R.placeholder,
6532
+ required: R.type === "email",
6533
+ className: `${o}-input`,
6534
+ style: {
6535
+ ...X,
6536
+ paddingRight: F(d.right, t),
6537
+ paddingLeft: F(d.left, t),
6538
+ paddingTop: F(d.top, t),
6539
+ paddingBottom: F(d.bottom, t)
6540
+ }
6541
+ },
6542
+ R.name
6543
+ ))
6544
+ }
6545
+ ),
6546
+ /* @__PURE__ */ N("div", { className: `${o}-overlayAnchor`, children: /* @__PURE__ */ N(
6547
+ "button",
6519
6548
  {
6520
- type: R.type === "email" ? "email" : R.type === "phone" ? "tel" : "text",
6521
- name: R.name,
6522
- autoComplete: "off",
6523
- value: U[R.name] ?? "",
6524
- onChange: (C) => E((j) => ({ ...j, [R.name]: C.target.value })),
6525
- placeholder: R.placeholder,
6526
- required: R.type === "email",
6527
- className: `${o}-input`,
6549
+ type: "submit",
6550
+ className: `${o}-submitBtn`,
6551
+ "aria-label": A,
6528
6552
  style: {
6529
- ...X,
6530
- paddingRight: F(d.right, t),
6531
- paddingLeft: F(d.left, t),
6532
- paddingTop: F(d.top, t),
6533
- paddingBottom: F(d.bottom, t)
6534
- }
6535
- },
6536
- R.name
6537
- ))
6538
- }
6539
- ),
6540
- /* @__PURE__ */ N("div", { className: `${o}-overlayAnchor`, children: /* @__PURE__ */ N(
6541
- "button",
6542
- {
6543
- type: "submit",
6544
- className: `${o}-submitBtn`,
6545
- "aria-label": A,
6546
- style: {
6547
- ...ce,
6548
- ...$e,
6549
- paddingRight: F(h.right, t),
6550
- paddingLeft: F(h.left, t),
6551
- paddingTop: F(h.top, t),
6552
- paddingBottom: F(h.bottom, t)
6553
- },
6554
- children: k === "submitting" ? "..." : fe ? Q ? /* @__PURE__ */ N("img", { src: Q, alt: "", draggable: !1 }) : null : ee
6555
- }
6556
- ) })
6557
- ] }),
6553
+ ...ce,
6554
+ ...$e,
6555
+ paddingRight: F(h.right, t),
6556
+ paddingLeft: F(h.left, t),
6557
+ paddingTop: F(h.top, t),
6558
+ paddingBottom: F(h.bottom, t)
6559
+ },
6560
+ children: k === "submitting" ? "..." : fe ? Q ? /* @__PURE__ */ N("img", { src: Q, alt: "", draggable: !1 }) : null : ee
6561
+ }
6562
+ ) })
6563
+ ]
6564
+ }
6565
+ ),
6558
6566
  M === "success" && /* @__PURE__ */ N(
6559
6567
  "p",
6560
6568
  {
@@ -6666,6 +6674,7 @@ const yl = [
6666
6674
  type: "object",
6667
6675
  version: 1,
6668
6676
  settings: {
6677
+ sizing: "auto manual",
6669
6678
  properties: {
6670
6679
  fieldsToShow: {
6671
6680
  type: "number",
@@ -6731,13 +6740,13 @@ const yl = [
6731
6740
  title: "",
6732
6741
  display: { type: "padding-controls" }
6733
6742
  },
6734
- height: {
6743
+ minHeight: {
6735
6744
  type: "number",
6736
6745
  scope: "layout",
6737
6746
  title: "min Height",
6738
6747
  display: { type: "range-control" },
6739
6748
  min: 0,
6740
- max: 100
6749
+ max: 200
6741
6750
  },
6742
6751
  corners: {
6743
6752
  type: "number",
@@ -6855,7 +6864,7 @@ const yl = [
6855
6864
  top: 0.01,
6856
6865
  bottom: 0.01
6857
6866
  },
6858
- height: 0.028,
6867
+ minHeight: 0.028,
6859
6868
  corners: 0.05,
6860
6869
  stroke: 1e-3,
6861
6870
  strokeColor: "#cccccc",
@@ -6881,7 +6890,7 @@ const yl = [
6881
6890
  tooltip: "General Settings",
6882
6891
  layout: [
6883
6892
  { type: "row", items: ["__componentName__", "fieldsToShow"] },
6884
- { type: "row", items: ["height", "corners"] },
6893
+ { type: "row", items: ["minHeight", "corners"] },
6885
6894
  { type: "row", items: [
6886
6895
  { type: "group", title: "", items: ["stroke", "buttonContent"] },
6887
6896
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.1-alpha.7",
3
+ "version": "1.0.1-alpha.8",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",