"use strict";(("undefined"!=typeof self?self:this).webpackJsonp__wix_communities_blog_ooi=("undefined"!=typeof self?self:this).webpackJsonp__wix_communities_blog_ooi||[]).push([[2891],{85572:(e,t,i)=>{i.d(t,{X:()=>l});var a=i(60751),n=i.n(a),o=i(76400),d=i(42049),r="rueY7";const l=({node:e,nodeIndex:t,NodeViewContainer:i,RicosNodesRenderer:a,children:l})=>{const s=e.imageData?.caption&&!e.nodes?.length?[{type:d.A.CAPTION,id:(0,o.$)(),nodes:[{type:d.A.TEXT,id:"",nodes:[],textData:{text:e.imageData.caption,decorations:[]}}]}]:e.nodes??[];return n().createElement(i,{node:e,nodeIndex:t},(({ContainerElement:e,SpoilerWrapper:t,LinkWrapper:i})=>n().createElement(e,null,n().createElement("figure",{className:r},n().createElement(i,null,n().createElement(t,null,l)),n().createElement(a,{nodes:s})))))}},47298:(e,t,i)=>{i.d(t,{A2:()=>l,Df:()=>n,Dl:()=>a,HJ:()=>d,Lr:()=>r,XM:()=>o,kI:()=>s});const a="imageViewer",n="imagePreview",o="imageSettingsAltInput",d="imageSettingsDisableExpandToggle",r="imageSettingsDisableDownloadToggle",l="imageSettingsSpoilerToggle",s="imageExpandButton"},81155:(e,t,i)=>{i.d(t,{_:()=>v});var a=i(4452),n=i.n(a),o=i(60751),d=i.n(o),r=i(38132),l=i(69280),s=i(47298);var c=e=>d().createElement("svg",{viewBox:"0 0 19 19",xmlns:"http://www.w3.org/2000/svg",...e},d().createElement("path",{d:"M15.071 8.371V4.585l-4.355 4.356a.2.2 0 0 1-.283 0l-.374-.374a.2.2 0 0 1 0-.283l4.356-4.355h-3.786a.2.2 0 0 1-.2-.2V3.2c0-.11.09-.2.2-.2H16v5.371a.2.2 0 0 1-.2.2h-.529a.2.2 0 0 1-.2-.2zm-6.5 6.9v.529a.2.2 0 0 1-.2.2H3v-5.371c0-.11.09-.2.2-.2h.529c.11 0 .2.09.2.2v3.786l4.355-4.356a.2.2 0 0 1 .283 0l.374.374a.2.2 0 0 1 0 .283L4.585 15.07h3.786c.11 0 .2.09.2.2z",fill:"#000",fillRule:"nonzero"})),g="vS5Jy",m="AkBW8",h="_7RstM",u="RH2Yr",p="-zq9j",w="jc4RX";const f=e=>{const{type:t,children:i}=e,a=!0===e.disableDownload?e=>e.preventDefault():void 0,n="onClick"in e,o=n?e.onClick:void 0,r=o?e=>{"Enter"!==e.key&&" "!==e.key||o(e)}:void 0,l={onClick:o,onKeyDown:r,onContextMenu:a},c=n||"regular"===t&&a?"button":void 0,m="button"===c?0:void 0;return d().createElement("div",{..."button"===c?l:{},role:c,"data-hook":s.Dl,tabIndex:m,className:g,"aria-haspopup":"button"===c||void 0},i)};var D=i(16252);const v=({dataUrl:e,node:t,className:i,config:a,helpers:g,isMobile:v,seoMode:b,imageClickActionConfig:x,expand:E,shouldLazyLoadImages:I})=>{const y=t.imageData?.containerData||l._t.containerData,{image:k,altText:C}=t.imageData||{},{src:N}=k||{},M=(0,o.useMemo)((()=>{if(e)return e;const{url:t,id:i}=N||{};if(t)return t;const{getImageUrl:a}=g??{};return a&&i?a({file_name:i}):i}),[e,t.imageData?.image?.src?.url,t.imageData?.image?.src?.id,g?.getImageUrl]),{width:_,height:A}=(({src:e,containerData:t,image:i})=>{const[a,n]=(0,o.useState)({width:void 0,height:void 0}),d=i?.width||Number(t?.width?.custom)||a.width,r=i?.height||Number(t?.height?.custom)||a.height;return(0,o.useLayoutEffect)((()=>{if("number"==typeof d&&"number"==typeof r)return;if(n({width:void 0,height:void 0}),!e)return;const t=new Image;return t.onload=()=>n({width:t.width,height:t.height}),t.src=e,()=>{t.onload=null}}),[e]),{width:d,height:r}})({src:M,containerData:y,image:k}),L=(({containerData:e,isMobile:t})=>"LEFT"!==e?.alignment&&"RIGHT"!==e?.alignment||e.width?.custom||"SMALL"===e.width?.size||"ORIGINAL"===e.width?.size||t?{}:{width:"300px"})({containerData:y,isMobile:v}),R=(({containerData:e,isMobile:t,width:i})=>"ORIGINAL"===e?.width?.size||t&&(Number(e?.width?.custom)||0)>150?{width:i??"0px",maxWidth:"100%"}:{})({containerData:y,isMobile:v,width:_}),S=(({src:e,config:t,width:i,height:a})=>{if(void 0===e||void 0===t?.imageProps)return{};const n=(0,D.isFunction)(t.imageProps)?t.imageProps({url:e.url,file_name:e.id,width:i,height:a}):t.imageProps;return["data-pin-nopin","data-pin-url","data-pin-media"].reduce(((e,t)=>n[t]?{...e,[t]:n[t]}:e),{})})({config:a,src:N,width:k?.width,height:k?.height}),T=void 0!==_&&void 0!==A;return d().createElement(f,{...x,disableDownload:t.imageData?.disableDownload},T&&M&&d().createElement(r.A,{id:t.imageData?.image?.src?.id??M,containerId:t.id,displayMode:"fill",width:_,height:A,uri:t.imageData?.image?.src?.id??M,alt:C||"",containerProps:{className:n()(p,w,i,{[u]:!!E}),containerId:t.id,style:{"--dim-height":A,"--dim-width":_,...L,...R}},imageStyles:{maxWidth:"100%"},socialAttrs:{...S,draggable:!1},isSEOBot:!!b,...I?{placeholderTransition:b?void 0:"blur",shouldUseLQIP:!1!==a?.disableTransition}:{}}),!!E&&d().createElement("div",{className:m,onClick:E,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||E(e)},role:"button",tabIndex:0,"data-hook":s.kI},d().createElement(c,{className:h})))}},82616:(e,t,i)=>{i.r(t),i.d(t,{ViewerImage:()=>c,default:()=>g});var a=i(60751),n=i.n(a),o=i(31031),d=i(82569),r=i(47574),l=i(85572),s=i(81155);i(22446);const c=({node:e,nodeIndex:t,NodeViewContainer:i,RicosNodesRenderer:c})=>{const{config:g,seoMode:u,helpers:p}=(0,a.useContext)(d.u),{isMobile:w}=(0,a.useContext)(r.iB),f=g[o.V5]??{},D=h({helpers:p,config:f,nodeId:e.id,imageData:e.imageData}),v=m({imageData:e.imageData,config:f,expand:D});return n().createElement(l.X,{node:e,nodeIndex:t,NodeViewContainer:i,RicosNodesRenderer:c},n().createElement(s._,{node:e,imageClickActionConfig:v,expand:D,config:f,seoMode:u,helpers:p,isMobile:w,shouldLazyLoadImages:!0}))};var g=({node:e,...t})=>n().createElement(c,{key:e.id,node:e,...t});const m=({imageData:e,config:t,expand:i})=>e?.link?.url&&t?{type:"link"}:e?.link?.anchor?{type:"anchor"}:i?{type:"expand",onClick:i}:{type:"regular"},h=({helpers:e,config:t,nodeId:i,imageData:a})=>{const{onExpand:n,disableExpand:d}=t;if(!0!==a?.disableExpand&&!0!==d&&n)return t=>{t.preventDefault(),t.stopPropagation(),e.onViewerAction?.(o.V5,"Click","expand_image"),n(i)}}},22446:()=>{}}]); //# sourceMappingURL=ricos_plugin_image.chunk.min.js.map