!function(){const e=window.jQuery,{VPData:t}=window,{settingsPopupGallery:i}=t,o={vendor:!1,vendors:[{vendor:"youtube",embedUrl:"https://www.youtube.com/embed/{{video_id}}?{{params}}",pattern:/(https?:\/\/)?(www.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?list=(.*)&v=|watch\?(.*[^&]&)v=)?((\w|-){11})(&list=(\w+)&?)?(.*)/,patternIndex:6,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramsIndex:10},{vendor:"vimeo",embedUrl:"https://player.vimeo.com/video/{{video_id}}?{{params}}",pattern:/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(.*)/,patternIndex:3,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramsIndex:4}],init(){},open(){},close(){},getQueryStringParams:e=>e?(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce(((e,t)=>{const[i,o]=t.split("=");return e[i]=o?decodeURIComponent(o.replace(/\+/g," ")):"",e}),{}):{},prepareParams(e,t){let i="";const a=t.params||{};if(t.paramsIndex&&e&&e[t.paramsIndex]){const i=o.getQueryStringParams(e[t.paramsIndex]);i&&"object"==typeof i&&Object.keys(i).forEach((e=>{e&&i[e]&&(a[e]=i[e])}))}return a&&Object.keys(a).length&&Object.keys(a).forEach((e=>{e&&a[e]&&(i&&(i+="&"),i+="".concat(e,"=").concat(a[e]))})),i},parseVideo(e,t){let i=!1;return o.vendors.forEach((a=>{if(!i){const p=e.match(a.pattern),r=!(!p||!p[a.patternIndex])&&p[a.patternIndex];if(r)if(a.embedCallback)i=a.embedCallback(e,p,t);else{let{embedUrl:t}=a;t=t.replace(/{{video_id}}/g,r),t=t.replace(/{{video_url}}/g,e),t=t.replace(/{{video_url_encoded}}/g,encodeURIComponent(e)),t=t.replace(/{{params}}/g,o.prepareParams(p,a));const n=a.width||1920,l=a.height||1080;i={vendor:a.vendor,id:r,embed:''),embedUrl:t,url:e,width:n,height:l}}}})),i||{vendor:"unknown",id:e,url:e,embedUrl:e,embed:'')}},parseGallery(t){const i=[];let a,p,r,n,l;return t.find(".vp-portfolio__item-wrap:not(.swiper-slide-duplicate)").each((function(){if(a=e(this).find(".vp-portfolio__item-popup"),a&&a.length){if(p=(a.attr("data-vp-popup-img-size")||"1920x1080").split("x"),n=a.attr("data-vp-popup-video"),l=!1,n&&(l=o.parseVideo(n,a.attr("data-vp-popup-poster"))),l)r={type:"embed",el:this,poster:l.poster,src:l.embedUrl,embed:l.embed,width:l.width||1920,height:l.height||1080};else{r={type:"image",el:this,src:a.attr("data-vp-popup-img"),srcset:a.attr("data-vp-popup-img-srcset"),width:parseInt(p[0],10),height:parseInt(p[1],10)};const e=a.attr("data-vp-popup-sm-img")||r.src;if(e){const t=(a.attr("data-vp-popup-sm-img-size")||a.attr("data-vp-popup-img-size")||"1920x1080").split("x");r.srcSmall=e,r.srcSmallWidth=parseInt(t[0],10),r.srcSmallHeight=parseInt(t[1],10)}const t=a.attr("data-vp-popup-md-img")||r.src;if(t){const e=(a.attr("data-vp-popup-md-img-size")||a.attr("data-vp-popup-img-size")||"1920x1080").split("x");r.srcMedium=t,r.srcMediumWidth=parseInt(e[0],10),r.srcMediumHeight=parseInt(e[1],10)}const i=a.children(".vp-portfolio__item-popup-title").get(0),o=a.children(".vp-portfolio__item-popup-description").get(0);(i||o)&&(r.caption=(i?i.outerHTML:"")+(o?o.outerHTML:""))}i.push(r)}})),i}};function a(e){return/(.png|.jpg|.jpeg|.gif|.tiff|.tif|.jfif|.jpe|.svg|.bmp|.webp)$/.test(e.href.toLowerCase().split("?")[0].split("#")[0])}function p(t){const i=e(t);let o=t.childNodes[0],a=i.next("figcaption");return"NOSCRIPT"===o.nodeName&&t.childNodes[1]&&(o=t.childNodes[1]),!a.length&&i.parent(".gallery-icon").length&&(a=i.parent(".gallery-icon").next("figcaption")),a=a.html(),a&&(a='
'.concat(a,"
")),{type:"image",el:o,linkEl:t,src:t.href,caption:a}}window.VPPopupAPI=o,e(document).on("extendClass.vpf",((t,i)=>{"vpf"===t.namespace&&(i.prototype.initPopupGallery=function(){const t=this;t.options.itemsClickAction&&"url"!==t.options.itemsClickAction&&(t.isPreview()||t.$item.on("click.vpf-uid-".concat(t.uid),"\n .vp-portfolio__item a.vp-portfolio__item-meta,\n .vp-portfolio__item .vp-portfolio__item-img > a,\n .vp-portfolio__item .vp-portfolio__item-meta-title > a,\n .vp-portfolio__item a.vp-portfolio__item-overlay\n ",(function(i){if(i.isDefaultPrevented())return;const a=e(this).closest(".vp-portfolio__item-wrap");let p=0;if(!a.find(".vp-portfolio__item-popup").length)return;i.preventDefault(),p=a.attr("data-swiper-slide-index")?parseInt(a.attr("data-swiper-slide-index"),10):a.index();const r=o.parseGallery(t.$item);o.open(r,p,t)})))},i.prototype.destroyPopupGallery=function(){const e=this;e.options.itemsClickAction&&"url"!==e.options.itemsClickAction&&(e.$item.off("click.vpf-uid-".concat(e.uid)),e.emitEvent("destroyPopupGallery"))})})),e(document).on("init.vpf",((e,t)=>{"vpf"===e.namespace&&t.initPopupGallery()})),e(document).on("destroy.vpf",((e,t)=>{"vpf"===e.namespace&&t.destroyPopupGallery()})),i.enable_on_wordpress_images&&e(document).on("click","\n .wp-block-image > a,\n .wp-block-image > figure > a,\n .wp-block-gallery .blocks-gallery-item > figure > a,\n .wp-block-gallery .wp-block-image > a,\n .wp-block-media-text > figure > a,\n .gallery .gallery-icon > a,\n figure.wp-caption > a,\n figure.tiled-gallery__item > a,\n p > a\n ",(function(t){if(t.isDefaultPrevented())return;if(!this.childNodes.length)return;let i=this.childNodes[0];if("NOSCRIPT"===i.nodeName&&this.childNodes[1]&&(i=this.childNodes[1]),"IMG"!==i.nodeName&&"PICTURE"!==i.nodeName)return;if(!a(this))return;t.preventDefault();const r=e(this),n=[],l=p(this),s=r.closest(".wp-block-gallery, .gallery, .tiled-gallery__gallery");let c=0;if(s.length){const e=s.find(".blocks-gallery-item > figure > a, .wp-block-image > a, .gallery-icon > a, figure.tiled-gallery__item > a");let t=0;e.each((function(){a(this)&&(this===l.linkEl&&(c=t),n.push(p(this)),t+=1)}))}else n.push(l);o.open(n,c)}))}();