!function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=62)}({0:function(e,t,i){"use strict";var n=i(13),s=i.n(n);function a(e,t){for(var i=0;i',ARR_DOWN_SVG:'',ZOOM_SVG:'',MAXIMIZE_SVG:'',NOTE_SVG:'',VIMEO_SVG:'',YOU_TUBE_SVG:'',BOOKMARK_SVG:'',HEART_SVG:'',HEART_2_SVG:'',COMENTS_SVG:'',COMENTS_2_SVG:'',INFO_SVG:'',DOWNLOAD_SVG:'',DOWNLOAD_2_SVG:'',LINK_SVG:'',LINK_2_SVG:'',SHARE_SVG:'',SHARE_2_SVG:'',FULL_SCREEN_SVG:'',NORMAL_SCREEN_SVG:'',CLOSE_SVG:'',VIEW_SVG:'',FB_SVG_COLOR:'',FB_SVG:'',TW_SVG:'',PIN_SVG:'',NEXT_ARR:'',PREV_ARR:'',ZOOM_IN_SVG:'',ZOOM_OUT_SVG:'',PLAY_SVG:'',PAUSE_SVG:'',USER_SVG:'',ATTENTION_SVG:'',POST_TYPE:'',VIDEO_TYPE:'',AUDIO_TYPE:'',GRID_SVG:'',SHOP_SVG:''}}},{key:"createPreloaderView",value:function(t){var i=0,n=document.createElement("div");n.className="".concat(e.ClassPref,"preloader");var s=document.createElement("div");s.className="".concat(e.ClassPref,"static"),s.style.width="".concat(8,"px"),s.style.height="".concat(8,"px"),s.style.margin="".concat(-4,"px"),s.style.backgroundColor=t,n.appendChild(s);var a=document.createElement("div");a.className="".concat(e.ClassPref,"spinner"),a.style.position="absolute",a.style.width="".concat(36,"px"),a.style.height="".concat(36,"px"),a.style.margin="".concat(-18,"px");for(var o=0;o<8;o+=1){var r=document.createElement("div");r.className="".concat(e.ClassPref,"point"),r.style.marginTop="".concat(-4,"px"),r.style.marginLeft="".concat(-4,"px"),r.style.width="".concat(8,"px"),r.style.height="".concat(8,"px"),r.style.backgroundColor=t,r.style.transform="rotate(".concat(i,"deg) translate(").concat(18,"px)"),i+=45,a.appendChild(r)}return n.appendChild(a),n}},{key:"passiveListener",get:function(){var e=!1;try{var t={get:function(){e=!0}},i=Object.defineProperty({},"passive",t);window.addEventListener("testPassive",null,i),window.removeEventListener("testPassive",null,i)}catch(e){}return!!e&&{passive:!1,capture:!1}}},{key:"requestAnimationFrame",value:function(e){return(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)(e)}},{key:"cancelAnimationFrame",value:function(e){(window.cancelAnimationFrame||window.mozCancelAnimationFrame)(e)}},{key:"whichTransitionEventEnd",value:function(){var e=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},i=Object.keys(t);for(var n in i)if(void 0!==e.style[n])return t[n]}},{key:"Device",get:function(){var e=window,t=e.navigator.userAgent,i={ios:!1,android:!1,androidChrome:!1,desktop:!1,windows:!1,iphone:!1,ipod:!1,ipad:!1,cordova:e.cordova||e.phonegap,phonegap:e.cordova||e.phonegap,browser:{ie11:!1}},n=t.match(/(Windows Phone);?[\s\/]+([\d.]+)?/),s=t.match(/(Android);?[\s\/]+([\d.]+)?/),a=t.match(/(iPad).*OS\s([\d_]+)/),o=t.match(/(iPod)(.*OS\s([\d_]+))?/),r=!a&&t.match(/(iPhone\sOS|iOS)\s([\d_]+)/);if(n&&(i.os="windows",i.osVersion=n[2],i.windows=!0),s&&!n&&(i.os="android",i.osVersion=s[2],i.android=!0,i.androidChrome=t.toLowerCase().indexOf("chrome")>=0),(a||r||o)&&(i.os="ios",i.ios=!0),r&&!o&&(i.osVersion=r[2].replace(/_/g,"."),i.iphone=!0),a&&(i.osVersion=a[2].replace(/_/g,"."),i.ipad=!0),o&&(i.osVersion=o[3]?o[3].replace(/_/g,"."):null,i.iphone=!0),i.ios&&i.osVersion&&t.indexOf("Version/")>=0&&"10"===i.osVersion.split(".")[0]&&(i.osVersion=t.toLowerCase().split("version/")[1].split(" ")[0]),i.desktop=!(i.os||i.android||i.webView),i.webView=(r||a||o)&&t.match(/.*AppleWebKit(?!.*Safari)/i),i.os&&"ios"===i.os){var l=i.osVersion.split("."),h=document.querySelector('meta[name="viewport"]');i.minimalUi=!i.webView&&(o||r)&&(1*l[0]==7?1*l[1]>=1:1*l[0]>7)&&h&&h.getAttribute("content").indexOf("minimal-ui")>=0}i.pixelRatio=e.devicePixelRatio||1,t.indexOf("Trident/7.0")>-1&&(i.browser.ie11=!0);var c=t.indexOf("Chrome")>-1;i.browser.explorer=t.indexOf("MSIE")>-1,i.browser.firefox=t.indexOf("Firefox")>-1;var d=t.indexOf("Safari")>-1,u=t.toLowerCase().indexOf("op")>-1;return i.browser.opera=u,i.browser.chrome=(!c||!u)&&c,i.browser.safari=(!c||!d)&&d,i}},{key:"isTouchDevice",get:function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}},{key:"isiPpad",get:function(){return 768===window.screen.height&&1024===window.screen.width||1024===window.screen.height&&768===window.screen.width||1366===window.screen.height&&1024===window.screen.width||1024===window.screen.height&&1366===window.screen.width}},{key:"getScrollbarWidth",get:function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var n=i.offsetWidth;return e.parentNode.removeChild(e),t-n}},{key:"hasScrollbar",get:function(){var e="BackCompat"===document.compatMode?document.body:document.documentElement;return e.scrollHeight>e.clientHeight}},{key:"miniScreen",get:function(){return window.screen.height<500||window.screen.width<500}},{key:"addParamsToURL",value:function(t,i,n){if(e.Device.browser.ie11)return"".concat(t+(t.indexOf("?")>=0?"&":"?")+encodeURIComponent(i),"=").concat(encodeURIComponent(n));var s=(t=new URL(t)).search,a=new URLSearchParams(s);return a.append(i,n),t.search=a.toString(),t.toString()}},{key:"youTubeCode",get:function(){return''}},{key:"vimeoCode",get:function(){return''}},{key:"mediaEl",value:function(t){var i=document.createElement(t);return i.className="thumb-".concat(t,"-content"),i.setAttribute("preload","metadata"),i.setAttribute("controlsList","nodownload"),"video"===t&&(i.setAttribute("preload",e.Device.browser.safari||e.Device.browser.opera?"auto":"metadata"),i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),i}},{key:"embedVideoEl",value:function(e,t){var i=document.createElement("iframe");return i.setAttribute("allow","autoplay"),i.setAttribute("allowfullscreen",""),i.setAttribute("frameborder","0"),"youtube"===e?i.src="https://www.youtube.com/embed/".concat(t,"?autoplay=1&rel=0&showinfo=0&wmode=transparent"):"vimeo"===e&&(i.src="https://player.vimeo.com/video/".concat(t,"?autoplay=1&byline=0&portrait=0&transparent=0")),i}},{key:"copyProperties",value:function(e,t){for(var i=[],n=Object.keys(e),s=0;si&&"auto"!==t&&(i=parseInt(t,10))}return i}},{key:"escape",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,(function(e){return t[e]}))}},{key:"trace",value:function(e){if(1!==arguments.length){for(var t="",i=0;i1?1:c);var d=Math.round(s*c),u=Math.round(a*c),m=Math.round((o-d)/2),g=Math.round((r-u)/2);return e.Rect(m,g,d,u)}},{key:"getItemFrameByIndexForBox",value:function(t,i,n,s,a,o){var r=1;o&&(r=o);var l=a=Math.min(i,a),h=Math.floor(i/a),c=(l=h>1?(i-(h-1)*n)/h:i)*r,d=Math.ceil((t+1)/h)-1,u=d*(c+s),m=(t-d*h)*(l+n);return e.Rect(m,u,l,c)}},{key:"fadeOut",value:function(e,t,i){i||(i=500);var n=Math.sqrt,s=(new Date).getTime();!function a(){var o=(new Date).getTime()-s,r=o/i;if(r<1){var l=1-n(r);e.style.opacity=String(l),setTimeout(a,Math.min(25,i-o))}else e.style.opacity="0",t&&t()}()}},{key:"ellipsizeTextBoxToLine",value:function(e,t){e.innerHTML=e.textContent||e.innerText||"";var i=e.innerHTML,n=e.innerHTML.split(" ");e.innerHTML=n[0].substring(0,3);var s=e.clientHeight*t;for(e.innerHTML=i;e.clientHeight>s;)n.pop(),e.innerHTML="".concat(n.join(" ")," ...")}},{key:"ellipsizeTextBox",value:function(e){e.innerHTML=e.textContent||e.innerText||"";for(var t=e.innerHTML.split(" ");e.scrollHeight>e.offsetHeight;)t.pop(),e.innerHTML="".concat(t.join(" ")," ...")}},{key:"searchParentByClassName",value:function(t,i){if(t.parentElement){var n=t.parentElement;return n.classList.contains(i)?n:e.searchParentByClassName(n,i)}}},{key:"scrollYpositionForDiv",value:function(e){var t=(window.innerHeight-e.clientHeight)/2;return window.innerHeight-e.getBoundingClientRect().bottom<-e.clientHeight||e.getBoundingClientRect().bottom<0&&e.getBoundingClientRect().top<0?e.getBoundingClientRect().top+window.pageYOffset-t:void 0}},{key:"scrollInElementToY",value:function(e,t){var i,n=(t=Math.min(t,e.scrollHeight-e.clientHeight-1))-e.scrollTop;i=setInterval((function(){n=.05*n+.07*(t-e.scrollTop);var s=e.scrollTop+n;Math.abs(n)<1?(n=0,clearInterval(i)):e.scrollTop=s}),15),document.addEventListener("wheel",(function e(){clearInterval(i),document.removeEventListener("wheel",e,!1)}),!1)}},{key:"scrollWindowToY",value:function(e){var t,i;function n(){clearInterval(t),document.removeEventListener("wheel",n,!1)}var s=window.pageYOffset;e=Math.min(e,document.documentElement.scrollHeight-document.documentElement.clientHeight-1);var a=0,o=.05+.01*Math.abs(e-window.pageYOffset)/1e3;o=Math.min(.9,o),t=setInterval((function(){var r=(e-window.pageYOffset)*o;(r===a||Math.abs(r)<1)&&(window.scrollTo(0,e),clearInterval(t)),a=(e-window.pageYOffset)*o,s+=a,window.scrollTo(0,s),void 0===i&&((i=Math.abs(s-window.pageYOffset)>20)?(window.scrollTo(0,e),clearInterval(t)):document.addEventListener("wheel",n,!1))}),15)}},{key:"scrollToY",value:function(e,t){var i,n=window.pageYOffset,s=Math.PI/(t/15),a=n/2,o=0,r=setInterval((function(){window.pageYOffset>e?(o+=1,i=a-a*Math.cos(o*s),window.scrollTo(0,n-i)):clearInterval(r)}),15)}},{key:"isFullscreen",get:function(){return document.webkitIsFullScreen||document.mozFullScreen||!1}},{key:"toggleFullScreen",value:function(e){var t=document.webkitIsFullScreen||document.mozFullScreen||!1;e.requestFullScreen=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||function(){return!1},document.cancelFullScreen=document.cancelFullScreen||document.webkitCancelFullScreen||document.mozCancelFullScreen||function(){return!1},t?document.cancelFullScreen():e.requestFullScreen()}},{key:"CacheItemsList",value:function(){var e={};function t(n){!e.itemsList||e.cached===e.itemsList.length&&!e.amount||e.amount&&e.cached>=e.amount||(e.amount&&(e.amount=Math.min(e.amount,e.itemsList.length)),e.currentItem=e.itemsList[n].webView,e.lastIndex=n,void 0===e.currentItem||e.currentItem.complete?(e.cached+=1,t(e.lastIndex+1>=e.itemsList.length?0:e.lastIndex+1)):e.currentItem.addEventListener("load",i,!1))}function i(){e.cached+=1,t(e.lastIndex+1>=e.itemsList.length?0:e.lastIndex+1)}return e.cached=0,e.itemsList=void 0,e.currentItem=void 0,e.amount=void 0,e.lastIndex=void 0,e.init=function(n,s,a){if(e.itemsList&&e.itemsList.length)for(var o=0;o0;t-=1){var i=Math.floor(Math.random()*(t+1)),n=[e[i],e[t]];e[t]=n[0],e[i]=n[1]}return e}},{key:"timeConverter",value:function(e){var t=new Date(e),i=new Date,n=new Date(Date.now()-864e5),s=t.getFullYear(),a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],o=t.getDate(),r=t.getHours(),l=t.getMinutes();return t.setHours(0,0,0,0)===i.setHours(0,0,0,0)?"Today, ".concat(r,":").concat(l):t.setHours(0,0,0,0)===n.setHours(0,0,0,0)?"Yesterday, ".concat(r,":").concat(l):s===(new Date).getFullYear()?"".concat(o," ").concat(a,", ").concat(s):"".concat(o," ").concat(a," ").concat(s)}},{key:"request",value:function(e,t,i,n,s){var a=new URL(e);if(i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.searchParams.set(o,i[o]);var r=new XMLHttpRequest;r.open("GET",a,!0),t&&r.setRequestHeader("X-WP-Nonce",t),r.onreadystatechange=function(){if(4===r.readyState){var e={};200!==r.status?e.error=r.statusText:e.data=r.responseText,n&&(e.params=n),s&&"function"==typeof s&&s(e)}},r.onerror=function(){h.trace("An error occurred while transferring the file.")};try{r.send()}catch(e){h.trace(e)}}},{key:"ItemGallery",value:function(e,t){var i={get webView(){return this.webImg.src?i.webImg:(this.itemViewSrc&&(this.webImg.src=this.itemViewSrc),this.webImg)}},n=this;if(this.copyProperties(e,i),i.appName=t,i.sharelink=e.postLink,i.alt=""!==e.title?e.title:void 0,i.title){var s=document.createElement("div");s.innerHTML=i.title,i.title=1===s.childNodes.length?s.childNodes[0].nodeValue:i.title}return i.ratio=1,i.errorStatus=!1,i.itemViewSrc=function(){if(i.thumb){if(i.thumb.large)return i.thumb.large.url;if(i.thumb.full)return i.thumb.full.url}else if(i.thumbURL)return i.thumbURL;return null}(),i.itemViewThumbSrc=function(){if(i.thumb){if(i.thumb.medium)return i.thumb.medium.url;if(i.thumb.large)return i.thumb.large.url;if(i.thumb.full)return i.thumb.full.url}else if(i.thumbURL)return i.thumbURL;return null}(),i.itemViewSize=function(){if(i.thumb){if(i.thumb.large)return n.Size(i.thumb.large.width,i.thumb.large.height);if(i.thumb.full)return n.Size(i.thumb.full.width,i.thumb.full.height)}return n.Size(400,400)}(),i.itemViewThumbSize=function(){if(i.thumb){if(i.thumb.medium)return n.Size(i.thumb.medium.width,i.thumb.medium.height);if(i.thumb.large)return n.Size(i.thumb.large.width,i.thumb.large.height);if(i.thumb.full)return n.Size(i.thumb.full.width,i.thumb.full.height)}return n.Size(400,400)}(),i.ratio=i.itemViewSize.height/i.itemViewSize.width,i.webImg=new Image,i.webImg.setAttribute("draggable","false"),i.webImgFrame=this.Rect(0,0,0,0),i.webImg.addEventListener("load",(function(){this.classList.add("onLoad")}),!1),i.webImg.addEventListener("error",(function(){i.errorStatus=!0,this.classList.add("onError")}),!1),i}},{key:"Item",value:function(e,t,i){var n={get webView(){return this.webImg.src?n.webImg:(this.itemViewFullSizePr?this.itemViewFlSrc&&(this.webImg.src=this.itemViewFlSrc):this.itemViewSrc&&(this.webImg.src=this.itemViewSrc),this.webImg)},set itemViewFullSize(e){this.itemViewFullSizePr=e}},s=this;if(n.itemViewFullSizePr=!(!i||!i.itemViewFullSize),n.comment_status="closed",n.featuredImage=void 0,n.tags=[],this.copyProperties(e,n),n.appName=t,n.idPrefix=void 0,n.albums=[],n.categories=[],n.user=n.author,n.sharelink=n.url,n.orignLinkText="",n.id=parseInt(e.id),n.ID=n.id,e.url&&(n.original=e.url),n.alt=""!==n.alt?n.alt:void 0,n.title=""!==n.title?n.title:void 0,n.caption=""!==n.caption?n.caption:void 0,n.description){var a=n.description.replace(new RegExp("\r?\n","g"),"
");n.description=a}return n.ratio=1,n.errorStatus=!1,"attachment"===e.type&&e.media_type&&(n.type=e.media_type),n.link=e.link&&void 0!==e.linkText?decodeURIComponent(e.link):void 0,n.linkTarget=e.linkTarget?e.linkTarget:void 0,n.linkText=e.linkText?e.linkText:void 0,n.hasTag=function(e){return"pgc_0"===e||!(!n.tags||0===n.tags.length)&&-1!==n.tags.indexOf(e)},n.meta=function(){var t={};if(n.meta&&Object.assign(t,n.meta),t.mime=n.mime,t.likes=0,t.views=0,n.sizes)return n.sizes.medium&&(t.thumb=n.sizes.medium),n.sizes.large&&(t.web=n.sizes.large),n.sizes.full&&(t.original=n.sizes.full),t;if(n.fullUrl&&n.url){t.original={},t.original.url=n.url;var i=n.url.toString().match(/.*\/(.+?)\./)[1].split("-").pop().split("x");i&&i.length>0&&(t.original.width=i[0]&&i[1]?Math.min(parseInt(i[0]),3e3):300,t.original.height=i[0]&&i[1]?Math.min(parseInt(i[1]),3e3):300,n.ratio=t.original.height/t.original.width),t.thumb=t.original,t.web=t.original}if(n.media_details&&n.media_details.sizes){var s=n.media_details.sizes;return s.medium&&(t.thumb=s.medium,t.thumb.url||(t.thumb.url=t.thumb.source_url)),s.large&&(t.web=s.large,t.web.url||(t.web.url=t.web.source_url)),s.full&&(t.original=s.full,t.original.url||(t.original.url=t.original.source_url)),t}if("audio"===n.type&&e.image&&e.image.width>=200&&!e.poster){var a={medium:{}};a.medium.url=e.image.src,a.medium.width=e.image.width,a.medium.height=e.image.height,a.medium.orientation=e.image.width/e.image.height>1?"landscape":"portrait",a.large=a.medium,a.full=a.medium,a.thumbnail=a.medium,n.poster=a}if(n.sizes)t.original=n.sizes.full?n.sizes.full:void 0,t.thumb=t.original,t.web=t.original,n.sizes.medium&&(t.thumb=n.sizes.medium),n.sizes.large&&(t.web=n.sizes.large);else{if("image"===n.type){t.original={},t.original.url=n.url;var o=n.url.toString().match(/.*\/(.+?)\./)[1].split("-").pop().split("x");return o&&o.length>0&&(t.original.width=o[0]&&o[1]?Math.min(parseInt(o[0]),3e3):300,t.original.height=o[0]&&o[1]?Math.min(parseInt(o[1]),3e3):300,n.ratio=t.original.height/t.original.width),t.thumb=t.original,t.web=t.original,t}if("video"===n.type&&(e.image&&e.image.width>=200&&(n.featuredImage=e.image),e.width&&e.height))return t.original={},t.original.url=n.url,t.original.width=e.width,t.original.height=e.height,n.ratio=t.original.height/t.original.width,t.thumb=t.original,t.web=t.original,t;if("audio"===n.type)return e.image&&e.image.width>=200?(t.original={},t.original.url=e.image.src,t.original.width=e.image.width,t.original.height=e.image.height,n.ratio=t.original.height/t.original.width,t.thumb=t.original,t.web=t.original,t):(t.original={},t.original.url="".concat(d.assets,"holder-mp3.png"),t.original.width=300,t.original.height=300,n.ratio=t.original.height/t.original.width,t.thumb=t.original,t.web=t.original,t);if(n.url&&void 0===n.width&&void 0===n.height){t.original={},t.original.url=n.url;var r=n.url.toString().match(/.*\/(.+?)\./)[1].split("-").pop().split("x");return r&&r.length>0&&(t.original.width=r[0]&&r[1]?Math.min(parseInt(r[0]),3e3):300,t.original.height=r[0]&&r[1]?Math.min(parseInt(r[1]),3e3):300,n.ratio=t.original.height/t.original.width),t.thumb=t.original,t.web=t.original,t}if(n.width&&n.height&&(n.src||n.url))return t.original={},t.original.url=n.src||n.url,t.original.width=n.width,t.original.height=n.height,n.ratio=t.original.height/t.original.width,t.thumb=t.original,t.web=t.original,t;if(n.imgUrl){t.original={},t.original.url=n.imgUrl;var l=n.imgUrl.toString().match(/.*\/(.+?)\./)[1].split("-").pop().split("x");return l&&l.length>0&&(t.original.width=l[0]&&l[1]?Math.min(parseInt(l[0]),3e3):300,t.original.height=l[0]&&l[1]?Math.min(parseInt(l[1]),3e3):300,n.ratio=t.original.height/t.original.width),t.thumb=t.original,t.web=t.original,t}}return t}(),n.itemViewFlSrc="video"===n.type?null:n.meta?n.meta.original?n.meta.original.url:n.meta.web?n.meta.web.url:null:null,n.itemViewSrc="video"===n.type?null:n.meta?n.meta.web?n.meta.web.url:n.meta.original?n.meta.original.url:null:null,n.itemViewThumbSrc="video"===n.type?null:n.meta?n.meta.thumb?n.meta.thumb.url:n.meta.web?n.meta.web.url:n.meta.original?n.meta.original.url:null:null,n.itemViewFlSize=n.meta&&"audio"!==n.type?n.meta.original?s.Size(n.meta.original.width,n.meta.original.height):n.meta.web?s.Size(n.meta.web.width,n.meta.web.height):s.Size(300,300):s.Size(300,300),n.itemViewSize=n.meta&&"audio"!==n.type?n.meta.web?s.Size(n.meta.web.width,n.meta.web.height):n.meta.original?s.Size(n.meta.original.width,n.meta.original.height):s.Size(300,300):s.Size(300,300),n.itemViewThumbSize=n.meta&&"audio"!==n.type?n.meta.thumb?s.Size(n.meta.thumb.width,n.meta.thumb.height):n.meta.web?s.Size(n.meta.web.width,n.meta.web.height):n.meta.original?s.Size(n.meta.original.width,n.meta.original.height):s.Size(300,300):s.Size(300,300),n.ratio=n.itemViewSize.height/n.itemViewSize.width,n.webImg=new Image,n.webImg.setAttribute("draggable","false"),n.webImgFrame=this.Rect(0,0,0,0),n.webImg.addEventListener("load",(function(){this.classList.add("onLoad")}),!1),n.webImg.addEventListener("error",(function(){n.errorStatus=!0,this.classList.add("onError")}),!1),n.initMetaObj=function(e){if(e.poster?n.poster=e.poster:delete n.poster,n.tags=e.tags,e.link&&""!==e.link){if(n.link=decodeURIComponent(e.link),n.linkTarget=e.linkTarget,n.linkText=e.linkText,n.orignLinkText=e.orignLinkText,"image"===n.type||n.parentType&&"image"===n.parentType){var t,i,s,a,o=n.link;o.match(/youtu\.be/i)||o.match(/youtube\.com/i)?(t=void 0!==(o=o.split(/(vi\/|v%3D|v=|\/v\/|youtu\.be\/|\/embed\/)/))[2]?o[2].split(/[^0-9a-z_\-]/i)[0]:o[0],i="video/youtube"):o.match(/vimeo\.com/i)&&(s=/(www\.)?vimeo.com\/(\d+)($|\/)/,(a=o.match(s))&&(t=a[2]?a[2]:void 0,i="video/vimeo")),void 0!==t?(n.parentType||(n.parentType=n.type),n.type="video",n.mime_type=i,n.videoId=t,n.link=void 0):(n.parentType&&(n.type=n.parentType),delete n.parentType,delete n.videoId,delete n.mime_type)}}else n.link=void 0,n.linkTarget="_self",n.linkText="",n.orignLinkText="",n.parentType&&(n.type=n.parentType),delete n.parentType,delete n.videoId,delete n.mime_type},n}},{key:"GalleryItem",value:function(e,t,i){var n,s;if(!(s="A"===t.tagName?t:t.getElementsByTagName("A")[0]))return null;if(s.target&&"_self"!==s.target)return null;if(!1===s.hasAttribute("href"))return null;var a=s.getAttribute("href"),o=s.getElementsByTagName("IMG")[0];if(o){if(o.dataset.lightboxExclude)return null;var r,l;if((n={get webView(){return this.webImg.src?n.webImg:(this.webImg.src=this.itemViewSrc,this.webImg)}}).galId=i,n.index=e,n.ID="".concat(e),o.dataset.id&&(n.ID+="_".concat(o.dataset.id),n.attId=o.dataset.id),n.url=a,n.sharelink=a,0===a.indexOf("http://")||0===a.indexOf("https://")){if("/"===(r=new URL(a)).pathname)return null;l=r.pathname.split("/").pop().split("#")[0].split("?")[0].split(".")}else l=(r=a).split("/").pop().split("#")[0].split("?")[0].split(".");if(l.length<=1)return null;if(n.fileName=l[0].split("-")[0],""===n.fileName)return null;if(o.src.indexOf(n.fileName)<0){if(!o.dataset.fullUrl)return null;if(o.dataset.fullUrl.indexOf(n.fileName)<0)return null}n.fileExt=l[l.length-1],o.dataset["".concat("pgcSgb","Id")]="".concat(i,"_").concat(e),s&&(s.dataset["".concat("pgcSgb","Id")]="".concat(i,"_").concat(e)),n.itemViewSrc=n.url,n.itemViewSize=h.Size(100,100),n.type="image",n.subtype="image/".concat(n.fileExt),o.alt&&""!==o.alt&&(n.alt=o.alt);var c=t.getElementsByTagName("FIGCAPTION");if(c[0]&&(c[0].id&&(n.ID+="_".concat(c[0].id.split("-").pop()),n.attId=c[0].id.split("-").pop()),n.title=c[0].innerHTML),!n.attId&&o.classList&&o.classList.length>0)for(var d=0;d0)return this.itemsList[0].itemViewSrc}};return this.copyProperties(e,n),n}},{key:"Meta",value:function(){return{}}}],(i=null)&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(n.a);t.a=u},13:function(e,t,i){e.exports={classPref:'".pgc-rev-utils-"'}},14:function(e,t,i){e.exports={classPref:'".pgc-rev-item-menu-"'}},15:function(e,t,i){e.exports={classPrefScroller:'".pgc-rev-scroller-ho-"'}},19:function(e,t,i){"use strict";var n=i(0),s=i(5),a=i(24),o=i.n(a);function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var i=0;i=150&&(this.img.style.width="".concat(e.thumb.width,"px"),this.img.style.height="".concat(e.thumb.height,"px"),i=e.thumb.src),i&&(this.img.src=i)):this.view.style.opacity=this.opacityPr,this.wrap_item.appendChild(this.hover),this.wrap_item.appendChild(this.inner),this.initSubContent(),this.initInteractive(),this.inited=!0}}},{key:"initSubContent",value:function(){this.type=this.item.type;var t=this.item;if("video"===this.type)if(t.mime_type);else if(!t.poster&&(!t.thumb||t.thumb&&t.thumb.width<150)){this.videoContent=n.a.mediaEl("video"),this.imgSubstitute=!0,this.videoContent.className="".concat(e.classPref,"video-content");var i=t.original;t.poster&&t.poster.medium?this.videoContent.setAttribute("poster",t.poster.medium.url):n.a.Device.browser.safari&&n.a.isTouchDevice&&(i+="#t=0.001"),this.videoContent.src=i,this.wrap_item.insertBefore(this.videoContent,this.wrap_item.firstChild)}this.hover.classList.add("".concat(e.classPref,"hover")),this.hover.style.backgroundColor=this.config.thumb_hover_color}},{key:"initInteractive",value:function(){var t=this;function i(e){switch(e.type){case"mouseenter":this.classList.add("hover"),t.hoverAnim(!0);break;case"mouseleave":!1===t.isSelect&&t.hoverAnim(!1),this.classList.remove("hover")}}this.view.addEventListener("click",(function(){t.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENT.THUMB_ACTION,t,{index:t.index}))})),this.view.addEventListener("mouseenter",i,!1),this.view.addEventListener("mouseleave",i,!1)}},{key:"updateSize",value:function(e){var t=Math.round(e*this.config.thumb_coverHieghtRation);this.thumbSize=n.a.Size(e,t),this.view.style.width="".concat(this.thumbSize.width,"px"),this.view.style.height="".concat(this.thumbSize.height,"px")}},{key:"x",set:function(e){this.view.style.left="".concat(e,"px")}},{key:"y",set:function(e){this.view.style.top="".concat(e,"px")}},{key:"hoverAnim",value:function(e){this.inner.style.border=e?"solid 2px ".concat(this.config.thumb_border_color):null}},{key:"select",set:function(e){e?(this.view.classList.add("pgc-select"),this.hoverAnim(!0)):(this.view.classList.remove("pgc-select"),this.hoverAnim(!1)),this.isSelect=e}},{key:"visibility",set:function(e){this.view.style.visibility=e}},{key:"display",get:function(){return this.displayPr},set:function(e){"none"===e&&clearTimeout(this.opacityDelay),this.view.style.display=e,this.displayPr=e}},{key:"opacity",set:function(e){var t=this;e.delay?this.opacityDelay=setTimeout((function(){(t.imgCompleted||t.imgSubstitute)&&(t.view.style.opacity=e.opacity),t.opacityPr=e.opacity}),e.delay):(clearTimeout(this.opacityDelay),(t.imgCompleted||t.imgSubstitute)&&(t.view.style.opacity=e.opacity),t.opacityPr=e.opacity)}}],[{key:"EVENT",get:function(){return{THUMB_ACTION:"THUMB_ACTION"}}},{key:"classPref",get:function(){var e=o.a.classPrefThumb;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}},{key:"CONFIG",get:function(){return{thumb_spasing:10,thumb_coverHieghtRation:1,thumb_loading_lazy:!1,thumb_border_color:"white",thumb_hover_color:"rgba(0,0,0,0.5)"}}}]),e}(),u=function(){function e(t,i,a){r(this,e),this.context="ItemsScrollBarPagination",this.config=e.CONFIG,n.a.copyProperties(i,this.config),this.appName=t.appName,this.appSet=t,this.thumbsList=[],this.presentedList=[],this.thumbSize=n.a.Size(Math.round(this.config.isb_height/this.config.isb_thum_ration),this.config.isb_height),this.activatedPages={},this.maxWidth=0,this.width=1,this.scrollLeft=0,this.view=document.createElement("div"),this.view.className="".concat(e.classPref,"view"),this.sliderContent=document.createElement("div"),this.sliderContent.className="".concat(e.classPref,"slider-content-view");var o=s.a.CONFIG;o.scrh_dragin=!0,o.scrh_block_pan_y=this.config.isb_block_pan_y;this.scroller=new s.a(this.appSet,o,{}),this.appSet.appEventManager.addGMEventListener(s.a.EVENTS.SCR_SCROLL,this,"scrollHandler"),this.view.appendChild(this.scroller.view),this.activIndex=void 0,this.activAudioIndex=void 0,a&&n.a.setStyleForElFomObj(this.view,a),this.appSet.appEventManager.addGMEventListener(d.EVENT.THUMB_ACTION,this,"thumbActionHandler")}return h(e,[{key:"initByItemslist",value:function(e){this.itemsList=e;var t=d.CONFIG;t.thumb_coverHieghtRation=this.config.isb_thum_ration,t.thumb_loading_lazy=!0,t.thumb_spasing=4,t.thumb_border_color=this.config.isb_itemBgColor;for(var i=0;is){var a;i0&&(a=i+this.thumbSize.width-this.width);var o=Math.ceil(a/this.thumbSize.width),r=Math.floor((a+this.width-this.thumbSize.width)/this.thumbSize.width),l=this.pageByItemIndex(o);l!==t&&this.addPage(l);var h=this.pageByItemIndex(r);h!==t&&this.addPage(h),Math.abs(this.scrollLeft-a)>this.width?this.scroller.scrollLeft=a:this.scroller.scrollLeftAnime=a}this.addPage(t),this.activIndex=e}}},{key:"size",set:function(e){var t=Math.floor(e.width/this.thumbSize.width);if(this.view.style.maxWidth="".concat(t*this.thumbSize.width,"px"),this.itemsOnPage!==t){if(this.itemsOnPage=t,this.width=Math.min(this.itemsOnPage,this.thumbsList.length)*this.thumbSize.width,this.view.style.width="".concat(this.width,"px"),this.view.style.maxWidth=null,this.activatedPages={},this.maxWidth=e.width,void 0!==this.activIndexes&&this.activIndexes.length){var i=this.activIndexes,n=this.pageByItemIndex(i[0]),s=this.pageByItemIndex(i[i.length-1]);this.addPage(n),this.addPage(s)}void 0!==this.activIndex&&this.addPage(this.pageByItemIndex(this.activIndex))}}},{key:"pageByItemIndex",value:function(e){return Math.floor(e/this.itemsOnPage)}},{key:"resizeHandler",value:function(){this.updateView()}},{key:"updateView",value:function(){c("Update View")}},{key:"prepareToRemove",value:function(){this.appSet.appEventManager.removeGMEventListener(s.a.EVENTS.SCR_ACTION,this,"scrollHandler"),this.scroller.remove(),this.appSet.appEventManager.removeGMEventListener(d.EVENT.THUMB_ACTION,this,"thumbActionHandler")}}],[{key:"classPref",get:function(){var e=o.a.classPref;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}},{key:"CONFIG",get:function(){return{isb_itemBgColor:"rgba(255,255,255,0.6)",isb_height:50,isb_thum_ration:.85,isb_block_pan_y:!1}}},{key:"EVENTS",get:function(){return{ITEMS_SCROLL_BAR_ITEM_ACTION:"ITEMS_SCROLL_BAR_ITEM_ACTION"}}}]),e}();t.a=u},2:function(e,t,i){"use strict";var n=i(0),s=i(14),a=i.n(s);function o(e,t){for(var i=0;i0)for(var c=0;c0)for(var g=0;g0&&(this.galleries.sl={},this.galleries.sl.appName="sl",this.galleries.sl.itemsList=b)}if(this.globalPreset.groupingAllImages){var _=[],I=document.querySelectorAll("[data-pgc-sgb-id]");if(I.length)for(var k=0;k0&&(this.galleries.gl={},this.galleries.gl.appName="gl",this.galleries.gl.itemsList=_)}var M=this;if(this.popstateHandler=function(){M.modal&&M.modal.prepareToRemove(),M.lightbox?M.lightbox.prepareToRemove():M.itemIDFromHash&&M.openLightboxForItemHash(M.itemIDFromHash)},this.globalPreset.deepLinking&&window.addEventListener("popstate",this.popstateHandler,!1),this.globalPreset.deepLinking){var O=this.itemIDFromHash;void 0!==O&&(window.history.replaceState(null,null,window.location.pathname+window.location.search),this.openLightboxForItemHash(O))}}var t,i,s;return t=e,(i=[{key:"lightboxConstructor",value:function(){return l("** Need override - itemViewConstructor **"),null}},{key:"lightboxConfig",get:function(){return l("** Need override - lightboxConfig **"),null}},{key:"attributesLightbox",get:function(){return l("** Need override - lightbox Attributes **"),null}},{key:"addLightboxEventListres",value:function(){l("** Need override - addLightboxEventListres **")}},{key:"removeLightboxEventListres",value:function(){l("** Need override - removeLightboxEventListres **")}},{key:"createGalleryByElement",value:function(e,t){var i="".concat(0===e.indexOf("bl")?"blocks-":"","gallery-item"),s=t.getElementsByClassName(i);0===s.length&&(s=t.getElementsByClassName("wp-block-image"));for(var a=[],o=0;o0?a:null}},{key:"keydownHandler",value:function(){var e=this;return e.handlerKB=function(t){if(e.modal)e.modal.prepareToRemove();else switch(t.keyCode){case 27:e.lightbox&&e.lightbox.prepareToRemove()}},e.handlerKB}},{key:"initAppForLightbox",value:function(){this.viewWidth=document.getElementsByTagName("BODY")[0].clientWidth,document.addEventListener("keydown",this.keydownHandler(),!0);var e=this;this.resizeWindow=function(){e.windowResizeHandler()},window.addEventListener("resize",this.resizeWindow),this.addLightboxEventListres()}},{key:"deactivateApp",value:function(){this.removeLightboxEventListres(),document.removeEventListener("keydown",this.handlerKB,!0),window.removeEventListener("resize",this.resizeWindow)}},{key:"checkGalleryYpositionForViewedItem",value:function(){if(this.viewedItem){var e=this.viewedItem,t=document.querySelectorAll('[data-pgc-sgb-id="'.concat(e.galId,"_").concat(e.index,'"]'))[0];if(t){var i=(window.innerHeight-t.clientHeight)/2,s=window.innerHeight-t.getBoundingClientRect().bottom<-t.clientHeight||t.getBoundingClientRect().bottom<0&&t.getBoundingClientRect().top<0?t.getBoundingClientRect().top+window.pageYOffset-i:void 0;s&&n.a.scrollWindowToY(s)}}}},{key:"itemIDFromHash",get:function(){if(0!==Object.keys(this.galleries).length){var e,t=window.location.hash.indexOf(h);if(t+1){e=window.location.hash.substr(t).split("-").length>=2?window.location.hash.substr(t).split("-"):void 0;var i={};i.galleryName=this.galleries[e[1]]?e[1]:void 0,i.galleryName||(i.galleryName=Object.keys(this.galleries)[0]);var n=e[2];if(n){var s=n.split("_");s[0]&&(i.index=parseInt(s[0])),s[1]&&(i.id=s[1])}return i}}}},{key:"itemHash",value:function(e){return"#".concat(h,"-").concat(this.lightbox.appName,"-").concat(e.ID)}},{key:"openLightboxForItemHash",value:function(e){var t,i,n=e.galleryName,s=e.index,a=e.id;if(n&&this.galleries[n]){t=this.galleries[n];var o=n.itemsList;if(o&&s&&o[s]){if(i=o[s],!a)return this.createLightboxForGallery(t,s);if(i.attId&&i.attId===a)return this.createLightboxForGallery(t,s);for(var r in this.galleries)if(Object.prototype.hasOwnProperty.call(this.galleries,r)){var h=this.getIndexById(a,this.galleries[r]);if(null!==h)return this.createLightboxForGallery(this.galleries[r],h)}this.createLightboxForGallery(t,s)}else if(!o&&a)for(var c in this.galleries)if(Object.prototype.hasOwnProperty.call(this.galleries,c)){var d=this.getIndexById(a,this.galleries[c]);if(null!==d)return this.createLightboxForGallery(this.galleries[c],d)}}return l("Hash is deprecated")}},{key:"getIndexById",value:function(e,t){var i=t.itemsList;if(!i||0===i.length)return null;for(var n=0;n').concat(t.linkText,""):s.innerHTML=t.link_text?t.link_text:t.title,n.appendChild(s),t.price||t.meta&&t.meta.price){var a=document.createElement("div"),r=document.createElement("div");r.className="".concat(e.classPref,"price"),r.innerHTML=t.price||t.meta.price,a.appendChild(r),n.appendChild(a)}return i.appendChild(n),i}return l(e,null,[{key:"classPref",get:function(){var e=a.a.classPrefPostInformer;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}}]),e}(),c=l((function e(t){o(this,e);var i=document.createElement("div"),n=document.createElement("div");return n.className="icon-holder",n.innerHTML=t,i.appendChild(n),i})),d=function(){function e(t){o(this,e),this.delegate=t,this.item=void 0,this.id=void 0,this.appName=t.appName,this.itemIndex=void 0,this.iconSet=t.iconSet,this.positionIndex=0,this.view=document.createElement("div"),this.view.className="".concat(e.classPref,"view"),this.itemInner=document.createElement("div"),this.itemInner.className="".concat(e.classPref,"inner"),this.view.appendChild(this.itemInner),this.preloader=n.a.createPreloaderView(this.delegate.config.sl_preloaderColor),this.preloader.style.display="none",this.view.appendChild(this.preloader),this.subContentHolder=document.createElement("div"),this.subContentHolder.className="".concat(e.classPref,"sub-content-holder"),this.view.appendChild(this.subContentHolder),this.videoContent=!1,this.vieoContentReadyAction=!1,this.vieoContentReady=!1,this.isEmbedContent=!1,this.videoAutoStarted=void 0,this.size=n.a.Size(0,0),this.imgSize=n.a.Size(0,0),this.imageFramePr=n.a.Rect(0,0,0,0),this.imageFrameFF=n.a.Rect(0,0,0,0),this.imageScaledFF=!1,this.width=0,this.height=0,this.maxXoffset=0,this.maxYoffset=0,this.MaxScale=4,this.imgScale=1,this.imgScaleFF=1,this.scale=1,this.newScale=1,this.newScaleMW=1,this.viewTranslatePr=n.a.Point(0,0),this.origin=n.a.Point(0,0),this.boundingBox=void 0,this.boundingBoxScale=void 0,this.animaSliderRender=void 0,this.speedX=0,this.speedY=0,this.oldX=0,this.newX=0,this.oldY=0,this.newY=0,this.draging=!1,this.isBlockDraging=!1,this.isBlockDragingMem=!1,this.startScale=void 0,this.startGlobalPoint=void 0,this.startDistForZoom=void 0}return l(e,[{key:"overLoadHandler",value:function(){var e=this;return this.overLoadH||(this.overLoadH=function(){e.preloader.style.display="none",e.subContentHolder.style.display=null,e.imgSize.width=this.naturalWidth,e.imgSize.height=this.naturalHeight,e.item.videoId&&e.imgSize.width<1e3&&(e.imgSize.width*=1.5,e.imgSize.height*=1.5),e.isInScale&&e.normalize(),e.fit(!1)}),this.overLoadH}},{key:"clearPage",value:function(){this.item=void 0,this.id=void 0,1!==this.scale&&(this.scale=1,this.viewTranslate=n.a.Point(0,0)),this.itemInner.innerHTML="",this.subContentHolder.innerHTML="",this.vieoContentReadyAction=!1,this.vieoContentReady=!1,delete this.videoContent,delete this.audioContent,this.itemImg&&this.itemImg.removeEventListener("load",this.overLoadHandler(),!1),this.itemImg=void 0}},{key:"initByItem",value:function(t){if(this.fadePrep(),void 0!==t){if(this.id!==t.ID){if(this.item=t,this.id=t.ID,1!==this.scale&&(this.scale=1,this.viewTranslate=n.a.Point(0,0)),this.itemInner.innerHTML="",this.subContentHolder.innerHTML="",this.vieoContentReadyAction=!1,this.vieoContentReady=!1,delete this.videoContent,delete this.audioContent,this.itemImg&&this.itemImg.removeEventListener("load",this.overLoadHandler(),!1),t.webView)if("video"!==t.type||t.mime_type)if("audio"===t.type&&t.poster){this.item.webImgFrame=n.a.Rect(0,0,0,0),this.imgSize.width=300,this.imgSize.height=300,this.itemImg=document.createElement("div"),this.itemImg.className="".concat(e.classPref,"place-holder");var i=new Image;i.className="".concat(e.classPref,"item-poster"),i.src=t.poster.medium.url,i.onload=function(){this.classList.add("onLoad")},this.itemImg.appendChild(i),this.itemInner.appendChild(this.itemImg)}else this.itemImg=t.webView,this.itemInner.appendChild(this.itemImg),this.vieoContentReady=!0,this.delegate.config.sl_copyR_Proptection&&this.itemImg.classList.add("iph-protect"),t.webView.complete?(this.preloader.style.display="none",this.imgSize.width=this.itemImg.naturalWidth,this.imgSize.height=this.itemImg.naturalHeight,t.videoId&&this.imgSize.width<1e3&&(this.imgSize.width*=1.5,this.imgSize.height*=1.5)):(this.imgSize=(this.delegate.config.sl_FullSizeViewMode,this.item.itemViewSize),t.videoId&&this.imgSize.width<1e3&&(this.imgSize.width*=1.5,this.imgSize.height*=1.5),this.subContentHolder.style.display="none",this.preloader.style.display="block",this.itemImg.addEventListener("load",this.overLoadHandler(),!1));else this.item.webImgFrame=n.a.Rect(0,0,0,0),this.imgSize.width=400,this.imgSize.height=400,this.itemImg=document.createElement("div"),this.itemImg.className="".concat(e.classPref,"place-holder"),this.itemInner.appendChild(this.itemImg);else this.item.webImgFrame=n.a.Rect(0,0,0,0),this.imgSize.width=400,this.imgSize.height=400,this.itemImg=document.createElement("div"),this.itemImg.className="".concat(e.classPref,"place-holder"),"video"===t.type||t.mime_type||this.itemImg.classList.add("bg-mode"),this.itemInner.appendChild(this.itemImg);switch("video"!==t.type||t.mime_type||this.addVideo(t.original),this.isInScale&&this.normalize(),this.fit(!1),t.type){case"audio":this.view.classList.add("info-icon"),this.audioContent=n.a.mediaEl("audio"),this.audioContent.setAttribute("controls",""),this.audioContent.className="lb-audio-content",this.subContentHolder.childNodes.length?this.subContentHolder.replaceChild(this.audioContent,this.subContentHolder.firstChild):this.subContentHolder.appendChild(this.audioContent),this.audioContent.src=t.original;break;case"video":this.view.classList.add("info-icon"),this.subContentHolder.innerHTML=new c(this.iconSet.PLAY_SVG).innerHTML,this.subContentHolder.getElementsByTagName("svg")[0].style.marginLeft="7px";break;case"post":case"page":case"product":this.view.classList.add("info-icon"),this.subContentHolder.innerHTML=new h(this.item).innerHTML;break;default:this.view.classList.remove("info-icon")}if(t.meta&&t.meta.subType)switch(t.meta.subType){case"product":this.view.classList.add("info-icon"),this.subContentHolder.innerHTML=new h(this.item).innerHTML}}}else this.clearPage()}},{key:"addVideo",value:function(t){var i=this;this.preloader.style.display="block",this.item.webView?(this.imgSize.width=this.item.webImgFrame.width,this.imgSize.height=this.item.webImgFrame.height):(this.item.webImgFrame=n.a.Rect(0,0,0,0),this.imgSize.width=1e3,this.imgSize.height=this.imgSize.width/(16/9)),this.itemImg.parentNode&&this.itemImg.parentNode.removeChild(this.itemImg),this.itemImg=document.createElement("div"),this.itemImg.className="".concat(e.classPref,"place-holder"),this.videoContent=n.a.mediaEl("video"),this.videoContent.className="lb-video-content",i.delegate.config.sl_video_loop&&this.videoContent.setAttribute("loop",""),this.item.poster?(this.videoContent.setAttribute("poster",this.item.poster.large?this.item.poster.large.url:this.item.poster.full.url),this.videoContent.removeAttribute("preload")):this.item.featuredImage?(this.videoContent.setAttribute("poster",this.item.featuredImage.src),this.videoContent.removeAttribute("preload")):this.item.image&&this.item.image.width>=200&&this.videoContent.setAttribute("poster",this.item.image.src),this.itemImg.appendChild(this.videoContent),this.videoContent.addEventListener("loadedmetadata",(function(){i.vieoContentReady=!0,i.preloader.style.display="none",this.videoWidth&&this.videoHeight&&(i.imgSize.width=this.videoWidth,i.imgSize.height=this.videoHeight,i.isInScale&&i.normalize(),i.fit(!1)),i.vieoContentReadyAction&&i.vieoContentReadyAction()})),this.videoContent.src=t+(void 0===this.item.poster&&void 0===this.item.featuredImage&&n.a.Device.browser.safari&&n.a.isTouchDevice?"#t=0.001":""),this.itemInner.appendChild(this.itemImg)}},{key:"posX",set:function(e){this.view.style.left="".concat(this.size.width*e,"px"),this.positionIndex=e}},{key:"resize",value:function(e){this.size=e,this.posX=this.positionIndex,this.isInScale&&this.normalize(),this.fit(!0)}},{key:"fit",value:function(){if(this.itemImg){var e=this.delegate.config.sl_xOffset,t=0,i=n.a.getFrameForBoxWithMode(this.imgSize,n.a.Size(this.size.width-2*e,this.size.height-2*t),!1,!1);i.x+=e,i.y+=t,this.imageFrameFF=i,t=this.delegate.config.sl_yOffset,(i=n.a.getFrameForBoxWithMode(this.imgSize,n.a.Size(this.size.width-2*e,this.size.height-2*t),!1,!1)).x+=e,i.y+=t,this.imageFrameNF=i,this.imgScale=Math.min(this.imgSize.width/i.width,this.MaxScale),this.imgScaleFF=this.imageFrameFF.height/i.height,"image"!==this.item.type&&"video"!==this.item.type&&"audio"!==this.item.type||(this.delegate.FF_Mode?(this.imageFrame=this.imageFrameFF,i=this.imageFrameFF,this.imageScaledFF=!0):(this.imageFrame=this.imageFrameNF,i=this.imageFrameNF,this.imageScaledFF=!1)),this.item.webImgFrame.x!==i.x||this.item.webImgFrame.y!==i.y||this.item.webImgFrame.width!==i.width||this.item.webImgFrame.height!==i.height?(this.imageFrame=i,this.item.webImgFrame=i):this.imageFramePr=i,this.subContentFrame=i}}},{key:"imageFrame",get:function(){return this.imageFramePr},set:function(e){this.itemImg.style.left="".concat(e.x,"px"),this.itemImg.style.top="".concat(e.y,"px"),this.itemImg.style.width="".concat(e.width,"px"),this.itemImg.style.height="".concat(e.height,"px"),this.imageFramePr=e}},{key:"subContentFrame",set:function(e){this.subContentHolder.style.left="".concat(e.x,"px"),this.subContentHolder.style.top="".concat(e.y,"px"),this.subContentHolder.style.width="".concat(e.width,"px"),this.subContentHolder.style.height="".concat(e.height,"px")}},{key:"checkOffset",value:function(e,t){var i=this.imageScaledFF?this.imageFrameFF:this.imageFrame;if(t!==this.boundingBoxScale){var s=i.width*(t||1),a=i.height*(t||1),o=i.x*(t||1),r=i.y*(t||1);this.boundingBox={left:s>this.size.width?-o:(this.size.width-this.size.width*t)/2,top:a>this.size.height?-r:(this.size.height-this.size.height*t)/2,right:s>this.size.width?this.size.width-(o+s):(this.size.width-this.size.width*t)/2,bottom:a>this.size.height?this.size.height-(r+a):(this.size.height-this.size.height*t)/2},this.boundingBoxScale=t}var l=e.x>this.boundingBox.left?this.boundingBox.left:e.x;l=lthis.boundingBox.top?this.boundingBox.top:e.y;return h=ht&&e.xn&&e.ythis.MaxScale&&(i=this.MaxScale/this.newScale),this.newScale*i<1&&(i=1/this.newScale),this.newScale*=i,this.origin=n.a.Point(t.x-i*(t.x-this.origin.x),t.y-i*(t.y-this.origin.y)),this.renderTransformTo(this.checkOffset(this.origin,this.newScale),this.newScale)}}},{key:"zoomByScaleDeltaToPoint",value:function(e,t){if("image"===this.item.type){var i;n.a.cancelAnimationFrame(this.animaSliderRender);var s=e/this.startDistForZoom,a=0;(i=this.startDistForZoom/this.startScale*s/(this.startDistForZoom/this.startScale)*this.startScale)>this.MaxScale&&(a=.8*-(i-this.MaxScale)),i+=a;var o=this.startGlobalPoint.x-this.startTranslate.x,r=this.startGlobalPoint.y-this.startTranslate.y,l=o/this.newScale,h=r/this.newScale,c=this.startGlobalPoint.x-l*i,d=this.startGlobalPoint.y-h*i,u=n.a.Point(c-t.x,d-t.y);this.scale=i,this.newScale=i,this.viewTranslate=u,this.startTranslate=n.a.Point(c,d)}}},{key:"viewTranslate",get:function(){return this.viewTranslatePr},set:function(e){this.viewTranslatePr=e,this.itemInner.style.transform="matrix(".concat(this.scale,", 0, 0, \n ").concat(this.scale,", ").concat(e.x,", ").concat(e.y,")")}},{key:"renderTransformTo",value:function(e,t){var i=this;n.a.cancelAnimationFrame(i.animaSliderRender),this.origin=e,this.newScale=t;var s=0,a=0,o=0;i.animaSliderRender=n.a.requestAnimationFrame((function r(){s=.05*s+.1*(e.x-i.viewTranslate.x),a=.05*a+.1*(e.y-i.viewTranslate.y),t&&(o=.05*o+.1*(t-i.scale));var l=i.viewTranslate.x;l+=s;var h=i.viewTranslate.y;h+=a,t&&(i.scale+=o),i.viewTranslate=n.a.Point(l,h),Math.abs(s)<.02&&Math.abs(a)<.02&&Math.abs(o)<.02?(n.a.cancelAnimationFrame(i.animaSliderRender),t&&(i.scale=t),i.viewTranslate=n.a.Point(e.x,e.y)):i.animaSliderRender=n.a.requestAnimationFrame(r)}))}},{key:"renderGlidingTransform",value:function(){var e=this;n.a.cancelAnimationFrame(e.animaSliderRender);var t=.95,i=.95;e.animaSliderRender=n.a.requestAnimationFrame((function s(){e.speedX*=t,e.speedY*=i;var a=e.viewTranslate.x;a+=e.speedX;var o=e.viewTranslate.y;if(o+=e.speedY,a>e.boundingBox.left||ae.boundingBox.left?e.boundingBox.left:r,a+=e.speedX,t=.75}if(o>e.boundingBox.top||oe.boundingBox.top?e.boundingBox.top:l,o+=e.speedY,i=.75}e.origin=n.a.Point(a,o),e.viewTranslate=n.a.Point(a,o),Math.abs(e.speedX)<.02&&Math.abs(e.speedY)<.02?(n.a.cancelAnimationFrame(e.animaSliderRender),e.speedX=0,e.speedY=0):e.animaSliderRender=n.a.requestAnimationFrame(s)}))}},{key:"renderStretchstretchTransform",value:function(){var e=this;n.a.cancelAnimationFrame(e.animaSliderRender);var t=this.checkOffset(n.a.Point(e.viewTranslate.x+e.speedX,e.viewTranslate.y+e.speedY),e.scale),i=0,s=0;e.animaSliderRender=n.a.requestAnimationFrame((function a(){i=.2*i+.15*(t.x-e.viewTranslate.x),s=.2*s+.15*(t.y-e.viewTranslate.y);var o=e.viewTranslate.x+i,r=e.viewTranslate.y+s;e.viewTranslate=n.a.Point(o,r),Math.abs(i)<.02&&Math.abs(s)<.02?(n.a.cancelAnimationFrame(e.animaSliderRender),e.viewTranslate=t):e.animaSliderRender=n.a.requestAnimationFrame(a)}))}},{key:"startDrag",value:function(e,t){n.a.cancelAnimationFrame(this.animaSliderRender),"image"===this.item.type&&(this.startDistForZoom=t,this.startGlobalPoint=e,this.startTranslate=this.viewTranslate,this.speedX=0,this.speedY=0,this.newX=this.viewTranslate.x,this.newY=this.viewTranslate.y,this.startScale=this.scale)}},{key:"stopDrag",value:function(){if("image"===this.item.type){if(this.isInScale)if(this.scale<1)this.normalize(!0);else if(this.scale>this.MaxScale)this.zoomIn(this.MaxScale,this.startGlobalPoint);else{var e=this.checkOffset(this.origin,this.newScale);this.isBlockDraging=e.x!==this.origin.x||e.y!==this.origin.y,this.isBlockDraging&&this.renderStretchstretchTransform()}this.draging&&(this.isBlockDraging?this.renderStretchstretchTransform():this.renderGlidingTransform(),this.draging=!1)}}},{key:"dragin",value:function(e){if("image"!==this.item.type)return!1;var t=this.startTranslate.x-e.x,i=this.startTranslate.y-e.y,s=this.checkOffset(n.a.Point(t,i),this.newScale);this.isBlockDraging=s.x!==t||s.y!==i,t-=.7*(t-s.x),i-=.7*(i-s.y);return this.oldX=this.newX,this.newX=t,this.speedX=.7*(this.newX-this.oldX),this.oldY=this.newY,this.newY=i,this.speedY=.7*(this.newY-this.oldY),this.origin=n.a.Point(t,i),this.viewTranslate=n.a.Point(t,i),this.draging=!0,!0}},{key:"action",value:function(e,t){if(this.item)switch(e){case"click":if(t&&"enter"===t)return"linkAction";if("video"===this.item.type){if(this.videoContent){if(!1===this.videoContent.controls&&(this.view.classList.add("video-play"),this.view.classList.remove("info-icon"),this.delegate.videoVolume&&(this.videoContent.volume=this.delegate.videoVolume),this.videoContent.controls=!0,t||this.videoContent.play()),t&&"space"===t){if(!this.videoContent.paused)return void this.videoContent.pause();this.videoContent.play()}return this.videoContent.paused?"videoStop":"videoPlay"}if(this.item.mime_type)return this.isEmbedContent?(this.removeEmbedVideoContent(),"videoStop"):(this.addEmbedVideoContent(),"videoPlay")}if("audio"===this.item.type&&this.audioContent)return this.audioContent.paused?(this.audioContent.setAttribute("controls",""),this.audioContent.play(),"audioPlay"):(this.audioContent.pause(),this.audioContent.removeAttribute("controls"),"audioStop");if("post"===this.item.type||"page"===this.item.type||"product"===this.item.type)return"linkAction";break;case"removeSubContent":if("video"===this.item.type)return this.videoContent?(this.view.classList.remove("video-play"),this.view.classList.add("info-icon"),this.videoContent.pause(),this.videoContent.currentTime=0,this.videoContent.controls=!1,0!==this.videoContent.played.length&&(this.delegate.videoVolume=this.videoContent.volume)):this.removeEmbedVideoContent(),"videoStop";this.audioContent&&(this.audioContent.pause(),this.audioContent.currentTime=0);break;default:return}}},{key:"addEmbedVideoContent",value:function(){if(this.item.mime_type){var e=this.item.mime_type.split("/")[1];if(!e)return;this.view.classList.add("video-play");var t=this.item.videoId,i=this.delegate;switch(i.onYtStatusChange(void 0),e){case"youtube":if(void 0===window.YT){var s=document.createElement("script");s.src="https://www.youtube.com/iframe_api";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(s,a)}this.subContentHolder.innerHTML='
',window.YT?new YT.Player(t,{videoId:t,playerVars:{autoplay:1,frameborder:0,rel:0},events:{onReady:function(e){i.onYtStatusChange("onReady")},onStateChange:function(e){i.onYtStatusChange(e.data)}}}):window.onYouTubeIframeAPIReady=function(){new YT.Player(t,{videoId:t,playerVars:{autoplay:1,frameborder:0,rel:0},events:{onReady:function(e){i.onYtStatusChange("onReady")},onStateChange:function(e){i.onYtStatusChange(e.data)}}})};break;case"vimeo":this.subContentHolder.innerHTML=n.a.vimeoCode.replace("%id%",this.item.videoId)}this.isEmbedContent=!0}}},{key:"removeEmbedVideoContent",value:function(){this.isEmbedContent&&(this.subContentHolder.innerHTML=new c(this.iconSet.PLAY_SVG).innerHTML,this.subContentHolder.getElementsByTagName("svg")[0].style.marginLeft="7px",this.isEmbedContent=!1,this.view.classList.remove("video-play"),this.view.classList.add("info-icon"),this.delegate.onYtStatusChange(void 0))}},{key:"fadePrep",value:function(){this.itemInner.style.animationName=null}},{key:"fadeIn",value:function(){var e=this;this.itemInner.style.animationName="pgc-rev-fade-in",this.fadeAnimClear=setTimeout((function(){e.fadePrep()}),600)}}],[{key:"classPref",get:function(){var e=a.a.classPrefPage;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}}]),e}(),u=function(){function e(t,i){o(this,e),this.iconSet=e.ICONS,this.config=e.CONFIG,n.a.copyProperties(i,this.config),this.appSet=t,this.appName=t.appName,this.cacherItemsList=this.appSet.cacheItemsList,this.id="".concat(this.appName,"_vitSlider_"),this.itemsList=void 0,this.visibleBounds=n.a.Rect(0,0,0,0),this.isControllsShow=!1,this.isZooming=!1,this.needHideControlls=!1,this.naviButtonsStatus=void 0,this.firsrTap=void 0,this.removing=!1,this.createlayoutDelay=void 0,this.intitByTermDelay=void 0,this.view=document.createElement("div"),this.view.className="".concat(e.classPref,"view"),this.view.id="".concat(this.id,"main"),this.resizeDelay=void 0,this.size=n.a.Size(0,0);var s=document.createElement("div");s.className="".concat(e.classPref,"bg"),this.config.sl_backgroundColor&&(this.background=s,this.background.style.backgroundColor=this.config.sl_backgroundColor,this.view.appendChild(s)),this.config.sl_audioPlayer&&this.config.sl_audioPlayer.pause(),this.sliderPages=[],this.draggingPr=!1,this.zoomingDrag=!1,this.speedX=0,this.speedY=0,this.scrollViewTranslateXPr=0,this.scrollViewTranslateYPr=0,this.startDragHandler=void 0,this.currentItemIndex=void 0,this.startItemIndex=0,this.items=[],this.itemsAmount=0,this.itemNumPr=void 0,this.pageInFocus=void 0,this.pageInFocusPrev=void 0,this.zoomingPage=void 0,this.videoVolume=void 0,this.FF_Mode=!1,this.mouseWheelMode=!1,this.animaSliderRender=void 0,this.slider=document.createElement("div"),this.slider.className="".concat(e.classPref,"wrap"),this.view.appendChild(this.slider),this.autoStartActionDelay=void 0,this._ytStatus=void 0}return l(e,[{key:"onYtStatusChange",value:function(t){this._ytStatus=t,this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.YT_ON_CHANGE_STATUS,this,{status:t,itemIndex:this.itemIndex}))}},{key:"ytStatus",get:function(){return this._ytStatus}},{key:"dragging",get:function(){return this.draggingPr},set:function(e){e?this.view.classList.add("isDragging"):this.view.classList.remove("isDragging"),this.draggingPr=e}},{key:"viewOfsetY",get:function(){return this.view.getBoundingClientRect().top+n.a.pageYOffset}},{key:"viewOfsetX",get:function(){return this.view.getBoundingClientRect().left+n.a.pageXOffset}},{key:"copyRight",value:function(){var t,i=this;return function(s){if(!n.a.Device.ios||"mouseup"!==s.type){var a,o;s.changedTouches&&s.changedTouches[0]?(a=s.changedTouches[0].pageX,o=s.changedTouches[0].pageY):(a=s.pageX,o=s.pageY),a-=i.viewOfsetX,o-=i.viewOfsetY;var r=i.itemsList[i.itemIndex];if(r.webView&&r.webView===s.target||s.target.className&&"pgc-rev-slider-page-sub-content-holder"===s.target.className||s.target.className&&("lb-video-content"===s.target.className||"lb-audio-content"===s.target.className)){s.preventDefault();var l=document.getElementById("gm_copyr");l&&(clearTimeout(t),l.parentNode.removeChild(l),l=null),(l=document.createElement("div")).id="gm_copyr",l.className="".concat(e.classPref,"hints"),l.innerHTML=r.user&&r.user.displayname?"Hey, this photo is ©".concat(r.user.displayname):i.config.sl_copyR_Alert,r.copyright&&""!==r.copyright&&(l.innerHTML=r.copyright),l.style.top="".concat(o,"px"),l.style.left="".concat(a,"px"),i.view.appendChild(l),t=setTimeout((function(){l.parentNode.removeChild(l)}),1e3)}}}}},{key:"initByStage",value:function(e){e.appendChild(this.view),this.config.sl_copyR_Proptection&&(this.copyR=this.copyRight(),document.addEventListener("contextmenu",this.copyR,!1)),this.createControlls()}},{key:"addToStage",value:function(){var t=this,i=document.getElementsByTagName("body")[0];this.view.style.zIndex=n.a.findHighestZIndex(i)+1,n.a.disableBodyScrollSlider(),this.config.sl_copyR_Proptection&&document.addEventListener("contextmenu",t.copyR,!1),i.appendChild(this.view),setTimeout((function(){t.view.classList.add("".concat(e.classPref,"activate"))}),30)}},{key:"initByList",value:function(e,t){if(e&&e.length>0){var i=this;this.currentItemIndex=t&&0!==t?0:void 0,this.startItemIndex=t||0,this.itemsList=e,this.createlayoutDelay=setTimeout((function(){i.createLayout()}),100)}}},{key:"prepareToRemove",value:function(){this.removing||(clearTimeout(this.createlayoutDelay),clearTimeout(this.intitByTermDelay),this.removing=!0,this.cacherItemsList.init(),this.appSet.appEventManager.removeGMEventListener(e.EVENTS.COLLECTION_DATA_REDY,this,"dataLoaded"),this.view.removeEventListener("wheel",this.handlerMWheel,!1),this.config.sl_copyR_Proptection&&document.removeEventListener("contextmenu",this.copyR,!1),this.config.sl_audioPlayer&&this.config.sl_audioPlayer.pause(),this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.REMOVE_LIGHTBOX,this,{})))}},{key:"remoteControl",value:function(t){if(this.startDragHandler||"esc"===t)switch(t){case"prev":this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{draging:!0})),this.gotoPrev();break;case"next":this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{draging:!0})),this.gotoNext();break;case"enter":case"space":this.firstClick(n.a.Point(this.view.clientWidth/2,this.view.clientHeight/2),t);break;case"esc":this.prepareToRemove();break;case"zoom":this.zoomSwitch()}}},{key:"showPreloader",value:function(e){var t;if(e){if(document.getElementById("".concat(this.appName,"slider_preloader")))return;(t=n.a.createPreloaderView(this.config.sl_preloaderColor)).id="".concat(this.appName,"slider_preloader"),this.view.appendChild(t)}else(t=document.getElementById("".concat(this.appName,"slider_preloader")))&&n.a.fadeOut(t,(function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),500)}},{key:"createLayout",value:function(){var t=this;this.itemsAmount=this.itemsList.length,this.size=n.a.Size(this.view.clientWidth,this.view.clientHeight),n.a.miniScreen&&this.slider.classList.add("miniScreen"),this.size.width<500&&(this.prevButton.classList.add("next-prev-button-mini-screen"),this.nextButton.classList.add("next-prev-button-mini-screen")),this.initSlider(),this.size.height<700&&this.slider.classList.add("miniScreen"),this.view.addEventListener("wheel",this.mouseWheelHandler(),!1),setTimeout((function(){t.showControlls(!0),t.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,t,{status:"ready"}))}),500)}},{key:"itemIndex",get:function(){return this.itemNumPr},set:function(e){this.itemNumPr=e,this.updateControlls()}},{key:"pageConstructor",get:function(){return new d(this)}},{key:"initSlider",value:function(){var e,t=0;if(0===this.sliderPages.length)for(t=0;t<3;t+=1)e=this.pageConstructor,this.slider.appendChild(e.view),this.sliderPages.push(e),e.resize(this.size);var i=this.itemsAmount>2?-1:0;for(t=0;t<3;t+=1)(e=this.sliderPages[t]).posX=i,e.itemIndex=void 0,i+=1;this.startDragHandler?this.gotoPageByNum(0):(this.startDragHandler=this.startDrag(),n.a.isTouchDevice&&(this.slider.addEventListener("touchstart",this.startDragHandler,n.a.passiveListener),window.addEventListener("touchmove",(function(){}),n.a.passiveListener)),this.slider.addEventListener("mousedown",this.startDragHandler,!1),this.gotoPageByNum(this.startItemIndex))}},{key:"scrollViewTranslateY",get:function(){return this.scrollViewTranslateYPr},set:function(e){this.scrollViewTranslateYPr=e,this.slider.style.transform="translate3d(".concat(this.scrollViewTranslateX,"px,").concat(e,"px, 0px)"),0!==e&&this.sliderVerticalRender()}},{key:"scrollViewTranslateX",get:function(){return this.scrollViewTranslateXPr},set:function(e){this.scrollViewTranslateXPr=e,this.slider.style.transform="translate3d(".concat(e,"px,").concat(this.scrollViewTranslateY,"px, 0px)"),!1===this.config.sl_carouselMode&&(e>0||e<-this.size.width*(this.itemsAmount-1))||this.pageRenderByIndex(-Math.round(e/this.size.width))}},{key:"sliderVerticalRender",value:function(){var t=1-Math.abs(this.scrollViewTranslateY)/(this.size.height/2);this.background&&(this.background.style.opacity=t),this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{backgroundOpacity:t})),this.needHideControlls||(t<.8?(this.showHideNaviButton("hide"),this.showControlls(!1)):(this.showHideNaviButton("show"),this.showControlls(!0)))}},{key:"tryOpenItemID",value:function(e){for(var t=0;t=0?i-1:2,s=i+1<3?i+1:0,a=[n,i,s],o=[e-1,e,e+1];for(t=0;t=i.index)&&this.cacherItemsList.init(this.itemsList,this.itemIndex,5),this.config.sl_video_auto_start&&(clearTimeout(this.autoStartActionDelay),this.pageInFocus.item&&"video"===this.pageInFocus.item.type&&this.videoAutoStarted!==this.pageInFocus.item.id&&(this.videoAutoStarted=this.pageInFocus.item.id,!1===this.pageInFocus.vieoContentReady?this.pageInFocus.vieoContentReadyAction=function(){t.firstClick(n.a.Point(t.view.clientWidth/2,t.view.clientHeight/2),"space")}:this.autoStartActionDelay=setTimeout((function(){t.firstClick(n.a.Point(t.view.clientWidth/2,t.view.clientHeight/2),"space")}),600))),void 0!==this.pageInFocusPrev&&this.pageInFocusPrev.action("removeSubContent"),void 0!==this.zoomingPage&&this.zoomingPage!==this.pageInFocus&&this.zoomingPage.normalize()}}},{key:"mouseWheelHandler",value:function(){var t,i=this,s=0,a=0,o=Date.now(),r=[],l=[],h=400,c=0;return i.handlerMWheel=function(d){if(d.stopPropagation(),d.preventDefault(),!1!==i.mouseWheelMode||!1!==i.config.sl_mouseWheelPagination){var u=n.a.Point(0,0);if("deltaX"in d)1===d.deltaMode?(u.x=18*d.deltaX,u.y=18*d.deltaY):(u.x=d.deltaX,u.y=d.deltaY);else if("wheelDelta"in d)d.wheelDeltaX&&(u.x=-.16*d.wheelDeltaX),d.wheelDeltaY?u.y=-.16*d.wheelDeltaY:u.y=-.16*d.wheelDelta;else{if(!("detail"in d))return;u.y=d.detail}if(i.config.sl_mouseWheelPagination){var m=Math.abs(u.y)>Math.abs(u.x)?u.y:u.x,g=Date.now();0===r.length&&r.push(g),g-r[0]0&&l[l.length-1]!==m&&(c+=1),l.push(m),r.push(g)):(h=c>3?1100:500,l=[],r=[],c=0),g-o>h&&(m>0?i.gotoNext():i.gotoPrev(),i.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,i,{draging:!0})),o=g)}else{var v=i.size.width/2,p=i.size.height/2;if(d.pageX&&(v=d.pageX,p=d.pageY),v-=i.viewOfsetX,p-=i.viewOfsetY,i.dragging)return;t!==i.pageInFocus&&(t=void 0),i.zoomingPage&&i.zoomingPage!==i.pageInFocus&&(i.zoomingPage.normalize(),i.zoomingPage=void 0),t?i.showControlls(!i.needHideControlls):(t=i.pageInFocus,i.zoomingPage=i.pageInFocus,t.isInScale||(i.needHideControlls=!i.isControllsShow)),v===s&&p===a||(t.startDrag(n.a.Point(v,p)),s=v,a=p),i.zoomControll(),t.zoomByScaleIter(u.y,n.a.Point(v,p)),t.isInScale?i.showControlls(!1):t=void 0}}},i.handlerMWheel}},{key:"zoomSwitch",value:function(){var e=n.a.Point(this.view.clientWidth/2,this.view.clientHeight/2);this.secondClick(e)}},{key:"isZoom",get:function(){return!!this.pageInFocus&&this.pageInFocus.isInScale}},{key:"fitMode",value:function(e){this.config.sl_fit&&(this.FF_Mode=e);for(var t=0;t1?d.config.sl_zoom&&(l=!0,t=e.touches[0].pageX,h=e.touches[0].pageY,c=e.touches[1].pageX,f=e.touches[1].pageY,w=Math.hypot(t-c,h-f),t+=(c-t)/2,h+=(f-h)/2):(l=!1,t=e.touches[0].pageX,h=e.touches[0].pageY):(t=e.pageX,h=e.pageY),t-=m,h-=u,!(n.a.Device.ios&&i<=20)){var b,y;if(void 0===r)h===s?r=!1:(b=180*Math.atan2(Math.abs(h-s),Math.abs(t-i))/Math.PI,r=b>45);if(!d.dragging&&d.zoomingPage){e.preventDefault();var S=Math.abs(i-t)>4?i-t:0,C=Math.abs(s-h)>4?s-h:0;return(S||C)&&(d.zoomingDrag=!0),void(l?d.pageInFocus.zoomByScaleDeltaToPoint(w,n.a.Point(S,C),n.a.Point(t,h)):d.zoomingPage&&d.zoomingPage.dragin(n.a.Point(S,C)))}e.preventDefault(),r?(g=0,(y=Math.abs(s-h)>4?s-h:0)&&(d.dragging=!0),d.config.sl_canRemoved&&(d.scrollViewTranslateY=o-y)):(d.transition=!0,(y=Math.abs(i-t)>4?i-t:0)&&(d.dragging=!0),d.scrollViewTranslateX=a-y,v=p,p=d.scrollViewTranslateX,g=p-v)}}function w(e){if(r=void 0,n.a.isTouchDevice&&(document.removeEventListener("touchmove",f,n.a.passiveListener),document.removeEventListener("touchend",w,n.a.passiveListener)),document.removeEventListener("mousemove",f,!1),document.removeEventListener("mouseup",w,!1),document.removeEventListener("contextmenu",w,!1),d.dragging||l||d.zoomingDrag){if(d.zoomingPage&&(d.zoomingPage.stopDrag(),l=!1),!d.zoomingPage)if(Math.abs(d.scrollViewTranslateY)<4){var i=d.currentItemIndex,s=n.a.isTouchDevice?7:1;Math.abs(g)>s&&t===d.currentItemIndex&&(i=g>0?i-1:i+1),d.speedX=g,d.scrollViewTranslateY=0,d.gotoPageByIndex(i,!0)}else{var a=d.scrollViewTranslateY/(d.size.height/2);Math.abs(a)>.2?d.prepareToRemove():d.renderTransformTo(n.a.Point(d.scrollViewTranslateX,0))}this.dragging=!1}else d.doubleClickController(e);d.zoomingDrag=!1,c=e.type}return function(r){var b,y,S,C;"mousedown"===r.type&&"touchend"===c||(d.zoomingPage=d.pageInFocus.isInScale?d.pageInFocus:void 0,n.a.cancelAnimationFrame(d.animaSliderRender),t=d.currentItemIndex,r.originalEvent&&(r=r.originalEvent),n.a.isTouchDevice||r.preventDefault(),r.button&&0!==r.button||(r.touches?!d.dragging&&r.touches.length>1?(l=!0,b=r.touches[0].pageX,y=r.touches[0].pageY,S=r.touches[1].pageX,C=r.touches[1].pageY,h=Math.hypot(b-S,y-C),b+=(S-b)/2,y+=(C-y)/2,d.zoomingPage=d.pageInFocus,d.needHideControlls=d.isControllsShow,d.showControlls(!1)):(b=r.touches[0].pageX,y=r.touches[0].pageY):(b=r.pageX,y=r.pageY),b-=m,y-=u,d.speedX=0,d.speedY=0,g=0,v=0,p=d.scrollViewTranslateX,i=b,s=y,a=d.scrollViewTranslateX,o=d.scrollViewTranslateY,d.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,d,{draging:!0})),d.zoomingPage&&d.zoomingPage.startDrag(n.a.Point(i,s),h),n.a.isTouchDevice&&(document.addEventListener("touchmove",f,n.a.passiveListener),document.addEventListener("touchend",w,n.a.passiveListener)),document.addEventListener("mousemove",f,!1),document.addEventListener("mouseup",w,!1),document.addEventListener("contextmenu",w,!1)))}}},{key:"createControlls",value:function(){var t=this;function i(e){e.style.backgroundColor=t.config.sl_navigationColorOver,e.childNodes[0].style.fill=t.config.sl_navigationIconColorOver}function s(e){e.style.backgroundColor=t.config.sl_navigationColor,e.childNodes[0].style.fill=t.config.sl_navigationIconColor}this.prevButton=document.createElement("div"),this.prevButton.className="".concat(e.classPref,"next-prev-button"),this.prevButton.style.left="".concat(0,"px"),this.prevButton.style.transform="translate(-150%, -50%)",this.prevButton.style.backgroundColor=t.config.sl_navigationColor,this.prevButton.style.visibility="hidden",this.prevButton.innerHTML=n.a.ICONS.PREV_ARR,this.prevButton.childNodes[0].style.fill=t.config.sl_navigationIconColor,this.prevButton.onmouseenter=function(){i(this)},this.prevButton.onmouseleave=function(){s(this)},this.prevButton.onclick=function(){t.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,t,{draging:!0})),t.gotoPrev(),n.a.Device.desktop||s(this)},this.view.appendChild(this.prevButton),this.nextButton=document.createElement("div"),this.nextButton.className="".concat(e.classPref,"next-prev-button"),this.nextButton.style.backgroundColor=t.config.sl_navigationColor,this.nextButton.style.right="0px",this.nextButton.style.transform="translate(150%, -50%)",this.nextButton.style.visibility="hidden",this.nextButton.innerHTML=n.a.ICONS.NEXT_ARR,this.nextButton.childNodes[0].style.fill=t.config.sl_navigationIconColor,this.nextButton.onmouseenter=function(){i(this)},this.nextButton.onmouseleave=function(){s(this)},this.nextButton.onclick=function(){t.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,t,{draging:!0})),t.gotoNext(),n.a.Device.desktop||s(this)},this.view.appendChild(this.nextButton)}},{key:"switchShowControlls",value:function(){this.showControlls(!this.isControllsShow)}},{key:"showHideNaviButton",value:function(e){if(this.naviButtonsStatus!==e){switch(e){case"show":if(this.isZoom)return;this.prevButton.style.transform="translate(0%, -50%)",this.nextButton.style.transform="translate(0%, -50%)";break;case"hide":this.prevButton.style.transform="translate(-150%, -50%)",this.nextButton.style.transform="translate(150%, -50%)"}this.naviButtonsStatus=e}}},{key:"zoomControll",value:function(){this.isZooming!==this.isZoom&&(this.isZooming=this.isZoom,this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{zoom:this.isZoom?"zoomIn":"zoomOut"})),this.isZoom?this.showHideNaviButton("hide"):this.showHideNaviButton("show"))}},{key:"showControlls",value:function(t){this.zoomControll(),this.isControllsShow!==t&&(t?(this.slider.classList.add("pgc-show-controls"),this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{controls:"show"})),this.showHideNaviButton("show")):(this.slider.classList.remove("pgc-show-controls"),this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{controls:"hide"})),n.a.miniScreen&&this.showHideNaviButton("hide")),this.isControllsShow=t)}},{key:"updateControlls",value:function(){this.itemsAmount<3||!1===this.config.sl_carouselMode?(0===this.itemIndex?this.prevButton.style.visibility="hidden":this.prevButton.style.visibility="visible",this.itemIndex===this.itemsAmount-1?this.nextButton.style.visibility="hidden":this.nextButton.style.visibility="visible",1===this.itemsAmount&&(this.prevButton.style.visibility="hidden",this.nextButton.style.visibility="hidden")):(this.prevButton.style.visibility="visible",this.nextButton.style.visibility="visible");var t=this.itemsList[this.itemIndex];t&&this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.UPDATE_CONTROLS,this,{item:t,itemIndex:this.itemIndex}))}},{key:"resizeHandler",value:function(e){var t=this;this.resizeDelay&&clearTimeout(this.resizeDelay),n.a.cancelAnimationFrame(this.animaSliderRender),this.resizeDelay=setTimeout((function(){if(t.size=e,t.size.width<500?(t.prevButton.classList.add("next-prev-button-mini-screen"),t.nextButton.classList.add("next-prev-button-mini-screen")):(t.prevButton.classList.remove("next-prev-button-mini-screen"),t.nextButton.classList.remove("next-prev-button-mini-screen")),0!==t.sliderPages.length){for(var i=0;i',NOTE_SVG:''}}},{key:"EVENTS",get:function(){return{COLLECTION_DATA_REDY:"COLLECTION_DATA_REDY",UPDATE_CONTROLS:"UPDATE_CONTROLS",YT_ON_CHANGE_STATUS:"YT_ON_CHANGE_STATUS",ZOOM:"ZOOM",REMOVE_LIGHTBOX:"REMOVE_LIGHTBOX"}}},{key:"CONFIG",get:function(){return{sl_preloaderColor:"#494949",sl_backgroundColor:"rgba(0,0,0,1)",sl_navigationIconColor:"rgba(255,255,255,1)",sl_navigationIconColorOver:"rgba(0,0,0,0.8)",sl_navigationColor:"rgba(0,0,0,0.8)",sl_navigationColorOver:"rgba(255,255,255,1)",sl_zoom:!1,sl_mouseWheel:!1,sl_fit:!1,sl_xOffset:2,sl_yOffset:0,sl_canRemoved:!1,sl_copyR_Alert:"Hello, this photo is mine!",sl_copyR_Proptection:!0,sl_audioPlayer:void 0,sl_mouseWheelPagination:!1,sl_next_prev_animation:!1,sl_video_auto_start:!1,sl_video_loop:!1,sl_carouselMode:!0,sl_FullSizeViewMode:!1}}}]),e}()},30:function(e,t,i){e.exports={classPref:'".sgb-share-bar-light"'}},5:function(e,t,i){"use strict";var n=i(0),s=i(15),a=i.n(s);function o(e,t){for(var i=0;i0,i.hasNextPage=this.scrollWidth-a-this.width>.5),this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.SCR_ACTION,this,i))}},{key:"currentPage",value:function(){var t=this.pages,i=this.width,s=this.view.scrollLeft,a=this.scrollWidth-s-i,o=s%i,r=Math.ceil(s/i)===t-1?this.lastPageWidth:i;this.nextPagePart=o/r;var l=Math.round(Math.floor(s/i)+this.nextPagePart),h=-(this.rPosX-s)/Math.abs(this.rPosX-s);return h&&this.scrollDirection!==h&&(this.scrollDirection=h,this.updateControls()),this.currentPagePr===l&&0!==a&&0!==s||(this.currentPagePr=l,this.updateControls()),this.rPosX=s,this.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.SCR_SCROLL,this,{scroll:s,scrollDirection:this.scrollDirection})),l}},{key:"gotoNext",value:function(){var e=this.currentPage(),t=this.nextPagePart>=.5&&!this.renderingX?e:e+1;this.gotoPageByIndex(t)}},{key:"gotoPrev",value:function(){var e=this.currentPage(),t=0!==this.nextPagePart&&this.nextPagePart<=.5&&!this.renderingX?e:e-1;this.gotoPageByIndex(t)}},{key:"gotoPageByIndex",value:function(e,t){var i=this.pages;this.internalControll=!1,e=Math.min(e,i-1);var n=(e=Math.max(e,0))*this.width;t?this.scrollLeft=n:this.scrollLeftAnime=n,this.currentPageIndex=e,this.updateControls(e)}},{key:"scrollLeftAnime",set:function(e){var t=this;this.accelX=Math.max(e,0),this.accelX=Math.min(e,this.scrollWidth-this.width);var i=this.view.scrollLeft,n=0,s=.05+.05*Math.abs(this.accelX-i)/1e3;s=Math.min(.9,s),this.renderingX=!0,this.scrollAnimInterval||(this.scrollAnimInterval=setInterval((function(){n=(t.accelX-i)*s,i+=n,t.view.scrollLeft=i,Math.abs(i-t.accelX)<=1&&(t.view.scrollLeft=t.accelX,t.renderingX=!1,t.updateControls(),clearInterval(t.scrollAnimInterval),t.scrollAnimInterval=void 0)}),17))}},{key:"scrollHandler",value:function(){var e=this;return this.scrHandler=function(){e.internalControll&&(clearInterval(e.scrollAnimInterval),e.scrollAnimInterval=void 0),e.currentPage()},this.scrHandler}},{key:"scrollLeft",get:function(){return this.view.scrollLeft},set:function(e){this.scrollAnimInterval&&(clearInterval(this.scrollAnimInterval),this.scrollAnimInterval=void 0),this.view.scrollLeft=e}},{key:"startDrag",value:function(){var t,i,s,a,o=this,r=0,l=0,h=0;function c(e){var n,c=e.pageX,d=e.pageY;if(void 0===a&&(d===i?a=!1:(n=180*Math.atan2(Math.abs(d-i),Math.abs(c-t))/Math.PI,a=n>45)),a)o.dragging=!0;else{e.preventDefault();var u=t-c;Math.abs(u)>4&&(o.dragging=!0),o.view.scrollLeft=s+u,l=h,h=o.view.scrollLeft,r=1*(h-l)}}function d(){document.removeEventListener("mousemove",c,!1),document.removeEventListener("mouseup",d,!1),o.config.scrh_smooth_dragin&&0!==r?(o.scrollAnimInterval=setInterval((function(){r*=.9,o.view.scrollLeft+=r,o.accelX=o.view.scrollLeft,o.renderingX=!0,Math.abs(r)<.1&&(o.renderingX=!1,clearInterval(o.scrollAnimInterval),o.updateControls(),o.scrollAnimInterval=void 0)}),17),o.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.SCR_ACTION,o,{dragging:!1})),o.dragging=!1):(o.renderingX=!1,o.updateControls(),o.dragging=!1,o.appSet.appEventManager.dispatchGMEvent(n.a.GMEvent(e.EVENTS.SCR_ACTION,o,{dragging:!1})))}return function(e){e.preventDefault(),clearInterval(o.scrollAnimInterval),o.scrollAnimInterval=void 0,r=0,a=void 0;var n=e.pageX,l=e.pageY;t=n,i=l,s=o.view.scrollLeft,document.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",d,!1)}}},{key:"resizeHandler",value:function(){if(this.viewWidth!==this.width){clearInterval(this.scrollAnimInterval),this.scrollAnimInterval=void 0;var e=this.pages;this.viewWidth=this.width;var t=(this.currentPageIndex+1)/e;this.calculateScroll();var i=Math.round(t*e)-1;this.gotoPageByIndex(0===this.currentPageIndex?0:i)}}},{key:"remove",value:function(){clearInterval(this.scrollAnimInterval),this.view.removeEventListener("scroll",this.scrHandler),this.view.removeEventListener("mouseup",this.msHandler,!1),this.view.removeEventListener("touchstart",this.msHandler,!1),this.view.removeEventListener("touchend",this.msHandler,!1)}}])&&o(t.prototype,i),s&&o(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.a=r},62:function(e,t,i){"use strict";i.r(t);var n=i(9),s=i(28),a=i(1),o=i(30),r=i.n(o);function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function h(e){for(var t=1;t\n \n \n \n \n \n \n ');this.view=document.createElement("div"),this.view.className="".concat(e.classPref,"wrap"),this.view.innerHTML=n,this.bar=this.view.getElementsByClassName("".concat(e.classPref,"progress-radial-bar"))[0],this.bar.style.fill=this.config.ap_autoPlayColor,this.view.getElementsByClassName("".concat(e.classPref,"progress-radial-track"))[0].style.fill=this.config.ap_autoPlayBgColor,this.animRatio=25,this.counter=0,this.durationCount=25*this.config.ap_slideshowDelay,this.interval=void 0,this.anPart=0,this.status=void 0}return d(e,[{key:"drawProgress",value:function(t){if(!isNaN(t)){t=e.clamp(parseFloat(t),0,1);var i=e.clamp(360*t,0,359.99999),n=i*Math.PI/180,s=51*Math.sin(n),a=-51*Math.cos(n),o=i>180?1:0,r="M 0 0 v -%@ A %@ %@ 1 ".replace(/%@/gi,51),l="".concat(r+o," 1 ").concat(s," ").concat(a," z");this.bar.setAttribute("d",l)}}},{key:"switch",value:function(){"play"===this.status?this.clear():this.start()}},{key:"start",value:function(){var t=this;this.view.style.opacity=1;var i=1/this.durationCount;this.interval=setInterval((function(){t.counter+=1,t.counter>=t.durationCount&&(clearInterval(t.interval),t.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.NEXT_SLIDE,t,{})),t.counter=0,t.start()),t.drawProgress(i*t.counter)}),1e3/this.animRatio),"play"!==this.status&&(this.status="play",t.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.PLAY,t,{status:this.status})))}},{key:"pause",value:function(){clearInterval(this.interval),this.status="pause"}},{key:"clear",value:function(){clearInterval(this.interval),this.counter=0,this.drawProgress(0),this.view.style.opacity=0,this.status="stop",this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.PLAY,this,{status:this.status}))}}],[{key:"classPref",get:function(){var e=l.a.classPrefAPlay;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}},{key:"CONFIG",get:function(){return{ap_autoPlayBgColor:"rgba(255,255,255, 0.3)",ap_autoPlayColor:"rgba(255,255,255, 1)",ap_slideshowDelay:8}}},{key:"EVENTS",get:function(){return{NEXT_SLIDE:"NEXT_SLIDE",PLAY:"PLAY"}}},{key:"clamp",value:function(e,t,i){return Math.max(t,Math.min(i,e))}}]),e}(),m=function(){function e(t,i){h(this,e),this.appSet=t,this.config=e.CONFIG,o.a.copyProperties(i,this.config),this.appName=t.appName,this.headerFooterStatus=void 0,this.headerStatus=void 0,this.mouseMovingTimer=void 0,this.resizeDelay=void 0,this.size=o.a.Size(0,0),this.view=document.createElement("div"),this.view.className="".concat(e.classPref,"view"),this.view.id="".concat(this.appName,"_lightbox"),o.a.Device.desktop||(this.view.style.height="100%");var r=document.createElement("div");r.className="".concat(e.classPref,"bg"),this.background=r,this.backgroundOpacity=1,this.background.style.backgroundColor=this.config.lb_backgroundColor,this.view.appendChild(r),this.content=document.createElement("div"),this.content.className="".concat(e.classPref,"content");var l=a.a.CONFIG;l.sl_backgroundColor=!1,l.sl_preloaderColor=this.config.lb_preloaderColor,l.sl_FullSizeViewMode=this.config.lb_FullSizeViewMode,l.sl_navigationColor=this.config.lb_sliderNavigationColor,l.sl_navigationIconColor=this.config.lb_sliderNavigationIconColor,l.sl_navigationColorOver=this.config.lb_sliderNavigationColorOver,l.sl_navigationIconColorOver=this.config.lb_sliderNavigationIconColorOver,l.sl_fit=!0;var c=this.config.lb_thumbBarEnable?60:this.config.lb_headerFooterHeight;l.sl_yOffset=o.a.miniScreen?0:c,l.sl_canRemoved=!0,l.sl_copyR_Alert=this.config.lb_copyR_Alert,l.sl_copyR_Proptection=this.config.lb_copyR_Proptection,l.sl_zoom=this.config.lb_zoom,l.sl_mouseWheel=this.config.lb_zoom,l.sl_audioPlayer=this.config.lb_audioPlayer,l.sl_mouseWheelPagination=this.config.lb_scrollNavi,l.sl_next_prev_animation=this.config.lb_sliderNextPrevAnimation,l.sl_video_auto_start=this.config.lb_videoAutoStart,l.sl_video_loop=this.config.lb_videoLoop,this.appSet.appEventManager.addGMEventListener(a.a.EVENTS.UPDATE_CONTROLS,this,"updateViewControls"),this.appSet.appEventManager.addGMEventListener(a.a.EVENTS.YT_ON_CHANGE_STATUS,this,"updateYTstatus"),this.appSet.appEventManager.addGMEventListener(a.a.EVENTS.REMOVE_LIGHTBOX,this,"prepareToRemove"),this.appSet.appEventManager.addGMEventListener(u.EVENTS.PLAY,this,"slideShowSwitchHandler"),this.appSet.appEventManager.addGMEventListener(u.EVENTS.NEXT_SLIDE,this,"slideshowHandler"),this.appSet.appEventManager.addGMEventListener(s.a.EVENTS.ITEMS_SCROLL_BAR_ITEM_ACTION,this,"scrollBarHandler"),this.slider=new a.a(this.appSet,l),this.slider.initByStage(this.content),this.slider.mouseWheelMode=this.config.lb_zoom,this.view.appendChild(this.content),this.header=document.createElement("div"),this.header.className="".concat(e.classPref,"header"),this.header.style.backgroundImage="linear-gradient(0deg,rgba(0,0,0,0),".concat(this.config.lb_headerFooterColor,")"),e.isMobileMode&&this.header.classList.add("".concat(e.classPref,"touch-device")),this.view.appendChild(this.header),this.footer=document.createElement("div"),this.footer.className="".concat(e.classPref,"footer"),this.footer.style.minHeight="".concat(c,"px"),e.isMobileMode&&this.footer.classList.add("".concat(e.classPref,"touch-device")),o.a.miniScreen&&(this.footer.style.backgroundImage="linear-gradient(0deg,".concat(this.config.lb_headerFooterColor,",rgba(0,0,0,0))")),this.view.appendChild(this.footer),this.infoBar1=document.createElement("div"),this.infoBar1.className="".concat(e.classPref,"info-wrap"),this.header.appendChild(this.infoBar1),this.config.lb_itemTitleEnable&&(this.itemTitle=document.createElement("div"),this.itemTitle.className="".concat(e.classPref,"item-title"),this.itemTitle.style.fontSize=e.isMobileMode?"".concat(16,"px"):"".concat(this.config.lb_itemTitleFontSize,"px"),e.isMobileMode&&(this.itemTitle.style.lineHeight="".concat(16,"px"),this.itemTitle.style.transform="translateY(6px)"),this.itemTitle.style.color=this.config.lb_itemTitleTextColor,this.infoBar1.appendChild(this.itemTitle));var d=document.createElement("div");d.className=this.config.lb_itemTitleEnable?"".concat(e.classPref,"caption-wrap"):"".concat(e.classPref,"caption-wrap-nt"),d.classList.add("mini-screen"),d.style.color=this.config.lb_itemCounterColor,!this.config.lb_thumbBarEnable&&e.isMobileMode,this.item_current_info=document.createElement("div"),this.item_current_info.className="".concat(e.classPref,"caption-current"),d.appendChild(this.item_current_info);var m=document.createElement("div");m.className="".concat(e.classPref,"caption-delimiter"),m.style.opacity=.7,this.config.lb_itemTitleEnable?m.textContent="/":m.style.backgroundColor=this.config.lb_itemCounterColor,d.appendChild(m),this.items_amount_info=document.createElement("div"),this.items_amount_info.className="".concat(e.classPref,"caption-all"),d.appendChild(this.items_amount_info),!1===this.config.lb_itemCounterEnable&&(d.style.display="none"),this.counter=d;var g=document.createElement("div");if(g.className="".concat(e.classPref,"caption-play-wrap"),g.appendChild(d),this.infoBar1.appendChild(g),this.config.lb_thumbBarEnable){var v=s.a.CONFIG;v.isb_itemBgColor=this.config.lb_thumbBarHoverColor,v.isb_block_pan_y=!0,this.thumbsBar=new s.a(this.appSet,v),this.footer.appendChild(this.thumbsBar.view),e.isMobileMode&&this.footer.appendChild(g)}else this.footer.appendChild(g);if(o.a.Device.desktop&&this.config.lb_slideshowEneble){var p=u.CONFIG;p.ap_autoPlayBgColor=this.config.lb_slideshowIndicatorColorBg,p.ap_autoPlayColor=this.config.lb_slideshowIndicatorColor,p.ap_slideshowDelay=this.config.lb_slideshowTimer,this.autoPlay=new u(this,p),g.appendChild(this.autoPlay.view)}var f=document.createElement("div");e.isMobileMode&&(f.style.width="100%"),f.className="".concat(e.classPref,"free-space"),this.header.appendChild(f),this.itemMenuWrap=document.createElement("div"),this.itemMenuWrap.className="".concat(e.classPref,"item-menu-wrap"),this.header.appendChild(this.itemMenuWrap);var w=n.a.CONFIG;w.im_link=!0,w.im_play=o.a.Device.desktop&&this.config.lb_slideshowEneble,w.im_zoom=o.a.Device.desktop&&this.config.lb_zoom,w.im_discuss=this.config.lb_discuss,w.im_info=this.config.lb_itemInfoEnable,w.im_share=this.config.lb_itemShare,w.im_download=this.config.lb_itemDownload,w.im_bookmark=this.config.lb_bookmark,w.im_like=this.config.lb_itemLike,w.im_close=!0,w.im_fulscreen=!o.a.Device.ios&&this.config.lb_fullscreen,w.im_backgroundColor=this.config.lb_menuBackgroundColor,w.im_backgroundColorOver=this.config.lb_menuBackgroundColorOver,w.im_iconColor=this.config.lb_menuIconColor,w.im_iconColorOver=this.config.lb_menuIconColorOver,w.im_likesSet=this.config.lb_likesSet,w.im_isContainIdInBookmarkSet=this.config.lb_isContainIdInBookmarkSet,this.itemMenu=new n.a(this.appSet,n.a.MENU_TYPE.LIGHTBOX,w),this.itemMenuWrap.appendChild(this.itemMenu.view),this.appSet.appEventManager.addGMEventListener(n.a.EVENTS.ITEM_MENU_ACTION,this,"itemMenuActionHandler"),this.addToStage()}return d(e,[{key:"itemMenuActionHandler",value:function(t){if(t.target===this.itemMenu){var i=t.params.item,n=t.params.type;if(i&&n){var s,a,r={};switch(r.item=i,n){case"info":r.type="info",this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_NEED_MODAL,this,r)),this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{action:"stop"}));break;case"link":i.link&&window.open(i.link,i.linkTarget?i.linkTarget:this.config.lb_linkTargetWindow);break;case"like":this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_ITEM_ACTION,this,{type:"like",item:i})),this.itemMenu.updateForItem(i);break;case"bookmark":this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_ITEM_ACTION,this,{type:"bookmark",item:i})),this.itemMenu.updateForItem(i);break;case"share":r.type="share",this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_NEED_MODAL,this,r)),this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{action:"stop"}));break;case"zoom":"function"==typeof this.sliderZoomSwitch&&this.sliderZoomSwitch();break;case"close":this.prepareToRemove();break;case"play":this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{}));break;case"download":s=i.url,(a=document.createElement("A")).href=s,a.download=s.substr(s.lastIndexOf("/")+1),document.body.appendChild(a),a.click(),document.body.removeChild(a);break;case"coments":"open"===i.comment_status&&(s="".concat(i.sharelink,"/#comments"),window.open(s,"_self"));break;case"fullscreen":this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_FULLSCREEN_SWITCH,this,{}))}}}}},{key:"sliderZoomSwitch",value:function(){this.slider&&this.slider.remoteControl("zoom")}},{key:"slideShowSwitchHandler",value:function(e){if(this.autoPlay)if(e.params.action)switch(e.params.action){case"play":this.autoPlay.start();break;case"stop":this.autoPlay.clear()}else e.params.status?this.itemMenu&&this.itemMenu.playButtonStatus(e.params.status):this.autoPlay.switch()}},{key:"slideshowHandler",value:function(){this.slider&&(void 0===this.slider.ytStatus||0===this.slider.ytStatus)&&this.slider.gotoNext()}},{key:"scrollBarHandler",value:function(e){if(e.target===this.thumbsBar&&this.slider&&e.params&&e.params.action&&(e.params.index||0===e.params.index))switch(e.params.action){case"click":this.slider.gotoPageByNum(e.params.index)}}},{key:"keydownHandler",value:function(){var e=this;return e.handlerKB=function(t){switch(t.keyCode){case 37:e.slider.remoteControl("prev");break;case 39:case 9:t.stopPropagation(),t.preventDefault(),e.slider.remoteControl("next");break;case 32:o.a.preventDefault(t),e.slider.remoteControl("space");break;case 13:o.a.preventDefault(t),e.slider.remoteControl("enter")}},e.handlerKB}},{key:"addToStage",value:function(){var t=this,i=document.getElementsByTagName("body")[0];this.view.style.zIndex=o.a.findHighestZIndex(i)+1,o.a.disableBodyScrollSlider(),document.addEventListener("keydown",t.keydownHandler(),!0),i.appendChild(this.view),setTimeout((function(){t.view.classList.add("".concat(e.classPref,"activate"))}),30)}},{key:"initByList",value:function(e,t){e&&e.length>0&&(this.currentItemIndex=t&&0!==t?0:void 0,this.startItemIndex=t||0,this.itemsList=e,this.thumbsBar&&this.thumbsBar.initByItemslist(this.itemsList),this.slider.initByList(this.itemsList,this.startItemIndex),this.resizeHandler())}},{key:"prepareToRemove",value:function(){var t=this;if(!this.removing){if(this.removing=!0,this.autoPlay&&this.autoPlay.clear(),this.slider.prepareToRemove(),this.thumbsBar&&this.thumbsBar.prepareToRemove(),this.view.removeChild(this.header),this.view.removeChild(this.content),this.view.removeChild(this.footer),this.background.classList.add("".concat(e.classPref,"deactivate")),this.background.style.opacity="0",document.removeEventListener("keydown",this.handlerKB,!0),document.getElementById("gmediaAudioPlayer"))document.getElementById("gmediaAudioPlayer").pause();this.appSet.appEventManager.removeGMEventListener(n.a.EVENTS.ITEM_MENU_ACTION,this,"itemMenuActionHandler"),this.appSet.appEventManager.removeGMEventListener(a.a.EVENTS.UPDATE_CONTROLS,this,"updateViewControls"),this.appSet.appEventManager.removeGMEventListener(a.a.EVENTS.YT_ON_CHANGE_STATUS,this,"updateYTstatus"),this.appSet.appEventManager.removeGMEventListener(a.a.EVENTS.REMOVE_LIGHTBOX,this,"prepareToRemove"),this.appSet.appEventManager.removeGMEventListener(u.EVENTS.PLAY,this,"slideShowSwitchHandler"),this.appSet.appEventManager.removeGMEventListener(u.EVENTS.NEXT_SLIDE,this,"slideshowHandler"),this.appSet.appEventManager.removeGMEventListener(s.a.EVENTS.ITEMS_SCROLL_BAR_ITEM_ACTION,this,"scrollBarHandler"),setTimeout((function(){o.a.enableBodyScrollSlider(),t.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_REMOVE_LIGHTBOX,t))}),300*this.backgroundOpacity)}}},{key:"mouseMoveHandler",value:function(){var t=this;"hide"===this.headerFooterStatus?(clearTimeout(this.mouseMovingTimer),"show"!==this.headerStatus&&(this.header.classList.add("".concat(e.classPref,"show")),this.headerStatus="show",this.slider&&this.slider.showHideNaviButton("show")),this.mouseMovingTimer=setTimeout((function(){t.header.classList.remove("".concat(e.classPref,"show")),t.slider&&t.slider.showHideNaviButton("hide"),t.headerStatus="hide"}),3e3)):(clearTimeout(this.mouseMovingTimer),"show"!==this.headerStatus&&(this.header.classList.add("".concat(e.classPref,"show")),this.headerStatus="show",this.slider&&this.slider.showHideNaviButton("show")))}},{key:"updateYTstatus",value:function(e){this.slider&&this.config.lb_videoAutoStart&&this.config.lb_tryPlayNext&&e.params&&void 0!==e.params.status&&0===e.params.status&&this.slider.gotoNext()}},{key:"updateViewControls",value:function(t){var i=this;if(t.params.backgroundOpacity&&(this.background.style.opacity=t.params.backgroundOpacity,this.backgroundOpacity=t.params.backgroundOpacity),t.params.draging&&this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{action:"stop"})),t.params.zoom&&(this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{action:"stop"})),this.itemMenu&&this.itemMenu.zoomButtonStatus(t.params.zoom)),t.params.controls)switch(this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(u.EVENTS.PLAY,this,{action:"stop"})),this.headerFooterStatus=t.params.controls,this.mouseMoveHandler(),t.params.controls){case"show":(o.a.miniScreen||this.backgroundOpacity<.9)&&this.header.classList.add("".concat(e.classPref,"show")),this.footer.classList.add("".concat(e.classPref,"show"));break;case"hide":(o.a.miniScreen||this.backgroundOpacity<.9)&&this.header.classList.remove("".concat(e.classPref,"show")),this.footer.classList.remove("".concat(e.classPref,"show"))}if((t.params.itemIndex||0===t.params.itemIndex)&&(this.item_current_info.innerHTML=t.params.itemIndex+1,this.items_amount_info.innerHTML=this.itemsList.length,this.thumbsBar&&this.thumbsBar.selectThumbByIndex(t.params.itemIndex)),t.params.item&&(this.currentItem=t.params.item,this.appSet.appEventManager.dispatchGMEvent(o.a.GMEvent(e.EVENTS.LB_ITEM_ACTION,this,{type:"view",item:this.currentItem,itemIndex:t.params.itemIndex})),this.itemTitle&&(this.itemTitle.innerHTML=t.params.item[this.config.lb_itemTitleSrc]?t.params.item[this.config.lb_itemTitleSrc]:""),this.itemMenu&&this.itemMenu.updateForItem(t.params.item)),t.params.status)switch(t.params.status){case"ready":this.autoPlay&&this.config.lb_slideshowAutoPlay&&!this.startItem&&this.autoPlay.start(),this.view.addEventListener("mousemove",(function(e){i.mouseMoveHandler(e)}),!1)}}},{key:"resizeHandler",value:function(){if(this.view.clientWidth<360?(this.autoPlay&&(this.autoPlay.view.style.display="none"),this.descriptionWrap||this.thumbsBar):this.autoPlay&&(this.autoPlay.view.style.display=null),this.itemMenu&&this.itemMenu.resizeHandler(),this.thumbsBar){var e=this.footer.clientWidth-10;this.thumbsBar.size=o.a.Size(e,0)}this.slider&&this.slider.resizeHandler(o.a.Size(this.view.clientWidth,this.view.clientHeight))}}],[{key:"classPref",get:function(){var e=l.a.classPref;return e.substring(e.lastIndexOf(".")+1,e.lastIndexOf('"'))}},{key:"EVENTS",get:function(){return{LB_NEED_MODAL:"LB_NEED_MODAL",LB_REMOVE_LIGHTBOX:"LB_REMOVE_LIGHTBOX",LB_FULLSCREEN_SWITCH:"LB_FULLSCREEN_SWITCH",LB_ITEM_ACTION:"LB_ITEM_ACTION"}}},{key:"CONFIG",get:function(){return{lb_FullSizeViewMode:!1,lb_scrollNavi:!1,lb_backgroundColor:"rgba(0,0,0,0.8)",lb_preloaderColor:"#494949",lb_headerFooterHeight:40,lb_headerFooterColor:"rgba(0,0,0,1)",lb_sliderNavigationColor:"rgba(0,0,0,0.8)",lb_sliderNavigationIconColor:"rgba(255,255,255,1)",lb_sliderNavigationColorOver:"rgba(255,255,255,1)",lb_sliderNavigationIconColorOver:"rgba(0,0,0,0)",lb_itemCounterEnable:!0,lb_itemCounterColor:"rgba(255,255,255,1)",lb_itemTitleEnable:!0,lb_itemTitleSrc:"title",lb_itemTitleFontSize:18,lb_itemTitleTextColor:"rgba(255,255,255,1)",lb_sliderNextPrevAnimation:!0,lb_thumbBarEnable:!0,lb_thumbBarHoverColor:"rgba(255,255,255,1)",lb_itemInfoEnable:!1,lb_itemLike:!1,lb_itemShare:!1,lb_itemDownload:!0,lb_zoom:!0,lb_discuss:!1,lb_fullscreen:!0,lb_bookmark:!1,lb_menuBackgroundColor:"rgb(0,0,0)",lb_menuBackgroundColorOver:"rgb(255,255,255)",lb_menuIconColor:"rgb(255,255,255)",lb_menuIconColorOver:"rgb(0,0,0)",lb_slideshowEneble:!0,lb_slideshowTimer:8,lb_slideshowAutoPlay:!1,lb_slideshowIndicatorColorBg:"rgba(255,255,255,0.7)",lb_slideshowIndicatorColor:"rgba(255,255,255,1)",lb_copyR_Alert:"Hello, this photo is mine!",lb_copyR_Proptection:!0,lb_audioPlayer:void 0,lb_likesSet:void 0,lb_isContainIdInBookmarkSet:void 0,lb_videoAutoStart:!1,lb_videoLoop:!1,lb_tryPlayNext:!1}}},{key:"isMobileMode",get:function(){return!(!o.a.isTouchDevice||o.a.isiPpad)}}]),e}();t.a=m}});