File: //var/www/wp-content/plugins/simply-gallery-block/dist/lightbox.page.build.js
(()=>{var e={317:e=>{e.exports=XMLHttpRequest}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=wp.element.createElement("svg",{className:"simply-icon",width:"22px",height:"22px",viewBox:"0 0 298.73 298.73",fill:"#0085ba",fillRule:"nonzero"},wp.element.createElement("g",{xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{xmlns:"http://www.w3.org/2000/svg",d:"M264.959,9.35H33.787C15.153,9.35,0,24.498,0,43.154v212.461c0,18.634,15.153,33.766,33.787,33.766 h231.171c18.634,0,33.771-15.132,33.771-33.766V43.154C298.73,24.498,283.593,9.35,264.959,9.35z M193.174,59.623 c18.02,0,32.634,14.615,32.634,32.634s-14.615,32.634-32.634,32.634c-18.025,0-32.634-14.615-32.634-32.634 S175.149,59.623,193.174,59.623z M254.363,258.149H149.362H49.039c-9.013,0-13.027-6.521-8.964-14.566l56.006-110.93 c4.058-8.044,11.792-8.762,17.269-1.605l56.316,73.596c5.477,7.158,15.05,7.767,21.386,1.354l13.777-13.951 c6.331-6.413,15.659-5.619,20.826,1.762l35.675,50.959C266.487,252.16,263.376,258.149,254.363,258.149z"})));wp.element.createElement("svg",{enableBackground:"new 0 0 48 48",height:"24px",version:"1.1",viewBox:"0 0 48 48",width:"24px"},wp.element.createElement("g",null,wp.element.createElement("path",{id:"svg_4",d:"m0.062,21.972113l21.943,0l0,-21.943l-21.943,0l0,21.943z",fill:"#0085ba"}),wp.element.createElement("path",{id:"svg_5",d:"m26.027885,21.972113l21.943,0l0,-21.943l-21.943,0l0,21.943z",fill:"#01273a"}),wp.element.createElement("path",{id:"svg_6",d:"m26.027885,47.937997l21.943,0l0,-21.943l-21.943,0l0,21.943z",fill:"#0085ba"}),wp.element.createElement("path",{id:"svg_7",d:"m0.005183,47.937997l21.943,0l0,-21.943l-21.943,0l0,21.943z",fill:"#01273a"}))),wp.element.createElement("svg",{enableBackground:"new 0 0 48 48",height:"24px",version:"1.1",viewBox:"0 0 48 48",width:"24px"},wp.element.createElement("g",{xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("rect",{x:"4.204546",transform:"rotate(90 15,11) ",y:"-4.180727",width:"21.07",height:"29.498",fill:"#0085ba"}),wp.element.createElement("rect",{transform:"rotate(-90 33,37) ",y:"22.682727",x:"22.725454",width:"21.07",height:"29.498",fill:"#0085ba"}),wp.element.createElement("rect",{transform:"rotate(90 41,10) ",y:"3.717",x:"30.623183",width:"21.07",height:"13.695",fill:"#01273a"}),wp.element.createElement("rect",{x:"-3.693182",transform:"rotate(90 7,37) ",y:"30.588",width:"21.07",height:"13.695",fill:"#01273a"}))),wp.element.createElement("svg",{enableBackground:"new 0 0 48 48",height:"24px",version:"1.1",viewBox:"0 0 48 48",width:"24px"},wp.element.createElement("g",null,wp.element.createElement("rect",{fill:"#0085ba",height:"29.498",width:"21.07",y:"-0.033"}),wp.element.createElement("rect",{fill:"#0085ba",height:"29.498",width:"21.07",x:"26.93",y:"18.535"}),wp.element.createElement("rect",{fill:"#01273a",height:"13.695",width:"21.07",x:"26.93",y:"-0.033"}),wp.element.createElement("rect",{fill:"#01273a",height:"13.695",width:"21.07",y:"34.338"}))),wp.element.createElement("svg",{enableBackground:"new 0 0 24 24",height:"24px",version:"1.1",viewBox:"0 0 24 24",width:"24px"},wp.element.createElement("g",null,wp.element.createElement("rect",{height:"12",width:"3",y:"2",x:"0",fill:"#0085ba"}),wp.element.createElement("rect",{height:"12",width:"3",y:"2",x:"21",fill:"#0085ba"}),wp.element.createElement("rect",{height:"17",width:"14",y:"0",x:"5",fill:"#0085ba"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"0",fill:"#01273a"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"8.5",fill:"#01273a"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"17",fill:"#01273a"}))),wp.element.createElement("svg",{enableBackground:"new 0 0 24 24",height:"24px",version:"1.1",viewBox:"0 0 24 24",width:"24px"},wp.element.createElement("g",null,wp.element.createElement("rect",{height:"17",width:"24",y:"0",x:"0",fill:"#0085ba"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"0",fill:"#01273a"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"8.5",fill:"#01273a"}),wp.element.createElement("rect",{height:"5",width:"7",y:"19",x:"17",fill:"#01273a"}))),wp.element.createElement("svg",{enableBackground:"new 0 0 24 24",height:"24px",version:"1.1",viewBox:"0 0 24 24",width:"24px"},wp.element.createElement("g",null,wp.element.createElement("rect",{fill:"#0085ba",id:"canvas_background",height:"26",width:"26",y:"0",x:"0"})),wp.element.createElement("g",null,wp.element.createElement("text",{fontWeight:"bold",fontStyle:"normal",xmlSpace:"preserve",textAnchor:"start",fontFamily:"Georgia, Times, 'Times New Roman', serif",fontSize:"18",id:"svg_11",y:"17",x:"0",strokeWidth:"0",stroke:"#fff",fill:"#ffffff"},"[/]"))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},wp.element.createElement("g",null,wp.element.createElement("rect",{fill:"#0085ba",id:"canvas_background",height:"26",width:"26",y:"-1",x:"-1"})),wp.element.createElement("g",null,wp.element.createElement("path",{fill:"none",id:"svg_1",strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round",stroke:"#ffffff",d:"m12,6.12638l0,13.00002m0,-13.00002c-1.1679,-0.77592 -2.75351,-1.25278 -4.5,-1.25278c-1.74649,0 -3.33211,0.47686 -4.5,1.25278l0,13.00002c1.16789,-0.7759 2.75351,-1.2528 4.5,-1.2528c1.74649,0 3.3321,0.4769 4.5,1.2528m0,-13.00002c1.1679,-0.77592 2.7535,-1.25278 4.5,-1.25278c1.7465,0 3.3321,0.47686 4.5,1.25278l0,13.00002c-1.1679,-0.7759 -2.7535,-1.2528 -4.5,-1.2528c-1.7465,0 -3.3321,0.4769 -4.5,1.2528"}))),wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32"},wp.element.createElement("g",null,wp.element.createElement("path",{fill:"#0085ba",d:"M27,2H7a2.92,2.92,0,0,0-2.11.87A2.94,2.94,0,0,0,4,5V29a1,1,0,0,0,1,1H23a1,1,0,0,0,1-1V26h3a1,1,0,0,0,1-1V3A1,1,0,0,0,27,2ZM13,14a2,2,0,1,1-2-2A2,2,0,0,1,13,14Zm7.88,9.47A1,1,0,0,1,20,24H8a1,1,0,0,1-.8-1.6l3-4a1,1,0,0,1,1.25-.29l1.35.67,2.49-2.49A1,1,0,0,1,16.1,16a1,1,0,0,1,.73.45l4,6A1,1,0,0,1,20.88,23.47ZM26,24H24V7a1,1,0,0,0-1-1H7A1,1,0,0,1,6,5a1,1,0,0,1,.31-.71A1,1,0,0,1,7,4H26Z"})));const t={modaBgColor:{type:"sring",default:"rgba(0,0,0,0.8)"},modalIconColor:{type:"sring",default:"rgba(255,255,255,1)"},modalIconColorHover:{type:"sring",default:"rgba(255,255,255,0.8)"},shareFacebook:{type:"boolean",default:!0},shareTwitter:{type:"boolean",default:!0},sharePinterest:{type:"boolean",default:!0},sliderItemDownload:{type:"boolean",default:!0},shareCopyLink:{type:"boolean",default:!0},sharePost:{type:"string",default:"sharelink"}};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=l({},{copyRProtection:{type:"boolean",default:!1},copyRAlert:{type:"string",default:"Hello, this photo is mine!"},sliderScrollNavi:{type:"boolean",default:!1},sliderFullSizeViewMode:{type:"boolean",default:!1},sliderNextPrevAnimation:{type:"string",default:"animation"},galleryScrollPositionControll:{type:"boolean",default:!1},sliderVideoAutoPlay:{type:"boolean",default:!1},sliderTryPlayNext:{type:"boolean",default:!1},sliderVideoLoop:{type:"boolean",default:!1},sliderItemCounterEnable:{type:"boolean",default:!0},sliderCaptionSrc:{type:"string",default:"caption"},sliderItemTitleEnable:{type:"boolean",default:!0},sliderItemTitleFontSize:{type:"number",default:18},sliderItemTitleTextColor:{type:"string",default:"rgba(255,255,255,1)"},itemCounterColor:{type:"string",default:"rgba(255,255,255,1)"},sliderThumbBarEnable:{type:"boolean",default:!0},sliderThumbBarHoverColor:{type:"string",default:"rgba(240,240,240,1)"},sliderBgColor:{type:"string",default:"rgba(0,0,0,0.8)"},sliderPreloaderColor:{type:"string",default:"rgba(240,240,240,1)"},sliderHeaderFooterBgColor:{type:"string",default:"rgba(0,0,0,0.4)"},sliderNavigationColor:{type:"string",default:"rgba(0,0,0,1)"},sliderNavigationColorOver:{type:"string",default:"rgba(255,255,255,1)"},sliderNavigationIconColor:{type:"string",default:"rgba(255,255,255,1)"},sliderNavigationIconColorOver:{type:"string",default:"rgba(0,0,0,1)"},sliderSlideshow:{type:"boolean",default:!0},sliderSlideshowAutoStart:{type:"boolean",default:!1},sliderSlideshowDelay:{type:"number",default:8},slideshowIndicatorColor:{type:"string",default:"rgba(255,255,255,1)"},slideshowIndicatorColorBg:{type:"string",default:"rgba(255,255,255,0.5)"},sliderThumbSubMenuBackgroundColor:{type:"string",default:"rgba(255,255,255,0)"},sliderThumbSubMenuBackgroundColorOver:{type:"string",default:"rgba(255,255,255,1)"},sliderThumbSubMenuIconColor:{type:"string",default:"rgba(255,255,255,1)"},sliderThumbSubMenuIconHoverColor:{type:"string",default:"rgba(0,0,0,1)"},sliderSocialShareEnabled:{type:"boolean",default:!0},sliderZoomEnable:{type:"boolean",default:!0},sliderFullscreenEnabled:{type:"boolean",default:!0}});delete i.sliderCaptionSrc,delete i.sliderFullSizeViewMode;var c=l({},t);delete c.sharePost;const s=Object.assign({nativGalleryEnable:{type:"boolean",default:!0},nativeAttachment:{type:"boolean",default:!0},singletonAttachment:{type:"boolean",default:!0},groupingAllImages:{type:"boolean",default:!1},lightboxType:{type:"string",default:"classic"}},i,c);var u=wp.element.Fragment,m=wp.components,p=m.Dropdown,d=m.ColorPicker;function y(e){var t=e.label,r=e.value,n=e.onChange;return wp.element.createElement("div",{className:"pgc-components-color-palette__custom-clear-wrappe"},wp.element.createElement(p,{className:"pgc-components-color-palette__custom-color",contentClassName:"components-color-palette__picker",renderToggle:function(e){var n=e.isOpen,o=e.onToggle;return wp.element.createElement(u,null,wp.element.createElement("label",{htmlFor:"inspector-color-control",className:"pgc-picker__label"},t),wp.element.createElement("div",{className:"pgc-color-indicator-wrap ".concat(n?"hoverActiv":""),onClick:o,onKeyPress:null,role:"button",tabIndex:"-1"},wp.element.createElement("div",{className:"pgc-color-indicator",style:{backgroundColor:r}})))},renderContent:function(){return wp.element.createElement(d,{className:"pgc-components-color-palette__custom-palette",color:r,onChangeComplete:function(e){var t="";for(var r in e.rgb)Object.prototype.hasOwnProperty.call(e.rgb,r)&&(t+="".concat(e.rgb[r]).concat("a"===r?"":","));n("rgba(".concat(t,")"))}})}}))}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g(n.key),n)}}function g(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}function h(e,t,r){return t=v(t),function(e,t){if(t&&("object"==b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,w()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w=function(){return!!e})()}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}var S=wp.element,k=S.Component,C=S.Fragment;const x=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){var e=this.props,t=e.className,r=e.protectContent,n=e.label,o=e.children,l=e.notic;return wp.element.createElement("div",{className:"pgc-sgb-premium-section ".concat(t||""," ").concat(r?"is-pgc-block":"")},o,r&&wp.element.createElement(C,null,wp.element.createElement("div",{className:"pgc-sgb-premium"}),wp.element.createElement("div",{className:"pgc-sgb-pr-label"},n),l&&wp.element.createElement("div",{className:"pgc-sgb-pr-notic"},l)))}}])&&f(r.prototype,n),o&&f(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(k);var P=r(317),O=r.n(P);function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}function j(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_(t)?t:t+""}var N="pgc_sgb_",B=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,n=[{key:"ICONS",get:function(){return{}}},{key:"sanitizeString",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","\n":"","\t":""};return e.replace(/[&<>"'/]/gi,(function(e){return t[e]})).trim()}},{key:"isTouchDevice",get:function(){return window.wp&&wp.media&&wp.media.isTouchDevice?wp.media.isTouchDevice:window.navigator.maxTouchPoints||"ontouchstart"in window}},{key:"browser",get:function(){var e=window.navigator.userAgent,t=e.indexOf("Chrome")>-1;if(e.indexOf("MSIE")>-1)return"explorer";if(e.indexOf("Firefox")>-1)return"firefox";var r=e.indexOf("Safari")>-1,n=e.toLowerCase().indexOf("op")>-1;return n&&!t?"opera":t&&!n||t&&r?"chrome":r&&!t?"safari":void 0}},{key:"passiveListener",get:function(){var e=!1;try{var t={get:function(){e=!0}},r=Object.defineProperty({},"passive",t);window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}catch(e){}return!!e&&{passive:!1,capture:!1}}},{key:"indexByPosition",value:function(e,t,r){var n=parseInt(t/e.width),o=Math.floor(r.y/e.height),l=Math.floor(r.x/e.width);return Math.max(0,o*n+l)}},{key:"pageXOffset",get:function(){return void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft}},{key:"pageYOffset",get:function(){return void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},{key:"moduleSettings",value:function(e){return window[e]&&window[e].settings?window[e].settings:null}},{key:"updateProperties",value:function(e,t){for(var r=Object.keys(e),n=0;n<r.length;n+=1){var o=r[n];Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}}},{key:"copyProperties",value:function(e,t){return t=Object.assign(t,e)}},{key:"trace",get:function(){return console.log}},{key:"checkScrip",value:function(e){for(var t=document.getElementsByTagName("script"),r=0;r<t.length;r+=1){var n=t[r];if(n.src===e)return r=t.length,n}return!1}},{key:"loadExtScripts",value:function(t,r){function n(){e.trace(this.src,"error")}for(var o=0;o<t.length;o+=1){var l=t[o],a=l.src,i=l.id,c=e.checkScrip(a);c||((c=document.createElement("script")).src=a,c.id="".concat(i,"_js"),c.async=!0,r&&(c.onload=r),c.onerror=n,document.body.appendChild(c))}}},{key:"getViewPortsBySelector",value:function(e){return document.querySelectorAll('div[data-gallery-id="'.concat(e,'"]'))}},{key:"requestAttachments",value:function(t,r,n,o){var l=new URL(t);l.searchParams.set("_fs_blog_admin","true");var a=new(O());a.open("POST",l,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),a.onreadystatechange=function(){if(4===a.readyState){var e={};200!==a.status?e.error=a.statusText:e.data=a.responseText,n&&(e.params=n),o&&"function"==typeof o&&o(e)}},a.onerror=function(){e.trace("An error occurred while transferring the file.")};try{var i,c=[];for(i in r)if(Object.prototype.hasOwnProperty.call(r,i))if("object"===_(r[i])){for(var s in r[i])if(Object.prototype.hasOwnProperty.call(r[i],s))if(Array.isArray(r[i][s]))for(var u=r[i][s],m=0;m<u.length;m+=1)c.push("".concat(encodeURIComponent("".concat(i,"[").concat(s,"][]")),"=").concat(encodeURIComponent(u[m])));else c.push("".concat(encodeURIComponent("".concat(i,"[").concat(s,"]")),"=").concat(encodeURIComponent(r[i][s])))}else c.push("".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(r[i])));a.send(c.join("&"))}catch(t){e.trace(t)}}},{key:"request2",value:function(t,r,n,o,l){var a=new URL(t),i=new(O()),c="";if(i.open("POST",a,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.onreadystatechange=function(){if(4===i.readyState){var e={};200!==i.status?e.error=i.statusText:e.data=i.responseText,l&&"function"==typeof l&&l(e)}},o){var s=Object.keys(o);if(s.length)for(var u=0;u<s.length;u+=1)Object.prototype.hasOwnProperty.call(o,s[u])&&(c+="&".concat(s[u],"=").concat(o[s[u]]))}i.onerror=function(){e.trace("An error occurred while transferring the file.")};try{i.send("action=pgc_sgb_action_wizard&nonce=".concat(r,"&props=").concat(n).concat(c))}catch(t){e.trace(t)}}},{key:"sanitize",value:function(t){var r=(t=t||"").replace(/<!--[\s\S]*?(-->|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"");return r!==t?e.stripTags(r):r}},{key:"stripTags",value:function(t){var r=e.sanitize(t),n=document.createElement("textarea");try{n.textContent=r,r=e.sanitize(n.value)}catch(t){e.trace(t)}return r}},{key:"escapeHTML",value:function(e){return e.toString().replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")}},{key:"unescapeHTML",value:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent}},{key:"validURL",value:function(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%@_.~+&:]*)*(\\?[;&a-z\\d%@_.,~+&:=-]*)?(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)}},{key:"requestGetFileBird",value:function(t,r,n,o,l,a){var i=new URL(t),c=new(O());c.open("GET",i,!0),c.setRequestHeader("Content-Type","application/json; charset=UTF-8"),c.setRequestHeader("X-Wp-Nonce",r),c.onreadystatechange=function(){if(4===c.readyState){var e={};200!==c.status?e.error=c.statusText:e.data=c.responseText,l&&(e.params=l),a&&"function"==typeof a&&a(e)}},c.onerror=function(){e.trace("An error occurred while transferring the file.")};try{c.send("action=".concat(n,"&props=").concat(o))}catch(t){e.trace(t)}}},{key:"request",value:function(t,r,n,o,l,a){var i=new URL(t),c=new(O());c.open("POST",i,!0),c.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),c.onreadystatechange=function(){if(4===c.readyState){var e={};200!==c.status?e.error=c.statusText:e.data=c.responseText,l&&(e.params=l),a&&"function"==typeof a&&a(e)}},c.onerror=function(){e.trace("An error occurred while transferring the file.")};try{c.send("action=".concat(n,"&nonce=").concat(r,"&props=").concat(o))}catch(t){e.trace(t)}}},{key:"getMediaModal",value:function(e,t){if(window.wp&&window.wp.media){var r=window.wp,n={title:"Select Files",multiple:"add",type:void 0,exclusionList:[]};t&&(n=Object.assign(n,t));var o=r.media.controller.Library.prototype.defaults,l={order:"DESC",orderby:"id",post__not_in:n.exclusionList};n.type&&(l.type=n.type);var a=r.media.controller.Library.extend({defaults:Object.assign(o,{query:!0,id:"library",title:n.title,multiple:n.multiple,priority:20,library:new r.media.query(l)})});return r.media.frames[e]?n.exclusionList&&r.media.frames[e].once("open",(function(){r.media.frames[e].setExclusion(n.exclusionList)})):(r.media.frames[e]=r.media({state:"library",states:[new a]}),r.media.frames[e].updateCollection=function(){var e=this.content.get();if(e&&e.collection){var t=e.collection;t.toArray().forEach((function(e){return e.trigger("destroy",e)})),t.mirroring._hasMore=!0,t.more()}},r.media.frames[e].setExclusion=function(t){r.media.frames[e].content&&r.media.frames[e].content.get().collection&&r.media.frames[e].content.get().collection.props.set({post__not_in:t})},r.media.frames[e].selectedItems=function(){return r.media.frames[e].state()?r.media.frames[e].state().get("selection").models.map((function(e){return e.attributes})):[]},r.media.frames[e].on("open",(function(){var t,n=this.state(),o=n.get("library"),l=n.get("selection");function a(){l&&l.models&&l.some((function(e){return!0===e.get("uploading")}))?(clearTimeout(t),t=setTimeout(a,100)):o.add(l.models)}r.media.frames[e].updateCollection(),r.media.frames[e].on("library:selection:add",(function(){a()}))}),r.media.frames[e])),r.media.frames[e].off("select"),r.media.frames[e]}}},{key:"getAttachmentDetailsModal",value:function(e,t){var r=window.wp;if(r&&r.media)return r.media.frames.pgc_simply_detail?r.media.frames.pgc_simply_detail.content.get("collection").controller.library.reset(e.models):(r.media.frames.pgc_simply_detail=r.media({frame:"edit-attachments",controller:{gridRouter:new r.media.view.MediaFrame.Manage.Router},library:e,model:new r.media.model.Attachment}),r.media.frames.pgc_simply_detail.resetRoute=function(){}),r.media.frames.pgc_simply_detail.state().frame.trigger("refresh",e.findWhere({id:parseInt(t)})),r.media.frames.pgc_simply_detail}},{key:"getVimeoData",value:function(t,r,n,o,l){var a=new URL("https://api.vimeo.com/".concat(t,"/").concat(r,"/videos"));for(var i in"projects"===t&&""!==o?a=new URL("https://api.vimeo.com/users/".concat(r,"/projects/").concat(o,"/videos")):"categories"===t&&delete n.sort,n)Object.prototype.hasOwnProperty.call(n,i)&&a.searchParams.append(i,n[i]);var c=new(O());c.open("GET",a,!0),c.setRequestHeader("Content-Type","application/vnd.vimeo.user+json;version=3.0,application/vnd.vimeo.video+json;version=3.4"),c.onreadystatechange=function(){if(4===c.readyState){var e={};200!==c.status?(e.error=c.statusText,l({error:c.status})):e.data=c.responseText,n&&(e.params=n),l&&"function"==typeof l&&l(e)}},c.onerror=function(t){e.trace("transfer Failed"),e.trace(t),l({error:"Transfer Failed"})};try{c.send()}catch(t){e.trace(t)}}},{key:"getYouTubeData",value:function(t,r,n){var o=new URL("https://www.googleapis.com/youtube/v3/".concat(t));for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&o.searchParams.append(l,r[l]);var a=new(O());a.open("GET",o,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),a.onreadystatechange=function(){if(4===a.readyState){var e={};200!==a.status?(e.error=a.statusText,n({error:a.status})):e.data=a.responseText,r&&(e.params=r),n&&"function"==typeof n&&n(e)}},a.onerror=function(t){e.trace("transfer Failed"),e.trace(t)};try{a.send()}catch(t){e.trace(t)}}},{key:"fetchAttachmentsMedia",value:function(e,t){var r=window.wp;if(r||r.media){var n=[];e&&(n=e.map((function(e){return r.media.attachment(e)}))),function e(r){r.more().then((function(){r.hasMore()?e(r):t(n)}))}(r.media.query({post__in:e,orderby:"post__in"}))}else this.trace("WP MEDIA Undefined!")}},{key:"Item",value:function(e){for(var t={model:["id","title","url","link","alt","description","caption","mime","type","image","thumb","width","height","fileLength","sizes","imageMeta","meta"]},r=0;r<t.model.length;r+=1){var n=t.model[r];Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}if(t.sizes){var o={};t.sizes.thumbnail&&(o.thumbnail=t.sizes.thumbnail),t.sizes.medium&&(o.medium=t.sizes.medium),t.sizes.large&&(o.large=t.sizes.large),t.sizes.full&&(o.full=t.sizes.full),t.sizes=o}if(delete t.model,!(Object.keys(t).length<=1))return t}}],(r=null)&&T(t.prototype,r),n&&T(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function I(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,L(n.key),n)}}function L(e){var t=function(e,t){if("object"!=A(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==A(t)?t:t+""}function M(e,t,r){return t=R(t),function(e,t){if(t&&("object"==A(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,H()?Reflect.construct(t,r||[],R(e).constructor):t.apply(e,r))}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(H=function(){return!!e})()}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}var z=wp.element,V=z.Component,G=z.Fragment,D=wp.components,q=D.RangeControl,U=D.ToggleControl,W=D.SelectControl,Z=D.TextControl,X=(B.trace,function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),M(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var __=wp.i18n.__,e=this.props,t=e.attributes,r=e.setSomeAttributes,n=t.isPremium;return wp.element.createElement(G,null,wp.element.createElement(x,{label:"PLUS / PRO Feature",protectContent:!n},wp.element.createElement(W,{__nextHasNoMarginBottom:!0,label:__("Items Transition Type","simply-gallery-block"),options:[{label:__("Slipping","simply-gallery-block"),value:"animation"},{label:__("Fading","simply-gallery-block"),value:"fade"}],value:t.sliderNextPrevAnimation,onChange:function(e){return r({sliderNextPrevAnimation:e})}}),void 0!==t.sliderFullSizeViewMode&&wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Display Image in original Size","simply-gallery-block"),checked:t.sliderFullSizeViewMode,onChange:function(){return r({sliderFullSizeViewMode:!t.sliderFullSizeViewMode})},help:function(){return __("This mode can significantly reduce performance and increase Internet traffic.","simply-gallery-block")}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Scroll to navigate (mouse wheel)","simply-gallery-block"),checked:!!t.sliderScrollNavi,onChange:function(){return r({sliderScrollNavi:!t.sliderScrollNavi})}}),void 0!==t.galleryScrollPositionControll&&wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Scroll down the page for the item you viewed","simply-gallery-block"),checked:!!t.galleryScrollPositionControll,onChange:function(){return r({galleryScrollPositionControll:!t.galleryScrollPositionControll})}}),void 0!==t.sliderVideoAutoPlay&&void 0!==t.sliderTryPlayNext&&wp.element.createElement(U,{__nextHasNoMarginBottom:!0,className:t.isPremium?"":"pgc_disabled",label:__("Autoplay Video","simply-gallery-block"),checked:!!t.isPremium&&!!t.sliderVideoAutoPlay,help:t.isPremium?"":"* Premium",onChange:function(){return r({sliderVideoAutoPlay:!t.sliderVideoAutoPlay,sliderTryPlayNext:0!=!t.sliderVideoAutoPlay&&t.sliderTryPlayNext})}}),void 0!==t.sliderVideoAutoPlay&&void 0!==t.sliderTryPlayNext&&wp.element.createElement(U,{__nextHasNoMarginBottom:!0,className:t.isPremium?"":"pgc_disabled",label:__("Try playing the next video.","simply-gallery-block"),checked:!!t.isPremium&&!!t.sliderTryPlayNext,help:t.isPremium?__("Present gallery as video playlist","simply-gallery-block"):"* Premium",onChange:function(){return r({sliderVideoAutoPlay:1==!t.sliderTryPlayNext||t.sliderVideoAutoPlay,sliderTryPlayNext:!t.sliderTryPlayNext,sliderVideoLoop:!1})}}),void 0!==t.sliderVideoLoop&&wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Loop Video","simply-gallery-block"),checked:!!t.isPremium&&!!t.sliderVideoLoop,onChange:function(){return r({sliderVideoLoop:!t.sliderVideoLoop,sliderTryPlayNext:0!=!t.sliderVideoAutoPlay&&t.sliderTryPlayNext})}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Prevent downloading","simply-gallery-block"),checked:!!t.copyRProtection,onChange:function(){return r({copyRProtection:!t.copyRProtection})},help:function(){return __("Disable right click to protect content from download","simply-gallery-block")}}),t.copyRProtection&&wp.element.createElement(Z,{__nextHasNoMarginBottom:!0,label:__("Copyright Alert (right mouse click)","simply-gallery-block"),value:t.copyRAlert,onChange:function(e){return r({copyRAlert:e})}})),wp.element.createElement(y,{label:__("Lightbox background color","simply-gallery-block"),value:t.sliderBgColor,onChange:function(e){return r({sliderBgColor:e})}}),wp.element.createElement(y,{label:__("Preloader Color","simply-gallery-block"),value:t.sliderPreloaderColor,onChange:function(e){return r({sliderPreloaderColor:e})}}),wp.element.createElement(y,{label:__("Lightbox Header & Footer color","simply-gallery-block"),value:t.sliderHeaderFooterBgColor,onChange:function(e){return r({sliderHeaderFooterBgColor:e})}}),wp.element.createElement(y,{label:__("Main Controls - BG Color","simply-gallery-block"),value:t.sliderNavigationColor,onChange:function(e){return r({sliderNavigationColor:e})}}),wp.element.createElement(y,{label:__("Main Controls - Hover BG Color","simply-gallery-block"),value:t.sliderNavigationColorOver,onChange:function(e){return r({sliderNavigationColorOver:e})}}),wp.element.createElement(y,{label:__("Main Controls - Icon Color","simply-gallery-block"),value:t.sliderNavigationIconColor,onChange:function(e){return r({sliderNavigationIconColor:e})}}),wp.element.createElement(y,{label:__("Main Controls - Icon Hover Color","simply-gallery-block"),value:t.sliderNavigationIconColorOver,onChange:function(e){return r({sliderNavigationIconColorOver:e})}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Items Counter","simply-gallery-block"),checked:!!t.sliderItemCounterEnable,onChange:function(){return r({sliderItemCounterEnable:!t.sliderItemCounterEnable})}}),t.sliderItemCounterEnable&&wp.element.createElement(y,{label:__("Items Counter Color","simply-gallery-block"),value:t.itemCounterColor,onChange:function(e){return r({itemCounterColor:e})}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Slideshow Button","simply-gallery-block"),checked:!!t.sliderSlideshow,onChange:function(){return r({sliderSlideshow:!t.sliderSlideshow})}}),t.sliderSlideshow&&wp.element.createElement(G,null,wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Slideshow Autostart","simply-gallery-block"),checked:!!t.sliderSlideshowAutoStart,onChange:function(){return r({sliderSlideshowAutoStart:!t.sliderSlideshowAutoStart})}}),wp.element.createElement(q,{__nextHasNoMarginBottom:!0,label:__("Slideshows Timer","simply-gallery-block"),value:t.sliderSlideshowDelay,onChange:function(e){return r({sliderSlideshowDelay:e})},min:1,max:20,step:1}),wp.element.createElement(y,{label:__("Slideshow Indicator Color","simply-gallery-block"),value:t.slideshowIndicatorColor,onChange:function(e){return r({slideshowIndicatorColor:e})}}),wp.element.createElement(y,{label:__("Slideshow Indicator Bg Color","simply-gallery-block"),value:t.slideshowIndicatorColorBg,onChange:function(e){return r({slideshowIndicatorColorBg:e})}}),wp.element.createElement("hr",null)),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Item Caption","simply-gallery-block"),checked:!!t.sliderItemTitleEnable,onChange:function(){return r({sliderItemTitleEnable:!t.sliderItemTitleEnable})}}),t.sliderItemTitleEnable&&wp.element.createElement(G,null,t.sliderCaptionSrc&&wp.element.createElement(W,{__nextHasNoMarginBottom:!0,label:__("Source for Item caption","simply-gallery-block"),options:[{label:__("Caption","simply-gallery-block"),value:"caption"},{label:__("Title","simply-gallery-block"),value:"title"},{label:__("Alt","simply-gallery-block"),value:"alt"}],value:t.sliderCaptionSrc,onChange:function(e){r({sliderCaptionSrc:e})}}),wp.element.createElement(q,{__nextHasNoMarginBottom:!0,label:__("Font size","simply-gallery-block"),value:t.sliderItemTitleFontSize,onChange:function(e){return r({sliderItemTitleFontSize:e})},min:10,max:30,step:1}),wp.element.createElement(y,{label:__("Text Color","simply-gallery-block"),value:t.sliderItemTitleTextColor,onChange:function(e){return r({sliderItemTitleTextColor:e})}}),wp.element.createElement("hr",null)),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Thumbnails Bar","simply-gallery-block"),checked:!!t.sliderThumbBarEnable,onChange:function(){return r({sliderThumbBarEnable:!t.sliderThumbBarEnable})}}),t.sliderThumbBarEnable&&wp.element.createElement(G,null,wp.element.createElement(y,{label:__("Thumbnails Border Color (select mode)","simply-gallery-block"),value:t.sliderThumbBarHoverColor,onChange:function(e){return r({sliderThumbBarHoverColor:e})}}),wp.element.createElement("hr",null)),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Enable Zooom","simply-gallery-block"),checked:!!t.sliderZoomEnable,onChange:function(){return r({sliderZoomEnable:!t.sliderZoomEnable})}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Share Buttons","simply-gallery-block"),checked:!!t.sliderSocialShareEnabled,onChange:function(){return r({sliderSocialShareEnabled:!t.sliderSocialShareEnabled})}}),wp.element.createElement(U,{__nextHasNoMarginBottom:!0,label:__("Show Fullscreen Button","simply-gallery-block"),checked:!!t.sliderFullscreenEnabled,onChange:function(){return r({sliderFullscreenEnabled:!t.sliderFullscreenEnabled})}}),wp.element.createElement(y,{label:__("Submenu button color","simply-gallery-block"),value:t.sliderThumbSubMenuBackgroundColor,onChange:function(e){return r({sliderThumbSubMenuBackgroundColor:e})}}),wp.element.createElement(y,{label:__("Submenu button Hover color","simply-gallery-block"),value:t.sliderThumbSubMenuBackgroundColorOver,onChange:function(e){return r({sliderThumbSubMenuBackgroundColorOver:e})}}),wp.element.createElement(y,{label:__("Submenu button Icon color","simply-gallery-block"),value:t.sliderThumbSubMenuIconColor,onChange:function(e){return r({sliderThumbSubMenuIconColor:e})}}),wp.element.createElement(y,{label:__("Submenu button Icon Hover color","simply-gallery-block"),value:t.sliderThumbSubMenuIconHoverColor,onChange:function(e){return r({sliderThumbSubMenuIconHoverColor:e})}}))}}],n&&I(r.prototype,n),o&&I(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(V));const Y=X;function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function J(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,K(n.key),n)}}function K(e){var t=function(e,t){if("object"!=$(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$(t)?t:t+""}function Q(e,t,r){return t=te(t),function(e,t){if(t&&("object"==$(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ee()?Reflect.construct(t,r||[],te(e).constructor):t.apply(e,r))}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ee=function(){return!!e})()}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}function re(e,t){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},re(e,t)}var ne=wp.element,oe=ne.Component,le=ne.Fragment,ae=wp.components,ie=ae.ToggleControl,ce=ae.SelectControl,se=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Q(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&re(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var __=wp.i18n.__,e=this.props,t=e.attributes,r=e.setSomeAttributes;return wp.element.createElement(le,null,void 0!==t.sharePost&&wp.element.createElement(ce,{__nextHasNoMarginBottom:!0,label:__("Share link to","simply-gallery-block"),options:[{label:__("Item","simply-gallery-block"),value:"sharelink"},{label:__("Post","simply-gallery-block"),value:"postlink"}],value:t.sharePost,onChange:function(e){return r({sharePost:e})}}),wp.element.createElement(y,{label:__("Overlap Color","simply-gallery-block"),value:t.modaBgColor,onChange:function(e){return r({modaBgColor:e})}}),wp.element.createElement(y,{label:__("Icon Color","simply-gallery-block"),value:t.modalIconColor,onChange:function(e){return r({modalIconColor:e})}}),wp.element.createElement(y,{label:__("Icon Color on Hover","simply-gallery-block"),value:t.modalIconColorHover,onChange:function(e){return r({modalIconColorHover:e})}}),wp.element.createElement(ie,{__nextHasNoMarginBottom:!0,label:__("Enable Facebook","simply-gallery-block"),checked:!!t.shareFacebook,onChange:function(){return r({shareFacebook:!t.shareFacebook})}}),wp.element.createElement(ie,{__nextHasNoMarginBottom:!0,label:__("Enable X","simply-gallery-block"),checked:!!t.shareTwitter,onChange:function(){return r({shareTwitter:!t.shareTwitter})}}),wp.element.createElement(ie,{__nextHasNoMarginBottom:!0,label:__("Enable Pinterest","simply-gallery-block"),checked:!!t.sharePinterest,onChange:function(){return r({sharePinterest:!t.sharePinterest})}}),wp.element.createElement(ie,{__nextHasNoMarginBottom:!0,label:__("Enable Download","simply-gallery-block"),checked:!!t.sliderItemDownload,onChange:function(){return r({sliderItemDownload:!t.sliderItemDownload})}}),wp.element.createElement(ie,{__nextHasNoMarginBottom:!0,label:__("Show Copy Link","simply-gallery-block"),checked:!!t.shareCopyLink,onChange:function(){return r({shareCopyLink:!t.shareCopyLink})}}))}}],n&&J(r.prototype,n),o&&J(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(oe);const ue=se;function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){ye(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ye(e,t,r){return(t=fe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function be(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fe(n.key),n)}}function fe(e){var t=function(e,t){if("object"!=me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==me(t)?t:t+""}function ge(e,t,r){return t=we(t),function(e,t){if(t&&("object"==me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,he()?Reflect.construct(t,r||[],we(e).constructor):t.apply(e,r))}function he(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(he=function(){return!!e})()}function we(e){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(e)}function ve(e,t){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ve(e,t)}var Ee=wp.element,Se=Ee.Component,ke=Ee.Fragment,Ce=wp.components,xe=Ce.PanelBody,Pe=Ce.Button,Oe=Ce.ToggleControl,_e=Ce.RadioControl,Te=B.trace,je="pgc-sgb-settins-page-",Ne=window.PGC_SGB_OPTIONS_PAGE;const Be=function(t){function r(){var e;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(e=ge(this,r,arguments)).setSomeAttributesForLightbox=e.setSomeAttributesForLightbox.bind(e),e.compareSubStateWithGlobalPreset=e.compareSubStateWithGlobalPreset.bind(e),e.saveSettingsHandler=e.saveSettingsHandler.bind(e),e.saveSettingsResponsedHandler=e.saveSettingsResponsedHandler.bind(e),Ne){e.tempRequestObject=void 0;var t={loading:!1,useGlobalLightbox:!(!Ne.globalLightbox||"1"!==Ne.globalLightbox)};e.defLightbox=de({},s),(t=de(de({},t),function(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r].default);return t}(e.defLightbox))).isPremium=Ne.isPremium&&"true"===Ne.isPremium;var n=Ne.lightboxPreset;n&&""!==n&&("false"===Ne.isPro&&(n.lightboxType="classic"),B.updateProperties(t,n)),t.sliderVideoAutoPlay=void 0,t.sliderVideoLoop=void 0,t.sliderTryPlayNext=void 0,e.globalLightbox=de({},t),e.state={globalLightbox:t}}else Te("Oops, something went wrong. No Gobal Presets!");return e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ve(e,t)}(r,t),n=r,o=[{key:"setSomeAttributes",value:function(e,t){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n],e[n]=t[n]);this.setState(r)}},{key:"setSomeAttributesForLightbox",value:function(e){this.setSomeAttributes(this.state.globalLightbox,e)}},{key:"compareSubStateWithGlobalPreset",value:function(e){var t=this.state[e],r=this[e];for(var n in r)if("loading"!==n){if(!Object.prototype.hasOwnProperty.call(r,n)||!Object.prototype.hasOwnProperty.call(t,n))return!1;if(t[n]!==r[n])return!1}return!0}},{key:"saveSettingsResponsedHandler",value:function(e){if(this.tempRequestObject&&e.data)try{var t,r=JSON.parse(e.data);if(this.tempRequestObject.key&&(t="global".concat(this.tempRequestObject.key)),delete this.tempRequestObject.key,r.message){for(var n=Object.keys(this.tempRequestObject),o=0,l=0;l<n.length;l+=1){var a=n[l];Object.prototype.hasOwnProperty.call(r.message,a)&&(o+=1)}o===n.length&&t&&(this[t]=de({},this.state[t]),this.tempRequestObject=void 0)}this.setSomeAttributes(this.state[t],{loading:!1})}catch(e){B.trace(e)}}},{key:"saveSettingsHandler",value:function(e){var t=Ne.nonce,r=Ne.ajaxurl;if(t&&r){for(var n=e.target.id.replace("global",""),o=e.target.id,l=this.state[o],a=N+n.toLowerCase(),i={},c=Object.keys(this["def".concat(n)]),s={},u=0;u<c.length;u+=1){var m=c[u];Object.prototype.hasOwnProperty.call(l,m)&&(s[m]=l[m])}return i[a]=s,"globalLightbox"===o&&(i["".concat(N,"global_lightbox_use")]=l.useGlobalLightbox),this.setSomeAttributes(l,{loading:!0}),B.request2(r,t,JSON.stringify(de(de({},{type:"update_option"}),{options:i})),null,this.saveSettingsResponsedHandler),i.key=n,void(this.tempRequestObject=i)}Te("Error: OPTIONS PAGE - not completed")}},{key:"render",value:function(){var t=this,__=wp.i18n.__;if(!Ne)return wp.element.createElement(ke,null,wp.element.createElement("div",{className:"".concat(je,"header")},wp.element.createElement("div",{className:"".concat(je,"logo-wrap ").concat(je,"group")},e,wp.element.createElement("div",{className:"".concat(je,"title")},"SimpLy ".concat(__("Lightbox Plugin","simply-gallery-block"))))),wp.element.createElement("div",{className:"".concat(je,"content")},wp.element.createElement("h2",{style:{color:"red"}},__("Oops, something went wrong. No Global Presets","simply-gallery-block"))),wp.element.createElement("div",{className:"".concat(je,"footer")},wp.element.createElement(Pe,{isSecondary:!0,href:"https://wordpress.org/support/plugin/simply-gallery-block/"},__("Ask a question","simply-gallery-block")," ")));var r=this.state.globalLightbox,n=Ne.isPremium,o=Ne.adminurl,l=Ne.postType,a=new URL("".concat(o,"edit.php"));return a.searchParams.set("post_type",l),a.searchParams.set("page","simply-gallery-block-pricing"),wp.element.createElement(ke,null,wp.element.createElement("div",{className:"".concat(je,"header")},wp.element.createElement("div",{className:"".concat(je,"logo-wrap ").concat(je,"group")},e,wp.element.createElement("div",{className:"".concat(je,"title")},"SimpLy ".concat(__("Lightbox Plugin","simply-gallery-block"))),wp.element.createElement("abbr",{title:"".concat(__("Version:","simply-gallery-block")," ").concat(Ne.version),className:"".concat(je,"version")},Ne.version),(!n||"false"===n)&&wp.element.createElement("div",{className:"".concat(je,"premium-title")},__("The PREMIUM version is now available.","simply-gallery-block"),wp.element.createElement("a",{href:a},__("Learn more about Plus / Pro Version","simply-gallery-block"))))),wp.element.createElement("div",{className:"".concat(je,"content")},wp.element.createElement("div",{className:"".concat(je,"title")},wp.element.createElement("h2",null,__("Lightbox for native WordPress Gallery / Image","simply-gallery-block"))),wp.element.createElement(xe,{title:__("Common Settings","simply-gallery-block"),initialOpen:!0,className:"".concat(je,"panel")},wp.element.createElement("div",{className:"".concat(je,"notic")},wp.element.createElement("h4",null,__("USAGE","simply-gallery-block")),wp.element.createElement("p",null,__("All linked images in a post or page will be displayed using SimpLy Lihghtbox, regardless if they are part of a gallery or single images. Just make sure that you link the image or gallery directly to the","simply-gallery-block")," ",wp.element.createElement("span",{className:"".concat(je,"important")},__("media","simply-gallery-block"))," ",__("and not the attachment page (in galleries the option","simply-gallery-block")," ",wp.element.createElement("span",{className:"".concat(je,"important")},__("link=file","simply-gallery-block"))," ",__("should be set).","simply-gallery-block")),wp.element.createElement(Oe,{__nextHasNoMarginBottom:!0,label:__("Activate Lightbox","simply-gallery-block"),checked:!!r.useGlobalLightbox,onChange:function(){return t.setSomeAttributesForLightbox({useGlobalLightbox:!r.useGlobalLightbox})}})),r.useGlobalLightbox&&wp.element.createElement("div",{className:"".concat(je,"settigs-wrap-min")},wp.element.createElement(xe,{opened:!0,className:"".concat(je,"group").concat(Ne.isPro&&"false"!==Ne.isPro?"":" no-pro")},wp.element.createElement(_e,{className:"".concat(je,"radio-controll"),label:__("Lightbox Type","simply-gallery-block"),help:__("* This type of lightbox will be used by default.","simply-gallery-block"),selected:r.lightboxType,options:[{label:"Classic",value:"classic"},{label:"Modern",value:"modern"}],onChange:function(e){return t.setSomeAttributesForLightbox({lightboxType:Ne.isPro&&"true"===Ne.isPro?e:"classic"})}})),wp.element.createElement(xe,{opened:!0,className:"".concat(je,"group")},wp.element.createElement(Oe,{__nextHasNoMarginBottom:!0,label:__("Use lightbox for Native WP Gallery","simply-gallery-block"),checked:!!r.nativGalleryEnable,onChange:function(){return t.setSomeAttributesForLightbox({nativGalleryEnable:!r.nativGalleryEnable})}}),wp.element.createElement(Oe,{__nextHasNoMarginBottom:!0,label:__("Use lightbox for Native WP Image","simply-gallery-block"),className:"".concat(je,"full-width"),checked:!!r.nativeAttachment,onChange:function(){return t.setSomeAttributesForLightbox({nativeAttachment:!r.nativeAttachment})}}),r.nativeAttachment&&wp.element.createElement(Oe,{__nextHasNoMarginBottom:!0,label:__("Combine all single WP Images (from the Post / Page) to display in the lightbox.","simply-gallery-block"),className:"pgc-sgb-sub-props",checked:!r.singletonAttachment,onChange:function(){return t.setSomeAttributesForLightbox({singletonAttachment:!r.singletonAttachment,groupingAllImages:!1})}}),r.nativGalleryEnable&&wp.element.createElement(Oe,{__nextHasNoMarginBottom:!0,label:__('Create Photo "Story" - Combine everything that is selected above.',"simply-gallery-block"),checked:!!r.groupingAllImages,onChange:function(){return t.setSomeAttributesForLightbox({groupingAllImages:!r.groupingAllImages,singletonAttachment:!1})}})),wp.element.createElement(xe,{title:__("Social Share","simply-gallery-block"),initialOpen:!1},wp.element.createElement(ue,{attributes:r,setSomeAttributes:this.setSomeAttributesForLightbox})),wp.element.createElement(xe,{title:"".concat(__("Lightbox Settings","simply-gallery-block")," ").concat(r.subTitle?r.subTitle:""),initialOpen:!0},wp.element.createElement(Y,{attributes:r,setSomeAttributes:this.setSomeAttributesForLightbox}))),wp.element.createElement("div",{className:"".concat(je,"settigs-wrap-min"),style:{backgroundColor:"unset"}},wp.element.createElement(Pe,{id:"globalLightbox",isPrimary:!0,isBusy:r.loading,disabled:r.loading||!0===this.compareSubStateWithGlobalPreset("globalLightbox"),onClick:this.saveSettingsHandler},this.compareSubStateWithGlobalPreset("globalLightbox")?__("Changes Saved","simply-gallery-block"):__("Save Changes","simply-gallery-block"))))),wp.element.createElement("div",{className:"".concat(je,"footer")}))}}],o&&be(n.prototype,o),l&&be(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,l}(Se);var Ae=wp.element,Ie=Ae.createRoot,Le=Ae.render;if(document.getElementById("pgc-simply-gallery-plugin-lightbox-page")){var Me=document.getElementById("pgc-simply-gallery-plugin-lightbox-page");Ie?Ie(Me).render(wp.element.createElement(Be,null)):Le(wp.element.createElement(Be,null),Me)}})()})();