Version Description
- 25-01-2022 = Fixed: Category filter issue. Few minor bug fix and improvements
Download this release
Release Info
Developer | priyomukul |
Plugin | Templately – Templates Cloud for Elementor & Gutenberg : 2500+ Free & Premium Designs! |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 1.3.3
- README.txt +10 -6
- assets/js/templately.min.js +1 -1
- templately.php +2 -2
README.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
=== Templately - Templates Cloud for Elementor & Gutenberg :
|
2 |
Contributors: templately, wpdevteam, re_enter_rupok, Asif2BD, priyomukul, rahat89, shadab109
|
3 |
Donate link: https://templately.com
|
4 |
Tags: templates, elementor, template-cloud, template, clouds, elementor templates, gutenberg, gutenberg templates, wordpress cloud, cloud backup
|
5 |
Requires at least: 5.0
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 1.3.
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -35,9 +35,9 @@ Save your design templates in MyCloud storage and access all your Saved Template
|
|
35 |
|
36 |
Create landing pages with Elementor, Gutenberg and boost up your page building experience to the next level.
|
37 |
|
38 |
-
### 🔥 Over
|
39 |
|
40 |
-
Elementor Template are easiest way to build website fast with
|
41 |
|
42 |
### 👨💻 Super Friendly Support ###
|
43 |
|
@@ -113,12 +113,16 @@ Yes, it will work with any standard WordPress theme.
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
116 |
= 1.3.2 - 20-01-2022 =
|
117 |
Added: Tri-State Dependency Actions for Filter ( include, exclude and nothing ).
|
118 |
Fixed: Adding Template to My Cloud is not working.
|
119 |
Fixed: WorkSpace Dropdown List Keeps Same if I switched to another WorkSpace.
|
120 |
Fixed: Filter reset button not clearing the tags properly.
|
121 |
-
Fixed: Cannot save the change in
|
122 |
Few minor bug fix and improvements
|
123 |
|
124 |
= 1.3.1 - 21-11-2021 =
|
1 |
+
=== Templately - Templates Cloud for Elementor & Gutenberg : 2000+ Free Designs! ===
|
2 |
Contributors: templately, wpdevteam, re_enter_rupok, Asif2BD, priyomukul, rahat89, shadab109
|
3 |
Donate link: https://templately.com
|
4 |
Tags: templates, elementor, template-cloud, template, clouds, elementor templates, gutenberg, gutenberg templates, wordpress cloud, cloud backup
|
5 |
Requires at least: 5.0
|
6 |
+
Tested up to: 5.9
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 1.3.3
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
35 |
|
36 |
Create landing pages with Elementor, Gutenberg and boost up your page building experience to the next level.
|
37 |
|
38 |
+
### 🔥 Over 1800 Elementor Templates Available Already ###
|
39 |
|
40 |
+
Elementor Template are easiest way to build website fast with the most popular pagebuilder, we have 1800+ templates available already.
|
41 |
|
42 |
### 👨💻 Super Friendly Support ###
|
43 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 1.3.3 - 25-01-2022 =
|
117 |
+
Fixed: Category filter issue.
|
118 |
+
Few minor bug fix and improvements
|
119 |
+
|
120 |
= 1.3.2 - 20-01-2022 =
|
121 |
Added: Tri-State Dependency Actions for Filter ( include, exclude and nothing ).
|
122 |
Fixed: Adding Template to My Cloud is not working.
|
123 |
Fixed: WorkSpace Dropdown List Keeps Same if I switched to another WorkSpace.
|
124 |
Fixed: Filter reset button not clearing the tags properly.
|
125 |
+
Fixed: Cannot save the change in WorkSpace.
|
126 |
Few minor bug fix and improvements
|
127 |
|
128 |
= 1.3.1 - 21-11-2021 =
|
assets/js/templately.min.js
CHANGED
@@ -87,4 +87,4 @@ e.exports=function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw
|
|
87 |
*
|
88 |
* This source code is licensed under the MIT license found in the
|
89 |
* LICENSE file in the root directory of this source tree.
|
90 |
-
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,s=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(s,0))},a=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var y=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var v=!1,b=null,w=-1,E=5,O=0;i=function(){return t.unstable_now()>=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var S=new MessageChannel,k=S.port2;S.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();O=e+E;try{b(!0,e)?k.postMessage(null):(v=!1,b=null)}catch(e){throw k.postMessage(null),e}}else v=!1},r=function(e){b=e,v||(v=!0,k.postMessage(null))},a=function(e,n){w=m((function(){e(t.unstable_now())}),n)},o=function(){h(w),w=-1}}function _(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<P(a,t)))break e;e[r]=t,e[n]=a,n=r}}function j(e){return void 0===(e=e[0])?null:e}function x(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,c=e[l];if(void 0!==i&&0>P(i,n))void 0!==c&&0>P(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==c&&0>P(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],T=[],A=1,N=null,L=3,I=!1,D=!1,M=!1;function R(e){for(var t=j(T);null!==t;){if(null===t.callback)x(T);else{if(!(t.startTime<=e))break;x(T),t.sortIndex=t.expirationTime,_(C,t)}t=j(T)}}function F(e){if(M=!1,R(e),!D)if(null!==j(C))D=!0,r(z);else{var t=j(T);null!==t&&a(F,t.startTime-e)}}function z(e,n){D=!1,M&&(M=!1,o()),I=!0;var r=L;try{for(R(n),N=j(C);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,L=N.priorityLevel;var c=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?N.callback=c:N===j(C)&&x(C),R(n)}else x(C);N=j(C)}if(null!==N)var u=!0;else{var s=j(T);null!==s&&a(F,s.startTime-n),u=!1}return u}finally{N=null,L=r,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||I||(D=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return L},t.unstable_getFirstCallbackNode=function(){return j(C)},t.unstable_next=function(e){switch(L){case 1:case 2:case 3:var t=3;break;default:t=L}var n=L;L=t;try{return e()}finally{L=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=L;L=e;try{return t()}finally{L=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?l+c:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),c=l;return e={id:A++,callback:n,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>l?(e.sortIndex=c,_(T,e),null===j(C)&&e===j(T)&&(M?o():M=!0,a(F,c-l))):(e.sortIndex=i,_(C,e),D||I||(D=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=j(C);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=L;return function(){var n=L;L=t;try{return e.apply(this,arguments)}finally{L=n}}}},function(e,t,n){},function(e,t,n){!function(t){"use strict";var n=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var n=t(e).toLowerCase();return(r="application/font-woff",{woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var r},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var n=window.atob(e.toDataURL().split(",")[1]),r=n.length,a=new Uint8Array(r),o=0;o<r;o++)a[o]=n.charCodeAt(o);t(new Blob([a],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var n=document.implementation.createHTMLDocument(),r=n.createElement("base");n.head.appendChild(r);var a=n.createElement("a");return n.body.appendChild(a),r.href=t,a.href=e,a.href},getAndEncode:function(e){l.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(t){var n,r=new XMLHttpRequest;if(r.onreadystatechange=function(){if(4!==r.readyState)return;if(200!==r.status)return void(n?t(n):o("cannot fetch resource: "+e+", status: "+r.status));var a=new FileReader;a.onloadend=function(){var e=a.result.split(/,/)[1];t(e)},a.readAsDataURL(r.response)},r.ontimeout=function(){n?t(n):o("timeout of 30000ms occured while fetching resource: "+e)},r.responseType="blob",r.timeout=3e4,r.open("GET",e,!0),r.send(),l.impl.options.imagePlaceholder){var a=l.impl.options.imagePlaceholder.split(/,/);a&&a[1]&&(n=a[1])}function o(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))}},asArray:function(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=e}))},width:function(e){var t=n(e,"border-left-width"),r=n(e,"border-right-width");return e.scrollWidth+t+r},height:function(e){var t=n(e,"border-top-width"),r=n(e,"border-bottom-width");return e.scrollHeight+t+r}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function n(e,t){var n=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(n.replace("px",""))}}(),r=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,n,o){return function(){return!t(e)}()?Promise.resolve(e):Promise.resolve(e).then(r).then((function(t){var r=Promise.resolve(e);return t.forEach((function(e){r=r.then((function(t){return a(t,e,n,o)}))})),r}))},shouldProcess:t,impl:{readUrls:r,inline:a}};function t(t){return-1!==t.search(e)}function r(t){for(var r,a=[];null!==(r=e.exec(t));)a.push(r[1]);return a.filter((function(e){return!n.isDataUrl(e)}))}function a(e,t,r,a){return Promise.resolve(t).then((function(e){return r?n.resolveUrl(e,r):e})).then(a||n.getAndEncode).then((function(e){return n.dataAsUrl(e,n.mimeType(t))})).then((function(r){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+n.escape(e)+")(['\"]?\\))","g")}(t),"$1"+r+"$3")}))}}(),a=function(){return{resolveAll:function(){return e(document).then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{n.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return r.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),o=function(){return{inlineAll:function t(a){return a instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?r.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(a).then((function(){return a instanceof HTMLImageElement?e(a).inline():Promise.all(n.asArray(a.childNodes).map((function(e){return t(e)})))})):Promise.resolve(a)},impl:{newImage:e}};function e(e){return{inline:function(t){return n.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||n.getAndEncode).then((function(t){return n.dataAsUrl(t,n.mimeType(e.src))})).then((function(t){return new Promise((function(n,r){e.onload=n,e.onerror=r,e.src=t}))}))}}}}(),i={imagePlaceholder:void 0,cacheBust:!1},l={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(n.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,n.width(e),n.height(e)).data}))},impl:{fontFaces:a,images:o,util:n,inliner:r,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?l.impl.options.imagePlaceholder=i.imagePlaceholder:l.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?l.impl.options.cacheBust=i.cacheBust:l.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return function e(t,r,a){return a||!r||r(t)?Promise.resolve(t).then((function(e){return e instanceof HTMLCanvasElement?n.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(e){return o(t,e,r)})).then((function(e){return function(e,t){return t instanceof Element?Promise.resolve().then(r).then(a).then(o).then(i).then((function(){return t})):t;function r(){var r,a;r=window.getComputedStyle(e),a=t.style,r.cssText?a.cssText=r.cssText:function(e,t){n.asArray(e).forEach((function(n){t.setProperty(n,e.getPropertyValue(n),e.getPropertyPriority(n))}))}(r,a)}function a(){[":before",":after"].forEach((function(r){!function(r){var a=window.getComputedStyle(e,r),o=a.getPropertyValue("content");if(""===o||"none"===o)return;var i=n.uid();t.className=t.className+" "+i;var l=document.createElement("style");l.appendChild(function(e,t,r){var a="."+e+":"+t,o=r.cssText?function(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}(r):function(e){return n.asArray(e).map((function(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")})).join("; ")+";"}(r);return document.createTextNode(a+"{"+o+"}")}(i,r,a)),t.appendChild(l)}(r)}))}function o(){e instanceof HTMLTextAreaElement&&(t.innerHTML=e.value),e instanceof HTMLInputElement&&t.setAttribute("value",e.value)}function i(){t instanceof SVGElement&&(t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t instanceof SVGRectElement&&["width","height"].forEach((function(e){var n=t.getAttribute(e);n&&t.style.setProperty(e,n)})))}}(t,e)})):Promise.resolve();function o(t,r,a){var o=t.childNodes;return 0===o.length?Promise.resolve(r):i(r,n.asArray(o),a).then((function(){return r}));function i(t,n,r){var a=Promise.resolve();return n.forEach((function(n){a=a.then((function(){return e(n,r)})).then((function(e){e&&t.appendChild(e)}))})),a}}}(e,t.filter,!0)})).then(s).then(f).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(n){e.style[n]=t.style[n]}));return e})).then((function(r){return function(e,t,r){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(n.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+r+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(r,t.width||n.width(e),t.height||n.height(e))}))}function u(e,t){return c(e,t).then(n.makeImage).then(n.delay(100)).then((function(r){var a=function(e){var r=document.createElement("canvas");if(r.width=t.width||n.width(e),r.height=t.height||n.height(e),t.bgcolor){var a=r.getContext("2d");a.fillStyle=t.bgcolor,a.fillRect(0,0,r.width,r.height)}return r}(e);return a.getContext("2d").drawImage(r,0,0),a}))}function s(e){return a.resolveAll().then((function(t){var n=document.createElement("style");return e.appendChild(n),n.appendChild(document.createTextNode(t)),e}))}function f(e){return o.inlineAll(e).then((function(){return e}))}e.exports=l}()},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"find",(function(){return Ff}));var a={};n.r(a),n.d(a,"isTabbableIndex",(function(){return Uf})),n.d(a,"find",(function(){return $f})),n.d(a,"findPrevious",(function(){return qf})),n.d(a,"findNext",(function(){return Kf}));var o=n(0),i=n.n(o),l=n(12),c=n.n(l),u=n(13);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function p(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var d=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var u=0,s=a.length;s>=0;s--){var d=a[s];"."===d?p(a,s):".."===d?(p(a,s),u++):u&&(p(a,s),u--)}if(!l)for(;u--;u)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},y="Invariant failed";function g(e,t){if(!e)throw new Error(y)}function v(e){return"/"===e.charAt(0)?e:"/"+e}function b(e){return"/"===e.charAt(0)?e.substr(1):e}function w(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function E(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function O(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function S(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=d(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function k(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var _=!("undefined"==typeof window||!window.document||!window.document.createElement);function j(e,t){t(window.confirm(e))}function x(){try{return window.history.state||{}}catch(e){return{}}}function P(e){void 0===e&&(e={}),_||g(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,c=o.getUserConfirmation,u=void 0===c?j:c,f=o.keyLength,p=void 0===f?6:f,d=e.basename?E(v(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return d&&(o=w(o,d)),S(o,r,n)}function h(){return Math.random().toString(36).substr(2,p)}var y=k();function b(e){s(z,e),z.length=n.length,y.notifyListeners(z.location,z.action)}function P(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||A(m(e.state))}function C(){A(m(x()))}var T=!1;function A(e){if(T)T=!1,b();else{y.confirmTransitionTo(e,"POP",u,(function(t){t?b({action:"POP",location:e}):function(e){var t=z.location,n=L.indexOf(t.key);-1===n&&(n=0);var r=L.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(T=!0,D(a))}(e)}))}}var N=m(x()),L=[N.key];function I(e){return d+O(e)}function D(e){n.go(e)}var M=0;function R(e){1===(M+=e)&&1===e?(window.addEventListener("popstate",P),a&&window.addEventListener("hashchange",C)):0===M&&(window.removeEventListener("popstate",P),a&&window.removeEventListener("hashchange",C))}var F=!1;var z={length:n.length,action:"POP",location:N,createHref:I,push:function(e,t){var a=S(e,t,h(),z.location);y.confirmTransitionTo(a,"PUSH",u,(function(e){if(e){var t=I(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var c=L.indexOf(z.location.key),u=L.slice(0,c+1);u.push(a.key),L=u,b({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=S(e,t,h(),z.location);y.confirmTransitionTo(a,"REPLACE",u,(function(e){if(e){var t=I(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var c=L.indexOf(z.location.key);-1!==c&&(L[c]=a.key),b({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=y.setPrompt(e);return F||(R(1),F=!0),function(){return F&&(F=!1,R(-1)),t()}},listen:function(e){var t=y.appendListener(e);return R(1),function(){R(-1),t()}}};return z}var C={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+b(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:b,decodePath:v},slash:{encodePath:v,decodePath:v}};function T(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function A(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function N(e){window.location.replace(T(window.location.href)+"#"+e)}function L(e){void 0===e&&(e={}),_||g(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?j:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?E(v(e.basename)):"",c=C[i],u=c.encodePath,f=c.decodePath;function p(){var e=f(A());return l&&(e=w(e,l)),S(e)}var d=k();function m(e){s(z,e),z.length=t.length,d.notifyListeners(z.location,z.action)}var h=!1,y=null;function b(){var e,t,n=A(),r=u(n);if(n!==r)N(r);else{var o=p(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(y===O(o))return;y=null,function(e){if(h)h=!1,m();else{d.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=I.lastIndexOf(O(t));-1===n&&(n=0);var r=I.lastIndexOf(O(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,D(a))}(e)}))}}(o)}}var x=A(),P=u(x);x!==P&&N(P);var L=p(),I=[O(L)];function D(e){t.go(e)}var M=0;function R(e){1===(M+=e)&&1===e?window.addEventListener("hashchange",b):0===M&&window.removeEventListener("hashchange",b)}var F=!1;var z={length:t.length,action:"POP",location:L,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=T(window.location.href)),n+"#"+u(l+O(e))},push:function(e,t){var n=S(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=O(n),r=u(l+t);if(A()!==r){y=t,function(e){window.location.hash=e}(r);var a=I.lastIndexOf(O(z.location)),o=I.slice(0,a+1);o.push(t),I=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=S(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=O(n),r=u(l+t);A()!==r&&(y=t,N(r));var a=I.indexOf(O(z.location));-1!==a&&(I[a]=t),m({action:"REPLACE",location:n})}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=d.setPrompt(e);return F||(R(1),F=!0),function(){return F&&(F=!1,R(-1)),t()}},listen:function(e){var t=d.appendListener(e);return R(1),function(){R(-1),t()}}};return z}function I(e,t,n){return Math.min(Math.max(e,t),n)}function D(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=k();function f(e){s(g,e),g.length=g.entries.length,u.notifyListeners(g.location,g.action)}function p(){return Math.random().toString(36).substr(2,c)}var d=I(i,0,a.length-1),m=a.map((function(e){return S(e,void 0,"string"==typeof e?p():e.key||p())})),h=O;function y(e){var t=I(g.index+e,0,g.entries.length-1),r=g.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var g={length:m.length,action:"POP",location:m[d],index:d,entries:m,createHref:h,push:function(e,t){var r=S(e,t,p(),g.location);u.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=S(e,t,p(),g.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=g.index+e;return t>=0&&t<g.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return g}var M=n(59),R=n(41),F=n.n(R);n(82);function z(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var U=n(24),B=n.n(U),V=function(e){var t=Object(M.a)();return t.displayName=e,t},W=V("Router-History"),H=V("Router"),$=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(u.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.a.createElement(H.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.a.createElement(W.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.a.Component);i.a.Component;var q=function(e){function t(){return e.apply(this,arguments)||this}Object(u.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.a.Component);var K={},Q=0;function G(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(K[e])return K[e];var t=F.a.compile(e);return Q<1e4&&(K[e]=t,Q++),t}(e)(t,{pretty:!0})}function Y(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var r=e.history,o=e.staticContext,l=a?r.push:r.replace,c=S(t?"string"==typeof n?G(n,t.params):s({},n,{pathname:G(n.pathname,t.params)}):n);return o?(l(c),null):i.a.createElement(q,{onMount:function(){l(c)},onUpdate:function(e,t){var n,r,a=S(t.to);n=a,r=s({},c,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(c)},to:n})}))}var X={},J=0;function Z(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,c=n.sensitive,u=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=X[n]||(X[n]={});if(r[e])return r[e];var a=[],o={regexp:F()(e,a,t),keys:a};return J<1e4&&(r[e]=o,J++),o}(n,{end:o,strict:l,sensitive:u}),a=r.regexp,i=r.keys,c=a.exec(e);if(!c)return null;var s=c[0],f=c.slice(1),p=e===s;return o&&!p?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var ee=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(H.Consumer,null,(function(t){t||g(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Z(n.pathname,e.props):t.match}),a=e.props,o=a.children,l=a.component,c=a.render;return Array.isArray(o)&&function(e){return 0===i.a.Children.count(e)}(o)&&(o=null),i.a.createElement(H.Provider,{value:r},r.match?o?"function"==typeof o?o(r):o:l?i.a.createElement(l,r):c?c(r):null:"function"==typeof o?o(r):null)}))},t}(i.a.Component);function te(e){return"/"===e.charAt(0)?e:"/"+e}function ne(e,t){if(!e)return t;var n=te(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function re(e){return"string"==typeof e?e:O(e)}function ae(e){return function(){g(!1)}}function oe(){}i.a.Component;var ie=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(H.Consumer,null,(function(t){t||g(!1);var n,r,a=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?Z(a.pathname,s({},e.props,{path:o})):t.match}})),r?i.a.cloneElement(n,{location:a,computedMatch:r}):null}))},t}(i.a.Component);var le=i.a.useContext;function ce(){return le(W)}function ue(){return le(H).location}function se(){var e=le(H).match;return e?e.params:{}}i.a.Component;var fe=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=L(t.props),t}return Object(u.a)(t,e),t.prototype.render=function(){return i.a.createElement($,{history:this.history,children:this.props.children})},t}(i.a.Component);var pe=function(e,t){return"function"==typeof e?e(t):e},de=function(e,t){return"string"==typeof e?S(e,null,null,t):e},me=function(e){return e},he=i.a.forwardRef;void 0===he&&(he=me);var ye=he((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=z(e,["innerRef","navigate","onClick"]),l=o.target,c=s({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=me!==he&&t||n,i.a.createElement("a",c)}));var ge=he((function(e,t){var n=e.component,r=void 0===n?ye:n,a=e.replace,o=e.to,l=e.innerRef,c=z(e,["component","replace","to","innerRef"]);return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var n=e.history,u=de(pe(o,e.location),e.location),f=u?n.createHref(u):"",p=s({},c,{href:f,navigate:function(){var t=pe(o,e.location),r=O(e.location)===O(de(t));(a||r?n.replace:n.push)(t)}});return me!==he?p.ref=t||l:p.innerRef=l,i.a.createElement(r,p)}))})),ve=function(e){return e},be=i.a.forwardRef;void 0===be&&(be=ve);be((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,a=e.activeClassName,o=void 0===a?"active":a,l=e.activeStyle,c=e.className,u=e.exact,f=e.isActive,p=e.location,d=e.sensitive,m=e.strict,h=e.style,y=e.to,v=e.innerRef,b=z(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var n=p||e.location,a=de(pe(y,n),n),w=a.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=E?Z(n.pathname,{path:E,exact:u,sensitive:d,strict:m}):null,S=!!(f?f(O,n):O),k="function"==typeof c?c(S):c,_="function"==typeof h?h(S):h;S&&(k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(k,o),_=s({},_,l));var j=s({"aria-current":S&&r||null,className:k,style:_,to:a},b);return ve!==be?j.ref=t||v:j.innerRef=v,i.a.createElement(ge,j)}))}));var we=i.a.createContext(null);var Ee=function(e){e()};function Oe(){var e=Ee,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,a=n={callback:e,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){r&&null!==t&&(r=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var Se={notify:function(){},get:function(){return[]}};function ke(e,t){var n,r=Se;function a(){i.onStateChange&&i.onStateChange()}function o(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Oe())}var i={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=Se)},getListeners:function(){return r}};return i}var _e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;var je=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=ke(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(o.useMemo)((function(){return t.getState()}),[t]);_e((function(){var e=a.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,l]);var c=n||we;return i.a.createElement(c.Provider,{value:a},r)},xe=n(56),Pe=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Ce=["reactReduxForwardedRef"],Te=[],Ae=[null,null];function Ne(e,t){var n=e[1];return[t.payload,n+1]}function Le(e,t,n){_e((function(){return e.apply(void 0,t)}),n)}function Ie(e,t,n,r,a,o,i){e.current=r,t.current=a,n.current=!1,o.current&&(o.current=null,i())}function De(e,t,n,r,a,o,i,l,c,u){if(e){var s=!1,f=null,p=function(){if(!s){var e,n,p=t.getState();try{e=r(p,a.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?i.current||c():(o.current=e,l.current=e,i.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(s=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var Me=function(){return[null,0]};function Re(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,l=n.methodName,c=void 0===l?"connectAdvanced":l,u=n.renderCountProp,f=void 0===u?void 0:u,p=n.shouldHandleStateChanges,d=void 0===p||p,m=n.storeKey,h=void 0===m?"store":m,y=(n.withRef,n.forwardRef),g=void 0!==y&&y,v=n.context,b=void 0===v?we:v,w=z(n,Pe),E=b;return function(t){var n=t.displayName||t.name||"Component",r=a(n),l=s({},w,{getDisplayName:a,methodName:c,renderCountProp:f,shouldHandleStateChanges:d,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),u=w.pure;var p=u?o.useMemo:function(e){return e()};function m(n){var r=Object(o.useMemo)((function(){var e=n.reactReduxForwardedRef,t=z(n,Ce);return[n.context,e,t]}),[n]),a=r[0],c=r[1],u=r[2],f=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(xe.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:E}),[a,E]),m=Object(o.useContext)(f),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var y=h?n.store:m.store,g=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,l)}(y)}),[y]),v=Object(o.useMemo)((function(){if(!d)return Ae;var e=ke(y,h?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[y,h,m]),b=v[0],w=v[1],O=Object(o.useMemo)((function(){return h?m:s({},m,{subscription:b})}),[h,m,b]),S=Object(o.useReducer)(Ne,Te,Me),k=S[0][0],_=S[1];if(k&&k.error)throw k.error;var j=Object(o.useRef)(),x=Object(o.useRef)(u),P=Object(o.useRef)(),C=Object(o.useRef)(!1),T=p((function(){return P.current&&u===x.current?P.current:g(y.getState(),u)}),[y,k,u]);Le(Ie,[x,j,C,u,T,P,w]),Le(De,[d,y,b,g,x,j,C,P,w,_],[y,b,g]);var A=Object(o.useMemo)((function(){return i.a.createElement(t,s({},T,{ref:c}))}),[c,t,T]);return Object(o.useMemo)((function(){return d?i.a.createElement(f.Provider,{value:O},A):A}),[f,A,O])}var y=u?i.a.memo(m):m;if(y.WrappedComponent=t,y.displayName=m.displayName=r,g){var v=i.a.forwardRef((function(e,t){return i.a.createElement(y,s({},e,{reactReduxForwardedRef:t}))}));return v.displayName=r,v.WrappedComponent=t,B()(v,t)}return B()(y,t)}}function Fe(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ze(e,t){if(Fe(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!Fe(e[n[a]],t[n[a]]))return!1;return!0}function Ue(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function Be(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Ve(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Be(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=Be(a),a=r(t,n)),a},r}}var We=[function(e){return"function"==typeof e?Ve(e):void 0},function(e){return e?void 0:Ue((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?Ue((function(t){return function(e,t){var n={},r=function(r){var a=e[r];"function"==typeof a&&(n[r]=function(){return t(a.apply(void 0,arguments))})};for(var a in e)r(a);return n}(e,t)})):void 0}];var He=[function(e){return"function"==typeof e?Ve(e):void 0},function(e){return e?void 0:Ue((function(){return{}}))}];function qe(e,t,n){return s({},n,e,t)}var Ke=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,o=n.areMergedPropsEqual,i=!1;return function(t,n,l){var c=e(t,n,l);return i?a&&o(c,r)||(r=c):(i=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return qe}}];var Qe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ge(e,t,n,r){return function(a,o){return n(e(a,o),t(r,o),o)}}function Ye(e,t,n,r,a){var o,i,l,c,u,s=a.areStatesEqual,f=a.areOwnPropsEqual,p=a.areStatePropsEqual,d=!1;function m(a,d){var m,h,y=!f(d,i),g=!s(a,o);return o=a,i=d,y&&g?(l=e(o,i),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):y?(e.dependsOnOwnProps&&(l=e(o,i)),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):g?(m=e(o,i),h=!p(m,l),l=m,h&&(u=n(l,c,i)),u):u}return function(a,s){return d?m(a,s):(l=e(o=a,i=s),c=t(r,i),u=n(l,c,i),d=!0,u)}}function Xe(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,o=z(t,Qe),i=n(e,o),l=r(e,o),c=a(e,o);return(o.pure?Ye:Ge)(i,l,c,e,o)}var Je=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Ze(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function et(e,t){return e===t}function tt(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Re:n,a=t.mapStateToPropsFactories,o=void 0===a?He:a,i=t.mapDispatchToPropsFactories,l=void 0===i?We:i,c=t.mergePropsFactories,u=void 0===c?Ke:c,f=t.selectorFactory,p=void 0===f?Xe:f;return function(e,t,n,a){void 0===a&&(a={});var i=a,c=i.pure,f=void 0===c||c,d=i.areStatesEqual,m=void 0===d?et:d,h=i.areOwnPropsEqual,y=void 0===h?ze:h,g=i.areStatePropsEqual,v=void 0===g?ze:g,b=i.areMergedPropsEqual,w=void 0===b?ze:b,E=z(i,Je),O=Ze(e,o,"mapStateToProps"),S=Ze(t,l,"mapDispatchToProps"),k=Ze(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:O,initMapDispatchToProps:S,initMergeProps:k,pure:f,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var nt=tt();function rt(){return Object(o.useContext)(we)}function at(e){void 0===e&&(e=we);var t=e===we?rt:function(){return Object(o.useContext)(e)};return function(){return t().store}}var ot=at();function it(e){void 0===e&&(e=we);var t=e===we?ot:at(e);return function(){return t().dispatch}}var lt=it(),ct=function(e,t){return e===t};function ut(e){void 0===e&&(e=we);var t=e===we?rt:function(){return Object(o.useContext)(e)};return function(e,n){void 0===n&&(n=ct);var r=t(),a=function(e,t,n,r){var a,i=Object(o.useReducer)((function(e){return e+1}),0)[1],l=Object(o.useMemo)((function(){return ke(n,r)}),[n,r]),c=Object(o.useRef)(),u=Object(o.useRef)(),s=Object(o.useRef)(),f=Object(o.useRef)(),p=n.getState();try{if(e!==u.current||p!==s.current||c.current){var d=e(p);a=void 0!==f.current&&t(d,f.current)?f.current:d}else a=f.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return _e((function(){u.current=e,s.current=p,f.current=a,c.current=void 0})),_e((function(){function e(){try{var e=n.getState();if(e===s.current)return;var r=u.current(e);if(t(r,f.current))return;f.current=r,s.current=e}catch(e){c.current=e}i()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}}),[n,l]),a}(e,n,r.store,r.subscription);return Object(o.useDebugValue)(a),a}}var st,ft=ut();st=l.unstable_batchedUpdates,Ee=st;var pt=n(1);function dt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var mt="function"==typeof Symbol&&Symbol.observable||"@@observable",ht=function(){return Math.random().toString(36).substring(7).split("").join(".")},yt={INIT:"@@redux/INIT"+ht(),REPLACE:"@@redux/REPLACE"+ht(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ht()}};function gt(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Et={},Ot=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Et,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_ITEMS":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=bt({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_ITEMS":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=bt({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"BLOCKS_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=b.platform,S=w,k=E,_=bt({},e);return _.hasOwnProperty(O)?_=bt(bt({},_[O]),{},{currentPage:S,totalPages:k}):_[O]={currentPage:S,totalPages:k},_;case"BLOCKS_CURRENT_PAGE":var j=t.payload,x=bt(bt({},e),{},{currentPage:j});return x;default:return e}};function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?St(Object(n),!0).forEach((function(t){_t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jt={},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PAGES":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=kt({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_PAGES":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=kt({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"PAGES_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=kt(kt({},e),{},{totalPages:E,currentPage:w});return O;case"PAGES_CURRENT_PAGE":var S=t.payload,k=kt(kt({},e),{},{currentPage:S});return k;default:return e}};function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){Tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var At={},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PACKS":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=Ct({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_PACKS":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=Ct({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"PACKS_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=Ct(Ct({},e),{},{totalPages:E,currentPage:w});return O;case"PACKS_CURRENT_PAGE":var S=t.payload,k=Ct(Ct({},e),{},{currentPage:S});return k;default:return e}};function Lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function It(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){Dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mt={isOpen:!1,type:!1,deep:0},Rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"PREVIEW":var n=e;n.previousType=n.type;var r=It(It({},n),t.payload);return r;default:return e}};function Ft(e){return function(e){if(Array.isArray(e))return zt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(n),!0).forEach((function(t){Vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wt=TemplatelyAdmin,Ht=Wt.cloud_map,$t=Wt.platform,qt={platforms:Wt.platform_exists,platform:"templately"===$t?"elementor":$t,plan:"all",current_route:null,previous_route:null,next_route:null,isLoggedIn:!1,isTemplate:!1,successText:null,loading:!1,itemLoading:!1,templates:{current_page:1,total_page:null},cloud_files:{search:{}},cloud_map:Ht||[],activeSidebar:{activeSidebarMenu:"all",activeParentSidebarMenu:"",categoryFor:"blocks"},dependencyFilter:{filterActive:!1,filtersID:null,filtersResults:{}},all_items:[],filtered_items:[],activeBlockOrPage:{type:"all",ulActive:!1,id:null},pagination:1,need_pagination:!1,pagination_loading:!1,pushed_time:null,searchQuery:{query:"",results:[]},cloud_usage_limit:{limit:10,files:0},workspace_slug:!1,retry:!1,retryMessage:"",tags:[],is_global_login:!1,user_can_logout:!1,is_linked_login:!1,filter:{from:"wrapper"}},Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FILTER_FROM":var n=Bt({},e);return Bt(Bt({},n),{},{filter:Bt(Bt({},n.filter),{},{from:t.payload})});case"SET_RETRY":var r=t.payload,a=Bt(Bt({},e),{},{retry:r});return a;case"SET_RETRY_MSG":var o=t.payload,i=Bt(Bt({},e),{},{retryMessage:o});return i;case"ADD_PLATFORMS":var l=t.payload,c=Bt(Bt({},e),{},{platforms:l});return c;case"SET_PLATFORM":var u=t.payload,s=Bt(Bt({},e),{},{platform:u});return s;case"SET_PLAN":var f=t.payload,p=Bt(Bt({},e),{},{plan:f});return p;case"ALL_TEMPLATES":var d=t.payload,m=d.current_page,h=d.total_page,y=d.items,g=Bt({},e.templates);g.hasOwnProperty(m)||(g[m]=y,g.current_page=m,g.total_page=h);var v=Bt(Bt({},e),{},{templates:g});return v;case"REMOVE_TEMPLATE":var b=t.payload,w=b.id,E=b.page,O=e.templates[E].filter((function(e){return e.id!=w})),S=Bt({},e.templates);S[E]=O;var k=Bt(Bt({},e),{},{templates:S});return k;case"TEMPLATE_TRIGGER":var _=Bt(Bt({},e),t.payload);return _;case"CLOUD_RESET":var j=t.payload.platform,x=Bt({},e);return x.cloud_files[j]={},x;case"ALL_CLOUDS":var P=t.payload,C=P.current_page,T=P.data,A=P.total_page,N=P.platform,L=Bt({},e);return L.cloud_files.hasOwnProperty(N)||(L.cloud_files[N]={}),L.cloud_files[N][C]=T,L.cloud_files[N].total_page=A,L.cloud_files[N].current_page=C,L;case"REMOVE_CLOUD_FILE":var I=t.payload,D=I.id,M=I.page,R=I.platform,F=Bt({},e),z={};z[R]={},z[R].current_page=F.cloud_files[R].current_page,z[R].total_page=F.cloud_files[R].total_page;var U=F.cloud_files[R][M].filter((function(e){return e.id!=D}));return z[R][M]=U,F.cloud_files=z,F;case"ALL_CLOUDS_MAP":var B=Bt({},t.payload),V=Bt(Bt({},e),{},{cloud_map:B});return V;case"ACTIVE_SIDEBAR":var W=Bt(Bt({},e.activeSidebar),t.payload),H=Bt(Bt({},e),{},{activeSidebar:W});return H;case"FILTER_DEPENDENCIES_RESULTS":var $=t.payload,q=$.current_page,K=$.data,Q=$.platform,G=$.total_page,Y=$.plan,X=Bt({},e.dependencyFilter),J=Bt({},X.filtersResults);J.hasOwnProperty(Y)||(J[Y]={},J[Y][Q]={},J[Y][Q].total_page=G,J[Y][Q].current_page=q),J[Y][Q][q]=K,X=Bt(Bt({},X),{},{filtersResults:J});var Z=Bt(Bt({},e),{},{dependencyFilter:X});return Z;case"FILTER_DEPENDENCIES_ACTIVE":var ee=Bt({},e.dependencyFilter),te=t.payload;ee=Bt(Bt({},ee),{},{filterActive:te});var ne=Bt(Bt({},e),{},{dependencyFilter:ee});return ne;case"FILTER_DEPENDENCIES_ID":var re=Bt({},e.dependencyFilter),ae=t.payload;re=Bt(Bt({},re),{},{filtersID:ae});var oe=Bt(Bt({},e),{},{dependencyFilter:re});return oe;case"USER_CAN_LOGOUT":return Bt(Bt({},e),{},{user_can_logout:t.payload});case"IS_LINKED_LOGIN":return Bt(Bt({},e),{},{is_linked_login:t.payload});case"SET_GLOBAL_SIGN_IN":return Bt(Bt({},e),{},{is_global_login:t.payload});case"FILTERED_TAGS":return Bt(Bt({},e),{},{tags:Ft(t.payload)});case"COMMON_ALL_ITEMS":var ie=e;if(!1!==t.payload){var le=Ft(t.payload);ie=Bt(Bt({},e),{},{all_items:le})}return ie;case"COMMON_FILTERED_ITEMS":var ce=e;if(!1!==t.payload){var ue=Ft(t.payload);ce=Bt(Bt({},e),{},{filtered_items:ue})}return ce;case"PACK_BLOCK_OR_PAGE":var se=Bt(Bt({},e.activeBlockOrPage),t.payload),fe=Bt(Bt({},e),{},{activeBlockOrPage:se});return fe;case"SET_SUCCESS_TEXT":var pe=t.payload,de=Bt(Bt({},e),{},{successText:pe});return de;case"SET_PAGINATION":var me=t.payload,he=Bt(Bt({},e),{},{pagination:me});return he;case"NEED_PAGINATION":var ye=t.payload,ge=Bt(Bt({},e),{},{need_pagination:ye});return ge;case"PAGINATION_LOADING":var ve=t.payload,be=Bt(Bt({},e),{},{pagination_loading:ve});return be;case"SET_LOADING":var we=t.payload,Ee=Bt(Bt({},e),{},{loading:we});return Ee;case"SET_ITEM_LOADING":var Oe=t.payload,Se=Bt(Bt({},e),{},{itemLoading:Oe});return Se;case"SET_LOGGED_IN":var ke=t.payload,_e=Bt(Bt({},e),{},{isLoggedIn:ke});return _e;case"SET_CURRENT_ROUTE":var je=t.payload,xe=Bt(Bt({},e),{},{current_route:je});return xe;case"SET_PREV_ROUTE":var Pe=t.payload,Ce=Bt(Bt({},e),{},{previous_route:Pe});return Ce;case"SET_NEXT_ROUTE":var Te=t.payload,Ae=Bt(Bt({},e),{},{next_route:Te});return Ae;case"SET_PUSHED_TIME":var Ne=t.payload,Le=Bt(Bt({},e),{},{pushed_time:Ne});return Le;case"SEARCH_QUERY":var Ie=t.payload,De=Bt(Bt({},e),{},{searchQuery:Ie});return De;case"CLOUD_USAGE_LIMIT":var Me=t.payload,Re=Bt(Bt({},e),{},{cloud_usage_limit:Me});return Re;case"WORKSPACE_SLUG":var Fe=t.payload,ze=Bt(Bt({},e),{},{workspace_slug:Fe});return ze;default:return e}};function Qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xt={user:TemplatelyAdmin.admin||{},errorText:null,successText:null},Jt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER":var n=t.payload,r=Gt(Gt({},e),{},{user:n});return r;case"ERROR_TEXT":var a=t.payload,o=Gt(Gt({},e),{},{errorText:a});return o;case"SUCCESS_TEXT":var i=t.payload,l=Gt(Gt({},e),{},{successText:i});return l;default:return e}};function Zt(e){return function(e){if(Array.isArray(e))return en(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return en(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return en(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(n),!0).forEach((function(t){rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var an={current_page:1,total_page:1,workspacesList:[]},on=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:an,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"WORKSPACE_RESET":return{};case"ALL_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=nn(nn({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"ALL_WORKSPACE_LIST":var l=t.payload;return null!==l?nn(nn({},e),{},{workspacesList:l}):nn({},e);case"ADD_WORKSPACE_IN_LIST":var c=t.payload,u=[].concat(Zt(c),Zt(e.workspacesList)),s=nn(nn({},e),{},{workspacesList:u});return s;case"EDIT_WORKSPACE":var f=t.payload.page,p=t.payload.data,d=nn({},e);if(d.hasOwnProperty(f)){var m=Zt(d[f]).filter((function(e){return e.id!=p.id}));m=[p].concat(Zt(m)),d[f]=m}return d;case"DELETE_WORKSPACE":var h=t.payload.page,y=t.payload.data,g=nn({},e);if(g.hasOwnProperty(h)){var v=Zt(g[h]).filter((function(e){return e.id!=y}));g[h]=v}return g;case"CREATE_WORKSPACE":var b=t.payload.page,w=t.payload.data,E=nn({},e),O=[];return E.hasOwnProperty(b)?(O=[w].concat(Zt(E[b])),E[b]=O):E[b]=[w],E;case"WORKSPACES_TOTAL_PAGES":var S=t.payload,k=S.current_page,_=S.total_page,j=nn(nn({},e),{},{totalPages:_,currentPage:k});return j;case"WORKSPACES_CURRENT_PAGE":var x=t.payload,P=nn(nn({},e),{},{currentPage:x});return P;default:return e}};function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(n),!0).forEach((function(t){un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ln(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sn={current_page:1,total_page:1,sharedWorkspaceList:[]},fn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHARED_WORKSPACE_RESET":return{};case"SHARED_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=cn(cn({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"SHARED_WORKSPACE_LIST":var l=t.payload;return null!=l&&l.length>0?cn(cn({},e),{},{sharedWorkspaceList:l}):cn({},e);case"SHARED_WORKSPACES_TOTAL_PAGES":var c=t.payload,u=c.current_page,s=c.total_page,f=cn(cn({},e),{},{totalPages:s,currentPage:u});return f;case"SHARED_WORKSPACES_CURRENT_PAGE":var p=t.payload,d=cn(cn({},e),{},{currentPage:p});return d;default:return e}},pn=["files"];function dn(e){return function(e){if(Array.isArray(e))return mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bn={filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}},wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"WORKSPACE_DETAILS_RESET":return{filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}};case"ADD_WORKSPACE_WITH_DETAILS":var n=t.payload,r=n.slug,a=n.data,o=n.page,i=n.platform,l=gn({},e),c={},u={};return a.hasOwnProperty("files")&&null!==a.files&&(a.files.hasOwnProperty("data")&&(c=a.files.data),u.total_page=a.files.total_page,u.current_page=a.files.current_page,u[o]=c),l.hasOwnProperty(r)?l[r].hasOwnProperty("files")&&null!==l[r].files?l[r].files.hasOwnProperty(i)?l[r].files[i]=gn(gn({},l[r].files[i]),u):l[r].files[i]=u:(l[r].files={},l[r].files[i]=u):(delete a.file,l[r]=a,l[r].files={},l[r].files[i]=u),l;case"ADD_FILES_PAGE_FOR_A_WORKSPACE":var s=t.payload,f=s.slug,p=s.data,d=s.page,m=s.platform,h=s.total_page,y=gn({},e);return y.hasOwnProperty(f)&&y[f].hasOwnProperty("files")&&y[f].files.hasOwnProperty(m)&&(y[f].files[m][d]=p,y[f].files[m].total_page=h),y;case"REMOVE_FILES_PAGE_FOR_A_WORKSPACE":var g=t.payload,v=g.page,b=g.slug,w=g.platform,E=g.fileAdded,O=gn({},e);if(O.hasOwnProperty(b)&&O[b].hasOwnProperty("files"))if(!0===E){var S={};S.total_page=O[b].files[w].total_page,S.current_page=O[b].files[w].current_page,delete O[b].files[w],O[b].files[w]=S}else O[b].files.hasOwnProperty(w)&&delete O[b].files[w][v];return O;case"ALL_CLOUDS_FILE_LIST":var k=t.payload,_=k.slug,j=k.data,x=k.platform,P=gn({},e),C=gn({},P.filesList);return C.hasOwnProperty(x)||(C[x]={}),C[x][_]=j,P=gn(gn({},P),{},{filesList:C});case"EDIT_WORKSPACE_DETAILS":var T=t.payload,A=T.slug,N=T.data,L=T.page,I=T.platform,D=gn({},e),M={},R={};if(N.hasOwnProperty("files")&&null!==N.files&&(N.files.hasOwnProperty("data")&&(M=N.files.data),R.total_page=N.files.total_page,R.current_page=N.files.current_page,R[L]=M),D.hasOwnProperty(A)){N.files;var F=hn(N,pn);D[A]=gn(gn({},D[A]),F),D[A].hasOwnProperty("files")&&null!==D[A].files?D[A].files.hasOwnProperty(I)?D[A].files[I]=gn(gn({},D[A].files[I]),R):D[A].files[I]=R:(D[A].files={},D[A].files[I]=R)}else delete N.file,D[A]=N,D[A].files={},D[A].files[I]=R;return D;case"ADD_FILE_TO_WORKSPACE":var z=t.payload,U=z.slug,B=z.data,V=gn({},e),W=null;return V.hasOwnProperty(U)&&V[U].hasOwnProperty("files")&&V[U].files.hasOwnProperty("data")?(W=[].concat(dn(V[U].files.data),dn(B)),V[U].files.data=W):(W=B,V[U].files.data=W),V;case"DELETE_FILE_FROM_WORKSPACE":var H=t.payload,$=H.fileFrom,q=H.id,K=H.page,Q=gn({},e),G=[];return Q.hasOwnProperty($)&&Q[$].hasOwnProperty("files")&&null!=Q[$].files&&Q[$].files.hasOwnProperty(K)&&Q[$].files[K]&&Q[$].files[K].length>0&&(G=Q[$].files[K].filter((function(e){return e.id!==q})),Q[$].files[K]=G),Q;default:return e}};var En=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a};var On=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Sn=Array.isArray,kn=n(9),_n=kn.a.Symbol,jn=Object.prototype,xn=jn.hasOwnProperty,Pn=jn.toString,Cn=_n?_n.toStringTag:void 0;var Tn=function(e){var t=xn.call(e,Cn),n=e[Cn];try{e[Cn]=void 0;var r=!0}catch(e){}var a=Pn.call(e);return r&&(t?e[Cn]=n:delete e[Cn]),a},An=Object.prototype.toString;var Nn=function(e){return An.call(e)},Ln=_n?_n.toStringTag:void 0;var In=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ln&&Ln in Object(e)?Tn(e):Nn(e)};var Dn=function(e){return null!=e&&"object"==typeof e};var Mn=function(e){return"symbol"==typeof e||Dn(e)&&"[object Symbol]"==In(e)};var Rn=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Fn,zn=function(e){if(!Rn(e))return!1;var t=In(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Un=kn.a["__core-js_shared__"],Bn=(Fn=/[^.]+$/.exec(Un&&Un.keys&&Un.keys.IE_PROTO||""))?"Symbol(src)_1."+Fn:"";var Vn=function(e){return!!Bn&&Bn in e},Wn=Function.prototype.toString;var Hn=function(e){if(null!=e){try{return Wn.call(e)}catch(e){}try{return e+""}catch(e){}}return""},$n=/^\[object .+?Constructor\]$/,qn=Function.prototype,Kn=Object.prototype,Qn=qn.toString,Gn=Kn.hasOwnProperty,Yn=RegExp("^"+Qn.call(Gn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Xn=function(e){return!(!Rn(e)||Vn(e))&&(zn(e)?Yn:$n).test(Hn(e))};var Jn=function(e,t){return null==e?void 0:e[t]};var Zn=function(e,t){var n=Jn(e,t);return Xn(n)?n:void 0},er=Zn(Object,"create");var tr=function(){this.__data__=er?er(null):{},this.size=0};var nr=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var ar=function(e){var t=this.__data__;if(er){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rr.call(t,e)?t[e]:void 0},or=Object.prototype.hasOwnProperty;var ir=function(e){var t=this.__data__;return er?void 0!==t[e]:or.call(t,e)};var lr=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=er&&void 0===t?"__lodash_hash_undefined__":t,this};function cr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}cr.prototype.clear=tr,cr.prototype.delete=nr,cr.prototype.get=ar,cr.prototype.has=ir,cr.prototype.set=lr;var ur=cr;var sr=function(){this.__data__=[],this.size=0};var fr=function(e,t){return e===t||e!=e&&t!=t};var pr=function(e,t){for(var n=e.length;n--;)if(fr(e[n][0],t))return n;return-1},dr=Array.prototype.splice;var mr=function(e){var t=this.__data__,n=pr(t,e);return!(n<0)&&(n==t.length-1?t.pop():dr.call(t,n,1),--this.size,!0)};var hr=function(e){var t=this.__data__,n=pr(t,e);return n<0?void 0:t[n][1]};var yr=function(e){return pr(this.__data__,e)>-1};var gr=function(e,t){var n=this.__data__,r=pr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function vr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vr.prototype.clear=sr,vr.prototype.delete=mr,vr.prototype.get=hr,vr.prototype.has=yr,vr.prototype.set=gr;var br=vr,wr=Zn(kn.a,"Map");var Er=function(){this.size=0,this.__data__={hash:new ur,map:new(wr||br),string:new ur}};var Or=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Sr=function(e,t){var n=e.__data__;return Or(t)?n["string"==typeof t?"string":"hash"]:n.map};var kr=function(e){var t=Sr(this,e).delete(e);return this.size-=t?1:0,t};var _r=function(e){return Sr(this,e).get(e)};var jr=function(e){return Sr(this,e).has(e)};var xr=function(e,t){var n=Sr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Pr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pr.prototype.clear=Er,Pr.prototype.delete=kr,Pr.prototype.get=_r,Pr.prototype.has=jr,Pr.prototype.set=xr;var Cr=Pr;function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i)||o,i};return n.cache=new(Tr.Cache||Cr),n}Tr.Cache=Cr;var Ar=Tr;var Nr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lr=/\\(\\)?/g,Ir=function(e){var t=Ar(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Nr,(function(e,n,r,a){t.push(r?a.replace(Lr,"$1"):n||e)})),t}));var Dr=function(e){if("string"==typeof e||Mn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Mr=_n?_n.prototype:void 0,Rr=Mr?Mr.toString:void 0;var Fr=function e(t){if("string"==typeof t)return t;if(Sn(t))return En(t,e)+"";if(Mn(t))return Rr?Rr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var zr=function(e){return null==e?"":Fr(e)};var Ur=function(e){return Sn(e)?En(e,Dr):Mn(e)?[e]:On(Ir(zr(e)))};var Br=function(){this.__data__=new br,this.size=0};var Vr=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Wr=function(e){return this.__data__.get(e)};var Hr=function(e){return this.__data__.has(e)};var $r=function(e,t){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!wr||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Cr(r)}return n.set(e,t),this.size=n.size,this};function qr(e){var t=this.__data__=new br(e);this.size=t.size}qr.prototype.clear=Br,qr.prototype.delete=Vr,qr.prototype.get=Wr,qr.prototype.has=Hr,qr.prototype.set=$r;var Kr=qr;var Qr=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Gr=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Yr=function(e,t,n){"__proto__"==t&&Gr?Gr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Xr=Object.prototype.hasOwnProperty;var Jr=function(e,t,n){var r=e[t];Xr.call(e,t)&&fr(r,n)&&(void 0!==n||t in e)||Yr(e,t,n)};var Zr=function(e,t,n,r){var a=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],c=r?r(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?Yr(n,l,c):Jr(n,l,c)}return n};var ea=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var ta=function(e){return Dn(e)&&"[object Arguments]"==In(e)},na=Object.prototype,ra=na.hasOwnProperty,aa=na.propertyIsEnumerable,oa=ta(function(){return arguments}())?ta:function(e){return Dn(e)&&ra.call(e,"callee")&&!aa.call(e,"callee")},ia=n(28),la=/^(?:0|[1-9]\d*)$/;var ca=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&la.test(e))&&e>-1&&e%1==0&&e<t};var ua=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},sa={};sa["[object Float32Array]"]=sa["[object Float64Array]"]=sa["[object Int8Array]"]=sa["[object Int16Array]"]=sa["[object Int32Array]"]=sa["[object Uint8Array]"]=sa["[object Uint8ClampedArray]"]=sa["[object Uint16Array]"]=sa["[object Uint32Array]"]=!0,sa["[object Arguments]"]=sa["[object Array]"]=sa["[object ArrayBuffer]"]=sa["[object Boolean]"]=sa["[object DataView]"]=sa["[object Date]"]=sa["[object Error]"]=sa["[object Function]"]=sa["[object Map]"]=sa["[object Number]"]=sa["[object Object]"]=sa["[object RegExp]"]=sa["[object Set]"]=sa["[object String]"]=sa["[object WeakMap]"]=!1;var fa=function(e){return Dn(e)&&ua(e.length)&&!!sa[In(e)]};var pa=function(e){return function(t){return e(t)}},da=n(18),ma=da.a&&da.a.isTypedArray,ha=ma?pa(ma):fa,ya=Object.prototype.hasOwnProperty;var ga=function(e,t){var n=Sn(e),r=!n&&oa(e),a=!n&&!r&&Object(ia.a)(e),o=!n&&!r&&!a&&ha(e),i=n||r||a||o,l=i?ea(e.length,String):[],c=l.length;for(var u in e)!t&&!ya.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ca(u,c))||l.push(u);return l},va=Object.prototype;var ba=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||va)};var wa=function(e,t){return function(n){return e(t(n))}},Ea=wa(Object.keys,Object),Oa=Object.prototype.hasOwnProperty;var Sa=function(e){if(!ba(e))return Ea(e);var t=[];for(var n in Object(e))Oa.call(e,n)&&"constructor"!=n&&t.push(n);return t};var ka=function(e){return null!=e&&ua(e.length)&&!zn(e)};var _a=function(e){return ka(e)?ga(e):Sa(e)};var ja=function(e,t){return e&&Zr(t,_a(t),e)};var xa=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Pa=Object.prototype.hasOwnProperty;var Ca=function(e){if(!Rn(e))return xa(e);var t=ba(e),n=[];for(var r in e)("constructor"!=r||!t&&Pa.call(e,r))&&n.push(r);return n};var Ta=function(e){return ka(e)?ga(e,!0):Ca(e)};var Aa=function(e,t){return e&&Zr(t,Ta(t),e)},Na=n(58);var La=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o};var Ia=function(){return[]},Da=Object.prototype.propertyIsEnumerable,Ma=Object.getOwnPropertySymbols,Ra=Ma?function(e){return null==e?[]:(e=Object(e),La(Ma(e),(function(t){return Da.call(e,t)})))}:Ia;var Fa=function(e,t){return Zr(e,Ra(e),t)};var za=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Ua=wa(Object.getPrototypeOf,Object),Ba=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)za(t,Ra(e)),e=Ua(e);return t}:Ia;var Va=function(e,t){return Zr(e,Ba(e),t)};var Wa=function(e,t,n){var r=t(e);return Sn(e)?r:za(r,n(e))};var Ha=function(e){return Wa(e,_a,Ra)};var $a=function(e){return Wa(e,Ta,Ba)},qa=Zn(kn.a,"DataView"),Ka=Zn(kn.a,"Promise"),Qa=Zn(kn.a,"Set"),Ga=Zn(kn.a,"WeakMap"),Ya=Hn(qa),Xa=Hn(wr),Ja=Hn(Ka),Za=Hn(Qa),eo=Hn(Ga),to=In;(qa&&"[object DataView]"!=to(new qa(new ArrayBuffer(1)))||wr&&"[object Map]"!=to(new wr)||Ka&&"[object Promise]"!=to(Ka.resolve())||Qa&&"[object Set]"!=to(new Qa)||Ga&&"[object WeakMap]"!=to(new Ga))&&(to=function(e){var t=In(e),n="[object Object]"==t?e.constructor:void 0,r=n?Hn(n):"";if(r)switch(r){case Ya:return"[object DataView]";case Xa:return"[object Map]";case Ja:return"[object Promise]";case Za:return"[object Set]";case eo:return"[object WeakMap]"}return t});var no=to,ro=Object.prototype.hasOwnProperty;var ao=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ro.call(e,"index")&&(n.index=e.index,n.input=e.input),n},oo=kn.a.Uint8Array;var io=function(e){var t=new e.constructor(e.byteLength);return new oo(t).set(new oo(e)),t};var lo=function(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},co=/\w*$/;var uo=function(e){var t=new e.constructor(e.source,co.exec(e));return t.lastIndex=e.lastIndex,t},so=_n?_n.prototype:void 0,fo=so?so.valueOf:void 0;var po=function(e){return fo?Object(fo.call(e)):{}};var mo=function(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var ho=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return io(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return lo(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return mo(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return uo(e);case"[object Set]":return new r;case"[object Symbol]":return po(e)}},yo=Object.create,go=function(){function e(){}return function(t){if(!Rn(t))return{};if(yo)return yo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var vo=function(e){return"function"!=typeof e.constructor||ba(e)?{}:go(Ua(e))};var bo=function(e){return Dn(e)&&"[object Map]"==no(e)},wo=da.a&&da.a.isMap,Eo=wo?pa(wo):bo;var Oo=function(e){return Dn(e)&&"[object Set]"==no(e)},So=da.a&&da.a.isSet,ko=So?pa(So):Oo,_o={};_o["[object Arguments]"]=_o["[object Array]"]=_o["[object ArrayBuffer]"]=_o["[object DataView]"]=_o["[object Boolean]"]=_o["[object Date]"]=_o["[object Float32Array]"]=_o["[object Float64Array]"]=_o["[object Int8Array]"]=_o["[object Int16Array]"]=_o["[object Int32Array]"]=_o["[object Map]"]=_o["[object Number]"]=_o["[object Object]"]=_o["[object RegExp]"]=_o["[object Set]"]=_o["[object String]"]=_o["[object Symbol]"]=_o["[object Uint8Array]"]=_o["[object Uint8ClampedArray]"]=_o["[object Uint16Array]"]=_o["[object Uint32Array]"]=!0,_o["[object Error]"]=_o["[object Function]"]=_o["[object WeakMap]"]=!1;var jo=function e(t,n,r,a,o,i){var l,c=1&n,u=2&n,s=4&n;if(r&&(l=o?r(t,a,o,i):r(t)),void 0!==l)return l;if(!Rn(t))return t;var f=Sn(t);if(f){if(l=ao(t),!c)return On(t,l)}else{var p=no(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(ia.a)(t))return Object(Na.a)(t,c);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(l=u||d?{}:vo(t),!c)return u?Va(t,Aa(l,t)):Fa(t,ja(l,t))}else{if(!_o[p])return o?t:{};l=ho(t,p,c)}}i||(i=new Kr);var m=i.get(t);if(m)return m;i.set(t,l),ko(t)?t.forEach((function(a){l.add(e(a,n,r,a,t,i))})):Eo(t)&&t.forEach((function(a,o){l.set(o,e(a,n,r,o,t,i))}));var h=f?void 0:(s?u?$a:Ha:u?Ta:_a)(t);return Qr(h||t,(function(a,o){h&&(a=t[o=a]),Jr(l,o,e(a,n,r,o,t,i))})),l};var xo=function(e){return jo(e,4)};function Po(e){return(Po="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)}var Co=function(e,t,n,r){void 0===r&&(r=0);for(var a=Ur(t);e&&r<a.length;)e=e[a[r++]];return void 0===e?n:e},To=function(e,t,n){for(var r=xo(e),a=r,o=0,i=Ur(t);o<i.length-1;o++){var l=i[o],c=Co(e,i.slice(0,o+1));if(c&&(No(c)||Array.isArray(c)))a=a[l]=xo(c);else{var u=i[o+1];a=a[l]=Ao(u)&&Number(u)>=0?[]:{}}}return(0===o?e:a)[i[o]]===n?e:(void 0===n?delete a[i[o]]:a[i[o]]=n,0===o&&void 0===n&&delete r[i[o]],r)},Ao=function(e){return String(Math.floor(Number(e)))===e},No=function(e){return null!==e&&"object"===Po(e)&&!(null!==(t=e)&&"object"===Po(t)&&Array.isArray(t));var t};function Lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(n),!0).forEach((function(t){Do(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Do(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mo={profile:TemplatelyAdmin.admin||{},favourites:{},downloads:{currentPage:1,totalPage:1}},Ro=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return To(n,e,t)},Fo=function e(t,n,r){var a;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(dt(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(dt(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(dt(2));var o=t,i=n,l=[],c=l,u=!1;function s(){c===l&&(c=l.slice())}function f(){if(u)throw new Error(dt(3));return i}function p(e){if("function"!=typeof e)throw new Error(dt(4));if(u)throw new Error(dt(5));var t=!0;return s(),c.push(e),function(){if(t){if(u)throw new Error(dt(6));t=!1,s();var n=c.indexOf(e);c.splice(n,1),l=null}}}function d(e){if(!gt(e))throw new Error(dt(7));if(void 0===e.type)throw new Error(dt(8));if(u)throw new Error(dt(9));try{u=!0,i=o(i,e)}finally{u=!1}for(var t=l=c,n=0;n<t.length;n++){(0,t[n])()}return e}function m(e){if("function"!=typeof e)throw new Error(dt(10));o=e,d({type:yt.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(dt(11));function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[mt]=function(){return this},e}return d({type:yt.INIT}),(a={dispatch:d,subscribe:p,getState:f,replaceReducer:m})[mt]=h,a}(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}var o,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:yt.INIT}))throw new Error(dt(12));if(void 0===n(void 0,{type:yt.PROBE_UNKNOWN_ACTION()}))throw new Error(dt(13))}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,a={},l=0;l<i.length;l++){var c=i[l],u=n[c],s=e[c],f=u(s,t);if(void 0===f){t&&t.type;throw new Error(dt(14))}a[c]=f,r=r||f!==s}return(r=r||i.length!==Object.keys(e).length)?a:e}}({profile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mo,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER_PROFILE":var n=t.payload,r=Io(Io({},e),{},{user:n});return r;case"SET_USER_FAVOURITES":var a=t.payload,o=a.currentPage,i=a.totalPage,l=a.data,c=a.plan,u=a.category,s=a.platform,f=Io({},e),p=["favourites",c,s,u],d=[].concat(p,["currentPage"]),m=[].concat(p,["totalPage"]),h=[].concat(p,[o]);return f=Ro(d,o,f),Io(Io({},f=Ro(m,i,f)),Ro(h,l,f));case"SET_USER_DOWNLOADS":var y=t.payload,g=y.currentPage,v=y.totalPage,b=y.data,w=Io({},e),E=["downloads"],O=[].concat(E,["currentPage"]),S=[].concat(E,["totalPage"]),k=[].concat(E,[g]);return w=Ro(O,g,w),Io(Io({},w=Ro(S,v,w)),Ro(k,b,w));default:return e}},admin:Jt,blocks:Ot,pages:xt,packs:Nt,preview:Rt,common:Kt,workspaces:on,sharedWorkspaces:fn,workspacesDetails:wn}),!1),zo={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Uo=o.createContext&&o.createContext(zo),Bo=function(){return(Bo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Vo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&(n[r[a]]=e[r[a]])}return n};function Wo(e){return function(t){return o.createElement(Ho,Bo({attr:Bo({},e.attr)},t),function e(t){return t&&t.map((function(t,n){return o.createElement(t.tag,Bo({key:n},t.attr),e(t.child))}))}(e.child))}}function Ho(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var a=e.attr,i=e.title,l=Vo(e,["attr","title"]);return o.createElement("svg",Bo({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,l,{className:n,style:Bo({color:e.color||t.color},t.style,e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),i&&o.createElement("title",null,i),e.children)};return void 0!==Uo?o.createElement(Uo.Consumer,null,(function(e){return t(e)})):t(zo)}function $o(e){return Wo({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function qo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function Ko(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function Qo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"}}]})(e)}function Go(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"}}]})(e)}function Yo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"}}]})(e)}function Xo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"}}]})(e)}function Jo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h192l-16 48h-72c-13.3 0-24 10.7-24 24s10.7 24 24 24h272c13.3 0 24-10.7 24-24s-10.7-24-24-24h-72l-16-48h192c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h448v288z"}}]})(e)}function Zo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function ei(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function ti(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function ni(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"}}]})(e)}function ri(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function ai(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"}}]})(e)}function oi(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function ii(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function li(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}}]})(e)}function ci(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"}}]})(e)}function ui(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 32h192c13.255 0 24 10.745 24 24v160c0 13.255-10.745 24-24 24H296c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24zm-80 0H24C10.745 32 0 42.745 0 56v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zM0 296v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm296 184h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H296c-13.255 0-24 10.745-24 24v160c0 13.255 10.745 24 24 24z"}}]})(e)}function si(e){return Wo({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function fi(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}var pi=function(e){return{type:"SET_RETRY",payload:e}},di=function(e){return{type:"USER_CAN_LOGOUT",payload:e}},mi=function(e){return{type:"SET_GLOBAL_SIGN_IN",payload:e}},hi=function(e){return{type:"IS_LINKED_LOGIN",payload:e}},yi=function(e){return{type:"SET_RETRY_MSG",payload:e}},gi=function(e){return{type:"ADD_PLATFORMS",payload:e}},vi=function(e){return{type:"ALL_ITEMS",payload:e}},bi=function(e){return{type:"ALL_PACKS",payload:e}},wi=function(e){return{type:"ALL_TEMPLATES",payload:e}},Ei=function(e){return{type:"CLOUD_RESET",payload:e}},Oi=function(e){return{type:"ALL_CLOUDS",payload:e}},Si=function(e){return{type:"REMOVE_CLOUD_FILE",payload:e}},ki=function(e){return{type:"PREVIEW",payload:e}},_i=function(e){return{type:"SET_LOADING",payload:e}},ji=function(e){return{type:"SET_ITEM_LOADING",payload:e}},xi=function(e){return{type:"SET_LOGGED_IN",payload:e}},Pi=function(e){return{type:"ERRORS",payload:e}},Ci=function(e){return{type:"ACTIVE_SIDEBAR",payload:e}},Ti=function(e){return{type:"FILTER_DEPENDENCIES_ACTIVE",payload:e}},Ai=function(e){return{type:"FILTER_FROM",payload:e}},Ni=function(e){return{type:"FILTER_DEPENDENCIES_ID",payload:e}},Li=function(e){return{type:"FILTERED_TAGS",payload:e}},Ii=function(e){return{type:"COMMON_ALL_ITEMS",payload:e}},Di=function(e){return{type:"COMMON_FILTERED_ITEMS",payload:e}},Mi=function(e){return{type:"PACK_BLOCK_OR_PAGE",payload:e}},Ri=function(e){return{type:"SET_PAGINATION",payload:e}},Fi=function(e){return{type:"NEED_PAGINATION",payload:e}},zi=function(e){return{type:"PAGINATION_LOADING",payload:e}},Ui=function(e){return{type:"SET_USER",payload:e}},Bi=function(e){return{type:"SUCCESS_TEXT",payload:e}},Vi=function(e){return{type:"SET_CURRENT_ROUTE",payload:e}},Wi=function(e){return{type:"SET_PUSHED_TIME",payload:e}},Hi=function(e){return{type:"ERROR_TEXT",payload:e}},$i=function(e){return{type:"SEARCH_QUERY",payload:e}},qi=function(e){return{type:"REMOVE_FILES_PAGE_FOR_A_WORKSPACE",payload:e}},Ki=function(e){return{type:"DELETE_FILE_FROM_WORKSPACE",payload:e}},Qi=function(e){return{type:"ALL_WORKSPACE_LIST",payload:e}},Gi=function(e){return{type:"SHARED_WORKSPACE_LIST",payload:e}},Yi=function(e){return{type:"WORKSPACE_SLUG",payload:e}},Xi=wp.i18n.__,Ji=nt((function(e){return{preview:e.preview}}))((function(e){var t=ce();return i.a.createElement("div",{className:"templately-logo"},i.a.createElement("svg",{width:"40px",enableBackground:"new 0 0 512 512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("circle",{cx:"90.5",cy:"454.8",fill:"#ffb45a",r:"57.2"}),i.a.createElement("circle",{cx:"256",cy:"454.8",fill:"#ff7b8e",r:"57.2"}),i.a.createElement("circle",{cx:"421.5",cy:"454.8",fill:"#5ac0ff",r:"57.2"}),i.a.createElement("path",{d:"m356.5 94.5c-3.1 0-6.1.2-9.1.4-12.4-54.3-61-94.9-119.1-94.9-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8c-19.9 0-39.2 0-58.8 0v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7 0-12.6 0-54 0-66.9-7.1 0-13.9 0-20.7 0-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"})),!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,i.a.createElement("svg",{height:"28",viewBox:"0 0 143 28",width:"143",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"#424c5e"},i.a.createElement("path",{d:"m6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3h3.9v-10.6c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9v-10.6c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6z"}),i.a.createElement("path",{d:"m59.8 6.3c-2.3 0-4.4.2-6.4.6v21.1h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9z"}),i.a.createElement("path",{d:"m70.5.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4h2.2v-10.3c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2z"}),i.a.createElement("path",{d:"m100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m120.6.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m138 6.2-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9l6.3-15.8z"})))),e.preview.isOpen&&i.a.createElement("span",{className:"templately-back-2-library",onClick:function(){return t.goBack()}},i.a.createElement(qo,{color:"#000"}),Xi("Back to Library","templately")))})),Zi=nt((function(e){return{preview:e.preview}}))((function(e){return i.a.createElement(ee,{exact:e.exact||!0,path:e.to,children:function(t){var n=t.match;return i.a.createElement("li",{className:n||e.active?"templately-active":""},i.a.createElement(ge,{className:e.className,onClick:function(){e.dispatch(Pi(null)),e.dispatch(ji(!0)),e.dispatch(Hi(null)),e.dispatch(Vi(e.to)),e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1)),e.dispatch(Fi(!1))},to:e.to},e.children,e.name))}})})),el=(n(84),n(86),n(87),n(91),n(95),n(6));function tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nl(e,t,n){return t&&tl(e.prototype,t),n&&tl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n(96);var rl=n(29);function al(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&&Object(rl.a)(e,t)}function ol(e){return(ol="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 il(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ll(e,t){if(t&&("object"===ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return il(e)}function cl(e){return(cl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ul=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function sl(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],a=t[n],!(r===a||ul(r)&&ul(a)))return!1;var r,a;return!0}var fl=function(e,t){var n;void 0===t&&(t=sl);var r,a=[],o=!1;return function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return o&&n===this&&t(i,a)||(r=e.apply(this,i),o=!0,n=this,a=i),r}},pl=n(3);n(99);function dl(e,t){if(null==e)return{};var n,r,a=z(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ml=n(31);function hl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||Object(ml.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yl=n(10),gl=n(17);var vl=n(40),bl=n.n(vl),wl=function(){};function El(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ol(e,t,n){var r=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&r.push("".concat(El(e,a)));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var Sl=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===ol(e)&&null!==e?[e]:[]};function kl(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function _l(e){return kl(e)?window.pageYOffset:e.scrollTop}function jl(e,t){kl(e)?window.scrollTo(0,t):e.scrollTop=t}function xl(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Pl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wl,a=_l(e),o=t-a,i=10,l=0;function c(){var t=xl(l+=i,a,o,n);jl(e,t),l<n?window.requestAnimationFrame(c):r(e)}c()}function Cl(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tl(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}function Ll(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,o=e.shouldScroll,i=e.isFixedPosition,l=e.theme.spacing,c=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,a=document.documentElement;if("fixed"===t.position)return a;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return a}(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var s=c.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,d=f.height,m=f.top,h=n.offsetParent.getBoundingClientRect().top,y=window.innerHeight,g=_l(c),v=parseInt(getComputedStyle(n).marginBottom,10),b=parseInt(getComputedStyle(n).marginTop,10),w=h-b,E=y-m,O=w+g,S=s-g-m,k=p-y+g+v,_=g+m-b;switch(a){case"auto":case"bottom":if(E>=d)return{placement:"bottom",maxHeight:t};if(S>=d&&!i)return o&&Pl(c,k,160),{placement:"bottom",maxHeight:t};if(!i&&S>=r||i&&E>=r)return o&&Pl(c,k,160),{placement:"bottom",maxHeight:i?E-v:S-v};if("auto"===a||i){var j=t,x=i?w:O;return x>=r&&(j=Math.min(x-v-l.controlHeight,t)),{placement:"top",maxHeight:j}}if("bottom"===a)return jl(c,k),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(O>=d&&!i)return o&&Pl(c,_,160),{placement:"top",maxHeight:t};if(!i&&O>=r||i&&w>=r){var P=t;return(!i&&O>=r||i&&w>=r)&&(P=i?w-b:O-b),o&&Pl(c,_,160),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return u}var Il=function(e){return"auto"===e?"bottom":e},Dl=Object(o.createContext)({getPortalPlacement:null}),Ml=function(e){al(n,e);var t=Nl(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={maxHeight:e.props.maxMenuHeight,placement:null},e.getPlacement=function(t){var n=e.props,r=n.minMenuHeight,a=n.maxMenuHeight,o=n.menuPlacement,i=n.menuPosition,l=n.menuShouldScrollIntoView,c=n.theme;if(t){var u="fixed"===i,s=Ll({maxHeight:a,menuEl:t,minHeight:r,placement:o,shouldScroll:l&&!u,isFixedPosition:u,theme:c}),f=e.context.getPortalPlacement;f&&f(s),e.setState(s)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||Il(t);return Al(Al({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return nl(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(o.Component);Ml.contextType=Dl;var Rl=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},Fl=Rl,zl=Rl,Ul=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},o),t)};Ul.defaultProps={children:"No options"};var Bl=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},o),t)};Bl.defaultProps={children:"Loading..."};var Vl=function(e){al(n,e);var t=Nl(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={placement:null},e.getPortalPlacement=function(t){var n=t.placement;n!==Il(e.props.menuPlacement)&&e.setState({placement:n})},e}return nl(n,[{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,a=e.menuPlacement,o=e.menuPosition,i=e.getStyles,c="fixed"===o;if(!t&&!c||!r)return null;var u=this.state.placement||Il(a),s=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,p={offset:s[u]+f,position:o,rect:s},d=Object(pl.c)("div",{css:i("menuPortal",p)},n);return Object(pl.c)(Dl.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},t?Object(l.createPortal)(d,t):d)}}]),n}(o.Component),Wl=Array.isArray,Hl=Object.keys,$l=Object.prototype.hasOwnProperty;function ql(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==ol(t)&&"object"==ol(n)){var r,a,o,i=Wl(t),l=Wl(n);if(i&&l){if((a=t.length)!=n.length)return!1;for(r=a;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i!=l)return!1;var c=t instanceof Date,u=n instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==n.getTime();var s=t instanceof RegExp,f=n instanceof RegExp;if(s!=f)return!1;if(s&&f)return t.toString()==n.toString();var p=Hl(t);if((a=p.length)!==Hl(n).length)return!1;for(r=a;0!=r--;)if(!$l.call(n,p[r]))return!1;for(r=a;0!=r--;)if(!("_owner"===(o=p[r])&&t.$$typeof||e(t[o],n[o])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function Kl(){var e,t,n=(e=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return Kl=function(){return n},n}var Ql={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},Gl=function(e){var t=e.size,n=dl(e,["size"]);return Object(pl.c)("svg",s({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ql},n))},Yl=function(e){return Object(pl.c)(Gl,s({size:20},e),Object(pl.c)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Xl=function(e){return Object(pl.c)(Gl,s({size:20},e),Object(pl.c)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Jl=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorContainer",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?a.neutral80:a.neutral40}}},Zl=Jl,ec=Jl,tc=Object(pl.d)(Kl()),nc=function(e){var t=e.delay,n=e.offset;return Object(pl.c)("span",{css:Object(gl.a)({animation:"".concat(tc," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},rc=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps,o=e.isRtl;return Object(pl.c)("div",s({},a,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),Object(pl.c)(nc,{delay:0,offset:o}),Object(pl.c)(nc,{delay:160,offset:!0}),Object(pl.c)(nc,{delay:320,offset:!o}))};rc.defaultProps={size:4};function ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ac(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ac(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cc=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fc=function(e){var t=e.children,n=e.innerProps;return Object(pl.c)("div",n,t)},pc=fc,dc=fc;var mc=function(e){var t=e.children,n=e.className,r=e.components,a=e.cx,o=e.data,i=e.getStyles,l=e.innerProps,c=e.isDisabled,u=e.removeProps,s=e.selectProps,f=r.Container,p=r.Label,d=r.Remove;return Object(pl.c)(pl.b,null,(function(r){var m=r.css,h=r.cx;return Object(pl.c)(f,{data:o,innerProps:sc(sc({},l),{},{className:h(m(i("multiValue",e)),a({"multi-value":!0,"multi-value--is-disabled":c},n))}),selectProps:s},Object(pl.c)(p,{data:o,innerProps:{className:h(m(i("multiValueLabel",e)),a({"multi-value__label":!0},n))},selectProps:s},t),Object(pl.c)(d,{data:o,innerProps:sc({className:h(m(i("multiValueRemove",e)),a({"multi-value__remove":!0},n))},u),selectProps:s}))}))};mc.defaultProps={cropWithEllipsis:!0};function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}for(var gc={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({},o,{css:a("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||Object(pl.c)(Yl,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.className,o=e.isDisabled,i=e.isFocused,l=e.innerRef,c=e.innerProps,u=e.menuIsOpen;return Object(pl.c)("div",s({ref:l,css:r("control",e),className:n({control:!0,"control--is-disabled":o,"control--is-focused":i,"control--menu-is-open":u},a)},c),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({},o,{css:a("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||Object(pl.c)(Xl,null))},DownChevron:Xl,CrossIcon:Yl,Group:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.Heading,i=e.headingProps,l=e.label,c=e.theme,u=e.selectProps;return Object(pl.c)("div",{css:a("group",e),className:r({group:!0},n)},Object(pl.c)(o,s({},i,{selectProps:u,theme:c,getStyles:a,cx:r}),l),Object(pl.c)("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.theme,o=(e.selectProps,dl(e,["className","cx","getStyles","theme","selectProps"]));return Object(pl.c)("div",s({css:r("groupHeading",oc({theme:a},o)),className:n({"group-heading":!0},t)},o))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles;return Object(pl.c)("div",{css:a("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps;return Object(pl.c)("span",s({},a,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerRef,o=e.isHidden,i=e.isDisabled,l=e.theme,c=(e.selectProps,dl(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return Object(pl.c)("div",{css:r("input",lc({theme:l},c))},Object(pl.c)(bl.a,s({className:n({input:!0},t),inputRef:a,inputStyle:cc(o),disabled:i},c)))},LoadingIndicator:rc,Menu:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerRef,i=e.innerProps;return Object(pl.c)("div",s({css:a("menu",e),className:r({menu:!0},n)},i,{ref:o}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isMulti,i=e.innerRef,l=e.innerProps;return Object(pl.c)("div",s({css:a("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":o},n),ref:i},l),t)},MenuPortal:Vl,LoadingMessage:Bl,NoOptionsMessage:Ul,MultiValue:mc,MultiValueContainer:pc,MultiValueLabel:dc,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Object(pl.c)("div",n,t||Object(pl.c)(Yl,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.isFocused,l=e.isSelected,c=e.innerRef,u=e.innerProps;return Object(pl.c)("div",s({css:a("option",e),className:r({option:!0,"option--is-disabled":o,"option--is-focused":i,"option--is-selected":l},n),ref:c},u),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("placeholder",e),className:r({placeholder:!0},n)},o),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps,i=e.isDisabled,l=e.isRtl;return Object(pl.c)("div",s({css:a("container",e),className:r({"--is-disabled":i,"--is-rtl":l},n)},o),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.innerProps;return Object(pl.c)("div",s({css:a("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":o},n)},i),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.isMulti,o=e.getStyles,i=e.hasValue;return Object(pl.c)("div",{css:o("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":a,"value-container--has-value":i},n)},t)}},vc=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],bc=new RegExp("["+vc.map((function(e){return e.letters})).join("")+"]","g"),wc={},Ec=0;Ec<vc.length;Ec++)for(var Oc=vc[Ec],Sc=0;Sc<Oc.letters.length;Sc++)wc[Oc.letters[Sc]]=Oc.base;var kc=function(e){return e.replace(bc,(function(e){return wc[e]}))};function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var jc=function(e){return e.replace(/^\s+|\s+$/g,"")},xc=function(e){return"".concat(e.label," ").concat(e.value)};var Pc={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Cc=function(e){return Object(pl.c)("span",s({css:Pc},e))};function Tc(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,dl(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return Object(pl.c)("input",s({ref:t},n,{css:Object(gl.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}function Ac(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Nc=function(e){al(n,e);var t=Ac(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),n}(o.Component),Lc=["boxSizing","height","overflow","paddingRight","position"],Ic={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Dc(e){e.preventDefault()}function Mc(e){e.stopPropagation()}function Rc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Fc(){return"ontouchstart"in window||navigator.maxTouchPoints}function zc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Uc=!(!window.document||!window.document.createElement),Bc=0,Vc=function(e){al(n,e);var t=zc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).originalStyles={},e.listenerOptions={capture:!1,passive:!1},e}return nl(n,[{key:"componentDidMount",value:function(){var e=this;if(Uc){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;if(n&&Lc.forEach((function(t){var n=o&&o[t];e.originalStyles[t]=n})),n&&Bc<1){var i=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,c=window.innerWidth-l+i||0;Object.keys(Ic).forEach((function(e){var t=Ic[e];o&&(o[e]=t)})),o&&(o.paddingRight="".concat(c,"px"))}a&&Fc()&&(a.addEventListener("touchmove",Dc,this.listenerOptions),r&&(r.addEventListener("touchstart",Rc,this.listenerOptions),r.addEventListener("touchmove",Mc,this.listenerOptions))),Bc+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(Uc){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;Bc=Math.max(Bc-1,0),n&&Bc<1&&Lc.forEach((function(t){var n=e.originalStyles[t];o&&(o[t]=n)})),a&&Fc()&&(a.removeEventListener("touchmove",Dc,this.listenerOptions),r&&(r.removeEventListener("touchstart",Rc,this.listenerOptions),r.removeEventListener("touchmove",Mc,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),n}(o.Component);function Wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}Vc.defaultProps={accountForScrollbars:!0};var Hc={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},$c=function(e){al(n,e);var t=Wc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={touchScrollTarget:null},e.getScrollTarget=function(t){t!==e.state.touchScrollTarget&&e.setState({touchScrollTarget:t})},e.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},e}return nl(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?Object(pl.c)("div",null,Object(pl.c)("div",{onClick:this.blurSelectInput,css:Hc}),Object(pl.c)(Nc,{innerRef:this.getScrollTarget},t),r?Object(pl.c)(Vc,{touchScrollTarget:r}):null):t}}]),n}(o.PureComponent);function qc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Kc=function(e){al(n,e);var t=qc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).isBottom=!1,e.isTop=!1,e.scrollTarget=void 0,e.touchStart=void 0,e.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},e.handleEventDelta=function(t,n){var r=e.props,a=r.onBottomArrive,o=r.onBottomLeave,i=r.onTopArrive,l=r.onTopLeave,c=e.scrollTarget,u=c.scrollTop,s=c.scrollHeight,f=c.clientHeight,p=e.scrollTarget,d=n>0,m=s-f-u,h=!1;m>n&&e.isBottom&&(o&&o(t),e.isBottom=!1),d&&e.isTop&&(l&&l(t),e.isTop=!1),d&&n>m?(a&&!e.isBottom&&a(t),p.scrollTop=s,h=!0,e.isBottom=!0):!d&&-n>u&&(i&&!e.isTop&&i(t),p.scrollTop=0,h=!0,e.isTop=!0),h&&e.cancelScroll(t)},e.onWheel=function(t){e.handleEventDelta(t,t.deltaY)},e.onTouchStart=function(t){e.touchStart=t.changedTouches[0].clientY},e.onTouchMove=function(t){var n=e.touchStart-t.changedTouches[0].clientY;e.handleEventDelta(t,n)},e.getScrollTarget=function(t){e.scrollTarget=t},e}return nl(n,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e&&("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.a.createElement(Nc,{innerRef:this.getScrollTarget},this.props.children)}}]),n}(o.Component);function Qc(e){var t=e.isEnabled,n=void 0===t||t,r=dl(e,["isEnabled"]);return n?i.a.createElement(Kc,r):r.children}var Gc=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,a=t.label,o=t.isDisabled,i=t.tabSelectsValue;switch(e){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(a||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},Yc=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,r?" is disabled. Select another option.":", selected.")}},Xc=function(e){return!!e.isDisabled};var Jc={clearIndicator:ec,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,a=r.colors,o=r.borderRadius,i=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?a.neutral5:a.neutral0,borderColor:t?a.neutral10:n?a.primary:a.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(a.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?a.primary:a.neutral30}}},dropdownIndicator:Zl,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?a.neutral10:a.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:a.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,a=r.colors,o=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:zl,menu:function(e){var t,n=e.placement,r=e.theme,a=r.borderRadius,o=r.spacing,i=r.colors;return t={label:"menu"},Object(pt.a)(t,function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Object(pt.a)(t,"backgroundColor",i.neutral0),Object(pt.a)(t,"borderRadius",a),Object(pt.a)(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Object(pt.a)(t,"marginBottom",o.menuGutter),Object(pt.a)(t,"marginTop",o.menuGutter),Object(pt.a)(t,"position","absolute"),Object(pt.a)(t,"width","100%"),Object(pt.a)(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,a=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:a?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,a=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&a.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}}},noOptionsMessage:Fl,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,a=e.theme,o=a.spacing,i=a.colors;return{label:"option",backgroundColor:r?i.primary:n?i.primary25:"transparent",color:t?i.neutral20:r?i.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?i.primary:i.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{label:"singleValue",color:t?a.neutral40:a.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var Zc={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var ru,au={backspaceRemovesValue:!0,blurInputOnSelect:Cl(),captureMenuScroll:!Cl(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ignoreCase:!0,ignoreAccents:!0,stringify:xc,trim:!0,matchFrom:"any"},ru),r=n.ignoreCase,a=n.ignoreAccents,o=n.stringify,i=n.trim,l=n.matchFrom,c=i?jc(t):t,u=i?jc(o(e)):o(e);return r&&(c=c.toLowerCase(),u=u.toLowerCase()),a&&(c=kc(c),u=kc(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Xc,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},ou=1,iu=function(e){al(n,e);var t=nu(n);function n(e){var r;Object(el.a)(this,n),(r=t.call(this,e)).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},r.blockOptionHover=!1,r.isComposing=!1,r.clearFocusValueOnUpdate=!1,r.commonProps=void 0,r.components=void 0,r.hasGroups=!1,r.initialTouchX=0,r.initialTouchY=0,r.inputIsHiddenAfterUpdate=void 0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.cacheComponents=function(e){var t;r.components=(t={components:e},yc(yc({},gc),t.components))},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,a=n.onChange,o=n.name;a(e,tu(tu({},t),{},{name:o}))},r.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,a=r.props,o=a.closeMenuOnSelect,i=a.isMulti;r.onInputChange("",{action:"set-value"}),o&&(r.inputIsHiddenAfterUpdate=!i,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,a=t.isMulti,o=r.state.selectValue;if(a)if(r.isOptionSelected(e,o)){var i=r.getOptionValue(e);r.setValue(o.filter((function(e){return r.getOptionValue(e)!==i})),"deselect-option",e),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(e)}})}else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue([].concat(Object(yl.a)(o),[e]),"select-option",e),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue(e,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));n&&r.blurInput()},r.removeValue=function(e){var t=r.state.selectValue,n=r.getOptionValue(e),a=t.filter((function(e){return r.getOptionValue(e)!==n}));r.onChange(a.length?a:null,{action:"remove-value",removedValue:e}),r.announceAriaLiveSelection({event:"remove-value",context:{value:e?r.getOptionLabel(e):""}}),r.focusInput()},r.clearValue=function(){r.onChange(null,{action:"clear"})},r.popValue=function(){var e=r.state.selectValue,t=e[e.length-1],n=e.slice(0,e.length-1);r.announceAriaLiveSelection({event:"pop-value",context:{value:t?r.getOptionLabel(t):""}}),r.onChange(n.length?n:null,{action:"pop-value",removedValue:t})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ol.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return r.props.getOptionLabel(e)},r.getOptionValue=function(e){return r.props.getOptionValue(e)},r.getStyles=function(e,t){var n=Jc[e](t);n.boxSizing="border-box";var a=r.props.styles[e];return a?a(n,t):n},r.getElementId=function(e){return"".concat(r.instancePrefix,"-").concat(e)},r.getActiveDescendentId=function(){var e=r.props.menuIsOpen,t=r.state,n=t.menuOptions,a=t.focusedOption;if(a&&e){var o=n.focusable.indexOf(a),i=n.render[o];return i&&i.key}},r.announceAriaLiveSelection=function(e){var t=e.event,n=e.context;r.setState({ariaLiveSelection:Yc(t,n)})},r.announceAriaLiveContext=function(e){var t=e.event,n=e.context;r.setState({ariaLiveContext:Gc(t,tu(tu({},n),{},{label:r.props["aria-label"]}))})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,a=t.menuIsOpen;r.focusInput(),a?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),e.preventDefault(),e.stopPropagation()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.stopPropagation(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&kl(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var a=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=a>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=e.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(t,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){var t=r.props,n=t.isSearchable,a=t.isMulti;r.props.onFocus&&r.props.onFocus(e),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:a}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){var e=r.props,t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,a=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,l=t.isClearable,c=t.isDisabled,u=t.menuIsOpen,s=t.onKeyDown,f=t.tabSelectsValue,p=t.openMenuOnFocus,d=r.state,m=d.focusedOption,h=d.focusedValue,y=d.selectValue;if(!(c||"function"==typeof s&&(s(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!a)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!f||!m||p&&r.isOptionSelected(m,y))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):l&&o&&r.clearValue();break;case" ":if(i)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.buildMenuOptions=function(e,t){var n=e.inputValue,a=void 0===n?"":n,o=e.options,i=function(e,n){var o=r.isOptionDisabled(e,t),i=r.isOptionSelected(e,t),l=r.getOptionLabel(e),c=r.getOptionValue(e);if(!(r.shouldHideSelectedOptions()&&i||!r.filterOption({label:l,value:c,data:e},a))){var u=o?void 0:function(){return r.onOptionHover(e)},s=o?void 0:function(){return r.selectOption(e)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:s,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:e,isDisabled:o,isSelected:i,key:f,label:l,type:"option",value:c}}};return o.reduce((function(e,t,n){if(t.options){r.hasGroups||(r.hasGroups=!0);var a=t.options.map((function(t,r){var a=i(t,"".concat(n,"-").concat(r));return a&&e.focusable.push(t),a})).filter(Boolean);if(a.length){var o="".concat(r.getElementId("group"),"-").concat(n);e.render.push({type:"group",key:o,data:t,options:a})}}else{var l=i(t,"".concat(n));l&&(e.render.push(l),e.focusable.push(t))}return e}),{render:[],focusable:[]})};var a=e.value;r.cacheComponents=fl(r.cacheComponents,ql).bind(il(r)),r.cacheComponents(e.components),r.instancePrefix="react-select-"+(r.props.instanceId||++ou);var o=Sl(a);r.buildMenuOptions=fl(r.buildMenuOptions,(function(e,t){var n=hl(e,2),r=n[0],a=n[1],o=hl(t,2),i=o[0];return a===o[1]&&r.inputValue===i.inputValue&&r.options===i.options})).bind(il(r));var i=e.menuIsOpen?r.buildMenuOptions(e,o):{render:[],focusable:[]};return r.state.menuOptions=i,r.state.selectValue=o,r}return nl(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,a=t.menuIsOpen,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==a||e.inputValue!==o){var i=Sl(e.value),l=e.menuIsOpen?this.buildMenuOptions(e,i):{render:[],focusable:[]},c=this.getNextFocusedValue(i),u=this.getNextFocusedOption(l.focusable);this.setState({menuOptions:l,selectValue:i,focusedOption:u,focusedValue:c})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,a,o,i=this.props,l=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused;(u&&!l&&e.isDisabled||u&&c&&!e.menuIsOpen)&&this.focusInput(),u&&l&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=n.offsetHeight/3,a.bottom+o>r.bottom?jl(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):a.top-o<r.top&&jl(t,Math.max(n.offsetTop-o,0)),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,a=n.isFocused,o=this.buildMenuOptions(this.props,r),i=this.props,l=i.isMulti,c=i.tabSelectsValue,u="first"===e?0:o.focusable.length-1;if(!l){var s=o.focusable.indexOf(r[0]);s>-1&&(u=s)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:o,focusedValue:null,focusedOption:o.focusable[u]},(function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu",context:{tabSelectsValue:c}})}))}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,a=this.state,o=a.selectValue,i=a.focusedValue;if(n){this.setState({focusedOption:null});var l=o.indexOf(i);i||(l=-1,this.announceAriaLiveContext({event:"value"}));var c=o.length-1,u=-1;if(o.length){switch(e){case"previous":u=0===l?0:-1===l?c:l-1;break;case"next":l>-1&&l<c&&(u=l+1)}-1===u&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==u,focusedValue:o[u]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props,n=t.pageSize,r=t.tabSelectsValue,a=this.state,o=a.focusedOption,i=a.menuOptions,l=i.focusable;if(l.length){var c=0,u=l.indexOf(o);o||(u=-1,this.announceAriaLiveContext({event:"menu",context:{tabSelectsValue:r}})),"up"===e?c=u>0?u-1:l.length-1:"down"===e?c=(u+1)%l.length:"pageup"===e?(c=u-n)<0&&(c=0):"pagedown"===e?(c=u+n)>l.length-1&&(c=l.length-1):"last"===e&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:Xc(l[c]),tabSelectsValue:r}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Zc):tu(tu({},Zc),this.props.theme):Zc}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,a=this.setValue,o=this.selectOption,i=this.props,l=i.isMulti,c=i.isRtl,u=i.options;return{cx:t,clearValue:e,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,setValue:a,selectProps:i,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,a=e.focusedOption,o=this.props,i=o.options,l=o.menuIsOpen,c=o.inputValue,u=o.screenReaderStatus,s=r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",f=a&&l?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused").concat(t.isDisabled?" disabled":"",", ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedOption:a,getOptionLabel:this.getOptionLabel,options:i}):"",p=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}({inputValue:c,screenReaderMessage:u({count:this.countOptions()})});return"".concat(s," ").concat(f," ").concat(p," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,a=e.inputValue,o=e.tabIndex,l=e.form,c=this.components.Input,u=this.state.inputIsHidden,f=r||this.getElementId("input"),p={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return i.a.createElement(Tc,s({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:wl,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:o,form:l,value:""},p));var d=this.commonProps,m=d.cx,h=d.theme,y=d.selectProps;return i.a.createElement(c,s({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:m,getStyles:this.getStyles,id:f,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:y,spellCheck:"false",tabIndex:o,form:l,theme:h,type:"text",value:a},p))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,a=t.MultiValueLabel,o=t.MultiValueRemove,l=t.SingleValue,c=t.Placeholder,u=this.commonProps,f=this.props,p=f.controlShouldRenderValue,d=f.isDisabled,m=f.isMulti,h=f.inputValue,y=f.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!p)return h?null:i.a.createElement(c,s({},u,{key:"placeholder",isDisabled:d,isFocused:w}),y);if(m)return v.map((function(t,l){var c=t===b;return i.a.createElement(n,s({},u,{components:{Container:r,Label:a,Remove:o},isFocused:c,isDisabled:d,key:"".concat(e.getOptionValue(t)).concat(l),index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var E=v[0];return i.a.createElement(l,s({},u,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||a)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:l,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!e||!a)return null;return i.a.createElement(e,s({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(n,s({},r,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:a,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,a=t.Menu,o=t.MenuList,l=t.MenuPortal,c=t.LoadingMessage,u=t.NoOptionsMessage,f=t.Option,p=this.commonProps,d=this.state,m=d.focusedOption,h=d.menuOptions,y=this.props,g=y.captureMenuScroll,v=y.inputValue,b=y.isLoading,w=y.loadingMessage,E=y.minMenuHeight,O=y.maxMenuHeight,S=y.menuIsOpen,k=y.menuPlacement,_=y.menuPosition,j=y.menuPortalTarget,x=y.menuShouldBlockScroll,P=y.menuShouldScrollIntoView,C=y.noOptionsMessage,T=y.onMenuScrollToTop,A=y.onMenuScrollToBottom;if(!S)return null;var N,L=function(t){var n=m===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.a.createElement(f,s({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=h.render.map((function(t){if("group"===t.type){t.type;var a=dl(t,["type"]),o="".concat(t.key,"-heading");return i.a.createElement(n,s({},p,a,{Heading:r,headingProps:{id:o,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return L(e)})))}if("option"===t.type)return L(t)}));else if(b){var I=w({inputValue:v});if(null===I)return null;N=i.a.createElement(c,p,I)}else{var D=C({inputValue:v});if(null===D)return null;N=i.a.createElement(u,p,D)}var M={minMenuHeight:E,maxMenuHeight:O,menuPlacement:k,menuPosition:_,menuShouldScrollIntoView:P},R=i.a.createElement(Ml,s({},p,M),(function(t){var n=t.ref,r=t.placerProps,l=r.placement,c=r.maxHeight;return i.a.createElement(a,s({},p,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:b,placement:l}),i.a.createElement(Qc,{isEnabled:g,onTopArrive:T,onBottomArrive:A},i.a.createElement($c,{isEnabled:x},i.a.createElement(o,s({},p,{innerRef:e.getMenuListRef,isLoading:b,maxHeight:c}),N))))}));return j||"fixed"===_?i.a.createElement(l,s({},p,{appendTo:j,controlElement:this.controlRef,menuPlacement:k,menuPosition:_}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,a=t.isMulti,o=t.name,l=this.state.selectValue;if(o&&!r){if(a){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return i.a.createElement("input",{name:o,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return i.a.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var s=l[0]?this.getOptionValue(l[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:s})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(Cc,{"aria-live":"polite"},i.a.createElement("span",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("span",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,a=e.ValueContainer,o=this.props,l=o.className,c=o.id,u=o.isDisabled,f=o.menuIsOpen,p=this.state.isFocused,d=this.commonProps=this.getCommonProps();return i.a.createElement(r,s({},d,{className:l,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:p}),this.renderLiveRegion(),i.a.createElement(t,s({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:p,menuIsOpen:f}),i.a.createElement(a,s({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(n,s({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),n}(o.Component);iu.defaultProps=au;n(100);function lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var cu={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},uu=n(23);function su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}o.Component;var fu,pu,du,mu=(fu=iu,du=pu=function(e){al(n,e);var t=lu(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).select=void 0,e.state={inputValue:void 0!==e.props.inputValue?e.props.inputValue:e.props.defaultInputValue,menuIsOpen:void 0!==e.props.menuIsOpen?e.props.menuIsOpen:e.props.defaultMenuIsOpen,value:void 0!==e.props.value?e.props.value:e.props.defaultValue},e.onChange=function(t,n){e.callProp("onChange",t,n),e.setState({value:t})},e.onInputChange=function(t,n){var r=e.callProp("onInputChange",t,n);e.setState({inputValue:void 0!==r?r:t})},e.onMenuOpen=function(){e.callProp("onMenuOpen"),e.setState({menuIsOpen:!0})},e.onMenuClose=function(){e.callProp("onMenuClose"),e.setState({menuIsOpen:!1})},e}return nl(n,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=this.props)[e].apply(t,r)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultInputValue,t.defaultMenuIsOpen,t.defaultValue,dl(t,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return i.a.createElement(fu,s({},n,{ref:function(t){e.select=t},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}]),n}(o.Component),pu.defaultProps=cu,du);function hu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var gu=wp.i18n.__,vu=nt((function(e){return{currentPath:e.common.currentPath,platform:e.common.platform}}))((function(e){var t=ce(),n=[{value:"pages",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),gu("Pages","templately"))},{value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),gu("Blocks","templately"))},{value:"",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-packs"}),gu("Packs","templately"))},{value:"templates",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-templates"}),gu("Templates","templately"))},{value:"clouds",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-myclouds"}),gu("My Clouds","templately"))}],r=hu(Object(o.useState)({value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),gu("Blocks","templately"))}),2),a=r[0],l=r[1];Object(o.useEffect)((function(){for(var e=window.location.href.replace(/^.*\/+/,""),t=i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),gu("Packs","templately")),r="",a=0;a<n.length;a++)if(n[a].value===e){r=n[a].value,t=n[a].label;break}l({value:r,label:t})}),[]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-modal-menu"},i.a.createElement("ul",null,"gutenberg"!==e.platform&&i.a.createElement(Zi,{to:"/pages",name:gu("Pages","templately")}),i.a.createElement(Zi,{to:"gutenberg"===e.platform?"/":"/blocks",name:gu("Blocks","templately")}),"gutenberg"===e.platform&&i.a.createElement(Zi,{to:"/pages",name:gu("Pages","templately")}),i.a.createElement(Zi,{to:"gutenberg"===e.platform?"/packs":"/",name:gu("Packs","templately")}),"gutenberg"!==e.platform&&i.a.createElement(Zi,{to:"/templates",name:gu("Templates","templately")}),i.a.createElement(Zi,{className:"efy-clouds-nav",to:"/clouds",name:gu("My Cloud","templately")},i.a.createElement("svg",{width:"20px",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},i.a.createElement("g",null,i.a.createElement("path",{d:"M76.8 76.5H11.6C5.2 76.5 0 81.7 0 88.1s5.2 11.6 11.6 11.6h65.2c6.4 0 11.6-5.2 11.6-11.6.1-6.4-5.1-11.6-11.6-11.6zM71 93.4c-2.9 0-5.2-2.3-5.2-5.2S68.1 83 71 83s5.2 2.3 5.2 5.2c.1 2.8-2.3 5.2-5.2 5.2zM90.2 21.4C88.9 12.7 81.3 6 72.3 6H71C67.4 2.3 62.2.2 57 .2 46.1.2 37.2 9 37 19.8c-4.8 3.8-7.7 9.6-7.7 15.7 0 11 9 20 20 20h32.6c10 0 18.1-8.1 18.1-18.1 0-6.8-3.8-13-9.8-16zm-8.3 24.8H49.3c-5.9 0-10.7-4.8-10.7-10.7 0-3.8 2.1-7.4 5.4-9.3l2.7-1.6-.4-3.2c-.1-.4-.1-.9-.1-1.3 0-5.9 4.8-10.7 10.7-10.7 3.4 0 6.6 1.6 8.6 4.3l1.8 2.5 3-.7c.6-.2 1.3-.2 2-.2 4.8 0 8.8 3.9 8.8 8.7l-.1 4 3.4 1c3.7 1.1 6.3 4.6 6.3 8.4 0 4.9-3.9 8.8-8.8 8.8z"}),i.a.createElement("path",{d:"M76.8 71.8c4.2 0 8 1.6 10.9 4.2L82 59H49.3c-12.7 0-23.1-10.3-23.4-23h-2c-5.1 0-8.4 2.6-11.4 9.3L.3 76.5c2.9-2.9 7-4.7 11.4-4.7z"})))))),i.a.createElement("div",{className:"templately-modal-mobile-menu"},i.a.createElement(mu,{options:n,classNamePrefix:"templately-switcher",onChange:function(n){return function(n){t.push("/"+n.value),l({value:n.value,label:n.label}),e.dispatch(Pi(null)),e.dispatch(ji(!0)),e.dispatch(Hi(null)),e.dispatch(Vi(e.to)),e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1)),e.dispatch(Fi(!1))}(n)},value:a,isSearchable:!1})))})),bu=n(4),wu=n.n(bu),Eu={open:function(e){c.a.render(e,document.getElementById("templately-gutenberg"))},close:function(){c.a.unmountComponentAtNode(document.getElementById("templately-gutenberg"))}};function Ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ku=wp.i18n.__,_u=nt((function(e){return{searchQuery:e.common.searchQuery.query,results:e.common.searchQuery.results}}))((function(e){var t=Ou(Object(o.useState)(""),2),n=t[0],r=t[1],a=Ou(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){l&&e.searchQuery.length>0&&(e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Vi("/search/".concat(e.searchQuery))),e.dispatch($i({query:e.searchQuery,isSearching:!0,results:e.results})),c(!1))}),[l]),Object(o.useEffect)((function(){e.dispatch($i({query:n,isSearching:!1,results:e.results}))}),[n]),i.a.createElement("div",{className:"templately-search-action"},i.a.createElement("input",{type:"text",onKeyDown:function(e){return c(13===(null==e?void 0:e.keyCode))},value:n,onChange:function(e){return r(e.currentTarget.value)},placeholder:ku("Search...","templately")}))}));function ju(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pu=nt((function(e){return{platform:e.common.platform}}))((function(e){var t=ju(Object(o.useState)([{value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")},{value:"gutenberg",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),"Gutenberg")}]),2),n=t[0],r=(t[1],ju(Object(o.useState)({value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")}),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_PLATFORM",payload:a.value}),e.dispatch(Ri(1))}),[a]),i.a.createElement(mu,{options:n,classNamePrefix:"templately-switcher",onChange:function(e){return l(e)},value:a,isSearchable:!1})})),Cu=n(16);function Tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nu=function(e){var t=function e(t,n){var r=t.headers,a=void 0===r?{}:r;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===e.nonce)return n(t);return n(Au(Au({},t),{},{headers:Au(Au({},a),{},{"X-WP-Nonce":e.nonce})}))};return t.nonce=e,t};function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Du=function(e,t){var n,r,a=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),a=(r=e.endpoint.replace(/^\//,""))?n+"/"+r:n),delete e.namespace,delete e.endpoint,t(Iu(Iu({},e),{},{path:a}))};function Mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fu=function(e){return function(t,n){return Du(t,(function(t){var r,a=t.url,o=t.path;return"string"==typeof o&&(r=e,-1!==e.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(o=o.replace("?","&")),a=r+o),n(Ru(Ru({},t),{},{url:a}))}))}};function zu(e){var t=e.split("?"),n=t[1],r=t[0];return n?r+"?"+n.split("&").map((function(e){return e.split("=")})).sort((function(e,t){return e[0].localeCompare(t[0])})).map((function(e){return e.join("=")})).join("&"):r}var Uu=function(e){var t=Object.keys(e).reduce((function(t,n){return t[zu(n)]=e[n],t}),{});return function(e,n){var r=e.parse,a=void 0===r||r;if("string"==typeof e.path){var o=e.method||"GET",i=zu(e.path);if("GET"===o&&t[i]){var l=t[i];return delete t[i],Promise.resolve(a?l.body:new window.Response(JSON.stringify(l.body),{status:200,statusText:"OK",headers:l.headers}))}if("OPTIONS"===o&&t[o]&&t[o][i])return Promise.resolve(t[o][i])}return n(e)}};function Bu(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}var Vu=n(43),Wu=n.n(Vu);function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qu(e){return(function(e){var t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,t){var n=hl(t.split("=").filter(Boolean).map(decodeURIComponent),2),r=n[0],a=n[1],o=void 0===a?"":a;r&&function(e,t,n){for(var r=t.length,a=r-1,o=0;o<r;o++){var i=t[o];!i&&Array.isArray(e)&&(i=e.length.toString());var l=!isNaN(Number(t[o+1]));e[i]=o===a?n:e[i]||(l?[]:{}),Array.isArray(e[i])&&!l&&(e[i]=$u({},e[i])),e=e[i]}}(e,r.replace(/\]/g,"").split("["),o);return e}),{})}function Ku(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gu(e){for(var t,n="",r=Object.entries(e);t=r.shift();){var a=hl(t,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var l,c=Ku(Object.entries(i).reverse());try{for(c.s();!(l=c.n()).done;){var u=hl(l.value,2),s=u[0],f=u[1];r.unshift(["".concat(o,"[").concat(s,"]"),f])}}catch(e){c.e(e)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),n+="&"+[o,i].map(encodeURIComponent).join("="))}return n.substr(1)}function Yu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(qu(e),t),n=n.substr(0,r)),n+"?"+Gu(t)}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zu=function(e){return e.json?e.json():Promise.reject(e)},es=function(e){return function(e){if(!e)return{};var t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},ts=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},ns=function(){var e,t=(e=Wu.a.mark((function e(t,n){var r,a,o,i,l,c;return Wu.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(ts(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Ss(Ju(Ju({},(s={per_page:100},f=void 0,p=void 0,f=(u=t).path,p=u.url,Ju(Ju({},dl(u,["path","url"])),{},{url:p&&Yu(p,s),path:f&&Yu(f,s)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,Zu(r);case 9:if(a=e.sent,Array.isArray(a)){e.next=12;break}return e.abrupt("return",a);case 12:if(o=es(r)){e.next=15;break}return e.abrupt("return",a);case 15:i=[].concat(a);case 16:if(!o){e.next=27;break}return e.next=19,Ss(Ju(Ju({},t),{},{path:void 0,url:o,parse:!1}));case 19:return l=e.sent,e.next=22,Zu(l);case 22:c=e.sent,i=i.concat(c),o=es(l),e.next=16;break;case 27:return e.abrupt("return",i);case 28:case"end":return e.stop()}var u,s,f,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Bu(o,r,a,i,l,"next",e)}function l(e){Bu(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function rs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function as(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var os=new Set(["PATCH","PUT","DELETE"]);function is(e,t){return void 0!==function(e,t){return qu(e)[t]}(e,t)}var ls=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},cs=function(e){var t={code:"invalid_json",message:Object(Cu.a)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},us=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(ls(e,t)).catch((function(e){return ss(e,t)}))};function ss(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return cs(e).then((function(e){var t={code:"unknown_error",message:Object(Cu.a)("An unknown error occurred.")};throw e||t}))}function fs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ds=function(e,t){if(!(e.path&&-1!==e.path.indexOf("/wp/v2/media")||e.url&&-1!==e.url.indexOf("/wp/v2/media")))return t(e);var n=0;return t(ps(ps({},e),{},{parse:!1})).catch((function(r){var a=r.headers.get("x-wp-upload-attachment-id");return r.status>=500&&r.status<600&&a?function e(r){return n++,t({path:"/wp/v2/media/".concat(r,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return n<5?e(r):(t({path:"/wp/v2/media/".concat(r,"?force=true"),method:"DELETE"}),Promise.reject())}))}(a).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Object(Cu.a)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(r)})):ss(r,e.parse)})).then((function(t){return us(t,e.parse)}))};function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ys={Accept:"application/json, */*;q=0.1"},gs={credentials:"include"},vs=[function(e,t){return"string"!=typeof e.url||is(e.url,"_locale")||(e.url=Yu(e.url,{_locale:"user"})),"string"!=typeof e.path||is(e.path,"_locale")||(e.path=Yu(e.path,{_locale:"user"})),t(e)},Du,function(e,t){var n=e.method,r=void 0===n?"GET":n;return os.has(r.toUpperCase())&&(e=as(as({},e),{},{headers:as(as({},e.headers),{},{"X-HTTP-Method-Override":r,"Content-Type":"application/json"}),method:"POST"})),t(e)},ns];var bs=function(e){if(e.status>=200&&e.status<300)return e;throw e},ws=function(e){var t=e.url,n=e.path,r=e.data,a=e.parse,o=void 0===a||a,i=dl(e,["url","path","data","parse"]),l=e.body,c=e.headers;return c=hs(hs({},ys),c),r&&(l=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,hs(hs(hs({},gs),i),{},{body:l,headers:c})).then((function(e){return Promise.resolve(e).then(bs).catch((function(e){return ss(e,o)})).then((function(e){return us(e,o)}))}),(function(){throw{code:"fetch_error",message:Object(Cu.a)("You are probably offline.")}}))};function Es(e){return vs.reduceRight((function(e,t){return function(n){return t(n,e)}}),ws)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Es.nonceEndpoint).then(bs).then((function(e){return e.text()})).then((function(t){return Es.nonceMiddleware.nonce=t,Es(e)}))}))}Es.use=function(e){vs.unshift(e)},Es.setFetchHandler=function(e){ws=e},Es.createNonceMiddleware=Nu,Es.createPreloadingMiddleware=Uu,Es.createRootURLMiddleware=Fu,Es.fetchAllMiddleware=ns,Es.mediaUploadMiddleware=ds;var Os,Ss=Es,ks=n(11),_s=n.n(ks),js=n(62),xs=n.n(js);function Ps(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Cs(e){return(Cs="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 Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function As(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){Ns(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ls=n(120),Is=xs()(_s.a),Ds=TemplatelyAdmin,Ms=Ds.platform,Rs=Ds.post_id,Fs=Ds.nonce,zs=Ds.is_editor,Us=(Ds.current_url,Ds.rest_url),Bs=Ds.api_nonce;Ss.use(Ss.createNonceMiddleware(Bs)),Ss.use(Ss.createRootURLMiddleware(Us)),void 0===(null===(Os=window)||void 0===Os?void 0:Os.fetch)&&Ss.setFetchHandler((function(e){var t=e.url,n=e.path,r=e.data,a=e.method;return wu()({url:t||n,method:a,data:r}).then((function(e){return null==e?void 0:e.data})).catch((function(e){return Promise.reject(e.response.data)}))}));var Vs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={heightAuto:!1,customClass:{container:"templately-swal"},showConfirmButton:!1};if("string"==typeof e){var r=e;n=As(As({},n),{},{text:r})}else{var a=e;n=As(As({},n),{},{html:a})}return t=t!={}?As(As({},n),t):n,Is.fire(t)},Ws=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"remote",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={fileType:"elementor"};n=As(As({},r),n);var a=new FormData;a.append("action","get_templately"),a.append("content_type","template_content"),a.append("nonce",Fs),a.append("source",t),a.append("id",e),void 0!==n.fileType&&a.append("file_type",n.fileType),void 0!==n.is_editor&&a.append("is_editor",n.is_editor);var o=n.fileType;return wu.a.post(ajaxurl,a).then((function(e){if("elementor"===o){if(e.data.success&&e.data.hasOwnProperty("data")){if("undefined"!=typeof elementor){var t=window.TemplatelyIndex;if("undefined"!=typeof $e)for(var n=0;n<e.data.data.content.length;n++)$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:e.data.data.content[n],options:t>=0?{at:t++}:{}});else{var r=new Backbone.Model({getTitle:function(){return"Test"}});elementor.channels.data.trigger("template:before:insert",r);for(var a=window.TemplatelyIndex,i=0;i<e.data.data.content.length;i++)elementor.getPreviewView().addChildElement(e.data.data.content[i],a>=0?{at:a++}:null);elementor.channels.data.trigger("template:after:insert",{})}}return!0}return e}if("gutenberg"===o){var l=wp.blocks.parse,c=wp.data.dispatch("core/block-editor").insertBlocks;return e.data.success&&e.data.hasOwnProperty("data")?(c(l(e.data.data.content)),!0):e}})).catch((function(e){return console.error("Insert Error: ",e)}))},Hs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cloud",n=new FormData;n.append("action","get_templately"),n.append("content_type","remove_from_cloud"),n.append("remove_from",t);var r="templately"===Ms?"elementor":Ms;return n.append("file_type",r),n.append("id",e),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},$s=function(e){window.open(e,"_blank"),window.focus()},qs=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"set_favourite",r=new FormData;return r.append("action","get_templately"),r.append("content_type",n),r.append("nonce",Fs),r.append("id",e),r.append("type",t),wu.a.post(ajaxurl,r).then((function(e){return e})).catch((function(e){return"Something went wrong."}))},Ks=function(){var e=new FormData;return e.append("action","get_templately"),e.append("content_type","logout"),e.append("nonce",Fs),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return console.error("Fav Error: ",e.response)}))},Qs=function(e,t){for(var n=0,r=0;r<t.length;r++)if(t[r].id===e){n=t[r].count;break}return n},Gs=function(e,t){return t.filter((function(t){return t.id!=e}))},Ys=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(t[r].template_id===e){n=!0;break}return n},Xs=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},Js=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},Zs=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={page:-1};n=As(As({},r),n);var a=new FormData;if(a.append("action","get_templately"),a.append("content_type","get_workspace"),void 0!==n.page&&a.append("pagenum",n.page),void 0!==n.per_page&&a.append("per_page",n.per_page),!0===e&&a.append("shared",!0),a.append("nonce",Fs),t)return wu.a.post(ajaxurl,a).then((function(e){return e}));var o={};return null!=n.cancelToken&&(o.cancelToken=n.cancelToken),wu.a.post(ajaxurl,a,o).then((function(e){return e.data.success?e.data.data.data:e.data.data})).catch((function(e){return console.error("Error Getting WorkSpace List: ",e)}))},ef=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return null!=e&&e.length>0&&"object"==Cs(e)&&e.map((function(e){n.push({value:e.id,slug:e.slug,label:e.name,shared:t})})),n},tf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("content_type","clouds_sync"),null!=e.per_page&&t.append("per_page",e.per_page),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("fileType",e.platform),null!=e.search&&t.append("search",e.search),t.append("nonce",Fs),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},nf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new FormData;return n.append("action","get_templately"),n.append("content_type","workspace_details"),n.append("slug",e),null!=t.per_page&&n.append("per_page",t.per_page),null!=t.page&&n.append("page",t.page),null!=t.search&&n.append("search",t.search),null!=t.platform&&n.append("file_type",t.platform),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},rf=function(e){var t=new FormData;return null!=e&&e.id&&t.append("id",e.id),e.hasOwnProperty("slug")&&t.append("slug",e.slug),e.hasOwnProperty("type")&&t.append("type",e.type),t.append("action","get_templately"),t.append("content_type","get_item"),t.append("nonce",Fs),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},af=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},r.length>1&&void 0!==r[1]&&r[1],null!=t.slug){e.next=4;break}return e.abrupt("return",{success:!1,loading:!1,error:!0,data:{errorMessage:"Something errormessage."}});case 4:return(n=new FormData).append("action","get_templately"),n.append("nonce",Fs),n.append("content_type","install_requirements"),n.append("requirements",JSON.stringify(t)),e.next=11,wu.a.post(ajaxurl,n).then((function(e){return e.data.data.hasOwnProperty("success")&&e.data.data.success?{success:!0,loading:!1,error:!1}:"pro_plugin"===e.data.data.errorCode?{success:!1,loading:!1,error:!1}:{success:!1,loading:!1,error:!0,data:{errorMessage:"Something went wrong."}}})).catch((function(e){return{loading:!1,error:!0,data:{errorMessage:e.response}}}));case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Ps(o,r,a,i,l,"next",e)}function l(e){Ps(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}(),of=function(e){if(e.length<8)return!1;return!!(/[A-Z]/g.test(e)&&/[a-z]/g.test(e)&&/[0-9]/g.test(e))},lf=function(){return new URLSearchParams(ue().search)},cf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null!=e&&e.id?Ss({path:"/clouds?id="+e.id}).then((function(e){var t=document.createElement("a");return t.setAttribute("download",null==e?void 0:e.file_name),t.href=null==e?void 0:e.fileURL,t.click(),t.remove(),!0})).catch((function(e){return console.error("DownloadError: ",null==e?void 0:e.code,null==e?void 0:e.message)})):(console.error("DownloadError: ID is missing to downlod."),!1)};function uf(e){return(uf="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)}var sf=function(e){return i.a.createElement("div",{className:"templately-modal-message ".concat(void 0!==e.className&&e.className)},e.icon&&e.icon,e.title&&i.a.createElement("h3",null," ",e.title," "),i.a.createElement("div",{className:"tmm-body"},"string"==typeof e.content&&i.a.createElement("p",null,e.content),"object"===uf(e.content)&&e.content))};function ff(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var df=TemplatelyAdmin,mf=df.nonce,hf=df.is_editor,yf=df.platform,gf=wp.i18n.__,vf=nt((function(e){return{preview:e.preview,items:e.items,packs:e.packs,errors:e.errors,successText:e.common.successText,user:e.admin.user}}))((function(e){var t=ff(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ff(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ue();return Object(o.useEffect)((function(){n&&(e.dispatch(vi([])),e.dispatch(bi([])),e.dispatch(Oi([])),"elementor"===yf&&window.TemplatelyModal.destroy(),"gutenberg"===yf&&Eu.close(),r(!1))}),[n]),Object(o.useEffect)((function(){if(l){var t=new FormData;t.append("action","get_templately"),t.append("content_type","clouds_sync"),t.append("nonce",mf);var n="templately"===yf?"elementor":yf;wu.a.post(ajaxurl,t).then((function(t){if(200===t.status&&t.data.success){var r=t.data.data.data.filter((function(e){return n===e.file_type}));e.dispatch(Oi({current_page:t.data.data.current_page,data:r,total_page:t.data.data.total_page,platform:e.platform})),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Synced",content:i.a.createElement("p",null,gf("Your Cloud is Successfully Synced with Your Templately Account.","templately"))})})}})).catch((function(e){return console.error("Sync Error From Actions: ",e)})),c(!1)}}),[l]),i.a.createElement("div",{className:"templately-modal-action-button"},"templately"===yf&&i.a.createElement(Pu,null),i.a.createElement(_u,null),0!==e.user.length&&"/clouds"===u.pathname&&i.a.createElement("button",{className:"templately-button templately-cloud-sync",onClick:function(){return c(!0)}},i.a.createElement("svg",{width:"28px",viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{d:"m357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245-20.397-11.367-43.345-17.35-66.911-17.35-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709-32.323 17.257-52.7 50.784-52.7 88.042 0 55.056 44.792 99.848 99.848 99.848h259.212c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),i.a.createElement("g",{id:"templatelySyncs",fill:"#6d7988",transform:"translate(260 22)"},i.a.createElement("path",{d:"m71.409 103.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012 10.467-15.689 20.775-31.488 30.891-47.406 4.201-6.609 1.861-10.715-5.963-11.07z"}),i.a.createElement("path",{d:"m250.088 84.992c-9.643-15.988-19.451-31.88-29.423-47.666-4.464-7.066-9.893-7.168-14.476-.301-10.26 15.376-20.364 30.86-30.321 46.435-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))),!hf&&0!==e.user.length&&i.a.createElement(ee,{exact:e.exact||!0,path:"/profile",children:function(t){var n=t.match;return i.a.createElement("button",{className:n?"templately-active templately-button":"templately-button",onClick:function(e){return e.preventDefault()}},i.a.createElement(ge,{className:e.className,onClick:function(){e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1))},to:"/profile"},e.user.hasOwnProperty("profile_photo")&&""!=e.user.profile_photo?i.a.createElement("img",{src:e.user.profile_photo}):i.a.createElement(fi,{color:"#a4b0c1"})))}}),("elementor"===yf||"gutenberg"===yf)&&i.a.createElement("button",{className:"templately-button templately-close",onClick:function(){return r(!0)}},i.a.createElement(si,{color:"#a4b0c1"})))})),bf=function(){return i.a.createElement("div",{className:"templately-modal-header"},i.a.createElement(Ji,null),i.a.createElement(vu,null),i.a.createElement(vf,null))},wf=function(e){return i.a.createElement("div",{onScroll:e.onScroll,className:"templately-modal-content-wrapper ".concat(null!=e.classes?e.classes:"")},e.children)},Ef=nt()((function(e){return i.a.createElement("div",{className:"templately-table ".concat(e.className&&e.className," ")},e.children)})),Of=nt()((function(e){return i.a.createElement("div",{className:"templately-table-row ".concat(void 0!==e.className?e.className:"")},e.children)})),Sf=nt()((function(e){return i.a.createElement("div",{className:"templately-table-col ".concat(null!=e.className?e.className:"")},e.children)})),kf=wp.i18n.__,_f=function(e){return i.a.createElement(Of,{className:"templately-table-head"},i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Name"))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Last Modified"))),i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Action"))))))},jf=n(7),xf=n(8),Pf=n.n(xf),Cf=n(2),Tf=n(32),Af=Object.create(null);function Nf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.since,r=t.version,a=t.alternative,o=t.plugin,i=t.link,l=t.hint,c=o?" from ".concat(o):"",u=n?" since version ".concat(n):"",s=r?" and will be removed".concat(c," in version ").concat(r):"",f=a?" Please use ".concat(a," instead."):"",p=i?" See: ".concat(i):"",d=l?" Note: ".concat(l):"",m="".concat(e," is deprecated").concat(u).concat(s,".").concat(f).concat(p).concat(d);m in Af||(Object(Tf.b)("deprecated",e,t,m),console.warn(m),Af[m]=!0)}function Lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t,n){return jf.Children.forEach(t,(function(t,r){t&&"string"!=typeof t&&(t=Object(jf.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e}),[])}function If(e,t){0}function Df(e){if(!e.collapsed)return e.getBoundingClientRect();var t=e.startContainer,n=t.ownerDocument;if("BR"===t.nodeName){var r=t.parentNode;If();var a=Array.from(r.childNodes).indexOf(t);If(),(e=n.createRange()).setStart(r,a),e.setEnd(r,a)}var o=e.getClientRects()[0];if(!o){If();var i=n.createTextNode("");(e=e.cloneRange()).insertNode(i),o=e.getClientRects()[0],If(i.parentNode),i.parentNode.removeChild(i)}return o}var Mf=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function Rf(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function Ff(e){var t=e.querySelectorAll(Mf);return Array.from(t).filter((function(e){return!(!Rf(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&Rf(n)}(e))}))}function zf(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function Uf(e){return-1!==zf(e)}function Bf(e,t){return{element:e,index:t}}function Vf(e){return e.element}function Wf(e,t){var n=zf(e.element),r=zf(t.element);return n===r?e.index-t.index:n-r}function Hf(e){return e.filter(Uf).map(Bf).sort(Wf).map(Vf).reduce((t={},function(e,n){var r=n.nodeName,a=n.type,o=n.checked,i=n.name;if("INPUT"!==r||"radio"!==a||!i)return e.concat(n);var l=t.hasOwnProperty(i);if(!o&&l)return e;if(l){var c=t[i];e=Object(Cf.without)(e,c)}return t[i]=n,e.concat(n)}),[]);var t}function $f(e){return Hf(Ff(e))}function qf(e){var t=Ff(e.ownerDocument.body),n=t.indexOf(e);return t.length=n,Object(Cf.last)(Hf(t))}function Kf(e){var t=Ff(e.ownerDocument.body),n=t.indexOf(e),r=t.slice(n+1).filter((function(t){return!e.contains(t)}));return Object(Cf.first)(Hf(r))}var Qf={focusable:r,tabbable:a};function Gf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e){if("undefined"==typeof window)return!1;e=window}var t=e.navigator.platform;return-1!==t.indexOf("Mac")||Object(Cf.includes)(["iPad","iPhone"],t)}var Yf="alt",Xf="ctrl",Jf="meta",Zf="shift",ep={primary:function(e){return e()?[Jf]:[Xf]},primaryShift:function(e){return e()?[Zf,Jf]:[Xf,Zf]},primaryAlt:function(e){return e()?[Yf,Jf]:[Xf,Yf]},secondary:function(e){return e()?[Zf,Yf,Jf]:[Xf,Zf,Yf]},access:function(e){return e()?[Xf,Yf]:[Zf,Yf]},ctrl:function(){return[Xf]},alt:function(){return[Yf]},ctrlShift:function(){return[Xf,Zf]},shift:function(){return[Zf]},shiftAlt:function(){return[Zf,Yf]}},tp=(Object(Cf.mapValues)(ep,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf;return[].concat(Object(yl.a)(e(n)),[t.toLowerCase()]).join("+")}})),Object(Cf.mapValues)(ep,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf,a=r(),o=(n={},Object(pt.a)(n,Yf,a?"⌥":"Alt"),Object(pt.a)(n,Xf,a?"⌃":"Ctrl"),Object(pt.a)(n,Jf,"⌘"),Object(pt.a)(n,Zf,a?"⇧":"Shift"),n),i=e(r).reduce((function(e,t){var n=Object(Cf.get)(o,t,t);return[].concat(Object(yl.a)(e),a?[n]:[n,"+"])}),[]),l=Object(Cf.capitalize)(t);return[].concat(Object(yl.a)(i),[l])}})));Object(Cf.mapValues)(tp,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf;return e(t,n).join("")}})),Object(Cf.mapValues)(ep,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf,a=r(),o=(n={},Object(pt.a)(n,Zf,"Shift"),Object(pt.a)(n,Jf,a?"Command":"Control"),Object(pt.a)(n,Xf,"Control"),Object(pt.a)(n,Yf,a?"Option":"Alt"),Object(pt.a)(n,",",Object(Cu.a)("Comma")),Object(pt.a)(n,".",Object(Cu.a)("Period")),Object(pt.a)(n,"`",Object(Cu.a)("Backtick")),n);return[].concat(Object(yl.a)(e(r)),[t]).map((function(e){return Object(Cf.capitalize)(Object(Cf.get)(o,e,e))})).join(a?" ":" + ")}}));function np(e){return[Yf,Xf,Jf,Zf].filter((function(t){return e["".concat(t,"Key")]}))}Object(Cf.mapValues)(ep,(function(e){return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gf,a=e(r),o=np(t);return!Object(Cf.xor)(a,o).length&&(n?t.key===n:Object(Cf.includes)(a,t.key.toLowerCase()))}}));function rp(e){var t=hl(Object(jf.useState)((function(){return!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)})),2),n=t[0],r=t[1];return Object(jf.useEffect)((function(){if(e){var t=function(){return r(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&n}var ap={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},op={">=":"min-width","<":"max-width"},ip={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},lp=Object(jf.createContext)(null),cp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(jf.useContext)(lp),r=!n&&"(".concat(op[t],": ").concat(ap[e],"px)"),a=rp(r);return n?ip[t](ap[e],n):a};cp.__experimentalWidthProvider=lp.Provider;var up=cp,sp=n(64),fp=n.n(sp).a;function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mp=function(e){var t=e.className,n=e.isPressed,r=dp(dp({},dl(e,["className","isPressed"])),{},{className:Pf()(t,{"is-pressed":n})||void 0,role:"img","aria-hidden":!0,focusable:!1});return Object(jf.createElement)("svg",r)},hp=Object(jf.createElement)(mp,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(jf.createElement)((function(e){return Object(jf.createElement)("path",e)}),{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function yp(e){if(e){if(e.scrollHeight>e.clientHeight){var t=(If((n=e).ownerDocument.defaultView),n.ownerDocument.defaultView.getComputedStyle(n)).overflowY;if(/(auto|scroll)/.test(t))return e}var n;return yp(e.parentNode)}}function gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n,r,a,o,i){var l=t.width,c="rtl"===document.documentElement.dir;"left"===n&&c?n="right":"right"===n&&c&&(n="left"),"left"===r&&c?r="right":"right"===r&&c&&(r="left");var u=Math.round(e.left+e.width/2),s={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)},f=e.left;"right"===r?f=e.right:"middle"!==o&&(f=u);var p=e.right;"left"===r?p=e.left:"middle"!==o&&(p=u);var d,m={popoverLeft:f,contentWidth:f-l>0?l:f},h={popoverLeft:p,contentWidth:p+l>window.innerWidth?window.innerWidth-p:l},y=n,g=null;if(!a)if("center"===n&&s.contentWidth===l)y="center";else if("left"===n&&m.contentWidth===l)y="left";else if("right"===n&&h.contentWidth===l)y="right";else{var v="left"===(y=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;g=v!==l?v:null}if(d="center"===y?s.popoverLeft:"left"===y?m.popoverLeft:h.popoverLeft,i){var b=i.getBoundingClientRect();d=Math.min(d,b.right-l)}return{xAxis:y,popoverLeft:d,contentWidth:g}}function Ep(e,t,n,r,a,o,i){var l=t.height;if(a){var c=(yp(o)||document.body).getBoundingClientRect().top+l-i;if(e.top<=c)return{yAxis:n,popoverTop:Math.min(e.bottom,c)}}var u=e.top+e.height/2;"bottom"===r?u=e.bottom:"top"===r&&(u=e.top);var s={popoverTop:u,contentHeight:(u-l/2>0?l/2:u)+(u+l/2>window.innerHeight?window.innerHeight-u:l/2)},f={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l},d=n,m=null;if(!a)if("middle"===n&&s.contentHeight===l)d="middle";else if("top"===n&&f.contentHeight===l)d="top";else if("bottom"===n&&p.contentHeight===l)d="bottom";else{var h="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==l?h:null}return{yAxis:d,popoverTop:"middle"===d?s.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Op=function(e,t){return function(n){var r=e(n),a=n.displayName,o=void 0===a?n.name||"Component":a;return r.displayName="".concat(Object(Cf.upperFirst)(Object(Cf.camelCase)(t)),"(").concat(o,")"),r}};function Sp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var kp=Object(jf.createContext)({focusHistory:[]}),_p=kp.Provider,jp=kp.Consumer;_p.displayName="FocusReturnProvider",jp.displayName="FocusReturnConsumer";jf.Component;function xp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Pp=Op((function e(t){if((r=t)instanceof jf.Component||"function"==typeof r){var n=t;return e({})(n)}var r,a=t.onFocusReturn,o=void 0===a?Cf.stubTrue:a;return function(e){var t=function(t){al(r,t);var n=xp(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return nl(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==o())for(var r,a=[].concat(Object(yl.a)(Cf.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(yl.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(jf.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(jf.createElement)(e,this.props.childProps))}}]),r}(jf.Component);return function(e){return Object(jf.createElement)(jp,null,(function(n){return Object(jf.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function Cp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Tp=Op((function(e){return function(t){al(r,t);var n=Cp(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(jf.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(il(e)),e}return nl(r,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var t=Qf.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(jf.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(jf.createElement)(e,this.props))}}]),r}(jf.Component)}),"withConstrainedTabbing");function Ap(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Np=["button","submit"];function Lp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Ip=Op((function(e){return function(t){al(r,t);var n=Ap(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(il(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(il(e)),e.queueBlurCheck=e.queueBlurCheck.bind(il(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(il(e)),e}return nl(r,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(Cf.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(Cf.includes)(Np,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(jf.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(jf.createElement)(e,s({ref:this.bindNode},this.props)))}}]),r}(jf.Component)}),"withFocusOutside")(function(e){al(n,e);var t=Lp(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(jf.Component));function Dp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Mp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,a=void 0===r?"lockscroll":r,o=0,i=0;function l(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=i)}function c(){0===o&&l(!0),++o}function u(){1===o&&l(!1),--o}return function(e){al(n,e);var t=Dp(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"componentDidMount",value:function(){c()}},{key:"componentWillUnmount",value:function(){u()}},{key:"render",value:function(){return null}}]),n}(jf.Component)}();function Rp(e){e.stopPropagation()}var Fp=Object(jf.forwardRef)((function(e,t){var n=e.children,r=dl(e,["children"]);return Object(jf.createElement)("div",s({},r,{ref:t,onMouseDown:Rp}),n)})),zp=n(22);function Up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Up(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vp(e){var t=Object(jf.useContext)(zp.a),n=t.slots[e]||{},r=t.fills[e],a=Object(jf.useMemo)((function(){return r||[]}),[r]),o=Object(jf.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),i=Object(jf.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),l=Object(jf.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),c=Object(jf.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return Bp(Bp({},n),{},{updateSlot:o,unregisterSlot:i,fills:a,registerFill:l,unregisterFill:c})}function Wp(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=cl(e)););return e}function Hp(){return(Hp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Wp(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}}).apply(this,arguments)}var $p=function(e){return!Object(Cf.isNumber)(e)&&(Object(Cf.isString)(e)||Object(Cf.isArray)(e)?!e.length:!e)},qp=n(65),Kp=n.n(qp);function Qp(e){var t=function(e,t){if("object"!==ol(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ol(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ol(t)?t:String(t)}function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xp(e){var t,n,r,a,o,i,l,c,u,s,f,p=e.children,d=(t=hl(Object(jf.useState)({}),2),n=t[0],r=t[1],a=hl(Object(jf.useState)({}),2),o=a[0],i=a[1],l=Object(jf.useCallback)((function(e,t,n){r((function(r){var a=r[e]||{};return Yp(Yp({},r),{},Object(pt.a)({},e,Yp(Yp({},a),{},{ref:t||a.ref,fillProps:n||a.fillProps||{}})))}))}),[]),c=Object(jf.useCallback)((function(e,t){r((function(n){var r=n[e],a=dl(n,[e].map(Qp));return(null==r?void 0:r.ref)===t?a:n}))}),[]),u=Object(jf.useCallback)((function(e,t){var r=n[e];if(r&&!Kp()(r.fillProps,t)){r.fillProps=t;var a=o[e];a&&a.map((function(e){return e.current.rerender()}))}}),[n,o]),s=Object(jf.useCallback)((function(e,t){i((function(n){return Yp(Yp({},n),{},Object(pt.a)({},e,[].concat(Object(yl.a)(n[e]||[]),[t])))}))}),[]),f=Object(jf.useCallback)((function(e,t){i((function(n){return n[e]?Yp(Yp({},n),{},Object(pt.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(jf.useMemo)((function(){return{slots:n,fills:o,registerSlot:l,updateSlot:u,unregisterSlot:c,registerFill:s,unregisterFill:f}}),[n,o,l,u,c,s,f]));return Object(jf.createElement)(zp.a.Provider,{value:d},p)}function Jp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Zp=Object(jf.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ed=Zp.Provider,td=Zp.Consumer;jf.Component;function nd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var rd=function(e){al(n,e);var t=nd(n);function n(){var e;return Object(el.a)(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(il(e)),e}return nl(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,a=t.registerSlot;e.name!==n&&(r(e.name),a(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Hp(cl(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,a=void 0===r?{}:r,o=e.getFills,i=Object(Cf.map)(o(n,this),(function(e){var t=e.occurrence,n=Object(Cf.isFunction)(e.children)?e.children(a):e.children;return jf.Children.map(n,(function(e,n){if(!e||Object(Cf.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(jf.cloneElement)(e,{key:r})}))})).filter(Object(Cf.negate)($p));return Object(jf.createElement)(jf.Fragment,null,Object(Cf.isFunction)(t)?t(i):i)}}]),n}(jf.Component),ad=function(e){return Object(jf.createElement)(td,null,(function(t){var n=t.registerSlot,r=t.unregisterSlot,a=t.getFills;return Object(jf.createElement)(rd,s({},e,{registerSlot:n,unregisterSlot:r,getFills:a}))}))},od=n(140),id=0;function ld(e){var t=e.name,n=e.children,r=e.registerFill,a=e.unregisterFill,o=function(e){var t=Object(jf.useContext)(Zp),n=t.getSlot,r=t.subscribe,a=hl(Object(jf.useState)(n(e)),2),o=a[0],i=a[1];return Object(jf.useEffect)((function(){return i(n(e)),r((function(){i(n(e))}))}),[e]),o}(t),i=Object(jf.useRef)({name:t,children:n});return i.current.occurrence||(i.current.occurrence=++id),Object(jf.useLayoutEffect)((function(){return r(t,i.current),function(){return a(t,i.current)}}),[]),Object(jf.useLayoutEffect)((function(){i.current.children=n,o&&o.forceUpdate()}),[n]),Object(jf.useLayoutEffect)((function(){t!==i.current.name&&(a(i.current.name,i.current),i.current.name=t,r(t,i.current))}),[t]),o&&o.node?(Object(Cf.isFunction)(n)&&(n=n(o.props.fillProps)),Object(od.createPortal)(n,o.node)):null}var cd=function(e){return Object(jf.createElement)(td,null,(function(t){var n=t.registerFill,r=t.unregisterFill;return Object(jf.createElement)(ld,s({},e,{registerFill:n,unregisterFill:r}))}))};function ud(e){var t=e.name,n=e.fillProps,r=void 0===n?{}:n,a=e.as,o=void 0===a?"div":a,i=dl(e,["name","fillProps","as"]),l=Object(jf.useContext)(zp.a),c=Object(jf.useRef)();return Object(jf.useLayoutEffect)((function(){return l.registerSlot(t,c,r),function(){l.unregisterSlot(t,c)}}),[l.registerSlot,l.unregisterSlot,t]),Object(jf.useLayoutEffect)((function(){l.updateSlot(t,r)})),Object(jf.createElement)(o,s({ref:c},i))}function sd(e){var t,n=e.name,r=e.children,a=Vp(n),o=Object(jf.useRef)({rerender:(t=hl(Object(jf.useState)({}),2)[1],function(){return t({})})});return Object(jf.useEffect)((function(){return a.registerFill(o),function(){a.unregisterFill(o)}}),[a.registerFill,a.unregisterFill]),a.ref&&a.ref.current?("function"==typeof r&&(r=r(a.fillProps)),Object(od.createPortal)(r,a.ref.current)):null}function fd(e){var t=e.bubblesVirtually,n=dl(e,["bubblesVirtually"]);return t?Object(jf.createElement)(ud,n):Object(jf.createElement)(ad,n)}function pd(e){return Object(jf.createElement)(jf.Fragment,null,Object(jf.createElement)(cd,e),Object(jf.createElement)(sd,e))}function dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dd(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hd(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var a,o=hl(r.split(" "),2),i=o[0],l=o[1],c=void 0===l?"center":l;return Pf()("components-animate__appear",(a={},Object(pt.a)(a,"is-from-"+c,"center"!==c),Object(pt.a)(a,"is-from-"+i,"middle"!==i),a))}return"slide-in"===t?Pf()("components-animate__slide-in","is-from-"+r):"loading"===t?Pf()("components-animate__loading"):void 0}function yd(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:hd(md({type:t},r))})}var gd=Tp(Pp((function(e){return e.children})));function vd(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),a=r.paddingTop,o=r.paddingBottom,i=r.paddingLeft,l=r.paddingRight,c=a?parseInt(a,10):0,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,f=l?parseInt(l,10):0;return{x:e.left+s,y:e.top+c,width:e.width-s-f,height:e.height-c-u,left:e.left+s,right:e.right-f,top:e.top+c,bottom:e.bottom-u}}function bd(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function wd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Ed(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Od=function(e){var t=e.headerTitle,n=e.onClose,r=e.onKeyDown,a=e.children,o=e.className,i=e.noArrow,l=void 0===i||i,c=e.isAlternate,u=e.position,f=void 0===u?"bottom right":u,p=(e.range,e.focusOnMount),d=void 0===p?"firstElement":p,m=e.anchorRef,h=e.shouldAnchorIncludePadding,y=e.anchorRect,g=e.getAnchorRect,v=e.expandOnMobile,b=e.animate,w=void 0===b||b,E=e.onClickOutside,O=e.onFocusOutside,S=e.__unstableSticky,k=e.__unstableSlotName,_=void 0===k?"Popover":k,j=e.__unstableObserveElement,x=e.__unstableBoundaryParent,P=dl(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(jf.useRef)(null),T=Object(jf.useRef)(null),A=Object(jf.useRef)(),N=up("medium","<"),L=hl(Object(jf.useState)(),2),I=L[0],D=L[1],M=Vp(_),R=v&&N,F=hl(fp(),2),z=F[0],U=F[1];l=R||l,Object(jf.useLayoutEffect)((function(){if(R)return Ed(A.current,"is-without-arrow",l),Ed(A.current,"is-alternate",c),bd(A.current,"data-x-axis"),bd(A.current,"data-y-axis"),wd(A.current,"top"),wd(A.current,"left"),wd(T.current,"maxHeight"),void wd(T.current,"maxWidth");var e=function(){if(A.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Df(r);if(r instanceof window.Element){var o=r.getBoundingClientRect();return a?o:vd(o,r)}var i=r.top,l=r.bottom,c=i.getBoundingClientRect(),u=l.getBoundingClientRect(),s=new window.DOMRect(c.left,c.top,c.width,u.bottom-c.top);return a?s:vd(s,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return a?p:vd(p,f)}}(C,y,g,m,h);if(e){var t,n,r=A.current,a=r.offsetParent,o=r.ownerDocument,i=0;if(a&&a!==o.body){var u=a.getBoundingClientRect();i=u.top,e=new window.DOMRect(e.left-u.left,e.top-u.top,e.width,e.height)}if(x)t=null===(n=A.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=n.split(" "),c=hl(l,3),u=c[0],s=c[1],f=void 0===s?"center":s,p=c[2],d=Ep(e,t,u,p,r,a,o),m=bp(e,t,f,p,r,d.yAxis,i);return vp(vp({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),f,S,A.current,i,t),p=s.popoverTop,d=s.popoverLeft,v=s.xAxis,b=s.yAxis,w=s.contentHeight,E=s.contentWidth;"number"==typeof p&&"number"==typeof d&&(wd(A.current,"top",p+"px"),wd(A.current,"left",d+"px")),Ed(A.current,"is-without-arrow",l||"center"===v&&"middle"===b),Ed(A.current,"is-alternate",c),bd(A.current,"data-x-axis",v),bd(A.current,"data-y-axis",b),wd(T.current,"maxHeight","number"==typeof w?w+"px":""),wd(T.current,"maxWidth","number"==typeof E?E+"px":"");D(({left:"right",right:"left"}[v]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),a=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),j&&(n=new window.MutationObserver(e)).observe(j,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",a),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[R,y,g,m,h,f,U,S,j,x]),function(e,t){Object(jf.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=Qf.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(d,T);var B=function(e){27===e.keyCode&&n&&(e.stopPropagation(),n()),r&&r(e)};var V=Object(jf.createElement)(Ip,{onFocusOutside:function(e){if(O)O(e);else if(E){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Nf("Popover onClickOutside prop",{alternative:"onFocusOutside"}),E(t)}else n&&n()}},Object(jf.createElement)(yd,{type:w&&I?"appear":null,options:{origin:I}},(function(e){var r=e.className;return Object(jf.createElement)(Fp,s({className:Pf()("components-popover",o,r,{"is-expanded":R,"is-without-arrow":l,"is-alternate":c})},P,{onKeyDown:B,ref:A}),R&&Object(jf.createElement)(Mp,null),R&&Object(jf.createElement)("div",{className:"components-popover__header"},Object(jf.createElement)("span",{className:"components-popover__header-title"},t),Object(jf.createElement)(Id,{className:"components-popover__close",icon:hp,onClick:n})),Object(jf.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(jf.createElement)("div",{style:{position:"relative"}},z,a)))})));return d&&(V=Object(jf.createElement)(gd,null,V)),M.ref&&(V=Object(jf.createElement)(pd,{name:_},V)),m||y?V:Object(jf.createElement)("span",{ref:C},V)};Od.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(jf.createElement)(fd,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Sd=Od;var kd=function(e){var t,n,r=e.shortcut,a=e.className;return r?(Object(Cf.isString)(r)&&(t=r),Object(Cf.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(jf.createElement)("span",{className:a,"aria-label":n},t)):null};function _d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var jd=function(e){al(n,e);var t=_d(n);function n(){var e;return Object(el.a)(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(Cf.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return nl(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===jf.Children.count(n)){var r=jf.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(Cf.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,a=e.shortcut;if(1!==jf.Children.count(t))return t;var o=jf.Children.only(t),i=this.state.isOver;return Object(jf.cloneElement)(o,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Lf(o.props.children,i&&Object(jf.createElement)(Sd,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(jf.createElement)(kd,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),n}(jf.Component);var xd=function(e){var t=e.icon,n=e.className,r=dl(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(jf.createElement)("span",s({className:a},r))};function Pd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pd(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Td=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,a=dl(e,["icon","size"]);if("string"==typeof n)return Object(jf.createElement)(xd,s({icon:n},a));if(n&&xd===n.type)return Object(jf.cloneElement)(n,Cd({},a));var o=r||24;if("function"==typeof n)return n.prototype instanceof jf.Component?Object(jf.createElement)(n,Cd({size:o},a)):n(Cd({size:o},a));if(n&&("svg"===n.type||n.type===mp)){var i=Cd(Cd({width:o,height:o},n.props),a);return Object(jf.createElement)(mp,i)}return Object(jf.isValidElement)(n)?Object(jf.cloneElement)(n,Cd({size:o},a)):n};function Ad(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Nd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nd(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ld=["onMouseDown","onClick"];var Id=Object(jf.forwardRef)((function(e,t){var n=e.href,r=e.target,a=e.isPrimary,o=e.isSmall,i=e.isTertiary,l=e.isPressed,c=e.isBusy,u=e.isDefault,f=e.isSecondary,p=e.isLink,d=e.isDestructive,m=e.className,h=e.disabled,y=e.icon,g=e.iconSize,v=e.showTooltip,b=e.tooltipPosition,w=e.shortcut,E=e.label,O=e.children,S=e.__experimentalIsFocusable,k=dl(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);u&&Nf("Button isDefault prop",{alternative:"isSecondary"});var _=Pf()("components-button",m,{"is-secondary":u||f,"is-primary":a,"is-small":o,"is-tertiary":i,"is-pressed":l,"is-busy":c,"is-link":p,"is-destructive":d,"has-text":!!y&&!!O,"has-icon":!!y}),j=h&&!S,x=void 0===n||j?"button":"a",P="a"===x?{href:n,target:r}:{type:"button",disabled:j,"aria-pressed":l};if(h&&S){P["aria-disabled"]=!0;var C,T=Ad(Ld);try{for(T.s();!(C=T.n()).done;){k[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){T.e(e)}finally{T.f()}}var A=!j&&(v&&E||w||!!E&&(!O||Object(Cf.isArray)(O)&&!O.length)&&!1!==v),N=Object(jf.createElement)(x,s({},P,k,{className:_,"aria-label":k["aria-label"]||E,ref:t}),y&&Object(jf.createElement)(Td,{icon:y,size:g}),O);return A?Object(jf.createElement)(jd,{text:E,shortcut:w,position:b},N):N})),Dd=TemplatelyAdmin.loadingImage,Md=function(e){return i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Dd}))};function Rd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zd=wp.i18n.__,Ud=TemplatelyAdmin,Bd=Ud.nonce,Vd=Ud.platform,Wd=Ud.is_block_editor,Hd=Ud.is_editor,$d=nt((function(e){return{is_verified:e.admin.user.is_verified,cloud_map:e.common.cloud_map,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Rd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Rd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Rd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Rd(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Object(o.useRef)(null),y=Object(o.useRef)(null),g=Object(o.useRef)(null),v=Object(o.useRef)(null),b=function(e){var t=h.current&&h.current.contains(e.target),n=y.current&&y.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){if(0!=s){var t=new FormData;t.append("action","get_templately"),t.append("content_type","push_to_cloud"),t.append("nonce",Bd),t.append("id",s);var n="templately"===Vd?"elementor":Vd;t.append("file_type",n),Vs("",{showConfirmButton:!1,showCloseButton:!0,html:i.a.createElement(Md,null)}),wu.a.post(ajaxurl,t).then((function(t){t.data.success?("success"==t.data.data.status&&(e.dispatch({type:"ALL_CLOUDS_MAP",payload:{template_id:s,cloud_item_id:t.data.data.data.myCloud_item}}),Vs(zd("Successfully Pushed to Cloud.","templately"),{timer:1500,icon:"success"})),"error"==t.data.data.status&&Vs(zd("Something went wrong.","templately"),{timer:1500,icon:"error"})):Vs(zd(t.data.data,"templately"),{timer:1500,icon:"error"})})).catch((function(e){return console.error("Pushed Related Issue: ",e)})),f(!1)}}),[s]),Object(o.useEffect)((function(){var t,n;0!=d&&(r(!1),(t=d,(n=new FormData).append("action","get_templately"),n.append("content_type","delete_template"),n.append("nonce",Fs),n.append("id",t),n.append("type","template"),wu.a.post(ajaxurl,n).then((function(e){return e.data})).catch((function(e){return{success:!1,data:"Something went wrong regarding delete this template."}}))).then((function(t){t.success?(e.dispatch({type:"REMOVE_TEMPLATE",payload:{id:d,page:e.pagination}}),Vs(t.data,{timer:2e3,icon:"success"})):Vs(t.data,{timer:2e3,icon:"error"})})),m(!1))}),[d]),Object(o.useEffect)((function(){return document.addEventListener("mousedown",b),function(){return document.removeEventListener("mousedown",b)}}),[]),Object(o.useEffect)((function(){0!=l&&(e.isLoading(!0),Ws(e.template.id,"local",{fileType:e.platform}).then((function(t){!0===t?(window.TemplatelyModal.destroy(),e.dispatch(setLoading(!0))):(e.dispatch(setLoading(!1)),e.isLoading(!1),Vs(t,{timer:2e3,icon:"error"}))})))}),[l]),i.a.createElement("div",{ref:v},i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("div",{className:"ttcol-header"},Js("elementor")&&i.a.createElement("img",{src:Js("elementor"),alt:e.name}),i.a.createElement("p",null,zd(e.name)))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,zd(e.date))),i.a.createElement(Sf,{className:"templately-col-actions-btn"},(!Hd||!Wd)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null),zd("Preview","templately")),(!Hd||!Wd)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){Boolean(e.is_verified)?f(e.template.id):Vs(zd("Please verify your account for inserting template.","templately"),{timer:1600,icon:"error"})}},i.a.createElement("i",null),zd("Push to Cloud","templately")),(Hd||Wd)&&i.a.createElement(Id,{className:"templately-cloud-item-action-btn tw-insert",ref:g,onClick:function(){return c(e.template.id)}},i.a.createElement("i",null),zd("Insert","templately")),i.a.createElement(Id,{className:"templately-cloud-item-action-btn",ref:h,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:y,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(Hd||Wd)&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",{className:"tw-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null)," ",zd("Preview","templately")),i.a.createElement("li",{className:"tw-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",zd("Push to Cloud","templately"))),i.a.createElement("li",{className:"twm-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null)," ",zd("Preview","templately")),i.a.createElement("li",{className:"twm-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",zd("Push To Cloud","templately")),i.a.createElement("li",{className:"tw-export"},i.a.createElement("a",{href:e.template.export_url},i.a.createElement("i",null)," ",zd("Export","templately"))),i.a.createElement("li",{className:"tw-delete",onClick:function(){return m(e.template.id)}},i.a.createElement("i",null)," ",zd("Delete","templately")))))))))})),qd=function(e){return i.a.createElement("div",e,e.children)};n(127);function Kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gd=wp.i18n.__,Yd=nt((function(e){return{pagination:e.common.pagination,need_pagination:e.common.need_pagination}}))((function(e){var t=Kd(Object(o.useState)(1),2),n=t[0],r=t[1],a=Kd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Kd(Object(o.useState)([]),2),s=u[0],f=u[1];Object(o.useEffect)((function(){r(e.count)}),[e.type,e.count]),Object(o.useEffect)((function(){l&&(e.dispatch(Ri(l)),e.dispatch(Hi(null)),e.categoryPagination||e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(zi(!0)))}),[l]),Object(o.useEffect)((function(){var t=1,r=n;n>10&&(t=Math.max(1,e.pagination-3),r=Math.min(e.pagination+3,n),e.pagination-1<=3&&(r=7),n-e.pagination<=3&&(t=n-6));var a=[];a.push(i.a.createElement("li",{className:1==e.pagination?"epage-link epage-active":"epage-link",key:1,onClick:function(){return c(1)}},Gd(1,"templately"))),t>1?a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdot"},Gd("...","templately"))):a.filter((function(e){return"dotdotdot"!=e.key}));for(var o=function(t){a.push(i.a.createElement("li",{className:e.pagination==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return c(t)}},Gd(t,"templately")))},l=t+1;l<r;l+=1)o(l);e.pagination+3<n&&r!==n&&a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdotdot"},Gd("...","templately"))),a.push(i.a.createElement("li",{className:e.pagination==n?"epage-link epage-active":"epage-link",key:n,onClick:function(){return c(n)}},Gd(n,"templately"))),n>=2?(e.dispatch(Fi(!0)),f(a)):e.dispatch(Fi(!1))}),[n,e.pagination]);var p,d=function(){var t=e.pagination-1>0?e.pagination-1:0;e.dispatch(Ri(t))},m=function(){var t=e.pagination+1<n?e.pagination+1:n;e.dispatch(Ri(t))};return i.a.createElement(i.a.Fragment,null,!(s.length<2||!e.need_pagination)&&i.a.createElement("div",{className:"templately-pagination"},i.a.createElement("ul",null,(p=!(e.pagination>1),i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return d()},disabled:p},i.a.createElement(Go,null)))),s,function(){var t=!(e.pagination<n);return i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return m()},disabled:t},i.a.createElement(Yo,null)))}())))})),Xd=TemplatelyAdmin.loadingImage,Jd=nt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){var t;return i.a.createElement("div",{className:"templately-pre-loader"},(null===(t=e.retryMessage)||void 0===t?void 0:t.length)>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(ji(!0)),e.dispatch(pi(!e.retry)),e.dispatch(yi(""))}},"Retry")):i.a.createElement("img",{src:Xd}))}));function Zd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return em(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return em(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tm=TemplatelyAdmin.templates,nm=nt((function(e){return{templates:e.common.templates,isTemplate:e.common.isTemplate||!1,userID:e.admin.user.id||null,platform:e.common.platform,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination}}))((function(e){var t=Zd(Object(o.useState)([]),2),n=t[0],r=t[1],a=Zd(Object(o.useState)(1),2),l=a[0],c=a[1],u=Zd(Object(o.useState)(!1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.pagination>1&&!e.templates.hasOwnProperty(e.pagination)&&(f(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","get_templates"),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("platform",e.platform),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({page:e.pagination,platform:e.platform}).then((function(t){t.data.success&&e.dispatch(wi(t.data.data)),f(!1)})).catch((function(e){console.error(e.response)})))}),[e.pagination]),Object(o.useEffect)((function(){e.isTemplate||(e.dispatch(wi(tm)),e.dispatch({type:"TEMPLATE_TRIGGER",payload:{isTemplate:!0}}))}),[e.templates,e.isTemplate]),Object(o.useEffect)((function(){if("elementor"===e.platform){var t=[];e.templates.hasOwnProperty(e.pagination)&&(e.templates[e.pagination].map((function(e){t.push(i.a.createElement($d,{isLoading:function(e){return f(e)},key:e.id,file_type:e.type,id:e.id,name:e.title,date:e.date,template:e}))})),r(t),c(e.templates.total_page))}}),[e.templates,e.pagination]),i.a.createElement(wf,null,i.a.createElement("div",{className:"templately-modal-content templately-templates"},s&&i.a.createElement(Jd,null),!s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ef,{className:"templately-clouds-table"},i.a.createElement(_f,null),i.a.createElement(qd,{className:"templately-table-body"},n)),i.a.createElement(Yd,{type:"templates",count:l}))))}));n(128);function rm(e){return(rm="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 am(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function om(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cm=wp.i18n.__,um=TemplatelyAdmin,sm=um.nonce,fm=um.cloud_activity,pm=wp.apiFetch,dm=nt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList}}))((function(e){var t=im(Object(o.useState)(""),2),n=t[0],r=t[1],a=im(Object(o.useState)(!0),2),l=a[0],c=a[1],u=im(Object(o.useState)(!1),2),s=u[0],f=u[1],p=im(Object(o.useState)(!1),2),d=p[0],m=p[1],h=im(Object(o.useState)(!1),2),y=h[0],g=h[1],v=im(Object(o.useState)([fm]),2),b=v[0],w=v[1],E=im(Object(o.useState)(fm),2),O=E[0],S=E[1],k=im(Object(o.useState)(!1),2),_=k[0],j=k[1],x=im(Object(o.useState)("/clouds?refresh"),2),P=x[0],C=x[1],T=im(Object(o.useState)([]),2),A=T[0],N=T[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_NEXT_ROUTE",payload:"/templates/save"}),e.isLoggedIn||e.dispatch(Vi("/sign-in"));var t=!0;return function(n,r){if(A.length<=0)Promise.all([Zs(!1,!1),Zs(!0,!1)]).then((function(n){if(n.length>0){var r=[];r.push({label:cm("My Clouds","templately"),value:"clouds"}),null!==n[0]&&(t&&e.dispatch(Qi(n[0])),r.push({label:cm("My WorkSpace","templately"),options:ef(n[0])})),null!==n[1]&&(t&&e.dispatch(Gi(n[1])),r.push({label:cm("Shared WorkSpace","templately"),options:ef(n[1],!0)})),t&&(w(r),N(r))}})).catch((function(e){wu.a.isCancel(e)||console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var a=[];if(a.push({label:cm("My Clouds","templately"),value:"clouds"}),e.workspaceList.length>0&&a.push({label:cm("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&a.push({label:cm("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList)}),a.length>0){var o=[];a.map((function(e){e&&null!=e.options&&(e.options=e.options.filter((function(e){return e.slug&&-1!==e.slug.indexOf(n.toLowerCase())}))),o.push(e)})),t&&w(a)}}}(),function(){return t=!1}}),[]),Object(o.useEffect)((function(){c(!(n.length>0))}),[n]),Object(o.useEffect)((function(){f(d)}),[d]),Object(o.useEffect)((function(){if("gutenberg"===e.platform&&s){var t=parseInt(O.value),r=wp.data.select("core/editor").getEditedPostAttribute("title"),a=wp.data.select("core/editor").getEditedPostContent(),o=wp.data.select("core/editor").getCurrentPostId(),i=wp.data.select("core/editor").getCurrentPostType(),l=wp.data.select("core/editor").isEditedPostEmpty(),c={title:r,content:a};0===c.content.length&&Vs("You have no content to save in Templately.",{timer:2e3,icon:"warning"}),l||(wp.data.dispatch("core/editor").savePost(),pm({path:"/wp/v2/".concat(i,"s/").concat(o),method:"POST",data:c}).then((function(r){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?am(Object(n),!0).forEach((function(t){om(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):am(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({__file:"wp_block"},c),o=new FormData;o.append("action","get_templately"),o.append("content_type","push_to_cloud"),o.append("nonce",sm),isNaN(t)||(o.append("workspace_id",t),o.append("workspaceActivity",JSON.stringify(O)),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),o.append("title",n),o.append("data",JSON.stringify(a)),o.append("file_type","gutenberg"),j(!0),wu.a.post(ajaxurl,o).then((function(t){if(t.data.success){var n=JSON.parse(t.data.data.data);null!=n?(n.hasOwnProperty("myCloud_item")&&e.dispatch(Wi(n.myCloud_item)),j("redirect")):(Vs("Something went wrong.",{timer:2e3,icon:"error"}),C("/templates/save"),j("redirect"))}else Vs(t.data.data,{timer:2e3,icon:"error"}),j("redirect"),C("/templates/save")}))}))),f(!1)}if(s&&"elementor"===e.platform){var u=parseInt(O.value),p={};isNaN(u)||((p={workspace_id:u}).workspaceActivity=JSON.stringify(O),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),j(!0);var d=null==e.page||!0===e.page?elementor.previewView.el.firstElementChild.firstElementChild:e.currentElement;navigator.userAgent.toLowerCase().indexOf("firefox");if(null!=d)(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new FormData;o.append("action","get_templately"),o.append("content_type","save_template"),o.append("nonce",Fs),n=r.model?r.model.get("elType"):elementor.config.document.library&&elementor.config.document.library.save_as_same_type?elementor.config.document.type:"page",t=r.hasOwnProperty("model")?[r.model.toJSON({remove:["default"]})]:elementor.elements.toJSON({remove:["default"]}),o.append("content",JSON.stringify(t)),o.append("source","local"),o.append("type",n),o.append("title",e),o.append("post_id",Rs);var i="templately"===Ms?"elementor":Ms;return o.append("file_type",i),null!=a.thumbnail&&o.append("thumbnail",a.thumbnail),null!=a.workspace_id&&(o.append("workspace_id",a.workspace_id),o.append("workspaceActivity",a.workspaceActivity)),wu.a.post(ajaxurl,o).then((function(e){return e})).catch((function(e){return e}))})(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==rm(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(Wi(n.myCloud_item)),j("redirect"),Vs(t.data.data.message,{timer:2e3,icon:"success"}))}else Vs("Something went wrong.",{timer:2e3,icon:"error"}),j("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}));f(!1)}}),[s]),Object(o.useEffect)((function(){y&&S(y)}),[y]),i.a.createElement(wf,null,i.a.createElement("div",{className:"templately-modal-content templately-templates-save"},_&&i.a.createElement(Jd,null),"redirect"===_&&i.a.createElement(Y,{to:P}),!1===_&&i.a.createElement("div",null,i.a.createElement("h3",null,cm("Save Your Template And Push to Cloud","templately")," "),i.a.createElement("div",{className:"templately-save-form"},i.a.createElement("div",null,i.a.createElement("input",{autoFocus:!0,type:"text",onKeyDown:function(e){return m(13===e.keyCode)},onChange:function(e){return r(e.currentTarget.value)},value:n,placeholder:"Template Name"}),i.a.createElement(mu,{maxMenuHeight:"200px",options:b,value:O,onChange:function(e){return g(e)}})),i.a.createElement("button",{disabled:l,className:"templately-button",onClick:function(){return f(!0)}},cm("Save & Push","templately"))))))}));n(38),n(39),n(55),n(129);function mm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ym=wp.i18n.__,gm=TemplatelyAdmin,vm=gm.nonce,bm=(gm.platform,function(e,t){return t.path===e}),wm=nt((function(e){return{cloudUsageLimit:e.common.cloud_usage_limit}}))((function(e){var t=function(e){var t=ue(),n=le(H).match;return e?Z(t.pathname,e):n}(),n=mm(Object(o.useState)(0),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){if(void 0===e.cloudUsageLimit.plan){var t=new FormData;t.append("action","get_templately"),t.append("content_type","cloud_usage_limit"),t.append("nonce",vm);wu.a.post(ajaxurl,t).then((function(t){200===t.status&&t.data.success&&"success"===t.data.data.status&&e.dispatch({type:"CLOUD_USAGE_LIMIT",payload:JSON.parse(t.data.data.data)})})).catch((function(e){console.error("Usages Limit: ",e)}))}}),[]),Object(o.useEffect)((function(){a(100*e.cloudUsageLimit.files/e.cloudUsageLimit.limit)}),[e.cloudUsageLimit]),i.a.createElement("div",{className:"templately-workspace-sidebar"},i.a.createElement("div",{className:"tws-menu-list"},i.a.createElement("ul",null,i.a.createElement(Zi,{to:"/clouds",className:"tws-menu-item tws-menu-item-cloud"},i.a.createElement("i",null),i.a.createElement("span",null,ym("My Cloud","templately"))),i.a.createElement(Zi,{to:"/workspace",active:bm("/workspace/:slug",t),className:"tws-menu-item tws-menu-item-workspaces"},i.a.createElement("i",null),i.a.createElement("span",null,ym("My WorkSpace","templately"))),i.a.createElement(Zi,{to:"/shared/workspace",active:bm("/shared/workspace/:slug",t),className:"tws-menu-item tws-menu-item-share"},i.a.createElement("i",null),i.a.createElement("span",null,ym("Shared with Me","templately"))),i.a.createElement(Zi,{to:"/profile",className:"tws-menu-item tws-menu-item-profile"},i.a.createElement("i",null),i.a.createElement("span",null,ym("Profile","templately"))))),i.a.createElement("div",{className:"tws-size"},i.a.createElement("div",null,i.a.createElement("p",null,ym("My Cloud Status","templately")),i.a.createElement("div",null,i.a.createElement("span",{style:{width:"".concat(r,"%")}})),i.a.createElement("p",null,"".concat(e.cloudUsageLimit&&e.cloudUsageLimit.files," of ").concat(e.cloudUsageLimit&&(-1===e.cloudUsageLimit.limit?"Unlimited":e.cloudUsageLimit.limit)," Files")))))})),Em=nt()((function(e){return i.a.createElement("div",{className:"templately-workspace"},i.a.createElement(wm,null),i.a.createElement("div",{className:"templately-workspace-content"},e.children))}));function Om(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var km=wp.i18n.__,_m=TemplatelyAdmin,jm=_m.loadingImage,xm=(_m.platform,_m.nonce,function(e){var t=Om(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Om(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Om(Object(o.useState)(""),2),s=u[0],f=u[1],p=Om(Object(o.useState)(!0),2),d=p[0],m=p[1],h=Om(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Om(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Om(Object(o.useState)([]),2),O=E[0],S=E[1];return Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)r(!0),Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.singleDispatch(t[0],"workspace"),n.push({label:km("My WorkSpace","templately"),options:ef(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.singleDispatch(t[1]),n.push({label:km("Shared WorkSpace","templately"),options:ef(t[1],!0)})),n.length>0?(r(!1),S(n)):f("string"==typeof t[0]?t[0]:"string"==typeof t[1]?t[1]:"")}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:km("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:km("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList,!0)}),t.length>0&&S(t)}}),[l]),Object(o.useEffect)((function(){m(!1===b)}),[b]),Object(o.useEffect)((function(){y&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"copy";if(null===e||null===t)return!1;var r=new FormData;return r.append("action","get_templately"),r.append("content_type","copy_or_move"),r.append("cloud_file_id",e),r.append("workspace_id",t),r.append("trigger_action",n),r.append("nonce",Fs),wu.a.post(ajaxurl,r).then((function(e){return e}))}(e.itemID,b.value,e.action).then((function(t){t.data.success&&"success"==t.data.data?_s.a.close({triggered:!0,action:e.action,name:b.label,fileTo:b.slug}):r(!1)})),g(!1))}),[y]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:jm})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,km("Item Name","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement("h3",null,e.title))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,"copy"===e.action?km("Copy to","templately"):km("Move to","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:O,onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:d,onClick:function(){return g(!0)}},km("Done","templately")))))});function Pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pm(Object(n),!0).forEach((function(t){Tm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Am(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lm=wp.i18n.__,Im=TemplatelyAdmin,Dm=Im.platform,Mm=Im.is_block_editor,Rm=Im.is_editor,Fm=nt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Am(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Am(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Am(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Am(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Am(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Am(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Object(o.useRef)(null),O=Object(o.useRef)(null),S=Object(o.useRef)(null),k=Object(o.useRef)(null),_=function(e){var t=E.current&&E.current.contains(e.target),n=O.current&&O.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",_),function(){return document.removeEventListener("mousedown",_)}}),[]),Object(o.useEffect)((function(){!1!==l&&(e.isLoading(!0),Ws(l,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==Dm?window.TemplatelyModal.destroy():Eu.close()):(e.isLoading(!1),Vs(t,{icon:"error",timer:2e3}))})))}),[l]),Object(o.useEffect)((function(){s&&(cf({id:s}).then((function(e){e?Vs("Downloaded!",{icon:"success",timer:2e3}):Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})).catch((function(e){Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})),f(!1))}),[s]),Object(o.useEffect)((function(){if(!1!==d||!1!==y){var t=!1!==y?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==y?y:d;Vs("",{html:i.a.createElement(xm,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(Qi(t)):e.dispatch(Gi(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Oi({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?m(!1):g(!1)}}),[d,y]),Object(o.useEffect)((function(){if(!1!==b){Vs("",Cm(Cm({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(sf,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?Hs(b,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(Ki({fileFrom:e.currentWorkspace,id:b,page:e.pagination}))):(e.isDelete(!0),e.dispatch(Si({page:e.pagination,id:t.data.data,platform:e.platform}))),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:t})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),w(!1)}}),[b]),i.a.createElement("div",{ref:k},i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("div",{className:"ttcol-header"},Js(e.file_type)&&i.a.createElement("img",{src:Js(e.file_type),alt:e.name}),i.a.createElement("p",null,Lm(e.name)))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,Lm(e.date))),i.a.createElement(Sf,{className:"templately-col-actions-btn"},(Rm||Mm)&&i.a.createElement(Id,{className:"templately-cloud-item-action-btn tw-insert",ref:S,onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement(Id,{className:"templately-cloud-item-action-btn",ref:E,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:O,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-download",onClick:function(){return f(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Download"),i.a.createElement("li",{className:"tw-copy",onClick:function(){return m(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return w(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))))}));function zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Um(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zm(Object(n),!0).forEach((function(t){Bm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hm=wp.i18n.__,$m=TemplatelyAdmin,qm=$m.platform,Km=$m.is_block_editor,Qm=$m.is_editor,Gm=nt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Vm(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Vm(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Vm(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Vm(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Vm(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Vm(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Object(o.useRef)(null),O=Object(o.useRef)(null),S=(Object(o.useRef)(null),Object(o.useRef)(null)),k=function(e){var t=E.current&&E.current.contains(e.target),n=O.current&&O.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",k),function(){return document.removeEventListener("mousedown",k)}}),[]),Object(o.useEffect)((function(){!1!==s&&(e.isLoading(!0),Ws(s,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==qm?window.TemplatelyModal.destroy():Eu.close()):(e.isLoading(!1),Vs(t,{icon:"error",timer:2e3}))})))}),[s]),Object(o.useEffect)((function(){l&&(cf({id:l}).then((function(e){e?Vs("Downloaded!",{icon:"success",timer:2e3}):Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})).catch((function(e){Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})),c(!1))}),[l]),Object(o.useEffect)((function(){if(!1!==d||!1!==y){var t=!1!==y?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==y?y:d;Vs("",{html:i.a.createElement(xm,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(Qi(t)):e.dispatch(Gi(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Oi({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?m(!1):g(!1)}}),[d,y]),Object(o.useEffect)((function(){if(!1!==b){Vs("",Um(Um({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(sf,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?Hs(b,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(Ki({fileFrom:e.currentWorkspace,id:b,page:e.pagination}))):(e.isDelete(!0),e.dispatch(Si({page:e.pagination,id:t.data.data,platform:e.platform}))),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:t})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),w(!1)}}),[b]),i.a.createElement("div",{ref:S},i.a.createElement("div",{className:"tcloud-grid-item"},i.a.createElement("div",{className:"tcloud-grid-item-content"},Js(e.file_type)&&i.a.createElement("img",{src:Js(e.file_type),alt:e.name}),i.a.createElement("h4",null,Hm(e.name)),i.a.createElement("p",null,Hm(e.date))),i.a.createElement("div",{className:"tcloud-grid-item-context-menu grid-view"},i.a.createElement(Id,{className:"templately-cloud-item-action-btn grid-view",ref:E,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:O,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(Qm||Km)&&i.a.createElement("li",{className:"tw-insert",onClick:function(){return f(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement("li",{className:"tw-download",onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Download"),i.a.createElement("li",{className:"tw-copy",onClick:function(){return m(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return w(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))})),Ym=wp.i18n.__,Xm=function(e){return i.a.createElement("div",{className:"ttemplately-loggein-message"},i.a.createElement("div",null,i.a.createElement("p",null,Ym("You have to logged in, in order to visit this page or view your items from cloud.","templately")),i.a.createElement(ge,{className:"templately-button btn-templately-login",to:"/sign-in"},Ym("Login","templately"))))},Jm=wp.i18n.__,Zm=function(e){var t=e.onClick,n=e.activeTab;return i.a.createElement("div",{className:"templately-profile-tab-menu"},i.a.createElement("ul",null,i.a.createElement("li",{className:"personal"===n?"active":"",onClick:function(){return t("personal")}},i.a.createElement(fi,null)," ",Jm("Personal Info","templately")),i.a.createElement("li",{className:"favourites"===n?"active":"",onClick:function(){return t("favourites")}},i.a.createElement(ni,null),Jm("My Favourites","templately")),i.a.createElement("li",{className:"downloads"===n?"active":"",onClick:function(){return t("downloads")}},i.a.createElement(Zo,null),Jm("My Downloads","templately"))))},eh=function(e){var t=e.render;return i.a.createElement("div",{className:"templately-profile-tab-content"},t())};n(130);function th(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rh=wp.i18n.__,ah=nt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform}}))((function(e){var t,n,r,a,l,c,u,s,f=th(Object(o.useState)(!1),2),p=f[0],d=f[1];return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){0!=p&&(Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(mi(!1)),e.dispatch(Ui([])),e.dispatch(Ei({platform:e.platform})),e.dispatch({type:"WORKSPACE_RESET"}),e.dispatch({type:"SHARED_WORKSPACE_RESET"}),e.dispatch({type:"WORKSPACE_DETAILS_RESET"}),Vs(rh("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(rh("Something went wrong.","templately"),{icon:"error",timer:1500})})),d(!1))}),[p]),i.a.createElement("div",{className:"templately-profile"},(null===(t=e.user)||void 0===t?void 0:t.profile_photo)&&i.a.createElement("img",{className:"templately-profile-photo",src:null===(n=e.user)||void 0===n?void 0:n.profile_photo,alt:null===(r=e.user)||void 0===r?void 0:r.name}),i.a.createElement("h1",null,(null===(a=e.user)||void 0===a?void 0:a.name)||"".concat(null===(l=e.user)||void 0===l?void 0:l.first_name," ").concat(null===(c=e.user)||void 0===c?void 0:c.last_name)),i.a.createElement("ul",null,i.a.createElement("li",null,"Email: ",null===(u=e.user)||void 0===u?void 0:u.email),i.a.createElement("li",null,"Joining Date: ",null===(s=e.user)||void 0===s?void 0:s.joined)),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},rh("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return d(!0)},className:"button templately-button"},rh("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return d(!0)},className:"button templately-button"},rh("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(ge,{className:"button templately-button",to:"/sign-in"},rh("Link My Account","templately"))))})),oh=n(66),ih=wp.i18n.__,lh=function(e){return i.a.createElement("div",{className:"templately-item-badge ".concat(e.pro?"templately-pro":"templately-free")},i.a.createElement("span",null,e.pro?ih("Pro","templately"):ih("Starter","templately")))};function ch(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sh=wp.i18n.__,fh=TemplatelyAdmin,ph=fh.loadingImage,dh=(fh.is_editor,function(e){var t=e.content,n=ch(Object(o.useState)(!1),2),r=n[0],a=n[1],l=ch(Object(o.useState)(!1),2),c=l[0],u=l[1],s=ch(Object(o.useState)(""),2),f=s[0],p=s[1],d=ch(Object(o.useState)(!1),2),m=d[0],h=d[1],y=ch(Object(o.useState)(!1),2),g=y[0],v=y[1],b=ch(Object(o.useState)(""),2),w=b[0],E=b[1],O=ch(Object(o.useState)(!1),2),S=O[0],k=O[1],_=ch(Object(o.useState)(!1),2),j=_[0],x=_[1];return Object(o.useEffect)((function(){var t,n,r,o;0!=g&&(a(!0),(t=g,n=w,r=e.platform,(o=new FormData).append("action","get_templately"),o.append("content_type","create_page"),o.append("title",n),o.append("nonce",Fs),o.append("id",t),o.append("platform",r),wu.a.post(ajaxurl,o).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),k(e))})),v(!1),E(""))}),[g]),Object(o.useEffect)((function(){var e,t;0!=m&&(a(!0),(e=m,(t=new FormData).append("action","get_templately"),t.append("content_type","import_to_library"),t.append("nonce",Fs),t.append("id",e),t.append("is_editor",Boolean(zs)),wu.a.post(ajaxurl,t).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){u(!1),e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),k(e))})).catch((function(e){return console.error("Importing went wrong: ",e)})),h(!1))}),[m]),Object(o.useEffect)((function(){a(!0),function(e){if(e.length<=0)return!1;var t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","platform_exists"),t.append("platform",e),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(e.platform).then((function(e){a(!1),e.data.data?x(!0):x(!1)}))}),[]),i.a.createElement(i.a.Fragment,null,r&&i.a.createElement("div",{className:"templately-pre-loader templately-platform-check"},i.a.createElement("img",{src:ph}),i.a.createElement("p",null,"Checking platform exists or not...")),!r&&i.a.createElement("div",{className:"templately-import-modal"},i.a.createElement("div",{className:"templately-im-header"},i.a.createElement("h3",null,e.title)),i.a.createElement("div",{className:"templately-im-body"},!1!==S&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,sh("Template imported successfully! You can now edit or preview the template and push to Templately cloud.","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:S.edit_link},sh("Edit Template","templately")),0!=S.elementor_edit_link&&i.a.createElement("a",{className:"templately-modal-button button",href:S.elementor_edit_link},sh("Edit Template with Elementor","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:S.visit},sh("Preview Template","templately"))),""!==f&&i.a.createElement("div",{className:"templately-imb-section"},"html"==(null==f?void 0:f.type)&&null!=(null==f?void 0:f.message)&&i.a.createElement("p",{dangerouslySetInnerHTML:{__html:f.message}}),c&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},sh("Upgrade to Pro","templately"))),0==S&&j&&""===f&&i.a.createElement(i.a.Fragment,null,"elementor"===e.platform&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use."),i.a.createElement("button",{className:"templately-modal-button button",onClick:function(){return h(t.id)}},sh("Import to Library","templately"))),i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Create a new page from this template to make it available as a draft page in your Pages list."),i.a.createElement("div",{className:"templately-imb-new-form"},i.a.createElement("input",{className:"widefat",type:"text",value:w,onChange:function(e){return E(e.currentTarget.value)}}),i.a.createElement("button",{className:"templately-modal-button button",disabled:""===w,onClick:function(){return v(t.id)}},sh("Create a Page","templately"))))),0==S&&!j&&i.a.createElement(i.a.Fragment,null,i.a.createElement("p",null,"You should have install"," ",sh(e.platform,"templately")," first.")))))});function mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(n),!0).forEach((function(t){yh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gh(e){return function(e){if(Array.isArray(e))return wh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||bh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||bh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bh(e,t){if(e){if("string"==typeof e)return wh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wh(e,t):void 0}}function wh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Eh=wp.i18n.__,Oh=TemplatelyAdmin,Sh=Oh.loadingImage,kh=Oh.is_editor,_h=Oh.is_block_editor,jh=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,a=e.errors,l=vh(Object(o.useState)(!0),2),c=l[0],u=l[1],s=vh(Object(o.useState)(!1),2),f=s[0],p=s[1],d=vh(Object(o.useState)(!1),2),m=d[0],h=d[1],y=vh(Object(o.useState)({}),2),g=y[0],v=y[1];return t?(Object(o.useEffect)((function(){af(t).then((function(e){u(e.loading),p(e.error),v(e.data)}))}),[]),Object(o.useEffect)((function(){m&&(u(!0),p(!1),af(t).then((function(e){if(!e.error){var n=a.filter((function(e){return e.id!==t.id}));r(n)}u(e.loading),p(e.error),v(e.data)})),h(!1))}),[m]),Object(o.useEffect)((function(){c||n(f)}),[c]),Object(o.useEffect)((function(){f&&r([].concat(gh(a),[t]))}),[f]),i.a.createElement(i.a.Fragment,null,c?i.a.createElement("span",{className:"templately-installing"},i.a.createElement("span",{className:"dashicons dashicons-update"}),"Installing..."):null,f?g&&g.errorMessage?i.a.createElement("span",{className:"templately-error"},i.a.createElement("span",{className:"dashicons dashicons-no"}),g.errorMessage):i.a.createElement("button",{className:"button button-small templately-retry",onClick:function(){return h(!0)}},i.a.createElement("span",{className:"dashicons dashicons-no"}),"Retry & Proceed to Import"):null,c||f?null:i.a.createElement("span",{className:"templately-success"},i.a.createElement("span",{className:"dashicons dashicons-yes-alt"})," Success"))):(Object(o.useEffect)((function(){n()}),[]),i.a.createElement("span",{className:"templately-warning"},i.a.createElement("span",{className:"dashicons dashicons-warning"})," Ignored"))},xh=function(e){var t=vh(Object(o.useState)(!1),2),n=t[0],r=t[1],a=vh(Object(o.useState)(!0),2),l=a[0],c=a[1],u=vh(Object(o.useState)([]),2),s=u[0],f=u[1],p=vh(Object(o.useState)(!1),2),d=p[0],m=p[1],h=vh(Object(o.useState)(null),2),y=h[0],g=h[1],v=vh(Object(o.useState)({}),2),b=v[0],w=v[1],E=vh(Object(o.useState)([]),2),O=E[0],S=E[1];Object(o.useEffect)((function(){var t,n,a;return(n=e.dependencyList,(a=new FormData).append("action","get_templately"),a.append("content_type","check_dependency"),a.append("nonce",Fs),a.append("dependency",JSON.stringify(n)),a.append("platform",Ms),wu.a.post(ajaxurl,a).then((function(e){return e.data.success?e.data.data.dependency:[]}))).then((function(n){var a,o=[];n.length>0&&(n.map((function(e,t){o.push(e)})),a="name",o.sort(Ls(a)),f(o)),o.length>0?c(!1):t=setTimeout((function(){"elementor"===e.platform&&Boolean(kh)||Boolean(_h)&&"gutenberg"===e.platform?_s.a.close({insert:!0}):(c(!1),r(!0))}),1500)})),function(){return clearTimeout(t)}}),[]);var k=function(e){return void 0===b[e]||b[e]},_=function(){g((function(e){return e+1}))},j=function(e){S(e)};return Object(o.useEffect)((function(){null!=y&&y>s.length-1&&0===O.length&&("elementor"===e.platform&&Boolean(kh)||Boolean(_h)&&"gutenberg"===e.platform?_s.a.close({insert:!0}):r(!0))}),[y]),Object(o.useEffect)((function(){d&&_s.a.close({cancel:!0})}),[d]),i.a.createElement("div",{className:"templately-global-modal"},l&&i.a.createElement("div",{className:"templately-pre-loader templately-dependencies"},i.a.createElement("img",{src:Sh}),i.a.createElement("p",null,"Checking dependencies...")),n&&!l&&i.a.createElement(dh,{platform:e.platform,title:e.title,content:e.content}),!l&&!n&&i.a.createElement("div",{className:"templately-installer-widget align-left"},i.a.createElement("h4",null,"To import this item you need to install all the Plugin(s) listed below:"),s.length>0&&i.a.createElement("ul",null,s.map((function(e,t){return i.a.createElement("li",{key:t},i.a.createElement("div",{className:"templately-checkbox"},i.a.createElement("input",{value:"1",type:"checkbox",id:"requirement".concat(t),disabled:e.is_pro,checked:k(t)&&!e.is_pro,onChange:function(n){if(!e.is_pro){var r=!!n.target.checked;w((function(e){return hh(hh({},e),{},yh({},t,r))}))}}}),i.a.createElement("label",{htmlFor:"requirement".concat(t)},i.a.createElement("span",null,e.link&&"#"!=e.link&&""!=e.link?i.a.createElement("a",{target:"_blank",rel:"nofollow",href:e.link},e.name):e.name))),y===t||y>t?i.a.createElement(jh,{key:"installing".concat(t),requirement:k(t)&&!e.is_pro?e:null,completeCallback:_,errors:O,setErrors:function(e){return j(e)}}):null)}))),i.a.createElement("p",null,i.a.createElement("strong",null,"Note:")," Make sure you have manually installed & activated the ",i.a.createElement("em",null,"PRO Plugin(s)")," ","listed above"),i.a.createElement("div",{className:"templately-btn-group"},i.a.createElement("button",{disabled:null!==y,onClick:function(){return m(!0)},className:"button button-large templately-installer-btn"},Eh("Cancel","templately")),i.a.createElement("button",{disabled:null!==y,onClick:function(){return g(0)},className:"button button-large templately-installer-btn"},Eh("Install & Proceed to Import","templately")))))};function Ph(e){return(Ph="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 Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Th(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(n),!0).forEach((function(t){Ah(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ah(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ih=TemplatelyAdmin,Dh=Ih.default_image,Mh=Ih.is_editor,Rh=Ih.platform,Fh=nt((function(e){return{preview:e.preview,favourites:e.admin.user.favourites,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,loading:e.common.loading,platform_exists:e.common.platforms}}))((function(e){var t=e.content,n=ue(),r=Nh(Object(o.useState)(!1),2),a=r[0],l=r[1],c=Nh(Object(o.useState)(!1),2),u=c[0],s=c[1],f=Nh(Object(o.useState)(!1),2),p=f[0],d=f[1],m=Nh(Object(o.useState)([]),2),h=m[0],y=m[1],g=Nh(Object(o.useState)(null==t?void 0:t.favourite_count),2),v=g[0],b=g[1],w="pack"===e.type;Object(o.useEffect)((function(){if(0!=a){if(!e.isLoggedIn)return e.dispatch(Vi("/sign-in")),void l(!1);Vs("",{showCloseButton:!0,allowOutsideClick:!1,target:Mh?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xh,{dependencyList:t.dependencies,platform:e.platform,title:t.name,content:t})}).then((function(t){null!=t.insert&&t.insert?(e.dispatch(_i(!0)),e.dispatch(gi(Th(Th({},e.platform_exists),{},Ah({},"elementor",!0)))),Ws(a,"remote",{fileType:e.platform,is_editor:Boolean(Mh)}).then((function(t){if(!0===t)"gutenberg"!==Rh?window.TemplatelyModal.destroy():Eu.close(),e.dispatch(_i(!1));else{e.dispatch(_i(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),Vs("",{icon:"error",html:i.a.createElement(sf,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},"Upgrade to Pro"))})})}}))):e.dispatch(_i(!1))})),l(!1)}}),[a]),Object(o.useEffect)((function(){var n;p&&(u?(n=qs(t.id,t.type,"set_unfavourite"),s(!1),b(v-1)):(n=qs(t.id,t.type),s(!0),b(v+1)),n.then((function(t){t.data.success&&e.dispatch(Ui(t.data.data))})),d(!1))}),[p]);var E=["block","page"].includes(t.type)?"item":"pack";return Object(o.useEffect)((function(){var n,r;if(s(void 0!==e.favourites&&(null===(n=e.favourites)||void 0===n?void 0:n[E])&&(null===(r=e.favourites)||void 0===r?void 0:r[E].includes(t.id))),t.dependencies&&t.dependencies.length>0){var a=[];t.dependencies.map((function(e,t){null!=e.icon&&a.push(i.a.createElement("img",{key:t,src:e.icon,alt:e.name}))})),y(a)}}),[]),i.a.createElement(i.a.Fragment,null,"object"==Ph(t)&&i.a.createElement("div",{className:Pf()("templately-single-item","templately-".concat("pack"===t.type?"pack":"block"),{"templately-preview-item":e.preview.isOpen})},i.a.createElement("div",null,i.a.createElement("div",{className:"templately-item-image"},i.a.createElement(lh,{pro:0!=t.price}),i.a.createElement(oh.LazyLoadImage,{height:"200px",effect:"blur",width:"100%",delayTime:"500",visibleByDefault:!0,alt:t.name,src:t.thumbnail||Dh}),i.a.createElement("div",{className:"templately-item-image-hover"},"pack"!=t.type&&i.a.createElement("span",null,i.a.createElement(ge,{to:"/".concat(t.type,"/").concat(t.slug,"?preview=true")},i.a.createElement(ti,{size:"20",color:"#fff"}))),(null==n?void 0:n.pathname)&&n.pathname!=="/".concat(t.type,"/").concat(t.slug)&&i.a.createElement("span",null,i.a.createElement(ge,{to:"/".concat(t.type,"/").concat(t.slug)},i.a.createElement(ri,{size:"20",color:"#fff"}))),h.length>0&&i.a.createElement("div",{className:"templately-item-dependencies-icon"},h))),i.a.createElement("div",{className:"templately-single-item-details"},i.a.createElement("div",{className:"templately-single-item-details-content"},i.a.createElement("p",{className:"item-title"},i.a.createElement("strong",null,t.name)),!w&&i.a.createElement("button",{className:"templately-button",onClick:function(){return l(t.id)}},i.a.createElement(Zo,{color:"#6072ff"}))),i.a.createElement("div",{className:"templately-single-item-details-hover"},i.a.createElement("div",{className:"templately-fav-rating"},i.a.createElement("button",{className:"templately-button templately-fav",onClick:function(){return d(!0)}},i.a.createElement(ni,{size:"16px",color:u?"#f5365b":"#ddd"}),i.a.createElement("span",null,v)),i.a.createElement("span",{className:"templately-ratings"},i.a.createElement(li,{size:"16px",color:"#ffdc63"}),i.a.createElement("span",null,null==t.rating?0:t.rating.toFixed(1)))),("block"==e.type||"page"==e.type||e.preview.isOpen)&&i.a.createElement("button",{className:"templately-button",onClick:function(){return l(t.id)}},i.a.createElement(Zo,{color:"#6072ff"})))))))})),zh=function(e){var t=e.items,n=e.isLoading,r=(e.itemsType,Object(o.useRef)(null));return Object(o.useEffect)((function(){return r.current=!0,function(){return r.current=!1}}),[]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement(Jd,null),!n&&(null==t?void 0:t.length)>0&&i.a.createElement(i.a.Fragment,null,t.map((function(e){return i.a.createElement(Fh,{type:e.type,key:e.id,content:e})}))))},Uh=["active","numbers","itemsFor","setActive"];function Bh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Vh=function(e){var t,n,r,a=e.active,o=e.numbers,l=e.itemsFor,c=e.setActive,u=Bh(e,Uh),s=Pf()("templately-plan-switcher",u.className);return i.a.createElement("div",{className:s},i.a.createElement("button",{onClick:function(){return c("all")},className:"components-button templately-plan-all ".concat("all"===a?"tactive":"")},"All ",u.showNumber&&"(".concat(null===(t=o[l])||void 0===t?void 0:t.total,")")),i.a.createElement("button",{onClick:function(){return c("starter")},className:"components-button templately-plan-starter ".concat("starter"===a?"tactive":"")},"Starter ",u.showNumber&&"(".concat(null===(n=o[l])||void 0===n?void 0:n.starter,")")),i.a.createElement("button",{onClick:function(){return c("pro")},className:"components-button templately-plan-pro ".concat("pro"===a?"tactive":"")},"Pro ",u.showNumber&&"(".concat(null===(r=o[l])||void 0===r?void 0:r.pro,")")))},Wh=["active","setActive"];function Hh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var $h=function(e){var t=e.active,n=e.setActive,r=Hh(e,Wh),a=Pf()("templately-items-switcher",r.className);return i.a.createElement("div",{className:a},i.a.createElement("button",{onClick:function(){return n("all")},className:"components-button ".concat("all"===t?"tactive":"")},"All"),i.a.createElement("button",{onClick:function(){return n("blocks")},className:"components-button ".concat("blocks"===t?"tactive":"")},"Blocks"),i.a.createElement("button",{onClick:function(){return n("pages")},className:"components-button ".concat("pages"===t?"tactive":"")},"Pages"),i.a.createElement("button",{onClick:function(){return n("packs")},className:"components-button ".concat("packs"===t?"tactive":"")},"Packs"))};function qh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qh=nt((function(e){return{favourites:e.profile.favourites,user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform,pagination:e.common.pagination}}))((function(e){var t=qh(Object(o.useState)([]),2),n=t[0],r=t[1],a=qh(Object(o.useState)(!0),2),l=a[0],c=a[1],u=qh(Object(o.useState)("all"),2),s=u[0],f=u[1],p=Object(o.useRef)(null),d=qh(Object(o.useState)(1),2),m=d[0],h=d[1],y=qh(Object(o.useState)("all"),2),g=y[0],v=y[1],b=Object(o.useCallback)((function(){switch(s){case"starter":return"plan_type=2";case"pro":return"plan_type=3";default:return"plan_type=1"}}),[s]),w=Object(o.useCallback)((function(){switch(g){case"blocks":return"&type=block";case"pages":return"&type=page";case"packs":return"&type=pack";default:return""}}),[g]);return Object(o.useEffect)((function(){return function(){e.dispatch(Ri(1))}}),[]),Object(o.useEffect)((function(){var t,n,a,o;if(!(null!==(t=e.favourites)&&void 0!==t&&t[s]&&null!==(n=e.favourites[s])&&void 0!==n&&n[e.platform]&&null!==(a=e.favourites[s][e.platform])&&void 0!==a&&a[g]&&null!==(o=e.favourites[s][e.platform][g])&&void 0!==o&&o[e.pagination]))return p.current=!0,c(!0),Ss({path:"/my-favourites?".concat(b()).concat(w(),"&page=").concat(e.pagination)}).then((function(t){p.current&&(null!=t&&t.data&&(r(t.data),h(t.total_page),e.dispatch({type:"SET_USER_FAVOURITES",payload:{category:g,plan:s,platform:e.platform,currentPage:t.current_page,totalPage:t.total_page,data:t.data}})),c(!1))})).catch((function(t){console.error("Error: Fetching My Favourites",t),e.dispatch(yi("Error: Fetching My Favourites"))})),function(){p.current=!1}}),[s,e.pagination,g]),Object(o.useEffect)((function(){var t,n,a,o;null!==(t=e.favourites)&&void 0!==t&&t[s]&&null!==(n=e.favourites[s])&&void 0!==n&&n[e.platform]&&null!==(a=e.favourites[s][e.platform])&&void 0!==a&&a[g]&&null!==(o=e.favourites[s][e.platform][g])&&void 0!==o&&o[e.pagination]&&(r(e.favourites[s][e.platform][g][e.pagination]),c(!1))}),[s,e.pagination,g]),i.a.createElement("div",{className:"templately-my-favourites"},i.a.createElement("div",{className:"my-favourites-header"},i.a.createElement($h,{className:"favourites-item-menu",active:g,setActive:v}),i.a.createElement(Vh,{className:"favourites-item-subs",active:s,setActive:f})),i.a.createElement("div",{className:"favourites-item-list"},i.a.createElement(zh,{itemsType:"block",items:n,isLoading:l})),i.a.createElement(Yd,{type:"favourites",count:m}))})),Gh=function(e){return i.a.createElement("div",e,e.children)};function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(n),!0).forEach((function(t){Jh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ey(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ey(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ey(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ty=Object(o.createContext)({includes:[],excludes:[],setIncludes:function(e){return e},setExcludes:function(e){return e}}),ny=function(e){var t=e.children,n=e.dependencies,r=e.giveAwayControls,a=e.activeFilter,l=e.setActiveFilter,c=Zh(Object(o.useState)(n.map((function(e){return e.id}))),2),u=c[0],s=(c[1],Zh(Object(o.useState)(n.map((function(e){return Xh(Xh({},e),{},{action:"none"})}))),2)),f=s[0],p=s[1],d=Zh(Object(o.useState)("none"),2),m=d[0],h=d[1];return Object(o.useEffect)((function(){p(n.map((function(e){return Xh(Xh({},e),{},{action:"none"})})))}),[n]),Object(o.useEffect)((function(){f.every((function(e){return"none"===e.action}))?h("none"):f.every((function(e){return"include"===e.action}))?h("include"):f.every((function(e){return"exclude"===e.action}))?h("exclude"):h("mixed")}),[f]),Object(o.useEffect)((function(){r(f)}),[f]),i.a.createElement(ty.Provider,{value:{activeFilter:a,setActiveFilter:l,controls:u,activeControls:f,setActiveControls:p,activeState:m,setActiveState:h}},t)},ry=ty,ay=["children","className"];function oy(){return(oy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ly(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iy(Object(n),!0).forEach((function(t){cy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var sy=function(e){e.children;var t=e.className,n=uy(e,ay),r=Object(o.useContext)(ry),a=r.activeControls,l=r.setActiveControls,c=r.activeState,u=r.setActiveState,s=r.activeFilter,f=r.setActiveFilter,p=Object(o.useCallback)((function(){switch(c){case"none":case"mixed":l(a.map((function(e){return ly(ly({},e),{},{action:"include"})}))),u("include");break;case"include":l(a.map((function(e){return ly(ly({},e),{},{action:"exclude"})}))),u("exclude");break;case"exclude":default:l(a.map((function(e){return ly(ly({},e),{},{action:"none"})}))),u("none")}}),[a,l,u,c]);return i.a.createElement("div",{className:"templately-sidebar-filter-head"},i.a.createElement("div",{className:"templately-pro-batch-select","aria-checked":c},i.a.createElement("span",oy({role:"checkbox","aria-checked":c,tabIndex:0,onClick:p,onKeyDown:function(e){return 32===e.keyCode&&p()},className:t?"".concat(t," tri-state-all-checkbox"):"tri-state-all-checkbox"},n),n.title),i.a.createElement("span",{className:"tsdf-actions",onClick:function(){var e="";"pro"===n.filter&&"pro"!==s&&(e="pro"),"free"===n.filter&&"free"!==s&&(e="free"),f(e)}},"free"===s&&"free"===n.filter||"pro"===s&&"pro"===n.filter?i.a.createElement(Xo,null):i.a.createElement(Qo,null))))},fy=["id","content"];function py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?py(Object(n),!0).forEach((function(t){my(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function my(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hy(e){return function(e){if(Array.isArray(e))return yy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vy=function(e){var t=e.id,n=e.content,r=(gy(e,fy),Object(o.useContext)(ry)),a=r.activeControls,l=r.setActiveControls,c=Object(o.useCallback)((function(){var e=hy(a);e=e.map((function(e){return e.id===t?dy(dy({},e),{},{action:"none"===e.action?"include":"include"===e.action?"exclude":"exclude"===e.action?"none":"include"}):e})),l(e)}),[a,t,l]),u=Object(o.useCallback)((function(e){var t=a.find((function(t){return t.id===e}));return t?t.action:"none"}),[a]),s=Pf()("tri-state-checkbox",{"tri-state-include":"include"===u(t),"tri-state-exclude":"exclude"===u(t)});return i.a.createElement("li",{className:s},i.a.createElement("input",{checked:"include"===u(t),type:"checkbox",id:"tsdf-".concat(t),onChange:c}),i.a.createElement("label",{htmlFor:"tsdf-".concat(t)},n.name))},by=wp.i18n.__,wy=function(e){return i.a.createElement(Of,{className:"templately-table-head"},i.a.createElement(Sf,null,i.a.createElement("p",null,by("Thumbnail","templately"))),i.a.createElement(Sf,null,i.a.createElement("p",null,by("Item Name","templately"))),i.a.createElement(Sf,null,i.a.createElement("p",null,by("Downloaded Date","templately"))))},Ey=wp.i18n.__,Oy=function(e){return i.a.createElement("div",null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("img",{src:e.thumbnail,alt:e.name})),i.a.createElement(Sf,null,i.a.createElement(ge,{to:"/".concat(e.type,"/").concat(e.slug,"?preview=true")},i.a.createElement("p",null,Ey(e.name)))),i.a.createElement(Sf,null,i.a.createElement("p",null,Ey(e.downloaded_at)))))};function Sy(){return(Sy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ky(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jy=nt((function(e){return{downloads:e.profile.downloads,user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform,retry:e.common.retry,pagination:e.common.pagination}}))((function(e){var t=ky(Object(o.useState)([]),2),n=t[0],r=t[1],a=ky(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Object(o.useRef)(null),s=ky(Object(o.useState)(1),2),f=s[0],p=s[1];return Object(o.useEffect)((function(){return u.current=!0,function(){u.current=!1,e.dispatch(Ri(1))}}),[]),Object(o.useEffect)((function(){var t;e.downloads&&null!==(t=e.downloads)&&void 0!==t&&t[e.pagination]||Ss({path:"/my-downloads?page=".concat(e.pagination)}).then((function(t){if(u.current){if(null!=t&&t.data){var n=[];p(t.total_page),e.dispatch({type:"SET_USER_DOWNLOADS",payload:{currentPage:t.current_page,totalPage:t.total_page,data:t.data}}),t.data.map((function(e){n.push(i.a.createElement(Oy,Sy({key:e.slug},e)))})),r(n)}c(!1)}})).catch((function(t){console.error("Error: Fetching My Downloads"),e.dispatch(yi("Error: Fetching My Downloads"))}))}),[e.retry,e.pagination]),Object(o.useEffect)((function(){var t;if(e.downloads&&null!==(t=e.downloads)&&void 0!==t&&t[e.pagination]){var n=[];e.downloads[e.pagination].map((function(e){n.push(i.a.createElement(Oy,Sy({key:e.slug},e)))})),r(n),c(!1)}}),[e.retry,e.pagination]),i.a.createElement("div",{className:"downloads-list"},l&&i.a.createElement(Jd,null),!l&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ef,{className:"templately-downloads-table"},i.a.createElement(wy,null),i.a.createElement(Gh,{className:"templately-table-body"},n)),i.a.createElement(Yd,{type:"downloads",count:f})))}));function xy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Py(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}wp.i18n.__;var Cy=nt((function(e){return{is_verified:e.admin.user.is_verified,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,loading:e.common.loading,retry:e.common.retry}}))((function(e){var t=xy(Object(o.useState)(!1),2),n=t[0],r=(t[1],xy(Object(o.useState)("personal"),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Xm,null),e.isLoggedIn&&i.a.createElement(Em,null,n&&i.a.createElement(Jd,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Zm,{onClick:function(e){return l(e)},activeTab:a}),i.a.createElement(eh,{render:function(){return"personal"===a?i.a.createElement(ah,null):"favourites"===a?i.a.createElement(Qh,null):"downloads"===a?i.a.createElement(jy,null):void 0}}))))}));function Ty(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ay(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ay(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ny=wp.i18n.__,Ly=nt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform}}))((function(e){var t=Ty(Object(o.useState)(!1),2),n=t[0],r=t[1],a=e.user;return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){0!=n&&(Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(mi(!1)),e.dispatch(Ui([])),e.dispatch(Ei({platform:e.platform})),e.dispatch({type:"WORKSPACE_RESET"}),e.dispatch({type:"SHARED_WORKSPACE_RESET"}),e.dispatch({type:"WORKSPACE_DETAILS_RESET"}),Vs(Ny("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(Ny("Something went wrong.","templately"),{icon:"error",timer:1500})})),r(!1))}),[n]),i.a.createElement("div",{className:"templately-admin-form-inner templately-profile"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-manage-accounts"},i.a.createElement("h1",null,Ny("Hey","templately")," ",a.display_name||a.name,","," ",Ny("Welcome Back!","templately")),i.a.createElement("div",{className:"templately-account-details"},i.a.createElement("strong",null,Ny("Account Details","templately"),":"),i.a.createElement("table",{bgcolor:"transparent",border:"0",cellPadding:"0",cellSpacing:"0"},i.a.createElement("tbody",null,a.email&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Email","templately"),":")),i.a.createElement("td",null,a.email)),a.plan&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Plan","templately"),":")),i.a.createElement("td",{className:"templately-plan"},"free"===a.plan?"Starter":a.plan)),a.joined&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Joining Date","templately"),":")),i.a.createElement("td",null,a.joined)),""!=a.plan_expire_at&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Expiry Date","templately"),":")),i.a.createElement("td",null,a.plan_expire_at))))),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},Ny("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},Ny("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},Ny("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(ge,{className:"button templately-button",to:"/sign-in"},Ny("Link My Account","templately"))))))}));n(131);function Iy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var My=wp.i18n.__,Ry=function(e){return i.a.createElement("input",{type:e.type||"text",className:"widefat templately-input",placeholder:e.placeholder,name:e.name,value:e.value,onBlur:function(t){return e.onBlur&&e.onBlur(t.target.value)},onChange:function(t){return e.onChange(t.target.value)}})},Fy=nt()((function(e){var t=Iy(Object(o.useState)(""),2),n=t[0],r=t[1],a=Iy(Object(o.useState)(""),2),l=a[0],c=a[1],u=Iy(Object(o.useState)(""),2),s=u[0],f=u[1],p=Iy(Object(o.useState)(""),2),d=p[0],m=p[1],h=Iy(Object(o.useState)(null),2),y=h[0],g=h[1],v=Iy(Object(o.useState)(""),2),b=v[0],w=v[1],E=Iy(Object(o.useState)(!0),2),O=E[0],S=E[1],k=Iy(Object(o.useState)(!1),2),_=k[0],j=k[1],x=Iy(Object(o.useState)(!1),2),P=x[0],C=x[1],T=Iy(Object(o.useState)(!1),2),A=T[0],N=T[1],L=Iy(Object(o.useState)(!1),2),I=L[0],D=L[1];return Object(o.useEffect)((function(){S(!0),""!=n&&""!=l&&""!=d&&""!=b&&""!=s&&_&&P&&Xs(s)&&d===b&&of(d)&&S(!1)}),[n,l,s,d,b,_,P]),Object(o.useEffect)((function(){null!==y&&("password"!==y&&"confirm_password"!==y||!(d.length>0||b.length>0)||(of(d)||Vs(My("Password must contain at least 8 characters, uppercase, lowercase and numbers."),{icon:"warning",showCloseButton:!0}),"confirm_password"===y&&d!==b&&Vs(My("Passwords do not match."),{icon:"warning",showCloseButton:!0})),"email"===y&&s.length>0&&!Xs(s)&&Vs(My("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),g(null))}),[y]),Object(o.useEffect)((function(){A&&(D(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return null!=e.first_name&&t.append("first_name",e.first_name),null!=e.last_name&&t.append("last_name",e.last_name),null!=e.email&&t.append("email",e.email),null!=e.password&&t.append("password",e.password),t.append("nonce",Fs),t.append("action","get_templately"),t.append("content_type","create_user"),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({first_name:n,last_name:l,email:s,password:d}).then((function(t){var n,r;if(null!=t&&t.data&&null!=t&&null!==(n=t.data)&&void 0!==n&&n.success)D(!1),TemplatelyAdmin.is_logged_in=!0,e.dispatch(xi(!0)),null!==e.next_route?e.dispatch(Vi(e.next_route)):e.dispatch(Vi("/settings")),e.dispatch(Bi(t.data.data)),e.dispatch(Ui(t.data.data.admin)),e.dispatch(di(null===(r=t.data.data.admin)||void 0===r?void 0:r.is_global_login));else if(D(!1),"string"==typeof t.data.data)Vs(t.data.data,{timer:2e3,icon:"error"});else{var a=Object.keys(t.data.data).map((function(e){return i.a.createElement("div",null,t.data.data[e])}));Vs(i.a.createElement("div",null,a),{timer:2e3,icon:"error"})}})).catch((function(e){return console.error("Error:",e)})),N(!1))}),[A]),i.a.createElement(i.a.Fragment,null,I&&i.a.createElement(Jd,null),i.a.createElement("h3",null,My("Create Account!","templately")),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Ry,{placeholder:"First Name",name:"first_name",value:n,onChange:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Ry,{placeholder:"Last Name",name:"last_name",value:l,onChange:function(e){return c(e)}}))),i.a.createElement(Ry,{placeholder:"Email",name:"email",value:s,onBlur:function(){return g("email")},onChange:function(e){return f(e)}}),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Ry,{placeholder:"Password",name:"password",type:"password",value:d,onBlur:function(){return g("password")},onChange:function(e){return m(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Ry,{placeholder:"Confirm Password",name:"confirm_password",type:"password",value:b,onBlur:function(){return g("confirm_password")},onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent",type:"checkbox",onChange:function(e){return j(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/privacy-policy",target:"_blank"},"Privacy Policy"),".")),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent-terms",type:"checkbox",onChange:function(e){return C(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent-terms"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/terms-of-services",target:"_blank"},"Terms of Services"),".")),i.a.createElement("button",{disabled:O,onClick:function(){return N(!0)},className:"button button-primary templately-button",type:"submit"},My("Create Account","templately")),i.a.createElement("p",{className:"templately-new-here"},i.a.createElement("span",{onClick:function(){return e.tab(1)}}," ",My("Already have an account?","templately"))))})),zy=wp.i18n.__,Uy=function(e){var t=e.global_signin,n=e.setGlobal_signin;return i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"global-sign-in",className:"global-sign-in"},i.a.createElement("input",{type:"checkbox",className:"templately-input",id:"global-sign-in",name:"global-sign-in",onChange:function(){return n(!t)}}),i.a.createElement("span",null,zy("Global Sign In","templately"))),i.a.createElement("p",{className:"templately-helptext"},zy("All the sitewide users will be logged in with this Templately account","templately")))};function By(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wy=wp.i18n.__,Hy=nt((function(e){return{isLoggedIn:e.common.isLoggedIn,errorText:e.admin.errorText,next_route:e.common.next_route,is_global_login:e.common.is_global_login,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t,n=By(Object(o.useState)(""),2),r=n[0],a=n[1],l=By(Object(o.useState)(""),2),c=l[0],u=l[1],s=By(Object(o.useState)(""),2),f=s[0],p=s[1],d=By(Object(o.useState)("password"),2),m=d[0],h=d[1],y=By(Object(o.useState)(!0),2),g=y[0],v=y[1],b=By(Object(o.useState)(!1),2),w=b[0],E=b[1],O=By(Object(o.useState)(!1),2),S=O[0],k=O[1],_=By(Object(o.useState)(null),2),j=_[0],x=_[1],P=By(Object(o.useState)(!1),2),C=P[0],T=P[1];return Object(o.useEffect)((function(){return function(){clearTimeout(t)}}),[]),Object(o.useEffect)((function(){null!==j&&("email"===j&&r.length>0&&!Xs(r)&&Vs(Wy("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),x(null))}),[j]),Object(o.useEffect)((function(){if(w){var n={};"api"===m?n.api_key=f:(n.email=r,n.password=c),n.global_signin=C,k(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new FormData;return n.append("withApi",t),t?null!=e.api_key&&n.append("api_key",e.api_key):(null!=e.email&&n.append("email",e.email),null!=e.password&&n.append("password",e.password)),null!=e.global_signin&&n.append("global_signin",e.global_signin),n.append("nonce",Fs),n.append("action","get_templately"),n.append("content_type","login_user"),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(n,"api"===m).then((function(t){t.hasOwnProperty("data")?t.data.success?(k(!1),TemplatelyAdmin.is_logged_in=!0,e.is_linked_login||C?C&&e.dispatch(di(!0)):(e.dispatch(di(!1)),e.dispatch(hi(!0))),e.dispatch(yi("")),e.dispatch(xi(!0)),null!==e.next_route?e.dispatch(Vi(e.next_route)):e.user_can_logout||e.is_linked_login?e.dispatch(Vi("/settings")):e.dispatch(Vi("/settings?refresh")),e.dispatch(Bi(t.data.data)),e.dispatch(Ui(t.data.data.admin))):(Vs(t.data.data,{timer:1500,icon:"error"}),k(!1)):(k(!1),Vs(Wy("Something went wrong.","elmentorify"),{timer:1500,icon:"error"}))})).catch((function(e){k(!1),Vs(Wy("Something went wrong.","elmentorify"),{timer:1500,icon:"error"})})).finally((function(){t=setTimeout((function(){e.dispatch(Bi(null))}),5e3)})),E(!1)}}),[w]),Object(o.useEffect)((function(){e.errorText&&e.dispatch(Hi(null)),v(!0),"api"===m?f.length>=20&&v(!1):Xs(r)&&c.length>=8&&v(!1)}),[c,r,f]),i.a.createElement(i.a.Fragment,null,"password"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("h3",null,Wy("Great to have you back!","templately")),i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("api")}},"Connect via API"),i.a.createElement("input",{className:"widefat templately-input",placeholder:"Email",name:"email",onBlur:function(){return x("email")},value:r,onChange:function(e){return a(e.target.value)}}),i.a.createElement("input",{type:"password",className:"widefat templately-input",placeholder:"Password",name:"password",value:c,onChange:function(e){return u(e.target.value)}}),!e.is_global_login&&i.a.createElement(Uy,{global_signin:C,setGlobal_signin:T}),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Wy(S?"Signing In...":"Sign In","templately"))),"api"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("password")}},"Connect via Login Credentials"),i.a.createElement("div",{className:"templately-api-input-wrapper"},i.a.createElement("input",{className:"widefat templately-input",placeholder:"API Key",name:"api_key",value:f,onChange:function(e){return p(e.target.value)}}),i.a.createElement(Uy,{global_signin:C,setGlobal_signin:T}),i.a.createElement("a",{href:"https://templately.com/manageapis",target:"_blank"},Wy("Get API Key","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Wy("Connect","templately"))),i.a.createElement("p",{className:"templately-new-here"},Wy("New here?","templately")," ",i.a.createElement("span",{onClick:function(){return e.tab(2)}}," ",Wy("Create an account!","templately")),i.a.createElement("a",{href:"https://templately.com/forgot-password",target:"_blank"},Wy("Forgot Password?","templately"))))}));function $y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ky=wp.i18n.__,Qy=nt((function(e){return{isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=$y(Object(o.useState)(1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Vi("/profile"))}),[]),Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Vi("/profile"))}),[e.isLoggedIn]),i.a.createElement("div",{className:"templately-admin-form-inner"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-admin-header"},i.a.createElement("div",{className:"templately-admin-title"},i.a.createElement("h1",null,Ky("1300+ Stunning Templates for WordPress","templately")),i.a.createElement("p",null,Ky("From multipurpose themes to niche templates, you’ll always find something that catches your eye.","templately")))),i.a.createElement("div",{className:"templately-admin-content"},i.a.createElement("div",{className:"templately-left"},i.a.createElement("div",{className:"templately-cloud-video-container"},i.a.createElement("iframe",{height:"350",src:"https://www.youtube.com/embed/coLxfjnrm3I",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))),i.a.createElement("div",{className:"templately-right"},i.a.createElement("div",{className:"templately-admin-tab"},i.a.createElement("ul",null,i.a.createElement("li",{onClick:function(){return r(1)},className:"".concat(1===n?"active":""," ")},Ky("Sign In","templately")),i.a.createElement("li",{onClick:function(){return r(2)},className:"".concat(2===n?"active":""," ")},Ky("Sign Up","templately"))),i.a.createElement("div",{className:"templately-admin-tab-content"},i.a.createElement("div",{className:"templately-admin-tcontent ".concat(1===n?"active":"")},i.a.createElement(Hy,{tab:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-admin-tcontent ".concat(2===n?"active":"")},i.a.createElement(Fy,{tab:function(e){return r(e)}}))))))))}));function Gy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xy=function(e){var t=Gy(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Object(o.useRef)(null),l=function(){a.current&&r(a.current.getBoundingClientRect().top<=0)};return Object(o.useEffect)((function(){return window.addEventListener("scroll",l),function(){window.addEventListener("scroll",(function(){return l}))}}),[]),i.a.createElement("div",{className:"templately-modal-sidebar".concat(n?" sticky":""),ref:a},i.a.createElement("div",{className:"templately-modal-sidebar-inner"},e.children))},Jy=["content"];function Zy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tg(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ng=function e(t){var n,r,a,l,c=t.content,u=tg(t,Jy),s=Zy(Object(o.useState)(!1),2),f=s[0],p=s[1],d=lt(),m=ft((function(e){return e.common.activeSidebar})),h=lf(),y=null==h?void 0:h.get("cat_id");l=null!=u&&u.onClick?u.onClick:Object(o.useCallback)((function(){var e;null!=m&&m.fromChild||(d(Ci({activeSidebarMenu:c.id,activeParentSidebarMenu:null!==(e=null==c?void 0:c.parent)&&void 0!==e?e:"",categoryFor:u.type})),d(Hi(null)),d(ji(!0)),d(Ri(1)))}),[m]);var g=Object(o.useMemo)((function(){return(m.activeSidebarMenu===c.id||m.activeParentSidebarMenu===c.id)&&m.categoryFor===u.type}),[m]);return Object(o.useEffect)((function(){var e;+y===c.id&&(d(Ci({activeSidebarMenu:c.id,activeParentSidebarMenu:null!==(e=null==c?void 0:c.parent)&&void 0!==e?e:"",categoryFor:u.type})),d(Hi(null)),d(ji(!0)),d(Ri(1)))}),[y]),i.a.createElement("li",{className:Pf()("templately-sidebar-menu-item",{"templately-has-child":(null==c||null===(n=c.child)||void 0===n?void 0:n.length)>0,"templately-active":g,"ts-collapesed":f}),onClick:l},i.a.createElement("span",null,c.name),(null==c||null===(r=c.child)||void 0===r?void 0:r.length)>0&&i.a.createElement(i.a.Fragment,null,f?i.a.createElement(Xo,{onClick:function(){return p(!f)}}):i.a.createElement(Qo,{onClick:function(){return p(!f)}}),(null==c||null===(a=c.child)||void 0===a?void 0:a.length)>0&&i.a.createElement("ul",{className:Pf()("templately-sidebar-submenu",{"tcollapse-submenu":f})},c.child.map((function(t){return i.a.createElement(e,{onClick:function(){var e;d(Ci({activeSidebarMenu:t.id,activeParentSidebarMenu:null!==(e=null==t?void 0:t.parent)&&void 0!==e?e:"",categoryFor:u.type,fromChild:!0})),d(Hi(null)),d(ji(!0)),d(Ri(1))},content:t,key:t.id,type:u.type})})))))},rg=TemplatelyAdmin.categories,ag=wp.i18n.__,og=function(e){var t=lt(),n=Object(o.useCallback)((function(){t(ji(!0)),t(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:"",categoryFor:e.type}))}),[]),r=Object(o.useMemo)((function(){return{id:"all",name:ag("All Categories","templately")}}),[]),a=Object(o.useMemo)((function(){return rg}),[]),l=e.collapse===e.title&&""!=e.collapse;return i.a.createElement("div",{className:Pf()("templately-categories","templately-".concat(e.type,"-categories"),null==e?void 0:e.className)},(null==e?void 0:e.title)&&i.a.createElement("h3",{className:"ts-filter-title",onClick:function(){return e.setCollapse(e.title===e.collapse?"":e.title)}},e.title," ",i.a.createElement("span",{className:"ts-collapse-action"},l?i.a.createElement(Xo,null):i.a.createElement(Qo,null))),l&&e.collapse===e.title&&i.a.createElement("ul",{className:"templately-sidebar-menu"},i.a.createElement(ng,{onClick:n,content:r,key:"all",type:e.type}),a[e.type].map((function(t){return i.a.createElement(ng,{type:e.type,content:t,key:t.id})}))))},ig=i.a.memo(og);wp.i18n.__;function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lg(Object(n),!0).forEach((function(t){ug(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ug(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}wp.i18n.__;var pg=function(e){var t=sg(Object(o.useState)("free"),2),n=t[0],r=t[1],a=sg(Object(o.useState)([]),2),l=a[0],c=a[1],u=sg(Object(o.useState)([]),2),s=u[0],f=u[1],p=sg(Object(o.useState)([]),2),d=p[0],m=p[1],h=sg(Object(o.useState)([]),2),y=h[0],g=h[1],v=sg(Object(o.useState)([]),2),b=v[0],w=v[1],E=ft((function(e){return e.common.platform}));Object(o.useEffect)((function(){(function(){var e=new FormData;return e.append("action","get_templately"),e.append("nonce",Fs),e.append("content_type","get_dependencies"),e.append("platform",Ms),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))})().then((function(e){var t;if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.data){var n=e.data.data.filter((function(e){return e.platform===E})),r=n.filter((function(e){return e.is_pro}));f(r);var a=n.filter((function(e){return!e.is_pro}));m(a),c(n)}})).catch((function(e){return console.error("ERROR: On Getting Dependencies: ",e)}))}),[]),Object(o.useEffect)((function(){e.isReset&&(f(l.filter((function(e){return e.is_pro}))),m(l.filter((function(e){return!e.is_pro}))))}),[e.isReset]);var O=Object(o.useMemo)((function(){return s.map((function(e){return cg(cg({},e),{},{action:"none"})}))}),[s]),S=Object(o.useMemo)((function(){return d.map((function(e){return cg(cg({},e),{},{action:"none"})}))}),[d]);return Object(o.useEffect)((function(){var t=[],n=[];y.map((function(e){"include"===e.action&&t.push(e.id),"exclude"===e.action&&n.push(e.id)})),b.map((function(e){"include"===e.action&&t.push(e.id),"exclude"===e.action&&n.push(e.id)})),e.setDependencies({include:t,exclude:n})}),[y,b]),i.a.createElement("div",{className:"templately-dependencies"},O.length>0&&i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("pro"===n?"tsdf-open":"")},i.a.createElement(ny,{activeFilter:n,setActiveFilter:r,dependencies:O,giveAwayControls:g},i.a.createElement(sy,{filter:"pro",title:"Pro Plugins Dependencies"}),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},O.map((function(e){return i.a.createElement(vy,{key:e.id,id:e.id,content:e})}))))),S.length>0&&i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("free"===n?"tsdf-open":"")},i.a.createElement(ny,{activeFilter:n,setActiveFilter:r,dependencies:S,giveAwayControls:w},i.a.createElement(sy,{filter:"free",title:"Free Plugins Dependencies"}),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},S.map((function(e){return i.a.createElement(vy,{key:e.id,id:e.id,content:e})}))))))},dg=i.a.memo(pg),mg=wp.i18n.__,hg=function(e){return i.a.createElement("div",{className:"templately-sidebar-dependency-filter"},i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary",onClick:function(){return e.setFilter(!0)}},mg("Filter","templately")),e.isResetVisible&&i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary templately-filter-clear",onClick:function(){return e.setReset(!0)}},mg("Reset","templately")))},yg=i.a.memo(hg);function gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bg=wp.i18n.__,wg=function(e){var t=gg(Object(o.useState)([]),2),n=t[0],r=t[1],a=gg(Object(o.useState)([]),2),l=a[0],c=a[1],u=gg(Object(o.useState)([]),2),s=u[0],f=u[1],p=lt(),d=lf(),m=+(null==d?void 0:d.get("tag_id"));Object(o.useEffect)((function(){var e;(e=new FormData,e.append("action","get_templately"),e.append("nonce",Fs),e.append("content_type","get_tags"),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))).then((function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t.data&&r(function(e){return e.map((function(e){return{value:e.id,label:bg(e.name,"templately")}}))}(e.data.data))})).catch((function(e){return console.error("On Gettings Tags: ",e)}))}),[]);var h=Object(o.useCallback)((function(e){null!=e?(f(e),e=e.map((function(e){return e.value})),c(e)):(f([]),c([]))}),[]);return Object(o.useEffect)((function(){e.setTags(l)}),[l]),Object(o.useEffect)((function(){e.isReset&&(c([]),f([]))}),[e.isReset]),Object(o.useEffect)((function(){if(m&&(null==n?void 0:n.length)>0){var t=n.filter((function(e){return e.value==m}));f(t),c([m]),e.setTags([m]),p(Ti(!0)),p(Hi(null)),p(ji(!0)),p(Ri(1))}}),[m,n]),i.a.createElement("div",{className:"templately-tags templately-sidebar-dependency-filter"},i.a.createElement("label",{htmlFor:"templately_tags"},"Filter Items by Tags"),i.a.createElement(mu,{isMulti:!0,placeholder:"Select Tags",name:"templately_tags",options:n,classNamePrefix:"templately-tags",onChange:h,value:s,maxMenuHeight:200}))},Eg=i.a.memo(wg);n(132);function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kg=TemplatelyAdmin.categories,_g=function(e){var t=Og(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Og(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Og(Object(o.useState)(""),2),s=u[0],f=u[1],p=Og(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Og(Object(o.useState)([]),2),y=h[0],g=h[1],v=Og(Object(o.useState)([]),2),b=v[0],w=v[1],E=lt(),O=!(null==e||!e.from)&&"search"===e.from;return Object(o.useEffect)((function(){var e,t;l&&(O&&E(Ai("search"+Date.now())),((null==b?void 0:b.length)>0||(null==y||null===(e=y.include)||void 0===e?void 0:e.length)>0||(null==y||null===(t=y.exclude)||void 0===t?void 0:t.length)>0)&&(E(Ti(!0)),m(!0)),E(Ni(y)),E(Li(b)),c(!1))}),[l]),Object(o.useEffect)((function(){n&&(O&&E(Ai("wrapper")),E(Ti(!1)),E(Ni(null)),w([]),E(Li([])),m(!1),r(!1))}),[n]),i.a.createElement(i.a.Fragment,null,O&&Object.keys(kg).map((function(e){return i.a.createElement(ig,{key:e,type:e,title:e,className:"templately-search-tags",isCollapsible:!0,collapse:s,setCollapse:function(e){return f(e)}})})),!O&&void 0!==(null==e?void 0:e.type)&&i.a.createElement(ig,{type:null==e?void 0:e.type}),i.a.createElement(dg,{setDependencies:function(e){return g(e)},isReset:n}),i.a.createElement(Eg,{setTags:function(e){return w(e)},isReset:n}),i.a.createElement(yg,{setFilter:function(e){return c(e)},setReset:function(e){return r(e)},isReset:n,isResetVisible:d}))},jg=i.a.memo(_g);n(133);function xg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cg=TemplatelyAdmin.items_count,Tg=nt((function(e){return{plan:e.common.plan,platform:e.common.platform}}))((function(e){var t,n,r,a=e.itemsFor,l=xg(Object(o.useState)(e.plan),2),c=l[0],u=l[1],s=Cg[e.platform];return Object(o.useEffect)((function(){c!=e.plan&&(e.dispatch({type:"SET_PLAN",payload:c}),e.dispatch(Ri(1)))}),[c]),i.a.createElement("div",{className:"templately-items-header-wrapper".concat(" ".concat(e.sticky))},i.a.createElement("div",{className:"templately-items-header-wrapper-inner"},i.a.createElement("div",{className:"templately-items-header"},i.a.createElement("h3",null,"All ",e.title)),i.a.createElement("div",{className:"templately-plan-switcher"},i.a.createElement("button",{onClick:function(){return u("all")},className:"components-button templately-plan-all ".concat("all"===e.plan?"tactive":"")},"All (",null===(t=s[a])||void 0===t?void 0:t.total,")"),i.a.createElement("button",{onClick:function(){return u("starter")},className:"components-button templately-plan-starter ".concat("starter"===e.plan?"tactive":"")},"Starter (",null===(n=s[a])||void 0===n?void 0:n.starter,")"),i.a.createElement("button",{onClick:function(){return u("pro")},className:"components-button templately-plan-pro ".concat("pro"===e.plan?"tactive":"")},"Pro (",null===(r=s[a])||void 0===r?void 0:r.pro,")"))))}));function Ag(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ng(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lg=TemplatelyAdmin,Ig=Lg.not_found,Dg=Lg.platform,Mg=nt((function(e){return{blocks:e.blocks,pages:e.pages,packs:e.packs,sidebar:e.common.activeSidebar,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,activeSidebar:e.common.activeSidebar,loading:e.common.loading,platform:e.common.platform,plan:e.common.plan,itemLoading:e.common.itemLoading,retry:e.common.retry,dependencyFiltersID:e.common.dependencyFilter.filtersID,dependencyFilterActive:e.common.dependencyFilter.filterActive,dependencyFilterResults:e.common.dependencyFilter.filtersResults,selectedTags:e.common.tags}}))((function(e){var t,n=(null===(t=e.location.pathname)||void 0===t?void 0:t.replace(/^\/+/,""))||("gutenberg"===e.platform?"blocks":"packs"),r=n.substring(0,n.length-1),a=Ag(Object(o.useState)([]),2),l=a[0],c=a[1],u=Ag(Object(o.useState)(1),2),s=u[0],f=u[1],p=Ag(Object(o.useState)(""),2),d=p[0],m=p[1],h=Object(o.useRef)(null);Object(o.useEffect)((function(){return h.current=!0,function(){return h.current=!1}}),[]);var y=Object(o.useMemo)((function(){return e.selectedTags}),[e.selectedTags]),g=Object(o.useMemo)((function(){return e.dependencyFiltersID}),[e.dependencyFiltersID]);Object(o.useEffect)((function(){m("")}),[e]);var v=Object(o.useCallback)((function(e){null!=h&&h.current&&(e.target.scrollTop>250&&""===d?m("templately-header-sticky"):m(""))}),[]),b=Object(o.useMemo)((function(){return e.sidebar}),[e.sidebar]),w=Object(o.useMemo)((function(){return e.blocks}),[e.blocks]),E=Object(o.useMemo)((function(){return e.pages}),[e.pages]),O=Object(o.useMemo)((function(){return e.packs}),[e.packs]),S=Object(o.useMemo)((function(){return e.pagination}),[e.pagination]),k=Object(o.useMemo)((function(){return e.platform}),[e.platform]),_=Object(o.useMemo)((function(){return e.plan}),[e.plan]),j=Object(o.useMemo)((function(){return e.dependencyFilterActive}),[e.dependencyFilterActive]),x=Object(o.useMemo)((function(){return e.dependencyFilterResults}),[e.dependencyFilterResults]);return Object(o.useEffect)((function(){if(null!==e.pagination){var t,r,a,o,i,l,c,u,s;if(!1===j)if("all"===e.sidebar.activeSidebarMenu){if(null!==(t=e[n])&&void 0!==t&&null!==(r=t[e.plan])&&void 0!==r&&null!==(a=r[e.platform])&&void 0!==a&&a[e.pagination])return f(e[n][e.plan][e.platform].total_page),e.dispatch(_i(!1)),e.dispatch(ji(!1)),void e.dispatch(zi(!1))}else if((null===(o=e[n])||void 0===o||null===(i=o[e.plan])||void 0===i||null===(l=i[e.platform])||void 0===l||null===(c=l.categoryData)||void 0===c||null===(u=c[e.sidebar.activeSidebarMenu])||void 0===u||null===(s=u[e.pagination])||void 0===s?void 0:s.length)>0)return f(e[n][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].total_page),e.dispatch(_i(!1)),e.dispatch(ji(!1)),void e.dispatch(zi(!1));e.dispatch(ji(!0));try{(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={content_type:"blocks",per_page:48,page:1};e=As(As({},t),e);var n=new FormData;return n.append("action","get_templately"),n.append("nonce",Fs),n.append("content_type",e.content_type),n.append("pagenum",e.page),n.append("per_page",e.per_page),null!=e.platform&&n.append("platform",e.platform),null!=e.category_id&&n.append("category_id",e.category_id),null!=e.dependencies&&n.append("dependencies",JSON.stringify(e.dependencies)),null!=e.tag_id&&e.tag_id.length>0&&n.append("tag_id",JSON.stringify(e.tag_id)),null!=e.plan_type&&"all"!==e.plan_type&&n.append("plan_type",e.plan_type),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))})({content_type:n,page:e.pagination,platform:e.platform,plan_type:e.plan,per_page:"templately"===Dg?52:51,category_id:"all"!==e.sidebar.activeSidebarMenu?e.sidebar.activeSidebarMenu:void 0,dependencies:g,tag_id:y}).then((function(t){if(null!=h&&h.current){if(!t.data.success)return void e.dispatch(yi(t.data.data));if(!t.data.data.hasOwnProperty("data"))return void e.dispatch(yi(t.data.data));if(e.dependencyFilterActive)return f(t.data.data.total_page),e.dispatch({type:"FILTER_DEPENDENCIES_RESULTS",payload:{current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}}),e.dispatch(ji(!1)),e.dispatch(_i(!1)),void e.dispatch(zi(!1));"blocks"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(vi({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_ITEMS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),"packs"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(bi({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PACKS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),"pages"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(function(e){return{type:"ALL_PAGES",payload:e}}({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PAGES",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),e.dispatch(ji(!1)),e.dispatch(_i(!1)),e.dispatch(zi(!1))}}))}catch(t){return void(null!=h&&h.current&&(e.dispatch(yi(res.data.data)),console.error("Catched Error: ",t)))}}}),[e.pagination,b,e.platform,e.plan,e.retry,j,g,y]),Object(o.useEffect)((function(){var t,r,a,o,i,l,u,s,f,p,d;if(!0!==e.dependencyFilterActive){if("all"!=e.sidebar.activeSidebarMenu){if(null!==(t=e[n])&&void 0!==t&&null!==(r=t[e.plan])&&void 0!==r&&null!==(a=r[e.platform])&&void 0!==a&&null!==(o=a.categoryData)&&void 0!==o&&null!==(i=o[e.sidebar.activeSidebarMenu])&&void 0!==i&&i[e.pagination]){var m=e[n][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination];c(m)}}else if(null!==(l=e[n])&&void 0!==l&&null!==(u=l[e.plan])&&void 0!==u&&null!==(s=u[e.platform])&&void 0!==s&&s[e.pagination]){var h=e[n][e.plan][e.platform][e.pagination];c(h)}}else if(null!==(f=e.dependencyFilterResults)&&void 0!==f&&null!==(p=f[e.plan])&&void 0!==p&&null!==(d=p[e.platform])&&void 0!==d&&d[e.pagination]){var y=e.dependencyFilterResults[e.plan][e.platform][e.pagination];c(y)}}),[w,E,O,S,b,k,_,j,x]),i.a.createElement(i.a.Fragment,null,e.loading&&i.a.createElement(wf,null,i.a.createElement(Jd,null)),!e.loading&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Xy,null,i.a.createElement(jg,{type:n})),e.itemLoading&&i.a.createElement(Jd,null),!e.itemLoading&&i.a.createElement(wf,{classes:"".concat(""!=d?"has-sticky-header":""),onScroll:v},i.a.createElement(Tg,{itemsFor:n,sticky:d,title:n}),0===l.length&&!e.itemLoading&&!e.pagination_loading&&i.a.createElement("div",{className:"templately-empty-clouds"},i.a.createElement("img",{src:Ig,alt:"Items Not Found"})),i.a.createElement("div",{className:Pf()("templately-modal-content","templately-blocks","templately-tab-".concat(n),{"templately-has-pagination":e.need_pagination})},!e.pagination_loading&&i.a.createElement(zh,{itemsType:r,items:l,isLoading:e.pagination_loading}),e.pagination_loading&&i.a.createElement(Jd,null)),i.a.createElement(Yd,{type:r,count:s,categoryPagination:"all"!==e.sidebar.activeSidebarMenu}))))}));function Rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zg=wp.i18n.__,Ug=TemplatelyAdmin.not_found,Bg=nt((function(e){return{searchQuery:e.common.searchQuery.query,isSearching:e.common.searchQuery.isSearching||!1,searchResults:e.common.searchQuery.results,loading:e.common.loading,platform:e.common.platform,activeSidebar:e.common.activeSidebar,filterFrom:e.common.filter.from,selectedTags:e.common.tags,dependencyFiltersID:e.common.dependencyFilter.filtersID}}))((function(e){var t=se().query,n=Rg(Object(o.useState)([]),2),r=n[0],a=n[1],l=Rg(Object(o.useState)(!0),2),c=l[0],u=l[1],s=Rg(Object(o.useState)(!1),2),f=s[0],p=s[1];Object(o.useEffect)((function(){null!=t&&t.length>0&&e.dispatch($i({query:t,isSearching:!0}))}),[]),Object(o.useEffect)((function(){0==e.isSearching&&e.searchQuery.length>0&&e.dispatch($i({query:e.searchQuery,isSearching:!0}))}),[e.platform]);var d=Object(o.useMemo)((function(){return e.filterFrom}),[e.filterFrom]),m=Object(o.useMemo)((function(){return e.selectedTags}),[e.selectedTags]),h=Object(o.useMemo)((function(){return e.dependencyFiltersID}),[e.dependencyFiltersID]),y=Object(o.useMemo)((function(){return e.activeSidebar}),[e.activeSidebar]);return Object(o.useEffect)((function(){e.dispatch(Ai("search"+Date.now()))}),[y]),Object(o.useEffect)((function(){if(e.searchQuery.length>0&&(e.isSearching||"wrapper"!=d)){var t={platform:e.platform,searchQuery:e.searchQuery,query_type:"pack,block,page"};"wrapper"!==d&&(t.dependencies=h,t.tags=m,t.categories=y.activeSidebarMenu),p(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","search"),null!=e&&e.searchQuery&&t.append("search",e.searchQuery),null!=e&&e.platform&&t.append("platform",e.platform),null!=e&&e.categories&&t.append("category_id",e.categories),null!=e&&e.dependencies&&t.append("dependencies",e.dependencies),null!=e&&e.query_type&&t.append("query_type",e.query_type),null!=e&&e.tags&&t.append("tag_id",e.tags),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(t).then((function(t){200==t.status&&t.data.success&&e.dispatch($i({query:e.searchQuery,results:t.data.data,isSearching:!1})),p(!1),u(!1)})).catch((function(e){console.error(e.response),u(!1),p(!1)}))}}),[e.isSearching,d,y]),Object(o.useEffect)((function(){var t=[];e.searchResults&&e.searchResults.length>0&&(t=e.searchResults),a(t)}),[e.searchResults]),Object(o.useEffect)((function(){e.loading&&u(!0)}),[e.loading]),i.a.createElement(i.a.Fragment,null,c&&i.a.createElement(wf,null,i.a.createElement(Jd,null)),!c&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Xy,null,i.a.createElement(jg,{from:"search"})),i.a.createElement("div",{className:"templately-modal-search"},i.a.createElement("div",{className:"templately-searched"},i.a.createElement("p",null,i.a.createElement("strong",null,zg("You are looking for: ","templately")),t)),i.a.createElement("div",{className:"templately-searched-items templately-modal-content templately-blocks"},r.length>0&&!f&&i.a.createElement(zh,{items:r,isLoading:e.pagination_loading}),r.length<=0&&!c&&!f&&i.a.createElement("div",{className:"templately-search-not-found"},i.a.createElement("div",null,i.a.createElement("img",{src:Ug,alt:"Searched Item Not Found"}))),f&&i.a.createElement(Jd,null)))))}));n(134);function Vg(){return(Vg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Wg=function(e){return i.a.createElement("div",{className:e.className},i.a.createElement("div",null,i.a.createElement("input",Vg({type:"text"},e))))};function Hg(e){return function(e){if(Array.isArray(e))return Kg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||qg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||qg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){if(e){if("string"==typeof e)return Kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kg(e,t):void 0}}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qg=wp.i18n.__,Gg=TemplatelyAdmin,Yg=Gg.loadingImage,Xg=Gg.nonce,Jg=function(e){var t=$g(Object(o.useState)(e.isLoading||!1),2),n=t[0],r=t[1],a=$g(Object(o.useState)(!0),2),l=a[0],c=a[1],u=$g(Object(o.useState)(!1),2),s=u[0],f=u[1],p=$g(Object(o.useState)(e.content.name),2),d=p[0],m=p[1],h=$g(Object(o.useState)([]),2),y=h[0],g=h[1],v=$g(Object(o.useState)([]),2),b=v[0],w=v[1],E=$g(Object(o.useState)(!1),2),O=E[0],S=E[1],k=$g(Object(o.useState)(!1),2),_=k[0],j=k[1],x=$g(Object(o.useState)(!1),2),P=x[0],C=x[1],T=$g(Object(o.useState)(""),2),A=T[0],N=T[1],L=$g(Object(o.useState)(!1),2),I=L[0],D=L[1],M=$g(Object(o.useState)([]),2),R=M[0],F=M[1],z=$g(Object(o.useState)([]),2),U=z[0],B=z[1],V=$g(Object(o.useState)([]),2),W=(V[0],V[1]),H=$g(Object(o.useState)([]),2),$=H[0],q=H[1];return Object(o.useEffect)((function(){var t=[],n=[];if(e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.map((function(e,r){n.push(e.email),t.push(i.a.createElement("li",{key:r},e.profile_photo&&i.a.createElement("img",{src:e.profile_photo}),i.a.createElement("span",{className:"tae-name "},e.name),i.a.createElement("span",{className:"tae-remove",onClick:function(t){j({email:e.email,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e.email,currentTarget:t.currentTarget.parentElement})}})))})),F(n),g(t)),e.content.pending_invitations&&e.content.pending_invitations.length>0){var r=JSON.parse(e.content.pending_invitations),a=[],o=[];r.map((function(e){Xs(e)&&(o.push(e),a.push(i.a.createElement("li",{key:e},i.a.createElement("span",{className:"tae-name "},e,i.a.createElement("em",null,Qg("invited","templately"))),i.a.createElement("span",{className:"tae-remove",onClick:function(t){j({email:e,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))})),W(o),F([].concat(n,o)),g([].concat(t,a))}}),[]),Object(o.useEffect)((function(){if(O){var e=Hg(U),t=A.toLowerCase();Xs(t)&&(e.includes(t)||(e.push(t),B(e)),N("")),S(!1)}}),[O]),Object(o.useEffect)((function(){if(!1!==I){var e=Hg(U).filter((function(e){return I!=e}));B(e),D(!1)}}),[I]),Object(o.useEffect)((function(){if(!1!==_||!1!==P){var e=Hg(R),t=Hg($);if(0!=_&&(_.currentTarget.classList.add("removed"),t.push(_.email),e=e.filter((function(e){return _.email!=e})),F(e),q(t),j(!1)),0!=P){P.currentTarget.classList.remove("removed"),e.push(P.email);var n=t.filter((function(e){return P.email!=e}));F(e),q(n),C(!1)}}}),[_,P]),Object(o.useEffect)((function(){var e=[];U.length>0&&U.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return D(t)}})))})),w(e)}),[U]),Object(o.useEffect)((function(){U.length>0||$.length>0?c(!1):c(!0)}),[R,U,$]),Object(o.useEffect)((function(){if(!0===s){r(!0);var t=U,n=Hg($),a=new FormData;a.append("action","get_templately"),a.append("content_type","edit_workspace"),a.append("id",e.content.id),a.append("title",d),a.append("share_with",t.join()),a.append("remove",n.join()),a.append("nonce",Xg),a.append("platform",e.platform),wu.a.post(ajaxurl,a).then((function(t){t.data.success&&("success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),_s.a.close({saved:!0})):_s.a.close({saved:!1}))})),f(!1)}}),[s]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Yg})),!n&&i.a.createElement("div",{className:"templately-workspace-edit-modal"},i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement(Wg,{value:d,onChange:function(e){c(!1),m(e.target.value)}}))),y.length>0&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Qg("Shared with","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-shared-with"},i.a.createElement("ul",{className:"templately-added-email-list"},y))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Qg("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},b),i.a.createElement("div",null,i.a.createElement(Wg,{onKeyUp:function(e){return S(13===e.keyCode)},onChange:function(e){return N(e.target.value)},value:A,placeholder:Qg("Type email to add","templately")}),i.a.createElement(Id,{disabled:0===A.length,onClick:function(){return S(!0)}},Qg("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:l,onClick:function(){return f(!0)}},Qg("Save","templately")))))},Zg=function(e){return i.a.createElement("div",{className:"templately-delete-confirm-text"},i.a.createElement("h3",null,"Are You Sure?"),i.a.createElement("p",null,"The WorkSpace will be permanently deleted including the files."))};function ev(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nv=wp.i18n.__,rv=nt((function(e){return{pagination:e.common.pagination,userID:e.admin.user.id||null}}))((function(e){var t=ev(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ev(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ev(Object(o.useState)(!1),2),s=u[0],f=u[1],p=ev(Object(o.useState)([]),2),d=p[0],m=p[1],h=ev(Object(o.useState)(!1),2),y=h[0],g=h[1],v=ue(),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=function(t){if(e.userID===e.content.owner.id){var n=b.current.contains(t.target),a=w.current&&w.current.contains(t.target);n||a||r(!1)}};return Object(o.useEffect)((function(){l&&(Vs("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(Jg,{singleDispatch:function(t){e.dispatch({type:"EDIT_WORKSPACE",payload:{page:e.pagination,slug:t.slug,data:t,platform:e.platform}}),e.dispatch(function(e){return{type:"EDIT_WORKSPACE_DETAILS",payload:e}}({page:e.pagination,slug:t.slug,data:t,platform:e.platform}))},pagination:e.pagination,content:e.content,platform:e.platform})}).then((function(e){return e.saved?Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Saved",content:"You have succesfully saved your WorkSpace changes."})}):e.dismiss?void 0:Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding changes in your WorkSpace. Try Later or Contact support."})})})),c(!1))}),[l]),Object(o.useEffect)((function(){s&&(Vs("",{showConfirmButton:!0,allowOutsideClick:!1,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!1,reverseButtons:!0,customClass:{container:"templately-delete-modal",confirmButton:"templately-delete-confirm",cancelButton:"templately-delete-cancel"},html:i.a.createElement(Zg,null),input:"checkbox",inputValue:0,inputPlaceholder:"Delete WorkSpace Files?",target:".templately-workspace-content",preConfirm:function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","delete_workspace"),n.append("id",e),n.append("withFiles",t),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e}))}}(s,t).then((function(t){return t.data.success&&"success"==t.data.data?(e.dispatch({type:"DELETE_WORKSPACE",payload:{page:e.pagination,data:s}}),{delete:!0}):{delete:!1}}))}}).then((function(t){if(t.hasOwnProperty("value")&&t.value.hasOwnProperty("delete")){if(t.value.delete){var n=v.pathname.replace(e.content.slug,"");return e.dispatch(Vi(n)),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:"You have deleted a WorkSpace from your account."})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your WorkSpace. Try Later."})})}})),f(!1))}),[s]),Object(o.useEffect)((function(){var t=[];e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.slice(0,e.shared||e.userID!==e.content.owner.id?5:4).map((function(e,n){null!=e.profile_photo?t.push(i.a.createElement("img",{key:n,src:e.profile_photo,alt:e.name})):t.push(i.a.createElement("span",{key:n},e.name.slice(0,1)))})),m(t));return document.addEventListener("mousedown",E),function(){return document.removeEventListener("mousedown",E)}}),[]),Object(o.useEffect)((function(){e.details||(!1!==y&&!1===n&&!1===l&&e.dispatch(Vi(e.shared?"/shared/workspace/".concat(y):"/workspace/".concat(y))),g(!1))}),[y]),i.a.createElement("div",{onClick:function(){return g(e.content.slug)},className:"".concat(e.details?"tsw-active ":"","templately-single-workspace").concat(!0===n?" templately-ctxmenu-open":"")},i.a.createElement("div",{className:"templately-single-workspace-inner"},e.userID===e.content.owner.id&&i.a.createElement("div",{className:"templately-sw-cxt-menu-wrapper"},i.a.createElement(Id,{ref:b,className:"templately-sw-action-btn",onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:w,className:"templately-sw-cxt-menu".concat(!0===n?" topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-edit",onClick:function(){return c(e.content.id)}},i.a.createElement("i",null),nv("Edit","templately")),i.a.createElement("li",{className:"tw-delete",onClick:function(){return f(e.content.id)}},i.a.createElement("i",null),nv("Delete","templately"))))),i.a.createElement("header",null,i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("div",null,i.a.createElement("span",{className:"tw-title"},nv(e.content.name,"templately")),(e.shared||e.details)&&i.a.createElement("span",{className:"tw-author"},nv("by "+e.content.owner.name,"templately")))),i.a.createElement("div",{className:"templately-workspace-sharewith"},i.a.createElement("p",null,nv("Shared with","templately")," "),i.a.createElement("div",{className:"templately-workspace-sharewith-image"},d,e.userID===e.content.owner.id&&i.a.createElement(Id,{onClick:function(){return c(!0)}},i.a.createElement(oi,null))))))}));function av(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ov(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?av(Object(n),!0).forEach((function(t){iv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):av(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lv(e){return function(e){if(Array.isArray(e))return sv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uv(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||uv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uv(e,t){if(e){if("string"==typeof e)return sv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sv(e,t):void 0}}function sv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fv=wp.i18n.__,pv=TemplatelyAdmin.loadingImage,dv=function(e){var t=cv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=cv(Object(o.useState)(!0),2),l=a[0],c=a[1],u=cv(Object(o.useState)(!1),2),s=u[0],f=u[1],p=cv(Object(o.useState)(""),2),d=p[0],m=p[1],h=cv(Object(o.useState)([]),2),y=h[0],g=h[1],v=cv(Object(o.useState)(!1),2),b=v[0],w=v[1],E=cv(Object(o.useState)(""),2),O=E[0],S=E[1],k=cv(Object(o.useState)(!1),2),_=k[0],j=k[1],x=cv(Object(o.useState)([]),2),P=x[0],C=x[1];return Object(o.useEffect)((function(){if(b){var e=lv(P),t=O.toLowerCase();Xs(t)&&(e.includes(t)||(e.push(t),C(e)),S("")),w(!1)}}),[b]),Object(o.useEffect)((function(){if(!1!==_){var e=lv(P).filter((function(e){return _!=e}));C(e),j(!1)}}),[_]),Object(o.useEffect)((function(){var e=[];P.length>0&&P.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return j(t)}})))})),g(e)}),[P]),Object(o.useEffect)((function(){c(!(P.length>0||d.length>0))}),[P,d]),Object(o.useEffect)((function(){s&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","create_workspace"),n.append("title",e),n.append("share_with",t.join()),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}}(d,P).then((function(t){t.data.success?"success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),_s.a.close(ov({created:!0},t.data.data))):_s.a.close(ov({created:!1},t.data.data)):r(!1)})),f(!1))}),[s]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-create-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:pv})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement("input",{autoFocus:!0,type:"text",value:d,onChange:function(e){return m(e.target.value)},placeholder:fv("WorkSpace Name","templately")}))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,fv("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},y),i.a.createElement("div",null,i.a.createElement(Wg,{onChange:function(e){return S(e.currentTarget.value)},onKeyUp:function(e){return w(13===e.keyCode)},value:O,placeholder:fv("Type email to add","templately")}),i.a.createElement(Id,{disabled:0===O.length,onClick:function(){return w(!0)}},fv("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:l,onClick:function(){return f(!0)}},fv("Create WorkSpace","templately")))))};function mv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yv=function(e){var t=mv(Object(o.useState)(!0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!1)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-single-workspace-placeholder ".concat(e.grid?"tworkspace-grid-placeholder":"tworkspace-list-placeholder")},e.grid?i.a.createElement("svg",{"aria-labelledby":"loading-aria",preserveAspectRatio:"none",viewBox:"0 0 305 159"},i.a.createElement("rect",{width:"100%",height:"100%",fill:'url("#fill")',clipPath:"url(#clip-path)"}),i.a.createElement("defs",null,i.a.createElement("clipPath",{id:"clip-path"},i.a.createElement("circle",{cx:"300",cy:"22",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"29",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"36",r:"3"}),i.a.createElement("path",{d:"M207.4 72.6H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2zM82.3 97.4H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{cx:"21",cy:"22",r:"21"}),i.a.createElement("path",{d:"M34.8 125C27 118 15 118.6 8 126.4c-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{d:"M59.8 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{d:"M90 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{d:"M120 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{cx:"142",cy:"139",r:"19"})),i.a.createElement("linearGradient",{id:"fill"},i.a.createElement("stop",{offset:"0.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-2; -2; 1"})),i.a.createElement("stop",{offset:"1.6",stopColor:"#6c7dff"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-1; -1; 2"})),i.a.createElement("stop",{offset:"2.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"0; 0; 3"}))))):i.a.createElement("svg",{id:"prefix__Layer_1",xmlns:"http://www.w3.org/2000/svg",x:0,y:0,viewBox:"0 0 1180 102",xmlSpace:"preserve"},i.a.createElement("style",null,".prefix__st0{fill:#edeeef}.prefix__st1{fill:#f3f3f3}"),i.a.createElement("circle",{id:"prefix__Ellipse_1",className:"prefix__st0",cx:1149.7,cy:21.1,r:2.7}),i.a.createElement("circle",{id:"prefix__Ellipse_2",className:"prefix__st0",cx:1149.7,cy:28.3,r:2.7}),i.a.createElement("circle",{id:"prefix__Ellipse_3",className:"prefix__st0",cx:1149.7,cy:35.4,r:2.7}),i.a.createElement("g",null,i.a.createElement("path",{id:"prefix__Path_1",className:"prefix__st1",d:"M300.9 44.8H98.6c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2z"}),i.a.createElement("path",{id:"prefix__Path_2",className:"prefix__st1",d:"M175.8 69.6H98.6c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{id:"prefix__Ellipse_4",className:"prefix__st1",cx:49,cy:52.1,r:21.2})),i.a.createElement("g",{id:"prefix__Group_1",transform:"translate(-3.146)"},i.a.createElement("path",{id:"prefix__Path_3",className:"prefix__st1",d:"M690 38c-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{id:"prefix__Path_4",className:"prefix__st1",d:"M715 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{id:"prefix__Path_5",className:"prefix__st1",d:"M745.2 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{id:"prefix__Path_6",className:"prefix__st1",d:"M775.2 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{id:"prefix__Ellipse_5",className:"prefix__st1",cx:797.6,cy:51.9,r:18.9})))):i.a.createElement("div",null)};function gv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bv=wp.i18n.__,wv=function(e){var t=gv(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!0)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace no-workspace-found-wrapper"},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},bv("No Workspaces Found.","templately")))):i.a.createElement("div",null)},Ev=function(e){return void 0===e.visibility||e.visibility||e.title&&e.title.length<=0?"":i.a.createElement("div",{className:"templately-workspace-header"},i.a.createElement("h1",null,e.title),e.children)},Ov=function(e){var t=e.grid,n=e.setGrid,r=function(e){return n("grid"===e)};return i.a.createElement("div",{className:"tview-action"},i.a.createElement(Id,{onClick:function(){return r("grid")},className:"templately-grid-view ".concat(t?"activated-view":"")},i.a.createElement(ui,null)),i.a.createElement(Id,{onClick:function(){return r("list")},className:"templately-list-view ".concat(t?"":"activated-view")},i.a.createElement(Ko,null)))};function Sv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _v=wp.i18n.__,jv=nt((function(e){return{workspaces:e.workspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,workspaceList:e.workspaces.workspacesList}}))((function(e){var t=Sv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Sv(Object(o.useState)([]),2),l=a[0],c=a[1],u=Sv(Object(o.useState)(1),2),s=u[0],f=u[1],p=Sv(Object(o.useState)(!0),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0||Zs(!1,!0,{page:e.pagination}).then((function(t){t.data.success&&(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"ALL_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}))})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}))}),[e.pagination]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(rv,{key:e.id,content:e}))})),c(t)}}),[e.workspaces,e.pagination]),Object(o.useEffect)((function(){n&&(Vs("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(dv,{singleDispatch:function(t,n){e.workspaceList.length>0&&e.dispatch({type:"ADD_WORKSPACE_IN_LIST",payload:[{id:t.id,name:t.name,slug:t.slug}]}),e.dispatch(function(e){return{type:"CREATE_WORKSPACE",payload:e}}({page:e.pagination,data:t}))}})}).then((function(e){if(e.hasOwnProperty("created"))return e.created?Vs("",{icon:"success",timer:2e3,html:i.a.createElement(sf,{title:"Successfully Created",content:i.a.createElement("p",null,"You have created a WorkSpace called"," ",i.a.createElement("strong",null,e.workspace.name))})}):Vs("",{icon:"error",showCloseButton:!0,html:i.a.createElement(sf,{title:"Something went wrong.",content:i.a.createElement("div",null,i.a.createElement("p",null,e.message),i.a.createElement("a",{href:"https://templately.com/subscription",target:"_blank"},_v("Upgrade to Pro","templately")))})})})),r(!1))}),[n]),i.a.createElement(Em,null,i.a.createElement(Ev,{title:"My WorkSpace"}),i.a.createElement("div",{className:"templately-my-workspace-item-view-buttons"},i.a.createElement(Ov,{grid:d,setGrid:m})),i.a.createElement("div",{className:"templately-my-workspace templately-workspace-list ".concat(d?"":"templately-list-view")},i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace",onClick:function(){return r(!0)}},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},_v("Add New WorkSpace","templately"))))," ",l.length>0?l:i.a.createElement(i.a.Fragment,null,i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(wv,{delay:3e3}))),i.a.createElement(Yd,{type:"workspace",count:s}))})),xv=TemplatelyAdmin.not_found,Pv=nt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-nothing-is-there"},""!=e.retryMessage?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(pi(!e.retry)),e.dispatch(yi(""))}},"Retry")):i.a.createElement("img",{src:xv}))}));function Cv(e){return function(e){if(Array.isArray(e))return Dv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Iv(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Av(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach((function(t){Nv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||Iv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Iv(e,t){if(e){if("string"==typeof e)return Dv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dv(e,t):void 0}}function Dv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mv=wp.i18n.__,Rv=TemplatelyAdmin.loadingImage,Fv=function(e){var t=Lv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Lv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Lv(Object(o.useState)(""),2),s=u[0],f=u[1],p=Lv(Object(o.useState)(!0),2),d=p[0],m=p[1],h=Lv(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Lv(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Lv(Object(o.useState)(!1),2),O=E[0],S=E[1],k=Lv(Object(o.useState)({value:"clouds",label:Mv("My Clouds","templately")}),2),_=k[0],j=k[1],x=Lv(Object(o.useState)([]),2),P=x[0],C=x[1],T=Lv(Object(o.useState)([]),2),A=T[0],N=T[1],L=Lv(Object(o.useState)([]),2),I=L[0],D=L[1],M=Lv(Object(o.useState)([]),2),R=M[0],F=M[1],z=Lv(Object(o.useState)(e.cloudFiles),2),U=z[0],B=z[1];Object(o.useEffect)((function(){if(F([]),"clouds"==_.value)if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}else D([]);if("workspaces"==_.value&&!1!==O)if(U.hasOwnProperty(O.slug)){var n=[];U[O.slug].map((function(e){n.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(n)}else{r(!0),nf(O.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=Av({},U);n[O.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:O.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}if("shared_workspaces"==_.value&&!1!==b)if(U.hasOwnProperty(b.slug)){var a=[];U[b.slug].map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else{r(!0),nf(b.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=Av({},U);n[b.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:b.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}}),[_,O,b,U,l]),Object(o.useEffect)((function(){if(r(!0),U.hasOwnProperty("clouds")){if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}}else tf({per_page:-1,platform:e.platform}).then((function(t){if(t.data.success){if(t.data.data.data.length>0){var n=[];t.data.data.data.map((function(e){n.push({label:e.name,value:e.id,file_type:e.file_type})})),D(n);var a=Av({},U);a.clouds=t.data.data.data,B(a),e.singleDispatch({slug:"clouds",data:t.data.data.data}),r(!1)}}else r(!0),f("string"==typeof t.data.data?t.data.data:"")}));e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0?Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[],a=[];null!==t[0]&&"string"!=typeof t[0]?(e.singleDispatch(t[0],"workspace"),n=ef(t[0])):f("string"==typeof t[0]?t[0]:""),null!==t[1]&&"string"!=typeof t[1]?(e.singleDispatch(t[1]),a=ef(t[1],!0)):f("string"==typeof t[1]?t[1]:""),n.length>0&&C(n),a.length>0&&N(a),(a.length>0||n.length>0)&&r(!1)}})).catch((function(e){return console.error("Error Regarding Fetching WorkSpace List:",e)})):(e.workspaceList.length>0&&C(ef(e.workspaceList)),e.sharedWorkspaceList.length>0&&N(ef(e.sharedWorkspaceList)),r(!1))}),[l]),Object(o.useEffect)((function(){null!==R?("workspaces"===_.value&&!1!==O&&R.length>0&&m(!1),"shared_workspaces"===_.value&&!1!==b&&R.length>0&&m(!1),"clouds"===_.value&&!b&&!O&&R.length>0&&m(!1)):m(!0)}),[b,O,R]),Object(o.useEffect)((function(){if(y){var t=R.reduce((function(e,t){var n=Cv(e);return n.push(t.value),n}),[]);r(!0),function(e,t){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","add_files_to_workspace"),n.append("workspace_id",e),n.append("files",t),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(e.workspaceID,JSON.stringify(t)).then((function(t){if(t.data.success){if("success"===t.data.data.status){var n=JSON.parse(t.data.data.data);if(n.files.length>0){var a=[];n.files.map((function(e){a.push({id:e.id,my_cloud_id:e.my_cloud_item_id,name:e.name,file_type:e.file_type,created_at:e.created_at,last_modified:e.last_modified,owner:e.owner})})),e.singleDispatch({slug:e.workspaceSlug,data:a},"workspace_details"),_s.a.close({added:!0})}}}else r(!1)})),g(!1)}}),[y]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:Rv})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Add Template to WorkSpace","templately"),": "))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select Source","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{isSearchable:!1,defaultValue:{value:"clouds",label:Mv("My Clouds","templately")},options:[{value:"clouds",label:Mv("My Clouds","templately")},{value:"workspaces",label:Mv("My Workspaces","templately")},{value:"shared_workspaces",label:Mv("Shared Workspaces","templately")}],onChange:function(e){return j(e)}}))),"workspaces"===_.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:P,noOptionsMessage:function(){return Mv("No WorkSpace Found","templately")},onChange:function(e){return S(e)}}))),"shared_workspaces"===_.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:A,noOptionsMessage:function(){return Mv("No Shared WorkSpace Found","templately")},onChange:function(e){return w(e)}}))),("shared_workspaces"===_.value&&!1!==b||"workspaces"===_.value&&!1!==O||"clouds"===_.value)&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select Templates","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{value:R,noOptionsMessage:function(){return Mv("No Saved Templates Found","templately")},classNamePrefix:"templately",isMulti:!0,options:I,onChange:function(e){return F(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:d,onClick:function(){return g(!0)}},Mv("Add To WorkSpace","templately")))))};function zv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Uv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Uv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bv=wp.i18n.__,Vv=nt((function(e){return{workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,clouds_file_list:e.workspacesDetails.filesList,platform:e.common.platform,pagination:e.common.pagination}}))((function(e){var t=zv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=zv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=zv(Object(o.useState)(""),2),s=u[0],f=u[1],p=zv(Object(o.useState)(!1),2),d=p[0],m=p[1],h=zv(Object(o.useState)([]),2),y=h[0],g=h[1],v=zv(Object(o.useState)(void 0),2),b=v[0],w=v[1],E=Object(o.useMemo)((function(){return null!=e&&e.shared?"/shared/workspace":"/workspace"}),[e.shared]);return Object(o.useEffect)((function(){!1!==n&&e.workspaceSlug!==n.slug?(e.setSearch(!1),e.setLoading(!0),e.dispatch(Ri(1)),e.dispatch(Vi(n.shared?"/shared/workspace/".concat(n.slug):"/workspace/".concat(n.slug))),e.dispatch(Yi(n.slug)),r(!1)):e.dispatch(Yi(!1))}),[n]),Object(o.useEffect)((function(){(e.pagination>1&&s.length>0||d&&s.length>0)&&(e.setItemLoading(!0),e.setSearch(!0),nf(e.workspaceSlug,{search:s,per_page:10,page:e.pagination}).then((function(t){var n,r,a;t.data.success&&(null!=t&&null!==(n=t.data)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(a=r.files)&&void 0!==a&&a.data&&(e.setTotalPage(t.data.data.files.total_page),e.setSearchedItem(t.data.data.files.data)),e.setItemLoading(!1))})),m(!1)),d&&0===s.length&&e.setSearch(!1)}),[d,e.pagination]),Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.dispatch(Qi(t[0])),n.push({label:Bv("My WorkSpace","templately"),options:ef(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.dispatch(Gi(t[1])),n.push({label:Bv("Shared WorkSpace","templately"),options:ef(t[1],!0)})),n.length>0&&g(n)}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:Bv("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:Bv("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList,!0)}),t.length>0&&g(t)}}),[e.retry]),Object(o.useEffect)((function(){l&&(Vs("",{html:i.a.createElement(Fv,{title:e.name,singleDispatch:function(t,n){"workspace_details"===n||e.dispatch({type:"ALL_CLOUDS_FILE_LIST",payload:{slug:t.slug,data:t.data,platform:e.platform}})},platform:e.platform,workspaceSlug:e.workspaceSlug,workspaceID:e.workspaceID,cloudFiles:e.clouds_file_list[e.platform]||[],currentWorkspace:e.currentWorkspace,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.added)return e.setFileAdded(!0),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Added.",content:i.a.createElement("p",null,"Your file has been added to this workspace."," ",i.a.createElement("strong",null,t.name))})})})),c(!1))}),[l]),Object(o.useEffect)((function(){if((null==y?void 0:y.length)>0&&void 0===b){var t,n,r=[];if(y.map((function(t){var n;null!==(n=r)&&void 0!==n&&n.length||(r=t.options.filter((function(t){return t.slug===e.workspaceSlug})))})),null!==(t=r)&&void 0!==t&&t[0])w(null===(n=r)||void 0===n?void 0:n[0])}}),[e.workspaceSlug,y]),i.a.createElement("div",{className:"templately-workspace-file-add"},i.a.createElement("div",{className:"twfa-header twfa-action"},i.a.createElement(ge,{onClick:function(){e.dispatch(Vi(null))},to:E,className:"twfa-header-back-button"},i.a.createElement($o,null)),i.a.createElement("h3",null,Bv("My Files","templately"))),i.a.createElement("div",{className:"twfa-search twfa-action"},i.a.createElement("div",null,i.a.createElement(mu,{className:"templately-select-workspace",classNamePrefix:"templately",options:y,value:b,onChange:function(e){return r(e)}}),i.a.createElement("div",{className:"templately-workspace-search-wrapper"},i.a.createElement(Wg,{onChange:function(e){return f(e.target.value)},onKeyDown:function(e){var t=e.keyCode;return m(13===t)},placeholder:Bv("Search...","templately")}),i.a.createElement("button",{onClick:function(){return m(!0)}},i.a.createElement(ii,null))))),i.a.createElement("div",{className:"twfa-add twfa-action"},i.a.createElement(Id,{onClick:function(){return c(!0)}},i.a.createElement(oi,null))),i.a.createElement(Ov,{grid:e.grid,setGrid:e.setGrid}))}));function Wv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $v=nt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,workspace_slug:e.common.workspace_slug,workspacesDetails:e.workspacesDetails||!1,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,platform:e.common.platform,retry:e.common.retry}}))((function(e){var t,n=Wv(Object(o.useState)({}),2),r=n[0],a=n[1],l=Wv(Object(o.useState)([]),2),c=l[0],u=l[1],s=Wv(Object(o.useState)([]),2),f=s[0],p=s[1],d=Wv(Object(o.useState)([]),2),m=d[0],h=d[1],y=Wv(Object(o.useState)(!0),2),g=y[0],v=y[1],b=Wv(Object(o.useState)(!1),2),w=b[0],E=b[1],O=Wv(Object(o.useState)(!1),2),S=O[0],k=O[1],_=Wv(Object(o.useState)(!1),2),j=_[0],x=_[1],P=Wv(Object(o.useState)(!1),2),C=P[0],T=P[1],A=Wv(Object(o.useState)(!1),2),N=A[0],L=A[1],I=Wv(Object(o.useState)(1),2),D=I[0],M=I[1],R=Wv(Object(o.useState)(!1),2),F=R[0],z=R[1],U=se(),B=ue(),V=Wv(Object(o.useState)(!1!==e.workspace_slug?e.workspace_slug:U.slug),2),W=V[0],H=V[1];return Object(o.useEffect)((function(){!1!==e.workspace_slug&&H(e.workspace_slug)}),[e.workspace_slug]),Object(o.useEffect)((function(){var t,n,r,o,i;if(!1!==W)if(null!==(t=e.workspacesDetails)&&void 0!==t&&null!==(n=t[W])&&void 0!==n&&null!==(r=n.files)&&void 0!==r&&null!==(o=r[e.platform])&&void 0!==o&&o[e.pagination]&&0===(null==B||null===(i=B.search)||void 0===i?void 0:i.length))M(e.workspacesDetails[W].files[e.platform].total_page);else if(!e.workspacesDetails.hasOwnProperty(W)||!e.workspacesDetails[W].files.hasOwnProperty(e.platform)||!e.workspacesDetails[W].files[e.platform].hasOwnProperty(e.pagination)||0!==B.search.length){var l=!1;g||(l=!0,x(!0)),nf(W,{page:e.pagination,platform:e.platform}).then((function(t){if(200===t.status){if(t.data.success)if(t.data.hasOwnProperty("data")&&null!==t.data.data){if(t.data.data.hasOwnProperty("files")&&null!==t.data.data.files){if("refresh"===w&&e.pagination===D)return e.dispatch(Ri(t.data.data.files.total_page)),void x(!1);M(t.data.data.files.total_page)}a({label:t.data.data.name,slug:t.data.data.slug,value:t.data.data.id}),e.dispatch({type:"ADD_WORKSPACE_WITH_DETAILS",payload:{slug:W,data:t.data.data,platform:e.platform,page:e.pagination,iLoading:l}})}else{var n=B.pathname.replace(U.slug,"");e.dispatch(Vi(n))}else e.dispatch(yi("string"==typeof t.data.data?t.data.data:""));v(!1),x(!1)}else v(!1),x(!1)})).catch((function(e){v(!1),console.error("WorkSpace Details Error: ",e)}))}}),[W,e.pagination,w,S,e.platform,e.retry]),Object(o.useEffect)((function(){!0===S&&(e.dispatch(qi({page:e.pagination,slug:W,platform:e.platform,fileAdded:!0})),k("refresh")),!0===w&&(e.dispatch(qi({page:e.pagination,slug:W,platform:e.platform})),E("refresh"))}),[w,S]),Object(o.useEffect)((function(){if(!1!==W&&e.workspacesDetails.hasOwnProperty(W)){if(L(e.workspacesDetails[W].id),e.workspacesDetails[W].hasOwnProperty("files")&&null!=e.workspacesDetails[W].files){var t=[];if(!e.workspacesDetails[W].files.hasOwnProperty(e.platform))return void u([]);e.workspacesDetails[W].files[e.platform].hasOwnProperty(e.pagination)&&e.workspacesDetails[W].files[e.platform][e.pagination].length>0?(e.workspacesDetails[W].files[e.platform][e.pagination].map((function(e){t.push(F?i.a.createElement(Gm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:e.id,currentWorkspace:W,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}):i.a.createElement(Fm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:e.id,currentWorkspace:W,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}))})),M(e.workspacesDetails[W].files[e.platform].total_page),u(t)):u([])}else u([]);v(!1),"refresh"===w&&E(!1)}}),[e.workspacesDetails,W,e.pagination,e.platform,C,F]),Object(o.useEffect)((function(){if(f.length>0){if(!1===W)return;var e=[];f.map((function(t){e.push(F?i.a.createElement(Gm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:t.id,currentWorkspace:W,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}):i.a.createElement(Fm,{details:!0,isLoading:function(e){return v(e)},key:t.id,currentWorkspace:W,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}))})),h(e)}else h([])}),[f]),Object(o.useEffect)((function(){var t,n,r;null!==(t=e.workspacesDetails)&&void 0!==t&&null!==(n=t[W])&&void 0!==n&&null!==(r=n.files)&&void 0!==r&&r[e.platform]&&M(e.workspacesDetails[W].files[e.platform].total_page)}),[e.platform,e.workspacesDetails,W,w,S]),i.a.createElement(Em,null,i.a.createElement("div",{className:"".concat(D>1?"thas-pagination ":"","templately-my-workspace templately-workspace-details templately-list-view").concat(g?" templately-loading":"")},g&&i.a.createElement(Jd,null),e.workspacesDetails[U.slug]&&!g&&i.a.createElement(rv,{details:!0,content:e.workspacesDetails[U.slug],platform:e.platform}),!g&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Vv,{retry:e.retry,setFileAdded:function(e){return k(e)},setLoading:function(e){return v(e)},setItemLoading:function(e){return x(e)},setSearch:function(e){return T(e)},setSearchedItem:function(e){return p(e)},setTotalPage:function(e){return M(e)},workspaceSlug:W,workspaceID:N,currentDetails:r,grid:F,setGrid:z,shared:-1!==(null===(t=e.location)||void 0===t?void 0:t.pathname.indexOf("shared"))}),i.a.createElement(Ef,{className:"templately-clouds-table"},(c.length>0&&!C||m.length>0&&C)&&i.a.createElement(i.a.Fragment,null,!F&&i.a.createElement(_f,null),j&&i.a.createElement(Jd,{small:!0}),C&&!j&&i.a.createElement(qd,{className:"templately-table-body ".concat(F?"templately-templates-grid-view":"")},m),!j&&!C&&i.a.createElement(qd,{className:"templately-table-body ".concat(F?"templately-templates-grid-view":"")},c)),(0===c.length&&j||0===m.length&&j)&&i.a.createElement(i.a.Fragment,null,j&&i.a.createElement(Jd,{small:!0})),!C&&0===c.length&&!j&&i.a.createElement(Pv,null),C&&0===m.length&&!j&&i.a.createElement(Pv,null)),D>1&&i.a.createElement(Yd,{type:"workspace",count:D}))))}));function qv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qv=wp.i18n.__,Gv=nt((function(e){return{is_verified:e.admin.user.is_verified,isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,platform:e.common.platform,loading:e.common.loading,pushed_time:e.common.pushed_time,userID:e.admin.user.id||null,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=qv(Object(o.useState)(!0),2),n=t[0],r=t[1],a=qv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=qv(Object(o.useState)(!1),2),s=u[0],f=u[1],p=qv(Object(o.useState)([]),2),d=p[0],m=p[1],h=qv(Object(o.useState)(1),2),y=h[0],g=h[1],v=qv(Object(o.useState)(""),2),b=v[0],w=v[1],E=qv(Object(o.useState)(""),2),O=E[0],S=E[1],k=qv(Object(o.useState)(!1),2),_=k[0],j=k[1],x=qv(Object(o.useState)(!1),2),P=x[0],C=x[1],T=qv(Object(o.useState)(!1),2),A=T[0],N=T[1],L=qv(Object(o.useState)({}),2),I=L[0],D=L[1],M=qv(Object(o.useState)(1),2),R=M[0],F=M[1],z=qv(Object(o.useState)(!1),2),U=z[0],B=z[1],V=ue();return Object(o.useEffect)((function(){A&&(e.dispatch(Ri(1)),C(!1),w(""),S(""),D({}),N(!1))}),[A]),Object(o.useEffect)((function(){if(R!==e.pagination||_){if(b.length>0){if(I.hasOwnProperty(e.pagination)&&O===b)return void f(!1);S(b),F(e.pagination),f(!0),tf({per_page:10,page:e.pagination,platform:e.platform,search:b}).then((function(t){if(200===t.status)if(t.data.success){C(!0),g(t.data.data.total_page);var n={};n[e.pagination]=t.data.data.data,D(n),f(!1)}else f(!1)})).catch((function(e){return console.error("Search MyClouds Error: ",e)}))}j(!1)}}),[_,e.pagination]),Object(o.useEffect)((function(){if(!P)return e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&!l&&"?refresh"!==V.search?(f(!1),void r(!1)):void(e.isLoggedIn&&(r(!0),f(!0),tf({page:e.pagination,platform:e.platform,per_page:10}).then((function(t){200===t.status&&(t.data.success?(g(t.data.data.total_page),e.dispatch(Oi({current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page,platform:e.platform})),f(!1),r(!1),e.dispatch({type:"SET_SUCCESS_TEXT",payload:Qv("Successfully Synced","templately")})):Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(Ui([])),Vs(Qv("You have to logged in again.","templately"),{icon:"error",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(Qv("Something went wrong. You have to re-login.","templately"),{icon:"error",timer:1500})})))})).catch((function(e){r(!1),console.error("Sync Error From MyClouds: ",e)}))))}),[e.pagination,l,e.platform,e.retry]),Object(o.useEffect)((function(){if(P){if(!I.hasOwnProperty(e.pagination))return;if(I.hasOwnProperty(e.pagination)){var t=[];I[e.pagination]&&I[e.pagination].length>0&&I[e.pagination].map((function(n){t.push(U?i.a.createElement(Gm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}):i.a.createElement(Fm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}))})),m(t)}}else if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&(l||s||!1===n)){g(e.clouds[e.platform].total_page);var a=[];e.clouds[e.platform][e.pagination].length>0&&e.clouds[e.platform][e.pagination].map((function(t){a.push(U?i.a.createElement(Gm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}):i.a.createElement(Fm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}))})),m(a),c(!1)}}),[e.clouds,s,n,e.pagination,l,e.platform,A,_,U]),Object(o.useEffect)((function(){e.clouds.hasOwnProperty(e.platform)&&g(e.clouds[e.platform].total_page||0)}),[e.platform]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Xm,null),e.isLoggedIn&&i.a.createElement(Em,null,n&&i.a.createElement(Jd,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ev,{visibility:!1,title:"My Cloud"},i.a.createElement("div",{className:"templately-cloud-searchbox"},i.a.createElement(Wg,{className:"templately-cloud-search",value:b,onChange:function(e){return w(e.target.value)},onKeyDown:function(e){return j(13===e.keyCode)},placeholder:Qv("Type and press enter...","templately")}),!P&&i.a.createElement(Id,{onClick:function(){return j(!0)},className:"templately-cloud-search-clear tsearch"},i.a.createElement(ii,null)),P&&i.a.createElement(Id,{onClick:function(){return N(!0)},className:"templately-cloud-search-clear"},i.a.createElement(si,null))),i.a.createElement(Ov,{grid:U,setGrid:B})),i.a.createElement("div",{className:"templately-my-clouds"},i.a.createElement(Ef,{className:"templately-clouds-table"},d.length>0&&i.a.createElement(i.a.Fragment,null,!U&&i.a.createElement(_f,null),!s&&i.a.createElement(qd,{className:"templately-table-body ".concat(U?"templately-templates-grid-view":"")},d),s&&i.a.createElement(Jd,null)),0===d.length&&!s&&i.a.createElement(Pv,null)),i.a.createElement(Yd,{type:"clouds",count:y})))))}));function Yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jv=nt((function(e){return{workspaces:e.sharedWorkspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=Yv(Object(o.useState)([]),2),n=t[0],r=t[1],a=Yv(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Yv(Object(o.useState)(1),2),s=u[0],f=u[1],p=Yv(Object(o.useState)(!1),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0?c(!1):(c(!0),Zs(!0,!0,{page:1}).then((function(t){t.data.success?(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"SHARED_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}),c(!1)):(c(!1),e.dispatch(yi("string"==typeof t.data.data?t.data.data:"")))})).catch((function(e){return console.error("Something went wrong: regarding fetching Shared WorkSpace list",e)})))}),[e.retry]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(rv,{key:n,shared:!0,content:e}))})),r(t)}}),[e.workspaces]),i.a.createElement(Em,null,i.a.createElement("div",{className:"templately-my-workspace-item-view-buttons"},i.a.createElement(Ov,{grid:d,setGrid:m})),i.a.createElement("div",{className:"templately-my-workspace templately-shared-workspace-wrapper ".concat(d?"":"templately-list-view")},!l&&n,!l&&0===n.length&&i.a.createElement(Pv,null),l&&i.a.createElement(Jd,null)),i.a.createElement(Yd,{type:"shared_workspace",count:s}))})),Zv=(TemplatelyAdmin.default_image,wp.i18n.__),eb=function(e){var t,n,r=e.categoryName,a=e.pack,o=e.content;return i.a.createElement("div",{className:"templately-preview-widget"},i.a.createElement("div",{className:"templately-item-meta"},r&&i.a.createElement("p",null,i.a.createElement("span",null,Zv("Category","templately")," : "),i.a.createElement(ge,{to:"/".concat(a?"".concat(o.type,"s"):"","?cat_id=").concat(null===(t=o.category)||void 0===t?void 0:t.id)},i.a.createElement("span",null,r))),a&&i.a.createElement("p",null,i.a.createElement("span",null,Zv("Item Parent","templately")," : "),i.a.createElement(ge,{to:"/pack/".concat(null==a?void 0:a.slug)},i.a.createElement("span",null,null==a?void 0:a.name)))),(null==o||null===(n=o.dependencies)||void 0===n?void 0:n.length)>0&&i.a.createElement("div",{className:"templately-item-meta templately-dependencies-wrapper"},i.a.createElement("p",null,i.a.createElement("span",null,Zv("Dependencies","templately")," :")),i.a.createElement("ul",{className:"templately-dependencies"},o.dependencies.map((function(e,t){return i.a.createElement("li",{key:t,"data-name":e.name},(null==e?void 0:e.icon)&&i.a.createElement("img",{src:e.icon,alt:e.name}))})))),i.a.createElement("div",{className:"templately-item-meta"},i.a.createElement("ul",null,i.a.createElement("li",null,i.a.createElement(ni,{fontSize:"20px",color:"rgb(245, 54, 91)"})," ",null!=e.favourite?e.favourite:0),i.a.createElement("li",null,i.a.createElement(li,{fontSize:"20px",color:"rgb(255, 220, 99)"})," ",null!=e.rating?e.rating.toFixed(1):0),i.a.createElement("li",null,i.a.createElement(Zo,{fontSize:"20px",color:"rgb(96, 114, 255)"})," ",null!=e.downloads?e.downloads:0))))};function tb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rb=nt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=e.items,n=null!=t.items&&t.items,r=tb(Object(o.useState)([]),2),a=r[0],l=r[1];return Object(o.useEffect)((function(){n&&(e.dispatch(Ii(n)),e.dispatch(Di(n)))}),[e.items]),Object(o.useEffect)((function(){if(n.length>0&&n){var t=[];e.filtered.map((function(e,n){t.push(i.a.createElement(Fh,{type:e.type,key:n,content:e}))})),l(t)}}),[e.filtered]),i.a.createElement("div",{className:"templately-item-details-preview"},n.length>0&&null!=n.length&&a,!1===n&&i.a.createElement(Fh,{key:t.id,type:t.type,content:t}))})),ab=wp.i18n.__,ob=function(e){var t,n,r,a=e.content,o=e.pack;return null!=a&&null!==(t=a.tags)&&void 0!==t&&t.length?i.a.createElement("div",{className:"templately-item-details-box"},(null==a||null===(n=a.tags)||void 0===n?void 0:n.length)>0&&i.a.createElement("div",{className:"templately-item-tags"},i.a.createElement("h3",null,ab("Tags","templately")),i.a.createElement("p",null,null==a||null===(r=a.tags)||void 0===r?void 0:r.map((function(e){return i.a.createElement(ge,{to:"/".concat(o?"".concat(a.type,"s"):"","?tag_id=").concat(null==e?void 0:e.id),key:null==e?void 0:e.id},i.a.createElement("span",null,e.name))}))))):""};function ib(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cb=nt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=ib(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(!1!==n){var t=e.all_items.filter((function(e){return e.category.id===n}));e.dispatch(Di(t)),e.dispatch(Mi({ulActive:!1})),r(!1)}}),[n]),i.a.createElement("li",null,i.a.createElement("span",{onClick:function(){return r(e.catID)}},e.name,i.a.createElement("span",null,"( ",e.count," )")))}));function ub(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fb=wp.i18n.__,pb=nt((function(e){return{all_items:e.common.all_items,ulActive:e.common.activeBlockOrPage.ulActive,blockClick:e.common.activeBlockOrPage.blocksBtnClick,pageClick:e.common.activeBlockOrPage.pagesBtnClick}}))((function(e){var t=ub(Object(o.useState)("all"),2),n=t[0],r=t[1],a=ub(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ub(Object(o.useState)(!1),2),s=u[0],f=u[1],p=ub(Object(o.useState)(!1),2),d=(p[0],p[1],e.items.items),m=[],h=[],y=0,g=0;null!=d&&d.map((function(e,t){var n=e.category&&null!=e.category.name?e.category.name:"None",r={};if("block"==e.type&&null!==e.category){var a=Qs(e.category.id,m),o=Gs(e.category.id,m);m=o,y++,r.name=n,r.id=e.category.id,r.count=++a,m.push(r),r={}}if("page"==e.type&&null!==e.category){var i=Qs(e.category.id,h),l=Gs(e.category.id,h);h=l,g++,r.name=n,r.id=e.category.id,r.count=++i,h.push(r),r={}}}));var v=[],b=[];return m.map((function(e){v.push(i.a.createElement(cb,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),h.map((function(e){b.push(i.a.createElement(cb,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),Object(o.useEffect)((function(){e.ulActive||(f(!1),c(!1))}),[e.ulActive]),Object(o.useEffect)((function(){"blocks"===n&&l&&e.dispatch(Mi({ulActive:"blocks"})),"blocks"!==n||l||e.dispatch(Mi({ulActive:!1})),"pages"===n&&s&&e.dispatch(Mi({ulActive:"pages"})),"pages"!==n||s||e.dispatch(Mi({ulActive:!1}))}),[s,l,n]),i.a.createElement("div",{className:"templately-pack-preview-header"},i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("all"===n?"epp-btn-active":""),onClick:function(){r("all"),f(!1),c(!1),e.dispatch(Di(e.all_items))}},fb("All","templately"))),y>0&&i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("blocks"===n?"epp-btn-active":""),onClick:function(){r("blocks"),f(!1),c(!l)}},i.a.createElement("span",{className:"epp-item-count"},"(",y,")"),fb("Blocks","templately")," ",i.a.createElement(Qo,null)),v.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("blocks"===e.ulActive&&"epp-active")},v)),g>0&&i.a.createElement("div",{className:"epp-right epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-pages ".concat("pages"===n?"epp-btn-active":""),onClick:function(){r("pages"),c(!1),f(!s)}},i.a.createElement("span",{className:"epp-item-count"},"(",g,")"),fb("Pages","templately")," ",i.a.createElement(Qo,null)),b.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("pages"===e.ulActive&&"epp-active")},b)))}));function db(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hb=nt((function(e){return{common:e.common,retry:e.common.retry,loading:e.common.loading}}))((function(e){var t,n=db(Object(o.useState)(!1),2),r=n[0],a=n[1],l=db(Object(o.useState)(!1),2),c=l[0],u=l[1],s=db(Object(o.useState)(!0),2),f=s[0],p=s[1];return Object(o.useEffect)((function(){var t=e.preview.slug;p(!0),rf({id:e.preview.id,slug:t,type:e.preview.type}).then((function(t){var n,r,o,i,l,c;null!=t&&null!==(n=t.data)&&void 0!==n&&n.success?(p(!1),(null==t||null===(r=t.data)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.length)>0&&null!=t&&null!==(i=t.data)&&void 0!==i&&null!==(l=i.data)&&void 0!==l&&null!==(c=l[0])&&void 0!==c&&c.author&&(a(t.data.data[0].author),u(t.data.data[0]))):null!=t&&t.data&&"string"==typeof t.data&&(p(!1),e.dispatch(yi(t.data)))})).catch((function(e){return console.error("Preview Layout Error: ",e)}))}),[e.preview,e.retry]),i.a.createElement(wf,null,(!c||!r||f||e.loading)&&i.a.createElement(Jd,null),c&&r&&!f&&!e.loading&&i.a.createElement("div",{className:"templately-preview-wrapper",onClick:function(){return e.dispatch(Mi({ulActive:!1}))}},i.a.createElement("div",{className:"templately-preview-body"},"pack"===e.rootType&&i.a.createElement(i.a.Fragment,null,i.a.createElement(pb,{items:c})),i.a.createElement(rb,{singleItem:e.singleItem,rootType:e.rootType,items:c})),i.a.createElement("div",{className:"templately-preview-sidebar"},i.a.createElement(eb,{content:c,categoryName:null==c||null===(t=c.category)||void 0===t?void 0:t.name,pack:null==c?void 0:c.pack,rating:null==c?void 0:c.rating,favourite:null==c?void 0:c.favourite_count,downloads:null==c?void 0:c.downloads}),i.a.createElement(ob,{content:c,pack:null==c?void 0:c.pack}))))}));function yb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yb(Object(n),!0).forEach((function(t){vb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Eb=wp.i18n.__,Ob=TemplatelyAdmin,Sb=Ob.is_editor,kb=Ob.platform,_b=nt((function(e){return{preview:e.preview,platform:e.common.platform,platform_exists:e.common.platforms,isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=bb(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(0!=n){if(!e.isLoggedIn)return e.dispatch(Vi("/sign-in")),void r(!1);Vs("",{showCloseButton:!0,allowOutsideClick:!1,target:Sb?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xh,{dependencyList:e.content.dependencies,platform:e.platform,title:e.content.name,content:e.content})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(gi(gb(gb({},e.platform_exists),{},vb({},"elementor",!0)))),e.dispatch(_i(!0)),Ws(n,"remote",{fileType:e.platform,is_editor:Boolean(Sb)}).then((function(t){if(!0===t)"gutenberg"!==kb?window.TemplatelyModal.destroy():Eu.close(),e.dispatch(_i(!0));else{e.dispatch(_i(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),Vs("",{icon:"error",html:i.a.createElement(sf,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},"Upgrade to Pro"))})})}})))})),r(!1)}}),[n]),i.a.createElement("div",{className:"templately-block-preview-header"},i.a.createElement("div",{className:"ep-right"},i.a.createElement("button",{onClick:function(){return r(e.itemID)},className:"ep-preview-insert"},Eb("Insert","templately")," ",i.a.createElement(Zo,null))))}));n(135);function jb(e){return(jb="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 xb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cb=function(e){var t=xb(Object(o.useState)(!0),2),n=t[0],r=t[1],a=xb(Object(o.useState)(!1),2),l=a[0],c=a[1],u=xb(Object(o.useState)("desktop"),2),s=u[0],f=u[1],p=xb(Object(o.useState)("100%"),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){"mobile"==s&&m("480px"),"tablet"==s&&m("786px"),"desktop"==s&&m("100%")}),[s,l]),Object(o.useEffect)((function(){"page"===e.preview.type&&e.preview.pageSlug,"block"===e.preview.type&&e.preview.itemSlug,"pack"===e.preview.type&&e.preview.packSlug,rf({type:e.preview.type,slug:e.preview.slug}).then((function(e){e.data.success&&c(e.data.data[0])})).catch((function(e){return console.error("GetItem Error For Preview: ",e)}))}),[e]),i.a.createElement("div",{className:"templately-preview-html-or-image"},!l&&i.a.createElement(Jd,null),"object"==jb(l)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(_b,{itemID:l.id,content:l}),i.a.createElement("div",{className:"templately-preview-image-wrapper"},i.a.createElement("div",{className:"templately-preview-hover"},i.a.createElement("button",{onClick:function(){return f("mobile")},className:"mobile"==s?"preview-active":""},i.a.createElement(ai,null)),i.a.createElement("button",{onClick:function(){return f("tablet")},className:"tablet"==s?"preview-active":""},i.a.createElement(ci,null)),i.a.createElement("button",{onClick:function(){return f("desktop")},className:"desktop"==s?"preview-active":""},i.a.createElement(Jo,null))),n&&i.a.createElement(Jd,null),i.a.createElement("iframe",{onLoad:function(){return r(!1)},loading:"eager",id:"templately-preview-iframe",className:Pf()("templately-preview-iframe",{"templately-iframe-loaded":!n}),width:d,height:"100%",src:l.live_url}))))},Tb=nt((function(e){return{loading:e.common.loading}}))((function(e){var t=se(),n=lf(),r=Object(o.useRef)(null);return Object(o.useEffect)((function(){return r.current=!0,r.current&&e.dispatch(ki({isOpen:!0,isSingle:!0})),function(){r.current=!1,e.dispatch(ki({isOpen:!1,isSingle:!1}))}}),[]),i.a.createElement(i.a.Fragment,null,Boolean(n.get("preview"))&&i.a.createElement(Cb,{rootType:t.type,preview:{slug:t.slug,type:t.type}}),!Boolean(n.get("preview"))&&i.a.createElement(hb,{singleItem:!0,rootType:t.type,preview:{slug:t.slug,type:t.type}}))}));function Ab(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Db=TemplatelyAdmin.is_editor,Mb=wp.i18n.__,Rb=nt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,currentRoutes:e.common.current_route,platform:e.common.platform}}))((function(e){var t=ue(),n=Lb(Object(o.useState)(!1),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){var t;r&&(t=new FormData,t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","verification_done"),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(t){if(t.data.data){a(!1);var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ab(Object(n),!0).forEach((function(t){Nb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ab(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.user);delete n.is_verified,e.dispatch(Ui(n))}})).catch((function(e){return console.error("ERROR: ",e)}))}),[r]),Object(o.useEffect)((function(){e.isLoggedIn||"/"!==t.pathname||window.elementorFrontend||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){switch(t.pathname){case"/templates":"gutenberg"===e.platform&&e.dispatch(Vi("/"));break;case"/blocks":"gutenberg"===e.platform?e.dispatch(Vi("/")):e.dispatch(Vi("/blocks"));break;case"/packs":"gutenberg"===e.platform?e.dispatch(Vi("/packs")):e.dispatch(Vi("/"))}}),[e.platform,t]),i.a.createElement("div",{className:"templately-modal-body templately-".concat(e.platform,"-platform ").concat(!Db&&!e.user.hasOwnProperty("status")&&e.isLoggedIn||"/settings"===t.pathname||"/sign-in"===t.pathname?"templately-admin-form":"")},null!=e.currentRoutes&&i.a.createElement(Y,{to:"".concat(e.currentRoutes)}),i.a.createElement(ie,null,i.a.createElement(ee,{exact:!0,path:"/sign-in",component:Qy}),i.a.createElement(ee,{exact:!0,path:"/pages",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/search/:query",component:Bg}),i.a.createElement(ee,{exact:!0,path:"/blocks",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/packs",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/templates",component:nm}),i.a.createElement(ee,{exact:!0,path:"/templates/save",component:function(){return i.a.createElement(dm,e)}}),i.a.createElement(ee,{exact:!0,path:"/clouds",component:Gv}),i.a.createElement(ee,{exact:!0,path:"/workspace",component:jv}),i.a.createElement(ee,{exact:!0,path:"/workspace/:slug",component:$v}),i.a.createElement(ee,{exact:!0,path:"/shared/workspace",component:Jv}),i.a.createElement(ee,{exact:!0,path:"/shared/workspace/:slug",component:$v}),i.a.createElement(ee,{exact:!0,path:"/settings",component:Ly}),i.a.createElement(ee,{exact:!0,path:"/profile",component:Cy}),i.a.createElement(ee,{exact:!0,path:"/:type/:slug",component:Tb})),!1===e.user.is_verified&&i.a.createElement("div",{className:"templately-verification"},i.a.createElement("p",null,Mb("Please complete your account by the verification email we sent you, If you don't get an email","templately")," ",i.a.createElement("a",{target:"_blank",href:"https://templately.dev/resend-verification-email?email=".concat(window.btoa(e.user.email),"&from=plugin")},Mb("click here","templately"))," ",Mb("to resend verification mail.","templately")),i.a.createElement("button",{onClick:function(){return a(!0)},className:"templately-button button-primary"},"I've verified & Close")))}));function Fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ub=TemplatelyAdmin,Bb=Ub.is_logged_in,Vb=Ub.platform_exists,Wb=Ub.user_can_logout,Hb=Ub.is_linked_login,$b=Ub.is_global_login,qb=Ub.prettyurl,Kb=Ub.current_url,Qb=function(e){var t=e.toggle,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(n),!0).forEach((function(t){zb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return delete n.toggle,Fo.dispatch(gi(Vb)),""!=qb?window.history.replaceState({},"","".concat(Kb,"#").concat(qb)):Fo.dispatch(Vi(e.route)),Fo.dispatch(xi(Boolean(Bb))),Fo.dispatch(di(Boolean(Wb))),Fo.dispatch(hi(Boolean(Hb))),Fo.dispatch(mi(Boolean($b))),t&&i.a.createElement(je,{store:Fo},i.a.createElement(fe,null,i.a.createElement("div",{className:"templately-modal-templately"},i.a.createElement(bf,null),i.a.createElement(Rb,n))))};function Gb(){return(Gb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yb=function(e){var t=e.toggle;return i.a.createElement("div",{id:"templatelyGutenberg"},i.a.createElement("div",{className:"templately-modal-templately-overlay",onClick:function(){return Eu.close()}}),i.a.createElement(Qb,Gb({toggle:t},e)))};function Xb(){return(Xb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Jb=TemplatelyAdmin.platform;if(window.Templately={modalOpen:function(e,t,n){c.a.render(i.a.createElement(Qb,Xb({toggle:e},t)),n)}},null!=document.getElementById("templatelyAdmin")&&c.a.render(i.a.createElement(Qb,{toggle:!0}),document.getElementById("templatelyAdmin")),"gutenberg"===Jb){var Zb=function(){Eu.open(i.a.createElement(Yb,{toggle:!0}))},ew=function(){Eu.open(i.a.createElement(Yb,{toggle:!0,route:"/templates/save",editor:"gutenberg"}))};wp.data.subscribe((function(){setTimeout((function(){var e,t,n,r;e=wp.data.select("core/editor").getCurrentPostType().toLowerCase().replace("/(?<= )[^s]|^./g",(function(e){return e.toUpperCase()})),t=document.querySelector("#editor"),n=document.querySelector(".edit-post-header-toolbar"),(r=document.createElement("div")).id="templately-guten-icon",r.innerHTML="<button class='gutenberg-add-templately-button' id='templatelyGutenbergButton'><span class='gutenberg-templately-icon'></span>Templately</button><button id='templatelyGutenbergPushButton' class='gutenberg-add-templately-button'>Save "+e+" in Templately</button>",null===t.querySelector("#templatelyGutenbergButton")&&(n.appendChild(r),document.getElementById("templatelyGutenbergButton").addEventListener("click",Zb),document.getElementById("templatelyGutenbergPushButton").addEventListener("click",ew))}),1)}))}},,,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(124)}]);
|
87 |
*
|
88 |
* This source code is licensed under the MIT license found in the
|
89 |
* LICENSE file in the root directory of this source tree.
|
90 |
+
*/var r,a,o,i,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,s=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(s,0))},a=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},i=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,d=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var y=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof p&&"function"==typeof p.now)t.unstable_now=function(){return p.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var v=!1,b=null,w=-1,E=5,O=0;i=function(){return t.unstable_now()>=O},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):E=0<e?Math.floor(1e3/e):5};var S=new MessageChannel,k=S.port2;S.port1.onmessage=function(){if(null!==b){var e=t.unstable_now();O=e+E;try{b(!0,e)?k.postMessage(null):(v=!1,b=null)}catch(e){throw k.postMessage(null),e}}else v=!1},r=function(e){b=e,v||(v=!0,k.postMessage(null))},a=function(e,n){w=m((function(){e(t.unstable_now())}),n)},o=function(){h(w),w=-1}}function _(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<P(a,t)))break e;e[r]=t,e[n]=a,n=r}}function j(e){return void 0===(e=e[0])?null:e}function x(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var o=2*(r+1)-1,i=e[o],l=o+1,c=e[l];if(void 0!==i&&0>P(i,n))void 0!==c&&0>P(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==c&&0>P(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],T=[],A=1,N=null,L=3,I=!1,D=!1,M=!1;function R(e){for(var t=j(T);null!==t;){if(null===t.callback)x(T);else{if(!(t.startTime<=e))break;x(T),t.sortIndex=t.expirationTime,_(C,t)}t=j(T)}}function F(e){if(M=!1,R(e),!D)if(null!==j(C))D=!0,r(z);else{var t=j(T);null!==t&&a(F,t.startTime-e)}}function z(e,n){D=!1,M&&(M=!1,o()),I=!0;var r=L;try{for(R(n),N=j(C);null!==N&&(!(N.expirationTime>n)||e&&!i());){var l=N.callback;if(null!==l){N.callback=null,L=N.priorityLevel;var c=l(N.expirationTime<=n);n=t.unstable_now(),"function"==typeof c?N.callback=c:N===j(C)&&x(C),R(n)}else x(C);N=j(C)}if(null!==N)var u=!0;else{var s=j(T);null!==s&&a(F,s.startTime-n),u=!1}return u}finally{N=null,L=r,I=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||I||(D=!0,r(z))},t.unstable_getCurrentPriorityLevel=function(){return L},t.unstable_getFirstCallbackNode=function(){return j(C)},t.unstable_next=function(e){switch(L){case 1:case 2:case 3:var t=3;break;default:t=L}var n=L;L=t;try{return e()}finally{L=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=L;L=e;try{return t()}finally{L=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?l+c:l,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),c=l;return e={id:A++,callback:n,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>l?(e.sortIndex=c,_(T,e),null===j(C)&&e===j(T)&&(M?o():M=!0,a(F,c-l))):(e.sortIndex=i,_(C,e),D||I||(D=!0,r(z))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();R(e);var n=j(C);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<N.expirationTime||i()},t.unstable_wrapCallback=function(e){var t=L;return function(){var n=L;L=t;try{return e.apply(this,arguments)}finally{L=n}}}},function(e,t,n){},function(e,t,n){!function(t){"use strict";var n=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var n=t(e).toLowerCase();return(r="application/font-woff",{woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var r},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var n=window.atob(e.toDataURL().split(",")[1]),r=n.length,a=new Uint8Array(r),o=0;o<r;o++)a[o]=n.charCodeAt(o);t(new Blob([a],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var n=document.implementation.createHTMLDocument(),r=n.createElement("base");n.head.appendChild(r);var a=n.createElement("a");return n.body.appendChild(a),r.href=t,a.href=e,a.href},getAndEncode:function(e){l.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(t){var n,r=new XMLHttpRequest;if(r.onreadystatechange=function(){if(4!==r.readyState)return;if(200!==r.status)return void(n?t(n):o("cannot fetch resource: "+e+", status: "+r.status));var a=new FileReader;a.onloadend=function(){var e=a.result.split(/,/)[1];t(e)},a.readAsDataURL(r.response)},r.ontimeout=function(){n?t(n):o("timeout of 30000ms occured while fetching resource: "+e)},r.responseType="blob",r.timeout=3e4,r.open("GET",e,!0),r.send(),l.impl.options.imagePlaceholder){var a=l.impl.options.imagePlaceholder.split(/,/);a&&a[1]&&(n=a[1])}function o(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))}},asArray:function(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=e}))},width:function(e){var t=n(e,"border-left-width"),r=n(e,"border-right-width");return e.scrollWidth+t+r},height:function(e){var t=n(e,"border-top-width"),r=n(e,"border-bottom-width");return e.scrollHeight+t+r}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function n(e,t){var n=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(n.replace("px",""))}}(),r=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,n,o){return function(){return!t(e)}()?Promise.resolve(e):Promise.resolve(e).then(r).then((function(t){var r=Promise.resolve(e);return t.forEach((function(e){r=r.then((function(t){return a(t,e,n,o)}))})),r}))},shouldProcess:t,impl:{readUrls:r,inline:a}};function t(t){return-1!==t.search(e)}function r(t){for(var r,a=[];null!==(r=e.exec(t));)a.push(r[1]);return a.filter((function(e){return!n.isDataUrl(e)}))}function a(e,t,r,a){return Promise.resolve(t).then((function(e){return r?n.resolveUrl(e,r):e})).then(a||n.getAndEncode).then((function(e){return n.dataAsUrl(e,n.mimeType(t))})).then((function(r){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+n.escape(e)+")(['\"]?\\))","g")}(t),"$1"+r+"$3")}))}}(),a=function(){return{resolveAll:function(){return e(document).then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{n.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return r.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),o=function(){return{inlineAll:function t(a){return a instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?r.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(a).then((function(){return a instanceof HTMLImageElement?e(a).inline():Promise.all(n.asArray(a.childNodes).map((function(e){return t(e)})))})):Promise.resolve(a)},impl:{newImage:e}};function e(e){return{inline:function(t){return n.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||n.getAndEncode).then((function(t){return n.dataAsUrl(t,n.mimeType(e.src))})).then((function(t){return new Promise((function(n,r){e.onload=n,e.onerror=r,e.src=t}))}))}}}}(),i={imagePlaceholder:void 0,cacheBust:!1},l={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(n.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,n.width(e),n.height(e)).data}))},impl:{fontFaces:a,images:o,util:n,inliner:r,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?l.impl.options.imagePlaceholder=i.imagePlaceholder:l.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?l.impl.options.cacheBust=i.cacheBust:l.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return function e(t,r,a){return a||!r||r(t)?Promise.resolve(t).then((function(e){return e instanceof HTMLCanvasElement?n.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(e){return o(t,e,r)})).then((function(e){return function(e,t){return t instanceof Element?Promise.resolve().then(r).then(a).then(o).then(i).then((function(){return t})):t;function r(){var r,a;r=window.getComputedStyle(e),a=t.style,r.cssText?a.cssText=r.cssText:function(e,t){n.asArray(e).forEach((function(n){t.setProperty(n,e.getPropertyValue(n),e.getPropertyPriority(n))}))}(r,a)}function a(){[":before",":after"].forEach((function(r){!function(r){var a=window.getComputedStyle(e,r),o=a.getPropertyValue("content");if(""===o||"none"===o)return;var i=n.uid();t.className=t.className+" "+i;var l=document.createElement("style");l.appendChild(function(e,t,r){var a="."+e+":"+t,o=r.cssText?function(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}(r):function(e){return n.asArray(e).map((function(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")})).join("; ")+";"}(r);return document.createTextNode(a+"{"+o+"}")}(i,r,a)),t.appendChild(l)}(r)}))}function o(){e instanceof HTMLTextAreaElement&&(t.innerHTML=e.value),e instanceof HTMLInputElement&&t.setAttribute("value",e.value)}function i(){t instanceof SVGElement&&(t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t instanceof SVGRectElement&&["width","height"].forEach((function(e){var n=t.getAttribute(e);n&&t.style.setProperty(e,n)})))}}(t,e)})):Promise.resolve();function o(t,r,a){var o=t.childNodes;return 0===o.length?Promise.resolve(r):i(r,n.asArray(o),a).then((function(){return r}));function i(t,n,r){var a=Promise.resolve();return n.forEach((function(n){a=a.then((function(){return e(n,r)})).then((function(e){e&&t.appendChild(e)}))})),a}}}(e,t.filter,!0)})).then(s).then(f).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(n){e.style[n]=t.style[n]}));return e})).then((function(r){return function(e,t,r){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(n.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+r+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(r,t.width||n.width(e),t.height||n.height(e))}))}function u(e,t){return c(e,t).then(n.makeImage).then(n.delay(100)).then((function(r){var a=function(e){var r=document.createElement("canvas");if(r.width=t.width||n.width(e),r.height=t.height||n.height(e),t.bgcolor){var a=r.getContext("2d");a.fillStyle=t.bgcolor,a.fillRect(0,0,r.width,r.height)}return r}(e);return a.getContext("2d").drawImage(r,0,0),a}))}function s(e){return a.resolveAll().then((function(t){var n=document.createElement("style");return e.appendChild(n),n.appendChild(document.createTextNode(t)),e}))}function f(e){return o.inlineAll(e).then((function(){return e}))}e.exports=l}()},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"find",(function(){return Ff}));var a={};n.r(a),n.d(a,"isTabbableIndex",(function(){return Uf})),n.d(a,"find",(function(){return $f})),n.d(a,"findPrevious",(function(){return qf})),n.d(a,"findNext",(function(){return Kf}));var o=n(0),i=n.n(o),l=n(12),c=n.n(l),u=n(13);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function p(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var d=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var u=0,s=a.length;s>=0;s--){var d=a[s];"."===d?p(a,s):".."===d?(p(a,s),u++):u&&(p(a,s),u--)}if(!l)for(;u--;u)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},y="Invariant failed";function g(e,t){if(!e)throw new Error(y)}function v(e){return"/"===e.charAt(0)?e:"/"+e}function b(e){return"/"===e.charAt(0)?e.substr(1):e}function w(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function E(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function O(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function S(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=d(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function k(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var _=!("undefined"==typeof window||!window.document||!window.document.createElement);function j(e,t){t(window.confirm(e))}function x(){try{return window.history.state||{}}catch(e){return{}}}function P(e){void 0===e&&(e={}),_||g(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,c=o.getUserConfirmation,u=void 0===c?j:c,f=o.keyLength,p=void 0===f?6:f,d=e.basename?E(v(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return d&&(o=w(o,d)),S(o,r,n)}function h(){return Math.random().toString(36).substr(2,p)}var y=k();function b(e){s(z,e),z.length=n.length,y.notifyListeners(z.location,z.action)}function P(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||A(m(e.state))}function C(){A(m(x()))}var T=!1;function A(e){if(T)T=!1,b();else{y.confirmTransitionTo(e,"POP",u,(function(t){t?b({action:"POP",location:e}):function(e){var t=z.location,n=L.indexOf(t.key);-1===n&&(n=0);var r=L.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(T=!0,D(a))}(e)}))}}var N=m(x()),L=[N.key];function I(e){return d+O(e)}function D(e){n.go(e)}var M=0;function R(e){1===(M+=e)&&1===e?(window.addEventListener("popstate",P),a&&window.addEventListener("hashchange",C)):0===M&&(window.removeEventListener("popstate",P),a&&window.removeEventListener("hashchange",C))}var F=!1;var z={length:n.length,action:"POP",location:N,createHref:I,push:function(e,t){var a=S(e,t,h(),z.location);y.confirmTransitionTo(a,"PUSH",u,(function(e){if(e){var t=I(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var c=L.indexOf(z.location.key),u=L.slice(0,c+1);u.push(a.key),L=u,b({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=S(e,t,h(),z.location);y.confirmTransitionTo(a,"REPLACE",u,(function(e){if(e){var t=I(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var c=L.indexOf(z.location.key);-1!==c&&(L[c]=a.key),b({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=y.setPrompt(e);return F||(R(1),F=!0),function(){return F&&(F=!1,R(-1)),t()}},listen:function(e){var t=y.appendListener(e);return R(1),function(){R(-1),t()}}};return z}var C={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+b(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:b,decodePath:v},slash:{encodePath:v,decodePath:v}};function T(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function A(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function N(e){window.location.replace(T(window.location.href)+"#"+e)}function L(e){void 0===e&&(e={}),_||g(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?j:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?E(v(e.basename)):"",c=C[i],u=c.encodePath,f=c.decodePath;function p(){var e=f(A());return l&&(e=w(e,l)),S(e)}var d=k();function m(e){s(z,e),z.length=t.length,d.notifyListeners(z.location,z.action)}var h=!1,y=null;function b(){var e,t,n=A(),r=u(n);if(n!==r)N(r);else{var o=p(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(y===O(o))return;y=null,function(e){if(h)h=!1,m();else{d.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=I.lastIndexOf(O(t));-1===n&&(n=0);var r=I.lastIndexOf(O(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,D(a))}(e)}))}}(o)}}var x=A(),P=u(x);x!==P&&N(P);var L=p(),I=[O(L)];function D(e){t.go(e)}var M=0;function R(e){1===(M+=e)&&1===e?window.addEventListener("hashchange",b):0===M&&window.removeEventListener("hashchange",b)}var F=!1;var z={length:t.length,action:"POP",location:L,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=T(window.location.href)),n+"#"+u(l+O(e))},push:function(e,t){var n=S(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=O(n),r=u(l+t);if(A()!==r){y=t,function(e){window.location.hash=e}(r);var a=I.lastIndexOf(O(z.location)),o=I.slice(0,a+1);o.push(t),I=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=S(e,void 0,void 0,z.location);d.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=O(n),r=u(l+t);A()!==r&&(y=t,N(r));var a=I.indexOf(O(z.location));-1!==a&&(I[a]=t),m({action:"REPLACE",location:n})}}))},go:D,goBack:function(){D(-1)},goForward:function(){D(1)},block:function(e){void 0===e&&(e=!1);var t=d.setPrompt(e);return F||(R(1),F=!0),function(){return F&&(F=!1,R(-1)),t()}},listen:function(e){var t=d.appendListener(e);return R(1),function(){R(-1),t()}}};return z}function I(e,t,n){return Math.min(Math.max(e,t),n)}function D(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=k();function f(e){s(g,e),g.length=g.entries.length,u.notifyListeners(g.location,g.action)}function p(){return Math.random().toString(36).substr(2,c)}var d=I(i,0,a.length-1),m=a.map((function(e){return S(e,void 0,"string"==typeof e?p():e.key||p())})),h=O;function y(e){var t=I(g.index+e,0,g.entries.length-1),r=g.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var g={length:m.length,action:"POP",location:m[d],index:d,entries:m,createHref:h,push:function(e,t){var r=S(e,t,p(),g.location);u.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=S(e,t,p(),g.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=g.index+e;return t>=0&&t<g.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return g}var M=n(59),R=n(41),F=n.n(R);n(82);function z(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var U=n(24),B=n.n(U),V=function(e){var t=Object(M.a)();return t.displayName=e,t},W=V("Router-History"),H=V("Router"),$=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(u.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.a.createElement(H.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.a.createElement(W.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.a.Component);i.a.Component;var q=function(e){function t(){return e.apply(this,arguments)||this}Object(u.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(i.a.Component);var K={},Q=0;function G(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(K[e])return K[e];var t=F.a.compile(e);return Q<1e4&&(K[e]=t,Q++),t}(e)(t,{pretty:!0})}function Y(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var r=e.history,o=e.staticContext,l=a?r.push:r.replace,c=S(t?"string"==typeof n?G(n,t.params):s({},n,{pathname:G(n.pathname,t.params)}):n);return o?(l(c),null):i.a.createElement(q,{onMount:function(){l(c)},onUpdate:function(e,t){var n,r,a=S(t.to);n=a,r=s({},c,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(c)},to:n})}))}var X={},J=0;function Z(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,c=n.sensitive,u=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=X[n]||(X[n]={});if(r[e])return r[e];var a=[],o={regexp:F()(e,a,t),keys:a};return J<1e4&&(r[e]=o,J++),o}(n,{end:o,strict:l,sensitive:u}),a=r.regexp,i=r.keys,c=a.exec(e);if(!c)return null;var s=c[0],f=c.slice(1),p=e===s;return o&&!p?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:p,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var ee=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(H.Consumer,null,(function(t){t||g(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Z(n.pathname,e.props):t.match}),a=e.props,o=a.children,l=a.component,c=a.render;return Array.isArray(o)&&function(e){return 0===i.a.Children.count(e)}(o)&&(o=null),i.a.createElement(H.Provider,{value:r},r.match?o?"function"==typeof o?o(r):o:l?i.a.createElement(l,r):c?c(r):null:"function"==typeof o?o(r):null)}))},t}(i.a.Component);function te(e){return"/"===e.charAt(0)?e:"/"+e}function ne(e,t){if(!e)return t;var n=te(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function re(e){return"string"==typeof e?e:O(e)}function ae(e){return function(){g(!1)}}function oe(){}i.a.Component;var ie=function(e){function t(){return e.apply(this,arguments)||this}return Object(u.a)(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(H.Consumer,null,(function(t){t||g(!1);var n,r,a=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?Z(a.pathname,s({},e.props,{path:o})):t.match}})),r?i.a.cloneElement(n,{location:a,computedMatch:r}):null}))},t}(i.a.Component);var le=i.a.useContext;function ce(){return le(W)}function ue(){return le(H).location}function se(){var e=le(H).match;return e?e.params:{}}i.a.Component;var fe=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=L(t.props),t}return Object(u.a)(t,e),t.prototype.render=function(){return i.a.createElement($,{history:this.history,children:this.props.children})},t}(i.a.Component);var pe=function(e,t){return"function"==typeof e?e(t):e},de=function(e,t){return"string"==typeof e?S(e,null,null,t):e},me=function(e){return e},he=i.a.forwardRef;void 0===he&&(he=me);var ye=he((function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=z(e,["innerRef","navigate","onClick"]),l=o.target,c=s({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=me!==he&&t||n,i.a.createElement("a",c)}));var ge=he((function(e,t){var n=e.component,r=void 0===n?ye:n,a=e.replace,o=e.to,l=e.innerRef,c=z(e,["component","replace","to","innerRef"]);return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var n=e.history,u=de(pe(o,e.location),e.location),f=u?n.createHref(u):"",p=s({},c,{href:f,navigate:function(){var t=pe(o,e.location),r=O(e.location)===O(de(t));(a||r?n.replace:n.push)(t)}});return me!==he?p.ref=t||l:p.innerRef=l,i.a.createElement(r,p)}))})),ve=function(e){return e},be=i.a.forwardRef;void 0===be&&(be=ve);be((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,a=e.activeClassName,o=void 0===a?"active":a,l=e.activeStyle,c=e.className,u=e.exact,f=e.isActive,p=e.location,d=e.sensitive,m=e.strict,h=e.style,y=e.to,v=e.innerRef,b=z(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return i.a.createElement(H.Consumer,null,(function(e){e||g(!1);var n=p||e.location,a=de(pe(y,n),n),w=a.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=E?Z(n.pathname,{path:E,exact:u,sensitive:d,strict:m}):null,S=!!(f?f(O,n):O),k="function"==typeof c?c(S):c,_="function"==typeof h?h(S):h;S&&(k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(k,o),_=s({},_,l));var j=s({"aria-current":S&&r||null,className:k,style:_,to:a},b);return ve!==be?j.ref=t||v:j.innerRef=v,i.a.createElement(ge,j)}))}));var we=i.a.createContext(null);var Ee=function(e){e()};function Oe(){var e=Ee,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,a=n={callback:e,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){r&&null!==t&&(r=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var Se={notify:function(){},get:function(){return[]}};function ke(e,t){var n,r=Se;function a(){i.onStateChange&&i.onStateChange()}function o(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Oe())}var i={addNestedSub:function(e){return o(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return Boolean(n)},trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=Se)},getListeners:function(){return r}};return i}var _e="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;var je=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=ke(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),l=Object(o.useMemo)((function(){return t.getState()}),[t]);_e((function(){var e=a.subscription;return e.trySubscribe(),l!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,l]);var c=n||we;return i.a.createElement(c.Provider,{value:a},r)},xe=n(56),Pe=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Ce=["reactReduxForwardedRef"],Te=[],Ae=[null,null];function Ne(e,t){var n=e[1];return[t.payload,n+1]}function Le(e,t,n){_e((function(){return e.apply(void 0,t)}),n)}function Ie(e,t,n,r,a,o,i){e.current=r,t.current=a,n.current=!1,o.current&&(o.current=null,i())}function De(e,t,n,r,a,o,i,l,c,u){if(e){var s=!1,f=null,p=function(){if(!s){var e,n,p=t.getState();try{e=r(p,a.current)}catch(e){n=e,f=e}n||(f=null),e===o.current?i.current||c():(o.current=e,l.current=e,i.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(s=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}}var Me=function(){return[null,0]};function Re(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,l=n.methodName,c=void 0===l?"connectAdvanced":l,u=n.renderCountProp,f=void 0===u?void 0:u,p=n.shouldHandleStateChanges,d=void 0===p||p,m=n.storeKey,h=void 0===m?"store":m,y=(n.withRef,n.forwardRef),g=void 0!==y&&y,v=n.context,b=void 0===v?we:v,w=z(n,Pe),E=b;return function(t){var n=t.displayName||t.name||"Component",r=a(n),l=s({},w,{getDisplayName:a,methodName:c,renderCountProp:f,shouldHandleStateChanges:d,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),u=w.pure;var p=u?o.useMemo:function(e){return e()};function m(n){var r=Object(o.useMemo)((function(){var e=n.reactReduxForwardedRef,t=z(n,Ce);return[n.context,e,t]}),[n]),a=r[0],c=r[1],u=r[2],f=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(xe.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:E}),[a,E]),m=Object(o.useContext)(f),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(m)&&Boolean(m.store);var y=h?n.store:m.store,g=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,l)}(y)}),[y]),v=Object(o.useMemo)((function(){if(!d)return Ae;var e=ke(y,h?null:m.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[y,h,m]),b=v[0],w=v[1],O=Object(o.useMemo)((function(){return h?m:s({},m,{subscription:b})}),[h,m,b]),S=Object(o.useReducer)(Ne,Te,Me),k=S[0][0],_=S[1];if(k&&k.error)throw k.error;var j=Object(o.useRef)(),x=Object(o.useRef)(u),P=Object(o.useRef)(),C=Object(o.useRef)(!1),T=p((function(){return P.current&&u===x.current?P.current:g(y.getState(),u)}),[y,k,u]);Le(Ie,[x,j,C,u,T,P,w]),Le(De,[d,y,b,g,x,j,C,P,w,_],[y,b,g]);var A=Object(o.useMemo)((function(){return i.a.createElement(t,s({},T,{ref:c}))}),[c,t,T]);return Object(o.useMemo)((function(){return d?i.a.createElement(f.Provider,{value:O},A):A}),[f,A,O])}var y=u?i.a.memo(m):m;if(y.WrappedComponent=t,y.displayName=m.displayName=r,g){var v=i.a.forwardRef((function(e,t){return i.a.createElement(y,s({},e,{reactReduxForwardedRef:t}))}));return v.displayName=r,v.WrappedComponent=t,B()(v,t)}return B()(y,t)}}function Fe(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ze(e,t){if(Fe(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!Fe(e[n[a]],t[n[a]]))return!1;return!0}function Ue(e){return function(t,n){var r=e(t,n);function a(){return r}return a.dependsOnOwnProps=!1,a}}function Be(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Ve(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Be(e);var a=r(t,n);return"function"==typeof a&&(r.mapToProps=a,r.dependsOnOwnProps=Be(a),a=r(t,n)),a},r}}var We=[function(e){return"function"==typeof e?Ve(e):void 0},function(e){return e?void 0:Ue((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?Ue((function(t){return function(e,t){var n={},r=function(r){var a=e[r];"function"==typeof a&&(n[r]=function(){return t(a.apply(void 0,arguments))})};for(var a in e)r(a);return n}(e,t)})):void 0}];var He=[function(e){return"function"==typeof e?Ve(e):void 0},function(e){return e?void 0:Ue((function(){return{}}))}];function qe(e,t,n){return s({},n,e,t)}var Ke=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,a=n.pure,o=n.areMergedPropsEqual,i=!1;return function(t,n,l){var c=e(t,n,l);return i?a&&o(c,r)||(r=c):(i=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return qe}}];var Qe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ge(e,t,n,r){return function(a,o){return n(e(a,o),t(r,o),o)}}function Ye(e,t,n,r,a){var o,i,l,c,u,s=a.areStatesEqual,f=a.areOwnPropsEqual,p=a.areStatePropsEqual,d=!1;function m(a,d){var m,h,y=!f(d,i),g=!s(a,o);return o=a,i=d,y&&g?(l=e(o,i),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):y?(e.dependsOnOwnProps&&(l=e(o,i)),t.dependsOnOwnProps&&(c=t(r,i)),u=n(l,c,i)):g?(m=e(o,i),h=!p(m,l),l=m,h&&(u=n(l,c,i)),u):u}return function(a,s){return d?m(a,s):(l=e(o=a,i=s),c=t(r,i),u=n(l,c,i),d=!0,u)}}function Xe(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,a=t.initMergeProps,o=z(t,Qe),i=n(e,o),l=r(e,o),c=a(e,o);return(o.pure?Ye:Ge)(i,l,c,e,o)}var Je=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Ze(e,t,n){for(var r=t.length-1;r>=0;r--){var a=t[r](e);if(a)return a}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function et(e,t){return e===t}function tt(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Re:n,a=t.mapStateToPropsFactories,o=void 0===a?He:a,i=t.mapDispatchToPropsFactories,l=void 0===i?We:i,c=t.mergePropsFactories,u=void 0===c?Ke:c,f=t.selectorFactory,p=void 0===f?Xe:f;return function(e,t,n,a){void 0===a&&(a={});var i=a,c=i.pure,f=void 0===c||c,d=i.areStatesEqual,m=void 0===d?et:d,h=i.areOwnPropsEqual,y=void 0===h?ze:h,g=i.areStatePropsEqual,v=void 0===g?ze:g,b=i.areMergedPropsEqual,w=void 0===b?ze:b,E=z(i,Je),O=Ze(e,o,"mapStateToProps"),S=Ze(t,l,"mapDispatchToProps"),k=Ze(n,u,"mergeProps");return r(p,s({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:O,initMapDispatchToProps:S,initMergeProps:k,pure:f,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var nt=tt();function rt(){return Object(o.useContext)(we)}function at(e){void 0===e&&(e=we);var t=e===we?rt:function(){return Object(o.useContext)(e)};return function(){return t().store}}var ot=at();function it(e){void 0===e&&(e=we);var t=e===we?ot:at(e);return function(){return t().dispatch}}var lt=it(),ct=function(e,t){return e===t};function ut(e){void 0===e&&(e=we);var t=e===we?rt:function(){return Object(o.useContext)(e)};return function(e,n){void 0===n&&(n=ct);var r=t(),a=function(e,t,n,r){var a,i=Object(o.useReducer)((function(e){return e+1}),0)[1],l=Object(o.useMemo)((function(){return ke(n,r)}),[n,r]),c=Object(o.useRef)(),u=Object(o.useRef)(),s=Object(o.useRef)(),f=Object(o.useRef)(),p=n.getState();try{if(e!==u.current||p!==s.current||c.current){var d=e(p);a=void 0!==f.current&&t(d,f.current)?f.current:d}else a=f.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return _e((function(){u.current=e,s.current=p,f.current=a,c.current=void 0})),_e((function(){function e(){try{var e=n.getState();if(e===s.current)return;var r=u.current(e);if(t(r,f.current))return;f.current=r,s.current=e}catch(e){c.current=e}i()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}}),[n,l]),a}(e,n,r.store,r.subscription);return Object(o.useDebugValue)(a),a}}var st,ft=ut();st=l.unstable_batchedUpdates,Ee=st;var pt=n(1);function dt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var mt="function"==typeof Symbol&&Symbol.observable||"@@observable",ht=function(){return Math.random().toString(36).substring(7).split("").join(".")},yt={INIT:"@@redux/INIT"+ht(),REPLACE:"@@redux/REPLACE"+ht(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ht()}};function gt(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Et={},Ot=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Et,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_ITEMS":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=bt({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_ITEMS":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=bt({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"BLOCKS_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=b.platform,S=w,k=E,_=bt({},e);return _.hasOwnProperty(O)?_=bt(bt({},_[O]),{},{currentPage:S,totalPages:k}):_[O]={currentPage:S,totalPages:k},_;case"BLOCKS_CURRENT_PAGE":var j=t.payload,x=bt(bt({},e),{},{currentPage:j});return x;default:return e}};function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?St(Object(n),!0).forEach((function(t){_t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jt={},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PAGES":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=kt({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_PAGES":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=kt({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"PAGES_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=kt(kt({},e),{},{totalPages:E,currentPage:w});return O;case"PAGES_CURRENT_PAGE":var S=t.payload,k=kt(kt({},e),{},{currentPage:S});return k;default:return e}};function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(n),!0).forEach((function(t){Tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var At={},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:At,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ALL_PACKS":var n,r=t.payload,a=r.current_page,o=r.data,i=r.platform,l=r.total_page,c=r.plan,u=Ct({},e);return u.hasOwnProperty(c)||(u[c]={}),null!==(n=u[c])&&void 0!==n&&n[i]||(u[c][i]={}),u[c][i].total_page=l,u[c][i].current_page=a,u[c][i][a]=o,u;case"ALL_CATEGORY_PACKS":var s=t.payload,f=s.categoryID,p=s.current_page,d=s.data,m=s.platform,h=s.total_page,y=s.plan,g=Ct({},e),v={};return v.current_page=p,v.total_page=h,v[p]=d,g.hasOwnProperty(y)?g[y].hasOwnProperty(m)?g[y][m].hasOwnProperty("categoryData")?g[y][m].categoryData.hasOwnProperty(f)?g[y][m].categoryData[f][p]=d:g[y][m].categoryData[f]=v:(g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v):(g[y]={},g[y][m]={},g[y][m].categoryData={},g[y][m].categoryData[f]=v),g;case"PACKS_TOTAL_PAGES":var b=t.payload,w=b.current_page,E=b.total_page,O=Ct(Ct({},e),{},{totalPages:E,currentPage:w});return O;case"PACKS_CURRENT_PAGE":var S=t.payload,k=Ct(Ct({},e),{},{currentPage:S});return k;default:return e}};function Lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function It(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){Dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mt={isOpen:!1,type:!1,deep:0},Rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"PREVIEW":var n=e;n.previousType=n.type;var r=It(It({},n),t.payload);return r;default:return e}};function Ft(e){return function(e){if(Array.isArray(e))return zt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(n),!0).forEach((function(t){Vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wt=TemplatelyAdmin,Ht=Wt.cloud_map,$t=Wt.platform,qt={platforms:Wt.platform_exists,platform:"templately"===$t?"elementor":$t,plan:"all",current_route:null,previous_route:null,next_route:null,isLoggedIn:!1,isTemplate:!1,successText:null,loading:!1,itemLoading:!1,templates:{current_page:1,total_page:null},cloud_files:{search:{}},cloud_map:Ht||[],activeSidebar:{activeSidebarMenu:"all",activeParentSidebarMenu:"",categoryFor:"blocks"},dependencyFilter:{filterActive:!1,filtersID:null,filtersResults:{}},all_items:[],filtered_items:[],activeBlockOrPage:{type:"all",ulActive:!1,id:null},pagination:1,need_pagination:!1,pagination_loading:!1,pushed_time:null,searchQuery:{query:"",results:[]},cloud_usage_limit:{limit:10,files:0},workspace_slug:!1,retry:!1,retryMessage:"",tags:[],is_global_login:!1,user_can_logout:!1,is_linked_login:!1,filter:{from:"wrapper"}},Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FILTER_FROM":var n=Bt({},e);return Bt(Bt({},n),{},{filter:Bt(Bt({},n.filter),{},{from:t.payload})});case"SET_RETRY":var r=t.payload,a=Bt(Bt({},e),{},{retry:r});return a;case"SET_RETRY_MSG":var o=t.payload,i=Bt(Bt({},e),{},{retryMessage:o});return i;case"ADD_PLATFORMS":var l=t.payload,c=Bt(Bt({},e),{},{platforms:l});return c;case"SET_PLATFORM":var u=t.payload,s=Bt(Bt({},e),{},{platform:u});return s;case"SET_PLAN":var f=t.payload,p=Bt(Bt({},e),{},{plan:f});return p;case"ALL_TEMPLATES":var d=t.payload,m=d.current_page,h=d.total_page,y=d.items,g=Bt({},e.templates);g.hasOwnProperty(m)||(g[m]=y,g.current_page=m,g.total_page=h);var v=Bt(Bt({},e),{},{templates:g});return v;case"REMOVE_TEMPLATE":var b=t.payload,w=b.id,E=b.page,O=e.templates[E].filter((function(e){return e.id!=w})),S=Bt({},e.templates);S[E]=O;var k=Bt(Bt({},e),{},{templates:S});return k;case"TEMPLATE_TRIGGER":var _=Bt(Bt({},e),t.payload);return _;case"CLOUD_RESET":var j=t.payload.platform,x=Bt({},e);return x.cloud_files[j]={},x;case"ALL_CLOUDS":var P=t.payload,C=P.current_page,T=P.data,A=P.total_page,N=P.platform,L=Bt({},e);return L.cloud_files.hasOwnProperty(N)||(L.cloud_files[N]={}),L.cloud_files[N][C]=T,L.cloud_files[N].total_page=A,L.cloud_files[N].current_page=C,L;case"REMOVE_CLOUD_FILE":var I=t.payload,D=I.id,M=I.page,R=I.platform,F=Bt({},e),z={};z[R]={},z[R].current_page=F.cloud_files[R].current_page,z[R].total_page=F.cloud_files[R].total_page;var U=F.cloud_files[R][M].filter((function(e){return e.id!=D}));return z[R][M]=U,F.cloud_files=z,F;case"ALL_CLOUDS_MAP":var B=Bt({},t.payload),V=Bt(Bt({},e),{},{cloud_map:B});return V;case"ACTIVE_SIDEBAR":var W=Bt(Bt({},e.activeSidebar),t.payload),H=Bt(Bt({},e),{},{activeSidebar:W});return H;case"FILTER_DEPENDENCIES_RESULTS":var $=t.payload,q=$.current_page,K=$.data,Q=$.platform,G=$.total_page,Y=$.plan,X=Bt({},e.dependencyFilter),J=Bt({},X.filtersResults);J.hasOwnProperty(Y)||(J[Y]={},J[Y][Q]={},J[Y][Q].total_page=G,J[Y][Q].current_page=q),J[Y][Q][q]=K,X=Bt(Bt({},X),{},{filtersResults:J});var Z=Bt(Bt({},e),{},{dependencyFilter:X});return Z;case"FILTER_DEPENDENCIES_ACTIVE":var ee=Bt({},e.dependencyFilter),te=t.payload;ee=Bt(Bt({},ee),{},{filterActive:te});var ne=Bt(Bt({},e),{},{dependencyFilter:ee});return ne;case"FILTER_DEPENDENCIES_ID":var re=Bt({},e.dependencyFilter),ae=t.payload;re=Bt(Bt({},re),{},{filtersID:ae});var oe=Bt(Bt({},e),{},{dependencyFilter:re});return oe;case"USER_CAN_LOGOUT":return Bt(Bt({},e),{},{user_can_logout:t.payload});case"IS_LINKED_LOGIN":return Bt(Bt({},e),{},{is_linked_login:t.payload});case"SET_GLOBAL_SIGN_IN":return Bt(Bt({},e),{},{is_global_login:t.payload});case"FILTERED_TAGS":return Bt(Bt({},e),{},{tags:Ft(t.payload)});case"COMMON_ALL_ITEMS":var ie=e;if(!1!==t.payload){var le=Ft(t.payload);ie=Bt(Bt({},e),{},{all_items:le})}return ie;case"COMMON_FILTERED_ITEMS":var ce=e;if(!1!==t.payload){var ue=Ft(t.payload);ce=Bt(Bt({},e),{},{filtered_items:ue})}return ce;case"PACK_BLOCK_OR_PAGE":var se=Bt(Bt({},e.activeBlockOrPage),t.payload),fe=Bt(Bt({},e),{},{activeBlockOrPage:se});return fe;case"SET_SUCCESS_TEXT":var pe=t.payload,de=Bt(Bt({},e),{},{successText:pe});return de;case"SET_PAGINATION":var me=t.payload,he=Bt(Bt({},e),{},{pagination:me});return he;case"NEED_PAGINATION":var ye=t.payload,ge=Bt(Bt({},e),{},{need_pagination:ye});return ge;case"PAGINATION_LOADING":var ve=t.payload,be=Bt(Bt({},e),{},{pagination_loading:ve});return be;case"SET_LOADING":var we=t.payload,Ee=Bt(Bt({},e),{},{loading:we});return Ee;case"SET_ITEM_LOADING":var Oe=t.payload,Se=Bt(Bt({},e),{},{itemLoading:Oe});return Se;case"SET_LOGGED_IN":var ke=t.payload,_e=Bt(Bt({},e),{},{isLoggedIn:ke});return _e;case"SET_CURRENT_ROUTE":var je=t.payload,xe=Bt(Bt({},e),{},{current_route:je});return xe;case"SET_PREV_ROUTE":var Pe=t.payload,Ce=Bt(Bt({},e),{},{previous_route:Pe});return Ce;case"SET_NEXT_ROUTE":var Te=t.payload,Ae=Bt(Bt({},e),{},{next_route:Te});return Ae;case"SET_PUSHED_TIME":var Ne=t.payload,Le=Bt(Bt({},e),{},{pushed_time:Ne});return Le;case"SEARCH_QUERY":var Ie=t.payload,De=Bt(Bt({},e),{},{searchQuery:Ie});return De;case"CLOUD_USAGE_LIMIT":var Me=t.payload,Re=Bt(Bt({},e),{},{cloud_usage_limit:Me});return Re;case"WORKSPACE_SLUG":var Fe=t.payload,ze=Bt(Bt({},e),{},{workspace_slug:Fe});return ze;default:return e}};function Qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xt={user:TemplatelyAdmin.admin||{},errorText:null,successText:null},Jt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER":var n=t.payload,r=Gt(Gt({},e),{},{user:n});return r;case"ERROR_TEXT":var a=t.payload,o=Gt(Gt({},e),{},{errorText:a});return o;case"SUCCESS_TEXT":var i=t.payload,l=Gt(Gt({},e),{},{successText:i});return l;default:return e}};function Zt(e){return function(e){if(Array.isArray(e))return en(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return en(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return en(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(n),!0).forEach((function(t){rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var an={current_page:1,total_page:1,workspacesList:[]},on=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:an,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"WORKSPACE_RESET":return{};case"ALL_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=nn(nn({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"ALL_WORKSPACE_LIST":var l=t.payload;return null!==l?nn(nn({},e),{},{workspacesList:l}):nn({},e);case"ADD_WORKSPACE_IN_LIST":var c=t.payload,u=[].concat(Zt(c),Zt(e.workspacesList)),s=nn(nn({},e),{},{workspacesList:u});return s;case"EDIT_WORKSPACE":var f=t.payload.page,p=t.payload.data,d=nn({},e);if(d.hasOwnProperty(f)){var m=Zt(d[f]).filter((function(e){return e.id!=p.id}));m=[p].concat(Zt(m)),d[f]=m}return d;case"DELETE_WORKSPACE":var h=t.payload.page,y=t.payload.data,g=nn({},e);if(g.hasOwnProperty(h)){var v=Zt(g[h]).filter((function(e){return e.id!=y}));g[h]=v}return g;case"CREATE_WORKSPACE":var b=t.payload.page,w=t.payload.data,E=nn({},e),O=[];return E.hasOwnProperty(b)?(O=[w].concat(Zt(E[b])),E[b]=O):E[b]=[w],E;case"WORKSPACES_TOTAL_PAGES":var S=t.payload,k=S.current_page,_=S.total_page,j=nn(nn({},e),{},{totalPages:_,currentPage:k});return j;case"WORKSPACES_CURRENT_PAGE":var x=t.payload,P=nn(nn({},e),{},{currentPage:x});return P;default:return e}};function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(n),!0).forEach((function(t){un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ln(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sn={current_page:1,total_page:1,sharedWorkspaceList:[]},fn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHARED_WORKSPACE_RESET":return{};case"SHARED_WORKSPACE_QUERY":var n=t.payload,r=n.current_page,a=n.data,o=n.total_page,i=cn(cn({},e),{},{current_page:r,total_page:o});return null!==r&&(i[r]=a),i;case"SHARED_WORKSPACE_LIST":var l=t.payload;return null!=l&&l.length>0?cn(cn({},e),{},{sharedWorkspaceList:l}):cn({},e);case"SHARED_WORKSPACES_TOTAL_PAGES":var c=t.payload,u=c.current_page,s=c.total_page,f=cn(cn({},e),{},{totalPages:s,currentPage:u});return f;case"SHARED_WORKSPACES_CURRENT_PAGE":var p=t.payload,d=cn(cn({},e),{},{currentPage:p});return d;default:return e}},pn=["files"];function dn(e){return function(e){if(Array.isArray(e))return mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){vn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bn={filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}},wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"WORKSPACE_DETAILS_RESET":return{filesList:{},searchFiles:{current_page:1,total_page:1,files:[]}};case"ADD_WORKSPACE_WITH_DETAILS":var n=t.payload,r=n.slug,a=n.data,o=n.page,i=n.platform,l=gn({},e),c={},u={};return a.hasOwnProperty("files")&&null!==a.files&&(a.files.hasOwnProperty("data")&&(c=a.files.data),u.total_page=a.files.total_page,u.current_page=a.files.current_page,u[o]=c),l.hasOwnProperty(r)?l[r].hasOwnProperty("files")&&null!==l[r].files?l[r].files.hasOwnProperty(i)?l[r].files[i]=gn(gn({},l[r].files[i]),u):l[r].files[i]=u:(l[r].files={},l[r].files[i]=u):(delete a.file,l[r]=a,l[r].files={},l[r].files[i]=u),l;case"ADD_FILES_PAGE_FOR_A_WORKSPACE":var s=t.payload,f=s.slug,p=s.data,d=s.page,m=s.platform,h=s.total_page,y=gn({},e);return y.hasOwnProperty(f)&&y[f].hasOwnProperty("files")&&y[f].files.hasOwnProperty(m)&&(y[f].files[m][d]=p,y[f].files[m].total_page=h),y;case"REMOVE_FILES_PAGE_FOR_A_WORKSPACE":var g=t.payload,v=g.page,b=g.slug,w=g.platform,E=g.fileAdded,O=gn({},e);if(O.hasOwnProperty(b)&&O[b].hasOwnProperty("files"))if(!0===E){var S={};S.total_page=O[b].files[w].total_page,S.current_page=O[b].files[w].current_page,delete O[b].files[w],O[b].files[w]=S}else O[b].files.hasOwnProperty(w)&&delete O[b].files[w][v];return O;case"ALL_CLOUDS_FILE_LIST":var k=t.payload,_=k.slug,j=k.data,x=k.platform,P=gn({},e),C=gn({},P.filesList);return C.hasOwnProperty(x)||(C[x]={}),C[x][_]=j,P=gn(gn({},P),{},{filesList:C});case"EDIT_WORKSPACE_DETAILS":var T=t.payload,A=T.slug,N=T.data,L=T.page,I=T.platform,D=gn({},e),M={},R={};if(N.hasOwnProperty("files")&&null!==N.files&&(N.files.hasOwnProperty("data")&&(M=N.files.data),R.total_page=N.files.total_page,R.current_page=N.files.current_page,R[L]=M),D.hasOwnProperty(A)){N.files;var F=hn(N,pn);D[A]=gn(gn({},D[A]),F),D[A].hasOwnProperty("files")&&null!==D[A].files?D[A].files.hasOwnProperty(I)?D[A].files[I]=gn(gn({},D[A].files[I]),R):D[A].files[I]=R:(D[A].files={},D[A].files[I]=R)}else delete N.file,D[A]=N,D[A].files={},D[A].files[I]=R;return D;case"ADD_FILE_TO_WORKSPACE":var z=t.payload,U=z.slug,B=z.data,V=gn({},e),W=null;return V.hasOwnProperty(U)&&V[U].hasOwnProperty("files")&&V[U].files.hasOwnProperty("data")?(W=[].concat(dn(V[U].files.data),dn(B)),V[U].files.data=W):(W=B,V[U].files.data=W),V;case"DELETE_FILE_FROM_WORKSPACE":var H=t.payload,$=H.fileFrom,q=H.id,K=H.page,Q=gn({},e),G=[];return Q.hasOwnProperty($)&&Q[$].hasOwnProperty("files")&&null!=Q[$].files&&Q[$].files.hasOwnProperty(K)&&Q[$].files[K]&&Q[$].files[K].length>0&&(G=Q[$].files[K].filter((function(e){return e.id!==q})),Q[$].files[K]=G),Q;default:return e}};var En=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a};var On=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Sn=Array.isArray,kn=n(9),_n=kn.a.Symbol,jn=Object.prototype,xn=jn.hasOwnProperty,Pn=jn.toString,Cn=_n?_n.toStringTag:void 0;var Tn=function(e){var t=xn.call(e,Cn),n=e[Cn];try{e[Cn]=void 0;var r=!0}catch(e){}var a=Pn.call(e);return r&&(t?e[Cn]=n:delete e[Cn]),a},An=Object.prototype.toString;var Nn=function(e){return An.call(e)},Ln=_n?_n.toStringTag:void 0;var In=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ln&&Ln in Object(e)?Tn(e):Nn(e)};var Dn=function(e){return null!=e&&"object"==typeof e};var Mn=function(e){return"symbol"==typeof e||Dn(e)&&"[object Symbol]"==In(e)};var Rn=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var Fn,zn=function(e){if(!Rn(e))return!1;var t=In(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Un=kn.a["__core-js_shared__"],Bn=(Fn=/[^.]+$/.exec(Un&&Un.keys&&Un.keys.IE_PROTO||""))?"Symbol(src)_1."+Fn:"";var Vn=function(e){return!!Bn&&Bn in e},Wn=Function.prototype.toString;var Hn=function(e){if(null!=e){try{return Wn.call(e)}catch(e){}try{return e+""}catch(e){}}return""},$n=/^\[object .+?Constructor\]$/,qn=Function.prototype,Kn=Object.prototype,Qn=qn.toString,Gn=Kn.hasOwnProperty,Yn=RegExp("^"+Qn.call(Gn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Xn=function(e){return!(!Rn(e)||Vn(e))&&(zn(e)?Yn:$n).test(Hn(e))};var Jn=function(e,t){return null==e?void 0:e[t]};var Zn=function(e,t){var n=Jn(e,t);return Xn(n)?n:void 0},er=Zn(Object,"create");var tr=function(){this.__data__=er?er(null):{},this.size=0};var nr=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rr=Object.prototype.hasOwnProperty;var ar=function(e){var t=this.__data__;if(er){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rr.call(t,e)?t[e]:void 0},or=Object.prototype.hasOwnProperty;var ir=function(e){var t=this.__data__;return er?void 0!==t[e]:or.call(t,e)};var lr=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=er&&void 0===t?"__lodash_hash_undefined__":t,this};function cr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}cr.prototype.clear=tr,cr.prototype.delete=nr,cr.prototype.get=ar,cr.prototype.has=ir,cr.prototype.set=lr;var ur=cr;var sr=function(){this.__data__=[],this.size=0};var fr=function(e,t){return e===t||e!=e&&t!=t};var pr=function(e,t){for(var n=e.length;n--;)if(fr(e[n][0],t))return n;return-1},dr=Array.prototype.splice;var mr=function(e){var t=this.__data__,n=pr(t,e);return!(n<0)&&(n==t.length-1?t.pop():dr.call(t,n,1),--this.size,!0)};var hr=function(e){var t=this.__data__,n=pr(t,e);return n<0?void 0:t[n][1]};var yr=function(e){return pr(this.__data__,e)>-1};var gr=function(e,t){var n=this.__data__,r=pr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function vr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vr.prototype.clear=sr,vr.prototype.delete=mr,vr.prototype.get=hr,vr.prototype.has=yr,vr.prototype.set=gr;var br=vr,wr=Zn(kn.a,"Map");var Er=function(){this.size=0,this.__data__={hash:new ur,map:new(wr||br),string:new ur}};var Or=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Sr=function(e,t){var n=e.__data__;return Or(t)?n["string"==typeof t?"string":"hash"]:n.map};var kr=function(e){var t=Sr(this,e).delete(e);return this.size-=t?1:0,t};var _r=function(e){return Sr(this,e).get(e)};var jr=function(e){return Sr(this,e).has(e)};var xr=function(e,t){var n=Sr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Pr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pr.prototype.clear=Er,Pr.prototype.delete=kr,Pr.prototype.get=_r,Pr.prototype.has=jr,Pr.prototype.set=xr;var Cr=Pr;function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i)||o,i};return n.cache=new(Tr.Cache||Cr),n}Tr.Cache=Cr;var Ar=Tr;var Nr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lr=/\\(\\)?/g,Ir=function(e){var t=Ar(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Nr,(function(e,n,r,a){t.push(r?a.replace(Lr,"$1"):n||e)})),t}));var Dr=function(e){if("string"==typeof e||Mn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Mr=_n?_n.prototype:void 0,Rr=Mr?Mr.toString:void 0;var Fr=function e(t){if("string"==typeof t)return t;if(Sn(t))return En(t,e)+"";if(Mn(t))return Rr?Rr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var zr=function(e){return null==e?"":Fr(e)};var Ur=function(e){return Sn(e)?En(e,Dr):Mn(e)?[e]:On(Ir(zr(e)))};var Br=function(){this.__data__=new br,this.size=0};var Vr=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Wr=function(e){return this.__data__.get(e)};var Hr=function(e){return this.__data__.has(e)};var $r=function(e,t){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!wr||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Cr(r)}return n.set(e,t),this.size=n.size,this};function qr(e){var t=this.__data__=new br(e);this.size=t.size}qr.prototype.clear=Br,qr.prototype.delete=Vr,qr.prototype.get=Wr,qr.prototype.has=Hr,qr.prototype.set=$r;var Kr=qr;var Qr=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Gr=function(){try{var e=Zn(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Yr=function(e,t,n){"__proto__"==t&&Gr?Gr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Xr=Object.prototype.hasOwnProperty;var Jr=function(e,t,n){var r=e[t];Xr.call(e,t)&&fr(r,n)&&(void 0!==n||t in e)||Yr(e,t,n)};var Zr=function(e,t,n,r){var a=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var l=t[o],c=r?r(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?Yr(n,l,c):Jr(n,l,c)}return n};var ea=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var ta=function(e){return Dn(e)&&"[object Arguments]"==In(e)},na=Object.prototype,ra=na.hasOwnProperty,aa=na.propertyIsEnumerable,oa=ta(function(){return arguments}())?ta:function(e){return Dn(e)&&ra.call(e,"callee")&&!aa.call(e,"callee")},ia=n(28),la=/^(?:0|[1-9]\d*)$/;var ca=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&la.test(e))&&e>-1&&e%1==0&&e<t};var ua=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},sa={};sa["[object Float32Array]"]=sa["[object Float64Array]"]=sa["[object Int8Array]"]=sa["[object Int16Array]"]=sa["[object Int32Array]"]=sa["[object Uint8Array]"]=sa["[object Uint8ClampedArray]"]=sa["[object Uint16Array]"]=sa["[object Uint32Array]"]=!0,sa["[object Arguments]"]=sa["[object Array]"]=sa["[object ArrayBuffer]"]=sa["[object Boolean]"]=sa["[object DataView]"]=sa["[object Date]"]=sa["[object Error]"]=sa["[object Function]"]=sa["[object Map]"]=sa["[object Number]"]=sa["[object Object]"]=sa["[object RegExp]"]=sa["[object Set]"]=sa["[object String]"]=sa["[object WeakMap]"]=!1;var fa=function(e){return Dn(e)&&ua(e.length)&&!!sa[In(e)]};var pa=function(e){return function(t){return e(t)}},da=n(18),ma=da.a&&da.a.isTypedArray,ha=ma?pa(ma):fa,ya=Object.prototype.hasOwnProperty;var ga=function(e,t){var n=Sn(e),r=!n&&oa(e),a=!n&&!r&&Object(ia.a)(e),o=!n&&!r&&!a&&ha(e),i=n||r||a||o,l=i?ea(e.length,String):[],c=l.length;for(var u in e)!t&&!ya.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ca(u,c))||l.push(u);return l},va=Object.prototype;var ba=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||va)};var wa=function(e,t){return function(n){return e(t(n))}},Ea=wa(Object.keys,Object),Oa=Object.prototype.hasOwnProperty;var Sa=function(e){if(!ba(e))return Ea(e);var t=[];for(var n in Object(e))Oa.call(e,n)&&"constructor"!=n&&t.push(n);return t};var ka=function(e){return null!=e&&ua(e.length)&&!zn(e)};var _a=function(e){return ka(e)?ga(e):Sa(e)};var ja=function(e,t){return e&&Zr(t,_a(t),e)};var xa=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Pa=Object.prototype.hasOwnProperty;var Ca=function(e){if(!Rn(e))return xa(e);var t=ba(e),n=[];for(var r in e)("constructor"!=r||!t&&Pa.call(e,r))&&n.push(r);return n};var Ta=function(e){return ka(e)?ga(e,!0):Ca(e)};var Aa=function(e,t){return e&&Zr(t,Ta(t),e)},Na=n(58);var La=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o};var Ia=function(){return[]},Da=Object.prototype.propertyIsEnumerable,Ma=Object.getOwnPropertySymbols,Ra=Ma?function(e){return null==e?[]:(e=Object(e),La(Ma(e),(function(t){return Da.call(e,t)})))}:Ia;var Fa=function(e,t){return Zr(e,Ra(e),t)};var za=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Ua=wa(Object.getPrototypeOf,Object),Ba=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)za(t,Ra(e)),e=Ua(e);return t}:Ia;var Va=function(e,t){return Zr(e,Ba(e),t)};var Wa=function(e,t,n){var r=t(e);return Sn(e)?r:za(r,n(e))};var Ha=function(e){return Wa(e,_a,Ra)};var $a=function(e){return Wa(e,Ta,Ba)},qa=Zn(kn.a,"DataView"),Ka=Zn(kn.a,"Promise"),Qa=Zn(kn.a,"Set"),Ga=Zn(kn.a,"WeakMap"),Ya=Hn(qa),Xa=Hn(wr),Ja=Hn(Ka),Za=Hn(Qa),eo=Hn(Ga),to=In;(qa&&"[object DataView]"!=to(new qa(new ArrayBuffer(1)))||wr&&"[object Map]"!=to(new wr)||Ka&&"[object Promise]"!=to(Ka.resolve())||Qa&&"[object Set]"!=to(new Qa)||Ga&&"[object WeakMap]"!=to(new Ga))&&(to=function(e){var t=In(e),n="[object Object]"==t?e.constructor:void 0,r=n?Hn(n):"";if(r)switch(r){case Ya:return"[object DataView]";case Xa:return"[object Map]";case Ja:return"[object Promise]";case Za:return"[object Set]";case eo:return"[object WeakMap]"}return t});var no=to,ro=Object.prototype.hasOwnProperty;var ao=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ro.call(e,"index")&&(n.index=e.index,n.input=e.input),n},oo=kn.a.Uint8Array;var io=function(e){var t=new e.constructor(e.byteLength);return new oo(t).set(new oo(e)),t};var lo=function(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},co=/\w*$/;var uo=function(e){var t=new e.constructor(e.source,co.exec(e));return t.lastIndex=e.lastIndex,t},so=_n?_n.prototype:void 0,fo=so?so.valueOf:void 0;var po=function(e){return fo?Object(fo.call(e)):{}};var mo=function(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var ho=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return io(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return lo(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return mo(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return uo(e);case"[object Set]":return new r;case"[object Symbol]":return po(e)}},yo=Object.create,go=function(){function e(){}return function(t){if(!Rn(t))return{};if(yo)return yo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var vo=function(e){return"function"!=typeof e.constructor||ba(e)?{}:go(Ua(e))};var bo=function(e){return Dn(e)&&"[object Map]"==no(e)},wo=da.a&&da.a.isMap,Eo=wo?pa(wo):bo;var Oo=function(e){return Dn(e)&&"[object Set]"==no(e)},So=da.a&&da.a.isSet,ko=So?pa(So):Oo,_o={};_o["[object Arguments]"]=_o["[object Array]"]=_o["[object ArrayBuffer]"]=_o["[object DataView]"]=_o["[object Boolean]"]=_o["[object Date]"]=_o["[object Float32Array]"]=_o["[object Float64Array]"]=_o["[object Int8Array]"]=_o["[object Int16Array]"]=_o["[object Int32Array]"]=_o["[object Map]"]=_o["[object Number]"]=_o["[object Object]"]=_o["[object RegExp]"]=_o["[object Set]"]=_o["[object String]"]=_o["[object Symbol]"]=_o["[object Uint8Array]"]=_o["[object Uint8ClampedArray]"]=_o["[object Uint16Array]"]=_o["[object Uint32Array]"]=!0,_o["[object Error]"]=_o["[object Function]"]=_o["[object WeakMap]"]=!1;var jo=function e(t,n,r,a,o,i){var l,c=1&n,u=2&n,s=4&n;if(r&&(l=o?r(t,a,o,i):r(t)),void 0!==l)return l;if(!Rn(t))return t;var f=Sn(t);if(f){if(l=ao(t),!c)return On(t,l)}else{var p=no(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(ia.a)(t))return Object(Na.a)(t,c);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(l=u||d?{}:vo(t),!c)return u?Va(t,Aa(l,t)):Fa(t,ja(l,t))}else{if(!_o[p])return o?t:{};l=ho(t,p,c)}}i||(i=new Kr);var m=i.get(t);if(m)return m;i.set(t,l),ko(t)?t.forEach((function(a){l.add(e(a,n,r,a,t,i))})):Eo(t)&&t.forEach((function(a,o){l.set(o,e(a,n,r,o,t,i))}));var h=f?void 0:(s?u?$a:Ha:u?Ta:_a)(t);return Qr(h||t,(function(a,o){h&&(a=t[o=a]),Jr(l,o,e(a,n,r,o,t,i))})),l};var xo=function(e){return jo(e,4)};function Po(e){return(Po="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)}var Co=function(e,t,n,r){void 0===r&&(r=0);for(var a=Ur(t);e&&r<a.length;)e=e[a[r++]];return void 0===e?n:e},To=function(e,t,n){for(var r=xo(e),a=r,o=0,i=Ur(t);o<i.length-1;o++){var l=i[o],c=Co(e,i.slice(0,o+1));if(c&&(No(c)||Array.isArray(c)))a=a[l]=xo(c);else{var u=i[o+1];a=a[l]=Ao(u)&&Number(u)>=0?[]:{}}}return(0===o?e:a)[i[o]]===n?e:(void 0===n?delete a[i[o]]:a[i[o]]=n,0===o&&void 0===n&&delete r[i[o]],r)},Ao=function(e){return String(Math.floor(Number(e)))===e},No=function(e){return null!==e&&"object"===Po(e)&&!(null!==(t=e)&&"object"===Po(t)&&Array.isArray(t));var t};function Lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(n),!0).forEach((function(t){Do(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Do(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mo={profile:TemplatelyAdmin.admin||{},favourites:{},downloads:{currentPage:1,totalPage:1}},Ro=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return To(n,e,t)},Fo=function e(t,n,r){var a;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(dt(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(dt(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(dt(2));var o=t,i=n,l=[],c=l,u=!1;function s(){c===l&&(c=l.slice())}function f(){if(u)throw new Error(dt(3));return i}function p(e){if("function"!=typeof e)throw new Error(dt(4));if(u)throw new Error(dt(5));var t=!0;return s(),c.push(e),function(){if(t){if(u)throw new Error(dt(6));t=!1,s();var n=c.indexOf(e);c.splice(n,1),l=null}}}function d(e){if(!gt(e))throw new Error(dt(7));if(void 0===e.type)throw new Error(dt(8));if(u)throw new Error(dt(9));try{u=!0,i=o(i,e)}finally{u=!1}for(var t=l=c,n=0;n<t.length;n++){(0,t[n])()}return e}function m(e){if("function"!=typeof e)throw new Error(dt(10));o=e,d({type:yt.REPLACE})}function h(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(dt(11));function n(){e.next&&e.next(f())}return n(),{unsubscribe:t(n)}}})[mt]=function(){return this},e}return d({type:yt.INIT}),(a={dispatch:d,subscribe:p,getState:f,replaceReducer:m})[mt]=h,a}(function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];0,"function"==typeof e[a]&&(n[a]=e[a])}var o,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:yt.INIT}))throw new Error(dt(12));if(void 0===n(void 0,{type:yt.PROBE_UNKNOWN_ACTION()}))throw new Error(dt(13))}))}(n)}catch(e){o=e}return function(e,t){if(void 0===e&&(e={}),o)throw o;for(var r=!1,a={},l=0;l<i.length;l++){var c=i[l],u=n[c],s=e[c],f=u(s,t);if(void 0===f){t&&t.type;throw new Error(dt(14))}a[c]=f,r=r||f!==s}return(r=r||i.length!==Object.keys(e).length)?a:e}}({profile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mo,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER_PROFILE":var n=t.payload,r=Io(Io({},e),{},{user:n});return r;case"SET_USER_FAVOURITES":var a=t.payload,o=a.currentPage,i=a.totalPage,l=a.data,c=a.plan,u=a.category,s=a.platform,f=Io({},e),p=["favourites",c,s,u],d=[].concat(p,["currentPage"]),m=[].concat(p,["totalPage"]),h=[].concat(p,[o]);return f=Ro(d,o,f),Io(Io({},f=Ro(m,i,f)),Ro(h,l,f));case"SET_USER_DOWNLOADS":var y=t.payload,g=y.currentPage,v=y.totalPage,b=y.data,w=Io({},e),E=["downloads"],O=[].concat(E,["currentPage"]),S=[].concat(E,["totalPage"]),k=[].concat(E,[g]);return w=Ro(O,g,w),Io(Io({},w=Ro(S,v,w)),Ro(k,b,w));default:return e}},admin:Jt,blocks:Ot,pages:xt,packs:Nt,preview:Rt,common:Kt,workspaces:on,sharedWorkspaces:fn,workspacesDetails:wn}),!1),zo={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Uo=o.createContext&&o.createContext(zo),Bo=function(){return(Bo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Vo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&(n[r[a]]=e[r[a]])}return n};function Wo(e){return function(t){return o.createElement(Ho,Bo({attr:Bo({},e.attr)},t),function e(t){return t&&t.map((function(t,n){return o.createElement(t.tag,Bo({key:n},t.attr),e(t.child))}))}(e.child))}}function Ho(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var a=e.attr,i=e.title,l=Vo(e,["attr","title"]);return o.createElement("svg",Bo({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,l,{className:n,style:Bo({color:e.color||t.color},t.style,e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),i&&o.createElement("title",null,i),e.children)};return void 0!==Uo?o.createElement(Uo.Consumer,null,(function(e){return t(e)})):t(zo)}function $o(e){return Wo({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function qo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function Ko(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function Qo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"}}]})(e)}function Go(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"}}]})(e)}function Yo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"}}]})(e)}function Xo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"}}]})(e)}function Jo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 0H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h192l-16 48h-72c-13.3 0-24 10.7-24 24s10.7 24 24 24h272c13.3 0 24-10.7 24-24s-10.7-24-24-24h-72l-16-48h192c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zm-16 352H64V64h448v288z"}}]})(e)}function Zo(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function ei(e){return Wo({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function ti(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function ni(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"}}]})(e)}function ri(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function ai(e){return Wo({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"}}]})(e)}function oi(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function ii(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function li(e){return Wo({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}}]})(e)}function ci(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM224 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm176-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h328c6.6 0 12 5.4 12 12v312z"}}]})(e)}function ui(e){return Wo({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 32h192c13.255 0 24 10.745 24 24v160c0 13.255-10.745 24-24 24H296c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24zm-80 0H24C10.745 32 0 42.745 0 56v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zM0 296v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm296 184h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H296c-13.255 0-24 10.745-24 24v160c0 13.255 10.745 24 24 24z"}}]})(e)}function si(e){return Wo({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function fi(e){return Wo({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}var pi=function(e){return{type:"SET_RETRY",payload:e}},di=function(e){return{type:"USER_CAN_LOGOUT",payload:e}},mi=function(e){return{type:"SET_GLOBAL_SIGN_IN",payload:e}},hi=function(e){return{type:"IS_LINKED_LOGIN",payload:e}},yi=function(e){return{type:"SET_RETRY_MSG",payload:e}},gi=function(e){return{type:"ADD_PLATFORMS",payload:e}},vi=function(e){return{type:"ALL_ITEMS",payload:e}},bi=function(e){return{type:"ALL_PACKS",payload:e}},wi=function(e){return{type:"ALL_TEMPLATES",payload:e}},Ei=function(e){return{type:"CLOUD_RESET",payload:e}},Oi=function(e){return{type:"ALL_CLOUDS",payload:e}},Si=function(e){return{type:"REMOVE_CLOUD_FILE",payload:e}},ki=function(e){return{type:"PREVIEW",payload:e}},_i=function(e){return{type:"SET_LOADING",payload:e}},ji=function(e){return{type:"SET_ITEM_LOADING",payload:e}},xi=function(e){return{type:"SET_LOGGED_IN",payload:e}},Pi=function(e){return{type:"ERRORS",payload:e}},Ci=function(e){return{type:"ACTIVE_SIDEBAR",payload:e}},Ti=function(e){return{type:"FILTER_DEPENDENCIES_ACTIVE",payload:e}},Ai=function(e){return{type:"FILTER_FROM",payload:e}},Ni=function(e){return{type:"FILTER_DEPENDENCIES_ID",payload:e}},Li=function(e){return{type:"FILTERED_TAGS",payload:e}},Ii=function(e){return{type:"COMMON_ALL_ITEMS",payload:e}},Di=function(e){return{type:"COMMON_FILTERED_ITEMS",payload:e}},Mi=function(e){return{type:"PACK_BLOCK_OR_PAGE",payload:e}},Ri=function(e){return{type:"SET_PAGINATION",payload:e}},Fi=function(e){return{type:"NEED_PAGINATION",payload:e}},zi=function(e){return{type:"PAGINATION_LOADING",payload:e}},Ui=function(e){return{type:"SET_USER",payload:e}},Bi=function(e){return{type:"SUCCESS_TEXT",payload:e}},Vi=function(e){return{type:"SET_CURRENT_ROUTE",payload:e}},Wi=function(e){return{type:"SET_PUSHED_TIME",payload:e}},Hi=function(e){return{type:"ERROR_TEXT",payload:e}},$i=function(e){return{type:"SEARCH_QUERY",payload:e}},qi=function(e){return{type:"REMOVE_FILES_PAGE_FOR_A_WORKSPACE",payload:e}},Ki=function(e){return{type:"DELETE_FILE_FROM_WORKSPACE",payload:e}},Qi=function(e){return{type:"ALL_WORKSPACE_LIST",payload:e}},Gi=function(e){return{type:"SHARED_WORKSPACE_LIST",payload:e}},Yi=function(e){return{type:"WORKSPACE_SLUG",payload:e}},Xi=wp.i18n.__,Ji=nt((function(e){return{preview:e.preview}}))((function(e){var t=ce();return i.a.createElement("div",{className:"templately-logo"},i.a.createElement("svg",{width:"40px",enableBackground:"new 0 0 512 512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("circle",{cx:"90.5",cy:"454.8",fill:"#ffb45a",r:"57.2"}),i.a.createElement("circle",{cx:"256",cy:"454.8",fill:"#ff7b8e",r:"57.2"}),i.a.createElement("circle",{cx:"421.5",cy:"454.8",fill:"#5ac0ff",r:"57.2"}),i.a.createElement("path",{d:"m356.5 94.5c-3.1 0-6.1.2-9.1.4-12.4-54.3-61-94.9-119.1-94.9-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8c-19.9 0-39.2 0-58.8 0v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7 0-12.6 0-54 0-66.9-7.1 0-13.9 0-20.7 0-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"})),!e.preview.isOpen&&i.a.createElement(i.a.Fragment,null,i.a.createElement("svg",{height:"28",viewBox:"0 0 143 28",width:"143",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"#424c5e"},i.a.createElement("path",{d:"m6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3h3.9v-10.6c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9v-10.6c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6z"}),i.a.createElement("path",{d:"m59.8 6.3c-2.3 0-4.4.2-6.4.6v21.1h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9z"}),i.a.createElement("path",{d:"m70.5.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4h2.2v-10.3c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2z"}),i.a.createElement("path",{d:"m100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4v-3.1h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1z"}),i.a.createElement("path",{d:"m110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1z"}),i.a.createElement("path",{d:"m120.6.7h3.9v20.8h-3.9z"}),i.a.createElement("path",{d:"m138 6.2-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9l6.3-15.8z"})))),e.preview.isOpen&&i.a.createElement("span",{className:"templately-back-2-library",onClick:function(){return t.goBack()}},i.a.createElement(qo,{color:"#000"}),Xi("Back to Library","templately")))})),Zi=nt((function(e){return{preview:e.preview}}))((function(e){return i.a.createElement(ee,{exact:e.exact||!0,path:e.to,children:function(t){var n=t.match;return i.a.createElement("li",{className:n||e.active?"templately-active":""},i.a.createElement(ge,{className:e.className,onClick:function(){e.dispatch(Pi(null)),e.dispatch(ji(!0)),e.dispatch(Hi(null)),e.dispatch(Vi(e.to)),e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1)),e.dispatch(Fi(!1))},to:e.to},e.children,e.name))}})})),el=(n(84),n(86),n(87),n(91),n(95),n(6));function tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nl(e,t,n){return t&&tl(e.prototype,t),n&&tl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n(96);var rl=n(29);function al(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&&Object(rl.a)(e,t)}function ol(e){return(ol="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 il(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ll(e,t){if(t&&("object"===ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return il(e)}function cl(e){return(cl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ul=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function sl(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],a=t[n],!(r===a||ul(r)&&ul(a)))return!1;var r,a;return!0}var fl=function(e,t){var n;void 0===t&&(t=sl);var r,a=[],o=!1;return function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return o&&n===this&&t(i,a)||(r=e.apply(this,i),o=!0,n=this,a=i),r}},pl=n(3);n(99);function dl(e,t){if(null==e)return{};var n,r,a=z(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ml=n(31);function hl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||Object(ml.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yl=n(10),gl=n(17);var vl=n(40),bl=n.n(vl),wl=function(){};function El(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Ol(e,t,n){var r=[n];if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&r.push("".concat(El(e,a)));return r.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var Sl=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===ol(e)&&null!==e?[e]:[]};function kl(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function _l(e){return kl(e)?window.pageYOffset:e.scrollTop}function jl(e,t){kl(e)?window.scrollTo(0,t):e.scrollTop=t}function xl(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Pl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wl,a=_l(e),o=t-a,i=10,l=0;function c(){var t=xl(l+=i,a,o,n);jl(e,t),l<n?window.requestAnimationFrame(c):r(e)}c()}function Cl(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function Tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tl(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}function Ll(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,o=e.shouldScroll,i=e.isFixedPosition,l=e.theme.spacing,c=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/,a=document.documentElement;if("fixed"===t.position)return a;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return a}(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var s=c.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,d=f.height,m=f.top,h=n.offsetParent.getBoundingClientRect().top,y=window.innerHeight,g=_l(c),v=parseInt(getComputedStyle(n).marginBottom,10),b=parseInt(getComputedStyle(n).marginTop,10),w=h-b,E=y-m,O=w+g,S=s-g-m,k=p-y+g+v,_=g+m-b;switch(a){case"auto":case"bottom":if(E>=d)return{placement:"bottom",maxHeight:t};if(S>=d&&!i)return o&&Pl(c,k,160),{placement:"bottom",maxHeight:t};if(!i&&S>=r||i&&E>=r)return o&&Pl(c,k,160),{placement:"bottom",maxHeight:i?E-v:S-v};if("auto"===a||i){var j=t,x=i?w:O;return x>=r&&(j=Math.min(x-v-l.controlHeight,t)),{placement:"top",maxHeight:j}}if("bottom"===a)return jl(c,k),{placement:"bottom",maxHeight:t};break;case"top":if(w>=d)return{placement:"top",maxHeight:t};if(O>=d&&!i)return o&&Pl(c,_,160),{placement:"top",maxHeight:t};if(!i&&O>=r||i&&w>=r){var P=t;return(!i&&O>=r||i&&w>=r)&&(P=i?w-b:O-b),o&&Pl(c,_,160),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return u}var Il=function(e){return"auto"===e?"bottom":e},Dl=Object(o.createContext)({getPortalPlacement:null}),Ml=function(e){al(n,e);var t=Nl(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={maxHeight:e.props.maxMenuHeight,placement:null},e.getPlacement=function(t){var n=e.props,r=n.minMenuHeight,a=n.maxMenuHeight,o=n.menuPlacement,i=n.menuPosition,l=n.menuShouldScrollIntoView,c=n.theme;if(t){var u="fixed"===i,s=Ll({maxHeight:a,menuEl:t,minHeight:r,placement:o,shouldScroll:l&&!u,isFixedPosition:u,theme:c}),f=e.context.getPortalPlacement;f&&f(s),e.setState(s)}},e.getUpdatedProps=function(){var t=e.props.menuPlacement,n=e.state.placement||Il(t);return Al(Al({},e.props),{},{placement:n,maxHeight:e.state.maxHeight})},e}return nl(n,[{key:"render",value:function(){return(0,this.props.children)({ref:this.getPlacement,placerProps:this.getUpdatedProps()})}}]),n}(o.Component);Ml.contextType=Dl;var Rl=function(e){var t=e.theme,n=t.spacing.baseUnit;return{color:t.colors.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px"),textAlign:"center"}},Fl=Rl,zl=Rl,Ul=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("noOptionsMessage",e),className:r({"menu-notice":!0,"menu-notice--no-options":!0},n)},o),t)};Ul.defaultProps={children:"No options"};var Bl=function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("loadingMessage",e),className:r({"menu-notice":!0,"menu-notice--loading":!0},n)},o),t)};Bl.defaultProps={children:"Loading..."};var Vl=function(e){al(n,e);var t=Nl(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={placement:null},e.getPortalPlacement=function(t){var n=t.placement;n!==Il(e.props.menuPlacement)&&e.setState({placement:n})},e}return nl(n,[{key:"render",value:function(){var e=this.props,t=e.appendTo,n=e.children,r=e.controlElement,a=e.menuPlacement,o=e.menuPosition,i=e.getStyles,c="fixed"===o;if(!t&&!c||!r)return null;var u=this.state.placement||Il(a),s=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,p={offset:s[u]+f,position:o,rect:s},d=Object(pl.c)("div",{css:i("menuPortal",p)},n);return Object(pl.c)(Dl.Provider,{value:{getPortalPlacement:this.getPortalPlacement}},t?Object(l.createPortal)(d,t):d)}}]),n}(o.Component),Wl=Array.isArray,Hl=Object.keys,$l=Object.prototype.hasOwnProperty;function ql(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==ol(t)&&"object"==ol(n)){var r,a,o,i=Wl(t),l=Wl(n);if(i&&l){if((a=t.length)!=n.length)return!1;for(r=a;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i!=l)return!1;var c=t instanceof Date,u=n instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==n.getTime();var s=t instanceof RegExp,f=n instanceof RegExp;if(s!=f)return!1;if(s&&f)return t.toString()==n.toString();var p=Hl(t);if((a=p.length)!==Hl(n).length)return!1;for(r=a;0!=r--;)if(!$l.call(n,p[r]))return!1;for(r=a;0!=r--;)if(!("_owner"===(o=p[r])&&t.$$typeof||e(t[o],n[o])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i))return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}}function Kl(){var e,t,n=(e=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return Kl=function(){return n},n}var Ql={name:"19bqh2r",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;"},Gl=function(e){var t=e.size,n=dl(e,["size"]);return Object(pl.c)("svg",s({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ql},n))},Yl=function(e){return Object(pl.c)(Gl,s({size:20},e),Object(pl.c)("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Xl=function(e){return Object(pl.c)(Gl,s({size:20},e),Object(pl.c)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Jl=function(e){var t=e.isFocused,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorContainer",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*r,transition:"color 150ms",":hover":{color:t?a.neutral80:a.neutral40}}},Zl=Jl,ec=Jl,tc=Object(pl.d)(Kl()),nc=function(e){var t=e.delay,n=e.offset;return Object(pl.c)("span",{css:Object(gl.a)({animation:"".concat(tc," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":null,height:"1em",verticalAlign:"top",width:"1em"},"")})},rc=function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps,o=e.isRtl;return Object(pl.c)("div",s({},a,{css:r("loadingIndicator",e),className:n({indicator:!0,"loading-indicator":!0},t)}),Object(pl.c)(nc,{delay:0,offset:o}),Object(pl.c)(nc,{delay:160,offset:!0}),Object(pl.c)(nc,{delay:320,offset:!o}))};rc.defaultProps={size:4};function ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ac(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ac(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cc=function(e){return{label:"input",background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}};function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fc=function(e){var t=e.children,n=e.innerProps;return Object(pl.c)("div",n,t)},pc=fc,dc=fc;var mc=function(e){var t=e.children,n=e.className,r=e.components,a=e.cx,o=e.data,i=e.getStyles,l=e.innerProps,c=e.isDisabled,u=e.removeProps,s=e.selectProps,f=r.Container,p=r.Label,d=r.Remove;return Object(pl.c)(pl.b,null,(function(r){var m=r.css,h=r.cx;return Object(pl.c)(f,{data:o,innerProps:sc(sc({},l),{},{className:h(m(i("multiValue",e)),a({"multi-value":!0,"multi-value--is-disabled":c},n))}),selectProps:s},Object(pl.c)(p,{data:o,innerProps:{className:h(m(i("multiValueLabel",e)),a({"multi-value__label":!0},n))},selectProps:s},t),Object(pl.c)(d,{data:o,innerProps:sc({className:h(m(i("multiValueRemove",e)),a({"multi-value__remove":!0},n))},u),selectProps:s}))}))};mc.defaultProps={cropWithEllipsis:!0};function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}for(var gc={ClearIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({},o,{css:a("clearIndicator",e),className:r({indicator:!0,"clear-indicator":!0},n)}),t||Object(pl.c)(Yl,null))},Control:function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.className,o=e.isDisabled,i=e.isFocused,l=e.innerRef,c=e.innerProps,u=e.menuIsOpen;return Object(pl.c)("div",s({ref:l,css:r("control",e),className:n({control:!0,"control--is-disabled":o,"control--is-focused":i,"control--menu-is-open":u},a)},c),t)},DropdownIndicator:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({},o,{css:a("dropdownIndicator",e),className:r({indicator:!0,"dropdown-indicator":!0},n)}),t||Object(pl.c)(Xl,null))},DownChevron:Xl,CrossIcon:Yl,Group:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.Heading,i=e.headingProps,l=e.label,c=e.theme,u=e.selectProps;return Object(pl.c)("div",{css:a("group",e),className:r({group:!0},n)},Object(pl.c)(o,s({},i,{selectProps:u,theme:c,getStyles:a,cx:r}),l),Object(pl.c)("div",null,t))},GroupHeading:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.theme,o=(e.selectProps,dl(e,["className","cx","getStyles","theme","selectProps"]));return Object(pl.c)("div",s({css:r("groupHeading",oc({theme:a},o)),className:n({"group-heading":!0},t)},o))},IndicatorsContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles;return Object(pl.c)("div",{css:a("indicatorsContainer",e),className:r({indicators:!0},n)},t)},IndicatorSeparator:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerProps;return Object(pl.c)("span",s({},a,{css:r("indicatorSeparator",e),className:n({"indicator-separator":!0},t)}))},Input:function(e){var t=e.className,n=e.cx,r=e.getStyles,a=e.innerRef,o=e.isHidden,i=e.isDisabled,l=e.theme,c=(e.selectProps,dl(e,["className","cx","getStyles","innerRef","isHidden","isDisabled","theme","selectProps"]));return Object(pl.c)("div",{css:r("input",lc({theme:l},c))},Object(pl.c)(bl.a,s({className:n({input:!0},t),inputRef:a,inputStyle:cc(o),disabled:i},c)))},LoadingIndicator:rc,Menu:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerRef,i=e.innerProps;return Object(pl.c)("div",s({css:a("menu",e),className:r({menu:!0},n)},i,{ref:o}),t)},MenuList:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isMulti,i=e.innerRef,l=e.innerProps;return Object(pl.c)("div",s({css:a("menuList",e),className:r({"menu-list":!0,"menu-list--is-multi":o},n),ref:i},l),t)},MenuPortal:Vl,LoadingMessage:Bl,NoOptionsMessage:Ul,MultiValue:mc,MultiValueContainer:pc,MultiValueLabel:dc,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Object(pl.c)("div",n,t||Object(pl.c)(Yl,{size:14}))},Option:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.isFocused,l=e.isSelected,c=e.innerRef,u=e.innerProps;return Object(pl.c)("div",s({css:a("option",e),className:r({option:!0,"option--is-disabled":o,"option--is-focused":i,"option--is-selected":l},n),ref:c},u),t)},Placeholder:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps;return Object(pl.c)("div",s({css:a("placeholder",e),className:r({placeholder:!0},n)},o),t)},SelectContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.innerProps,i=e.isDisabled,l=e.isRtl;return Object(pl.c)("div",s({css:a("container",e),className:r({"--is-disabled":i,"--is-rtl":l},n)},o),t)},SingleValue:function(e){var t=e.children,n=e.className,r=e.cx,a=e.getStyles,o=e.isDisabled,i=e.innerProps;return Object(pl.c)("div",s({css:a("singleValue",e),className:r({"single-value":!0,"single-value--is-disabled":o},n)},i),t)},ValueContainer:function(e){var t=e.children,n=e.className,r=e.cx,a=e.isMulti,o=e.getStyles,i=e.hasValue;return Object(pl.c)("div",{css:o("valueContainer",e),className:r({"value-container":!0,"value-container--is-multi":a,"value-container--has-value":i},n)},t)}},vc=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],bc=new RegExp("["+vc.map((function(e){return e.letters})).join("")+"]","g"),wc={},Ec=0;Ec<vc.length;Ec++)for(var Oc=vc[Ec],Sc=0;Sc<Oc.letters.length;Sc++)wc[Oc.letters[Sc]]=Oc.base;var kc=function(e){return e.replace(bc,(function(e){return wc[e]}))};function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var jc=function(e){return e.replace(/^\s+|\s+$/g,"")},xc=function(e){return"".concat(e.label," ").concat(e.value)};var Pc={name:"1laao21-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;"},Cc=function(e){return Object(pl.c)("span",s({css:Pc},e))};function Tc(e){e.in,e.out,e.onExited,e.appear,e.enter,e.exit;var t=e.innerRef,n=(e.emotion,dl(e,["in","out","onExited","appear","enter","exit","innerRef","emotion"]));return Object(pl.c)("input",s({ref:t},n,{css:Object(gl.a)({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"")}))}function Ac(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Nc=function(e){al(n,e);var t=Ac(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"componentDidMount",value:function(){this.props.innerRef(Object(l.findDOMNode)(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),n}(o.Component),Lc=["boxSizing","height","overflow","paddingRight","position"],Ic={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Dc(e){e.preventDefault()}function Mc(e){e.stopPropagation()}function Rc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Fc(){return"ontouchstart"in window||navigator.maxTouchPoints}function zc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Uc=!(!window.document||!window.document.createElement),Bc=0,Vc=function(e){al(n,e);var t=zc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).originalStyles={},e.listenerOptions={capture:!1,passive:!1},e}return nl(n,[{key:"componentDidMount",value:function(){var e=this;if(Uc){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;if(n&&Lc.forEach((function(t){var n=o&&o[t];e.originalStyles[t]=n})),n&&Bc<1){var i=parseInt(this.originalStyles.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,c=window.innerWidth-l+i||0;Object.keys(Ic).forEach((function(e){var t=Ic[e];o&&(o[e]=t)})),o&&(o.paddingRight="".concat(c,"px"))}a&&Fc()&&(a.addEventListener("touchmove",Dc,this.listenerOptions),r&&(r.addEventListener("touchstart",Rc,this.listenerOptions),r.addEventListener("touchmove",Mc,this.listenerOptions))),Bc+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(Uc){var t=this.props,n=t.accountForScrollbars,r=t.touchScrollTarget,a=document.body,o=a&&a.style;Bc=Math.max(Bc-1,0),n&&Bc<1&&Lc.forEach((function(t){var n=e.originalStyles[t];o&&(o[t]=n)})),a&&Fc()&&(a.removeEventListener("touchmove",Dc,this.listenerOptions),r&&(r.removeEventListener("touchstart",Rc,this.listenerOptions),r.removeEventListener("touchmove",Mc,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),n}(o.Component);function Wc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}Vc.defaultProps={accountForScrollbars:!0};var Hc={name:"1dsbpcp",styles:"position:fixed;left:0;bottom:0;right:0;top:0;"},$c=function(e){al(n,e);var t=Wc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={touchScrollTarget:null},e.getScrollTarget=function(t){t!==e.state.touchScrollTarget&&e.setState({touchScrollTarget:t})},e.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},e}return nl(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.isEnabled,r=this.state.touchScrollTarget;return n?Object(pl.c)("div",null,Object(pl.c)("div",{onClick:this.blurSelectInput,css:Hc}),Object(pl.c)(Nc,{innerRef:this.getScrollTarget},t),r?Object(pl.c)(Vc,{touchScrollTarget:r}):null):t}}]),n}(o.PureComponent);function qc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Kc=function(e){al(n,e);var t=qc(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).isBottom=!1,e.isTop=!1,e.scrollTarget=void 0,e.touchStart=void 0,e.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},e.handleEventDelta=function(t,n){var r=e.props,a=r.onBottomArrive,o=r.onBottomLeave,i=r.onTopArrive,l=r.onTopLeave,c=e.scrollTarget,u=c.scrollTop,s=c.scrollHeight,f=c.clientHeight,p=e.scrollTarget,d=n>0,m=s-f-u,h=!1;m>n&&e.isBottom&&(o&&o(t),e.isBottom=!1),d&&e.isTop&&(l&&l(t),e.isTop=!1),d&&n>m?(a&&!e.isBottom&&a(t),p.scrollTop=s,h=!0,e.isBottom=!0):!d&&-n>u&&(i&&!e.isTop&&i(t),p.scrollTop=0,h=!0,e.isTop=!0),h&&e.cancelScroll(t)},e.onWheel=function(t){e.handleEventDelta(t,t.deltaY)},e.onTouchStart=function(t){e.touchStart=t.changedTouches[0].clientY},e.onTouchMove=function(t){var n=e.touchStart-t.changedTouches[0].clientY;e.handleEventDelta(t,n)},e.getScrollTarget=function(t){e.scrollTarget=t},e}return nl(n,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e&&("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e&&("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.a.createElement(Nc,{innerRef:this.getScrollTarget},this.props.children)}}]),n}(o.Component);function Qc(e){var t=e.isEnabled,n=void 0===t||t,r=dl(e,["isEnabled"]);return n?i.a.createElement(Kc,r):r.children}var Gc=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,r=t.isMulti,a=t.label,o=t.isDisabled,i=t.tabSelectsValue;switch(e){case"menu":return"Use Up and Down to choose options".concat(o?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(a||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"}},Yc=function(e,t){var n=t.value,r=t.isDisabled;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"select-option":return"option ".concat(n,r?" is disabled. Select another option.":", selected.")}},Xc=function(e){return!!e.isDisabled};var Jc={clearIndicator:ec,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,a=r.colors,o=r.borderRadius,i=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?a.neutral5:a.neutral0,borderColor:t?a.neutral10:n?a.primary:a.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(a.primary):null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?a.primary:a.neutral30}}},dropdownIndicator:Zl,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,a=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?a.neutral10:a.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{margin:r.baseUnit/2,paddingBottom:r.baseUnit/2,paddingTop:r.baseUnit/2,visibility:t?"hidden":"visible",color:a.neutral80}},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,a=r.colors,o=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?a.neutral60:a.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:zl,menu:function(e){var t,n=e.placement,r=e.theme,a=r.borderRadius,o=r.spacing,i=r.colors;return t={label:"menu"},Object(pt.a)(t,function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),Object(pt.a)(t,"backgroundColor",i.neutral0),Object(pt.a)(t,"borderRadius",a),Object(pt.a)(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),Object(pt.a)(t,"marginBottom",o.menuGutter),Object(pt.a)(t,"marginTop",o.menuGutter),Object(pt.a)(t,"position","absolute"),Object(pt.a)(t,"width","100%"),Object(pt.a)(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,a=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:a?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,a=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused&&a.dangerLight,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}}},noOptionsMessage:Fl,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,a=e.theme,o=a.spacing,i=a.colors;return{label:"option",backgroundColor:r?i.primary:n?i.primary25:"transparent",color:t?i.neutral20:r?i.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:!t&&(r?i.primary:i.primary50)}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,a=n.colors;return{label:"singleValue",color:t?a.neutral40:a.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"calc(100% - ".concat(2*r.baseUnit,"px)"),overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(e){var t=e.theme.spacing;return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}};var Zc={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}};function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var ru,au={backspaceRemovesValue:!0,blurInputOnSelect:Cl(),captureMenuScroll:!Cl(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({ignoreCase:!0,ignoreAccents:!0,stringify:xc,trim:!0,matchFrom:"any"},ru),r=n.ignoreCase,a=n.ignoreAccents,o=n.stringify,i=n.trim,l=n.matchFrom,c=i?jc(t):t,u=i?jc(o(e)):o(e);return r&&(c=c.toLowerCase(),u=u.toLowerCase()),a&&(c=kc(c),u=kc(u)),"start"===l?u.substr(0,c.length)===c:u.indexOf(c)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Xc,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0},ou=1,iu=function(e){al(n,e);var t=nu(n);function n(e){var r;Object(el.a)(this,n),(r=t.call(this,e)).state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},r.blockOptionHover=!1,r.isComposing=!1,r.clearFocusValueOnUpdate=!1,r.commonProps=void 0,r.components=void 0,r.hasGroups=!1,r.initialTouchX=0,r.initialTouchY=0,r.inputIsHiddenAfterUpdate=void 0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.cacheComponents=function(e){var t;r.components=(t={components:e},yc(yc({},gc),t.components))},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,a=n.onChange,o=n.name;a(e,tu(tu({},t),{},{name:o}))},r.setValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",n=arguments.length>2?arguments[2]:void 0,a=r.props,o=a.closeMenuOnSelect,i=a.isMulti;r.onInputChange("",{action:"set-value"}),o&&(r.inputIsHiddenAfterUpdate=!i,r.onMenuClose()),r.clearFocusValueOnUpdate=!0,r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,a=t.isMulti,o=r.state.selectValue;if(a)if(r.isOptionSelected(e,o)){var i=r.getOptionValue(e);r.setValue(o.filter((function(e){return r.getOptionValue(e)!==i})),"deselect-option",e),r.announceAriaLiveSelection({event:"deselect-option",context:{value:r.getOptionLabel(e)}})}else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue([].concat(Object(yl.a)(o),[e]),"select-option",e),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));else r.isOptionDisabled(e,o)?r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e),isDisabled:!0}}):(r.setValue(e,"select-option"),r.announceAriaLiveSelection({event:"select-option",context:{value:r.getOptionLabel(e)}}));n&&r.blurInput()},r.removeValue=function(e){var t=r.state.selectValue,n=r.getOptionValue(e),a=t.filter((function(e){return r.getOptionValue(e)!==n}));r.onChange(a.length?a:null,{action:"remove-value",removedValue:e}),r.announceAriaLiveSelection({event:"remove-value",context:{value:e?r.getOptionLabel(e):""}}),r.focusInput()},r.clearValue=function(){r.onChange(null,{action:"clear"})},r.popValue=function(){var e=r.state.selectValue,t=e[e.length-1],n=e.slice(0,e.length-1);r.announceAriaLiveSelection({event:"pop-value",context:{value:t?r.getOptionLabel(t):""}}),r.onChange(n.length?n:null,{action:"pop-value",removedValue:t})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ol.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return r.props.getOptionLabel(e)},r.getOptionValue=function(e){return r.props.getOptionValue(e)},r.getStyles=function(e,t){var n=Jc[e](t);n.boxSizing="border-box";var a=r.props.styles[e];return a?a(n,t):n},r.getElementId=function(e){return"".concat(r.instancePrefix,"-").concat(e)},r.getActiveDescendentId=function(){var e=r.props.menuIsOpen,t=r.state,n=t.menuOptions,a=t.focusedOption;if(a&&e){var o=n.focusable.indexOf(a),i=n.render[o];return i&&i.key}},r.announceAriaLiveSelection=function(e){var t=e.event,n=e.context;r.setState({ariaLiveSelection:Yc(t,n)})},r.announceAriaLiveContext=function(e){var t=e.event,n=e.context;r.setState({ariaLiveContext:Gc(t,tu(tu({},n),{},{label:r.props["aria-label"]}))})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,a=t.menuIsOpen;r.focusInput(),a?(r.inputIsHiddenAfterUpdate=!n,r.onMenuClose()):r.openMenu("first"),e.preventDefault(),e.stopPropagation()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.stopPropagation(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&kl(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var a=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=a>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=e.currentTarget.value;r.inputIsHiddenAfterUpdate=!1,r.onInputChange(t,{action:"input-change"}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){var t=r.props,n=t.isSearchable,a=t.isMulti;r.props.onFocus&&r.props.onFocus(e),r.inputIsHiddenAfterUpdate=!1,r.announceAriaLiveContext({event:"input",context:{isSearchable:n,isMulti:a}}),r.setState({isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur"}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){var e=r.props,t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,a=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,l=t.isClearable,c=t.isDisabled,u=t.menuIsOpen,s=t.onKeyDown,f=t.tabSelectsValue,p=t.openMenuOnFocus,d=r.state,m=d.focusedOption,h=d.focusedValue,y=d.selectValue;if(!(c||"function"==typeof s&&(s(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!a)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!f||!m||p&&r.isOptionSelected(m,y))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.inputIsHiddenAfterUpdate=!1,r.onInputChange("",{action:"menu-close"}),r.onMenuClose()):l&&o&&r.clearValue();break;case" ":if(i)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.buildMenuOptions=function(e,t){var n=e.inputValue,a=void 0===n?"":n,o=e.options,i=function(e,n){var o=r.isOptionDisabled(e,t),i=r.isOptionSelected(e,t),l=r.getOptionLabel(e),c=r.getOptionValue(e);if(!(r.shouldHideSelectedOptions()&&i||!r.filterOption({label:l,value:c,data:e},a))){var u=o?void 0:function(){return r.onOptionHover(e)},s=o?void 0:function(){return r.selectOption(e)},f="".concat(r.getElementId("option"),"-").concat(n);return{innerProps:{id:f,onClick:s,onMouseMove:u,onMouseOver:u,tabIndex:-1},data:e,isDisabled:o,isSelected:i,key:f,label:l,type:"option",value:c}}};return o.reduce((function(e,t,n){if(t.options){r.hasGroups||(r.hasGroups=!0);var a=t.options.map((function(t,r){var a=i(t,"".concat(n,"-").concat(r));return a&&e.focusable.push(t),a})).filter(Boolean);if(a.length){var o="".concat(r.getElementId("group"),"-").concat(n);e.render.push({type:"group",key:o,data:t,options:a})}}else{var l=i(t,"".concat(n));l&&(e.render.push(l),e.focusable.push(t))}return e}),{render:[],focusable:[]})};var a=e.value;r.cacheComponents=fl(r.cacheComponents,ql).bind(il(r)),r.cacheComponents(e.components),r.instancePrefix="react-select-"+(r.props.instanceId||++ou);var o=Sl(a);r.buildMenuOptions=fl(r.buildMenuOptions,(function(e,t){var n=hl(e,2),r=n[0],a=n[1],o=hl(t,2),i=o[0];return a===o[1]&&r.inputValue===i.inputValue&&r.options===i.options})).bind(il(r));var i=e.menuIsOpen?r.buildMenuOptions(e,o):{render:[],focusable:[]};return r.state.menuOptions=i,r.state.selectValue=o,r}return nl(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props,n=t.options,r=t.value,a=t.menuIsOpen,o=t.inputValue;if(this.cacheComponents(e.components),e.value!==r||e.options!==n||e.menuIsOpen!==a||e.inputValue!==o){var i=Sl(e.value),l=e.menuIsOpen?this.buildMenuOptions(e,i):{render:[],focusable:[]},c=this.getNextFocusedValue(i),u=this.getNextFocusedOption(l.focusable);this.setState({menuOptions:l,selectValue:i,focusedOption:u,focusedValue:c})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,r,a,o,i=this.props,l=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused;(u&&!l&&e.isDisabled||u&&c&&!e.menuIsOpen)&&this.focusInput(),u&&l&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=n.offsetHeight/3,a.bottom+o>r.bottom?jl(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):a.top-o<r.top&&jl(t,Math.max(n.offsetTop-o,0)),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,a=n.isFocused,o=this.buildMenuOptions(this.props,r),i=this.props,l=i.isMulti,c=i.tabSelectsValue,u="first"===e?0:o.focusable.length-1;if(!l){var s=o.focusable.indexOf(r[0]);s>-1&&(u=s)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.inputIsHiddenAfterUpdate=!1,this.setState({menuOptions:o,focusedValue:null,focusedOption:o.focusable[u]},(function(){t.onMenuOpen(),t.announceAriaLiveContext({event:"menu",context:{tabSelectsValue:c}})}))}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,r=t.isSearchable,a=this.state,o=a.selectValue,i=a.focusedValue;if(n){this.setState({focusedOption:null});var l=o.indexOf(i);i||(l=-1,this.announceAriaLiveContext({event:"value"}));var c=o.length-1,u=-1;if(o.length){switch(e){case"previous":u=0===l?0:-1===l?c:l-1;break;case"next":l>-1&&l<c&&(u=l+1)}-1===u&&this.announceAriaLiveContext({event:"input",context:{isSearchable:r,isMulti:n}}),this.setState({inputIsHidden:-1!==u,focusedValue:o[u]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props,n=t.pageSize,r=t.tabSelectsValue,a=this.state,o=a.focusedOption,i=a.menuOptions,l=i.focusable;if(l.length){var c=0,u=l.indexOf(o);o||(u=-1,this.announceAriaLiveContext({event:"menu",context:{tabSelectsValue:r}})),"up"===e?c=u>0?u-1:l.length-1:"down"===e?c=(u+1)%l.length:"pageup"===e?(c=u-n)<0&&(c=0):"pagedown"===e?(c=u+n)>l.length-1&&(c=l.length-1):"last"===e&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null}),this.announceAriaLiveContext({event:"menu",context:{isDisabled:Xc(l[c]),tabSelectsValue:r}})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Zc):tu(tu({},Zc),this.props.theme):Zc}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,a=this.setValue,o=this.selectOption,i=this.props,l=i.isMulti,c=i.isRtl,u=i.options;return{cx:t,clearValue:e,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,setValue:a,selectProps:i,theme:this.getTheme()}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,r=t.selectValue.indexOf(n);if(r>-1){if(e.indexOf(n)>-1)return n;if(r<e.length)return e[r]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e,t)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var r=this.getOptionValue(e);return t.some((function(e){return n.getOptionValue(e)===r}))}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,r=e.focusedValue,a=e.focusedOption,o=this.props,i=o.options,l=o.menuIsOpen,c=o.inputValue,u=o.screenReaderStatus,s=r?function(e){var t=e.focusedValue,n=e.getOptionLabel,r=e.selectValue;return"value ".concat(n(t)," focused, ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedValue:r,getOptionLabel:this.getOptionLabel,selectValue:n}):"",f=a&&l?function(e){var t=e.focusedOption,n=e.getOptionLabel,r=e.options;return"option ".concat(n(t)," focused").concat(t.isDisabled?" disabled":"",", ").concat(r.indexOf(t)+1," of ").concat(r.length,".")}({focusedOption:a,getOptionLabel:this.getOptionLabel,options:i}):"",p=function(e){var t=e.inputValue,n=e.screenReaderMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}({inputValue:c,screenReaderMessage:u({count:this.countOptions()})});return"".concat(s," ").concat(f," ").concat(p," ").concat(t)}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,a=e.inputValue,o=e.tabIndex,l=e.form,c=this.components.Input,u=this.state.inputIsHidden,f=r||this.getElementId("input"),p={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};if(!n)return i.a.createElement(Tc,s({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:wl,onFocus:this.onInputFocus,readOnly:!0,disabled:t,tabIndex:o,form:l,value:""},p));var d=this.commonProps,m=d.cx,h=d.theme,y=d.selectProps;return i.a.createElement(c,s({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:m,getStyles:this.getStyles,id:f,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,selectProps:y,spellCheck:"false",tabIndex:o,form:l,theme:h,type:"text",value:a},p))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,r=t.MultiValueContainer,a=t.MultiValueLabel,o=t.MultiValueRemove,l=t.SingleValue,c=t.Placeholder,u=this.commonProps,f=this.props,p=f.controlShouldRenderValue,d=f.isDisabled,m=f.isMulti,h=f.inputValue,y=f.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!p)return h?null:i.a.createElement(c,s({},u,{key:"placeholder",isDisabled:d,isFocused:w}),y);if(m)return v.map((function(t,l){var c=t===b;return i.a.createElement(n,s({},u,{components:{Container:r,Label:a,Remove:o},isFocused:c,isDisabled:d,key:"".concat(e.getOptionValue(t)).concat(l),index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var E=v[0];return i.a.createElement(l,s({},u,{data:E,isDisabled:d}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||a)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:l,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!e||!a)return null;return i.a.createElement(e,s({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.a.createElement(n,s({},r,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.a.createElement(e,s({},t,{innerProps:a,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,r=t.GroupHeading,a=t.Menu,o=t.MenuList,l=t.MenuPortal,c=t.LoadingMessage,u=t.NoOptionsMessage,f=t.Option,p=this.commonProps,d=this.state,m=d.focusedOption,h=d.menuOptions,y=this.props,g=y.captureMenuScroll,v=y.inputValue,b=y.isLoading,w=y.loadingMessage,E=y.minMenuHeight,O=y.maxMenuHeight,S=y.menuIsOpen,k=y.menuPlacement,_=y.menuPosition,j=y.menuPortalTarget,x=y.menuShouldBlockScroll,P=y.menuShouldScrollIntoView,C=y.noOptionsMessage,T=y.onMenuScrollToTop,A=y.onMenuScrollToBottom;if(!S)return null;var N,L=function(t){var n=m===t.data;return t.innerRef=n?e.getFocusedOptionRef:void 0,i.a.createElement(f,s({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=h.render.map((function(t){if("group"===t.type){t.type;var a=dl(t,["type"]),o="".concat(t.key,"-heading");return i.a.createElement(n,s({},p,a,{Heading:r,headingProps:{id:o,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return L(e)})))}if("option"===t.type)return L(t)}));else if(b){var I=w({inputValue:v});if(null===I)return null;N=i.a.createElement(c,p,I)}else{var D=C({inputValue:v});if(null===D)return null;N=i.a.createElement(u,p,D)}var M={minMenuHeight:E,maxMenuHeight:O,menuPlacement:k,menuPosition:_,menuShouldScrollIntoView:P},R=i.a.createElement(Ml,s({},p,M),(function(t){var n=t.ref,r=t.placerProps,l=r.placement,c=r.maxHeight;return i.a.createElement(a,s({},p,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:b,placement:l}),i.a.createElement(Qc,{isEnabled:g,onTopArrive:T,onBottomArrive:A},i.a.createElement($c,{isEnabled:x},i.a.createElement(o,s({},p,{innerRef:e.getMenuListRef,isLoading:b,maxHeight:c}),N))))}));return j||"fixed"===_?i.a.createElement(l,s({},p,{appendTo:j,controlElement:this.controlRef,menuPlacement:k,menuPosition:_}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,a=t.isMulti,o=t.name,l=this.state.selectValue;if(o&&!r){if(a){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return i.a.createElement("input",{name:o,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return i.a.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):i.a.createElement("input",{name:o,type:"hidden"});return i.a.createElement("div",null,u)}var s=l[0]?this.getOptionValue(l[0]):"";return i.a.createElement("input",{name:o,type:"hidden",value:s})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.a.createElement(Cc,{"aria-live":"polite"},i.a.createElement("span",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.a.createElement("span",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,a=e.ValueContainer,o=this.props,l=o.className,c=o.id,u=o.isDisabled,f=o.menuIsOpen,p=this.state.isFocused,d=this.commonProps=this.getCommonProps();return i.a.createElement(r,s({},d,{className:l,innerProps:{id:c,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:p}),this.renderLiveRegion(),i.a.createElement(t,s({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:p,menuIsOpen:f}),i.a.createElement(a,s({},d,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),i.a.createElement(n,s({},d,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),n}(o.Component);iu.defaultProps=au;n(100);function lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var cu={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},uu=n(23);function su(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}o.Component;var fu,pu,du,mu=(fu=iu,du=pu=function(e){al(n,e);var t=lu(n);function n(){var e;Object(el.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).select=void 0,e.state={inputValue:void 0!==e.props.inputValue?e.props.inputValue:e.props.defaultInputValue,menuIsOpen:void 0!==e.props.menuIsOpen?e.props.menuIsOpen:e.props.defaultMenuIsOpen,value:void 0!==e.props.value?e.props.value:e.props.defaultValue},e.onChange=function(t,n){e.callProp("onChange",t,n),e.setState({value:t})},e.onInputChange=function(t,n){var r=e.callProp("onInputChange",t,n);e.setState({inputValue:void 0!==r?r:t})},e.onMenuOpen=function(){e.callProp("onMenuOpen"),e.setState({menuIsOpen:!0})},e.onMenuClose=function(){e.callProp("onMenuClose"),e.setState({menuIsOpen:!1})},e}return nl(n,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=this.props)[e].apply(t,r)}}},{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultInputValue,t.defaultMenuIsOpen,t.defaultValue,dl(t,["defaultInputValue","defaultMenuIsOpen","defaultValue"]));return i.a.createElement(fu,s({},n,{ref:function(t){e.select=t},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}]),n}(o.Component),pu.defaultProps=cu,du);function hu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var gu=wp.i18n.__,vu=nt((function(e){return{currentPath:e.common.currentPath,platform:e.common.platform}}))((function(e){var t=ce(),n=[{value:"pages",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),gu("Pages","templately"))},{value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),gu("Blocks","templately"))},{value:"",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-packs"}),gu("Packs","templately"))},{value:"templates",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-templates"}),gu("Templates","templately"))},{value:"clouds",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-myclouds"}),gu("My Clouds","templately"))}],r=hu(Object(o.useState)({value:"blocks",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-blocks"}),gu("Blocks","templately"))}),2),a=r[0],l=r[1];Object(o.useEffect)((function(){for(var e=window.location.href.replace(/^.*\/+/,""),t=i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-pages"}),gu("Packs","templately")),r="",a=0;a<n.length;a++)if(n[a].value===e){r=n[a].value,t=n[a].label;break}l({value:r,label:t})}),[]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-modal-menu"},i.a.createElement("ul",null,"gutenberg"!==e.platform&&i.a.createElement(Zi,{to:"/pages",name:gu("Pages","templately")}),i.a.createElement(Zi,{to:"gutenberg"===e.platform?"/":"/blocks",name:gu("Blocks","templately")}),"gutenberg"===e.platform&&i.a.createElement(Zi,{to:"/pages",name:gu("Pages","templately")}),i.a.createElement(Zi,{to:"gutenberg"===e.platform?"/packs":"/",name:gu("Packs","templately")}),"gutenberg"!==e.platform&&i.a.createElement(Zi,{to:"/templates",name:gu("Templates","templately")}),i.a.createElement(Zi,{className:"efy-clouds-nav",to:"/clouds",name:gu("My Cloud","templately")},i.a.createElement("svg",{width:"20px",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},i.a.createElement("g",null,i.a.createElement("path",{d:"M76.8 76.5H11.6C5.2 76.5 0 81.7 0 88.1s5.2 11.6 11.6 11.6h65.2c6.4 0 11.6-5.2 11.6-11.6.1-6.4-5.1-11.6-11.6-11.6zM71 93.4c-2.9 0-5.2-2.3-5.2-5.2S68.1 83 71 83s5.2 2.3 5.2 5.2c.1 2.8-2.3 5.2-5.2 5.2zM90.2 21.4C88.9 12.7 81.3 6 72.3 6H71C67.4 2.3 62.2.2 57 .2 46.1.2 37.2 9 37 19.8c-4.8 3.8-7.7 9.6-7.7 15.7 0 11 9 20 20 20h32.6c10 0 18.1-8.1 18.1-18.1 0-6.8-3.8-13-9.8-16zm-8.3 24.8H49.3c-5.9 0-10.7-4.8-10.7-10.7 0-3.8 2.1-7.4 5.4-9.3l2.7-1.6-.4-3.2c-.1-.4-.1-.9-.1-1.3 0-5.9 4.8-10.7 10.7-10.7 3.4 0 6.6 1.6 8.6 4.3l1.8 2.5 3-.7c.6-.2 1.3-.2 2-.2 4.8 0 8.8 3.9 8.8 8.7l-.1 4 3.4 1c3.7 1.1 6.3 4.6 6.3 8.4 0 4.9-3.9 8.8-8.8 8.8z"}),i.a.createElement("path",{d:"M76.8 71.8c4.2 0 8 1.6 10.9 4.2L82 59H49.3c-12.7 0-23.1-10.3-23.4-23h-2c-5.1 0-8.4 2.6-11.4 9.3L.3 76.5c2.9-2.9 7-4.7 11.4-4.7z"})))))),i.a.createElement("div",{className:"templately-modal-mobile-menu"},i.a.createElement(mu,{options:n,classNamePrefix:"templately-switcher",onChange:function(n){return function(n){t.push("/"+n.value),l({value:n.value,label:n.label}),e.dispatch(Pi(null)),e.dispatch(ji(!0)),e.dispatch(Hi(null)),e.dispatch(Vi(e.to)),e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1)),e.dispatch(Fi(!1))}(n)},value:a,isSearchable:!1})))})),bu=n(4),wu=n.n(bu),Eu={open:function(e){c.a.render(e,document.getElementById("templately-gutenberg"))},close:function(){c.a.unmountComponentAtNode(document.getElementById("templately-gutenberg"))}};function Ou(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Su(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Su(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Su(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ku=wp.i18n.__,_u=nt((function(e){return{searchQuery:e.common.searchQuery.query,results:e.common.searchQuery.results}}))((function(e){var t=Ou(Object(o.useState)(""),2),n=t[0],r=t[1],a=Ou(Object(o.useState)(!1),2),l=a[0],c=a[1];return Object(o.useEffect)((function(){l&&e.searchQuery.length>0&&(e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Vi("/search/".concat(e.searchQuery))),e.dispatch($i({query:e.searchQuery,isSearching:!0,results:e.results})),c(!1))}),[l]),Object(o.useEffect)((function(){e.dispatch($i({query:n,isSearching:!1,results:e.results}))}),[n]),i.a.createElement("div",{className:"templately-search-action"},i.a.createElement("input",{type:"text",onKeyDown:function(e){return c(13===(null==e?void 0:e.keyCode))},value:n,onChange:function(e){return r(e.currentTarget.value)},placeholder:ku("Search...","templately")}))}));function ju(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pu=nt((function(e){return{platform:e.common.platform}}))((function(e){var t=ju(Object(o.useState)([{value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")},{value:"gutenberg",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),"Gutenberg")}]),2),n=t[0],r=(t[1],ju(Object(o.useState)({value:"elementor",label:i.a.createElement(i.a.Fragment,null,i.a.createElement("span",{className:"tswitcher-icon tswitch-elementor"}),"Elementor")}),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_PLATFORM",payload:a.value}),e.dispatch(Ri(1))}),[a]),i.a.createElement(mu,{options:n,classNamePrefix:"templately-switcher",onChange:function(e){return l(e)},value:a,isSearchable:!1})})),Cu=n(16);function Tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nu=function(e){var t=function e(t,n){var r=t.headers,a=void 0===r?{}:r;for(var o in a)if("x-wp-nonce"===o.toLowerCase()&&a[o]===e.nonce)return n(t);return n(Au(Au({},t),{},{headers:Au(Au({},a),{},{"X-WP-Nonce":e.nonce})}))};return t.nonce=e,t};function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Du=function(e,t){var n,r,a=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(n=e.namespace.replace(/^\/|\/$/g,""),a=(r=e.endpoint.replace(/^\//,""))?n+"/"+r:n),delete e.namespace,delete e.endpoint,t(Iu(Iu({},e),{},{path:a}))};function Mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fu=function(e){return function(t,n){return Du(t,(function(t){var r,a=t.url,o=t.path;return"string"==typeof o&&(r=e,-1!==e.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(o=o.replace("?","&")),a=r+o),n(Ru(Ru({},t),{},{url:a}))}))}};function zu(e){var t=e.split("?"),n=t[1],r=t[0];return n?r+"?"+n.split("&").map((function(e){return e.split("=")})).sort((function(e,t){return e[0].localeCompare(t[0])})).map((function(e){return e.join("=")})).join("&"):r}var Uu=function(e){var t=Object.keys(e).reduce((function(t,n){return t[zu(n)]=e[n],t}),{});return function(e,n){var r=e.parse,a=void 0===r||r;if("string"==typeof e.path){var o=e.method||"GET",i=zu(e.path);if("GET"===o&&t[i]){var l=t[i];return delete t[i],Promise.resolve(a?l.body:new window.Response(JSON.stringify(l.body),{status:200,statusText:"OK",headers:l.headers}))}if("OPTIONS"===o&&t[o]&&t[o][i])return Promise.resolve(t[o][i])}return n(e)}};function Bu(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}var Vu=n(43),Wu=n.n(Vu);function Hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qu(e){return(function(e){var t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,t){var n=hl(t.split("=").filter(Boolean).map(decodeURIComponent),2),r=n[0],a=n[1],o=void 0===a?"":a;r&&function(e,t,n){for(var r=t.length,a=r-1,o=0;o<r;o++){var i=t[o];!i&&Array.isArray(e)&&(i=e.length.toString());var l=!isNaN(Number(t[o+1]));e[i]=o===a?n:e[i]||(l?[]:{}),Array.isArray(e[i])&&!l&&(e[i]=$u({},e[i])),e=e[i]}}(e,r.replace(/\]/g,"").split("["),o);return e}),{})}function Ku(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gu(e){for(var t,n="",r=Object.entries(e);t=r.shift();){var a=hl(t,2),o=a[0],i=a[1];if(Array.isArray(i)||i&&i.constructor===Object){var l,c=Ku(Object.entries(i).reverse());try{for(c.s();!(l=c.n()).done;){var u=hl(l.value,2),s=u[0],f=u[1];r.unshift(["".concat(o,"[").concat(s,"]"),f])}}catch(e){c.e(e)}finally{c.f()}}else void 0!==i&&(null===i&&(i=""),n+="&"+[o,i].map(encodeURIComponent).join("="))}return n.substr(1)}function Yu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(qu(e),t),n=n.substr(0,r)),n+"?"+Gu(t)}function Xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xu(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zu=function(e){return e.json?e.json():Promise.reject(e)},es=function(e){return function(e){if(!e)return{};var t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},ts=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},ns=function(){var e,t=(e=Wu.a.mark((function e(t,n){var r,a,o,i,l,c;return Wu.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(ts(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Ss(Ju(Ju({},(s={per_page:100},f=void 0,p=void 0,f=(u=t).path,p=u.url,Ju(Ju({},dl(u,["path","url"])),{},{url:p&&Yu(p,s),path:f&&Yu(f,s)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,Zu(r);case 9:if(a=e.sent,Array.isArray(a)){e.next=12;break}return e.abrupt("return",a);case 12:if(o=es(r)){e.next=15;break}return e.abrupt("return",a);case 15:i=[].concat(a);case 16:if(!o){e.next=27;break}return e.next=19,Ss(Ju(Ju({},t),{},{path:void 0,url:o,parse:!1}));case 19:return l=e.sent,e.next=22,Zu(l);case 22:c=e.sent,i=i.concat(c),o=es(l),e.next=16;break;case 27:return e.abrupt("return",i);case 28:case"end":return e.stop()}var u,s,f,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Bu(o,r,a,i,l,"next",e)}function l(e){Bu(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function rs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function as(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rs(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var os=new Set(["PATCH","PUT","DELETE"]);function is(e,t){return void 0!==function(e,t){return qu(e)[t]}(e,t)}var ls=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},cs=function(e){var t={code:"invalid_json",message:Object(Cu.a)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},us=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(ls(e,t)).catch((function(e){return ss(e,t)}))};function ss(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return cs(e).then((function(e){var t={code:"unknown_error",message:Object(Cu.a)("An unknown error occurred.")};throw e||t}))}function fs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ds=function(e,t){if(!(e.path&&-1!==e.path.indexOf("/wp/v2/media")||e.url&&-1!==e.url.indexOf("/wp/v2/media")))return t(e);var n=0;return t(ps(ps({},e),{},{parse:!1})).catch((function(r){var a=r.headers.get("x-wp-upload-attachment-id");return r.status>=500&&r.status<600&&a?function e(r){return n++,t({path:"/wp/v2/media/".concat(r,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return n<5?e(r):(t({path:"/wp/v2/media/".concat(r,"?force=true"),method:"DELETE"}),Promise.reject())}))}(a).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Object(Cu.a)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(r)})):ss(r,e.parse)})).then((function(t){return us(t,e.parse)}))};function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ys={Accept:"application/json, */*;q=0.1"},gs={credentials:"include"},vs=[function(e,t){return"string"!=typeof e.url||is(e.url,"_locale")||(e.url=Yu(e.url,{_locale:"user"})),"string"!=typeof e.path||is(e.path,"_locale")||(e.path=Yu(e.path,{_locale:"user"})),t(e)},Du,function(e,t){var n=e.method,r=void 0===n?"GET":n;return os.has(r.toUpperCase())&&(e=as(as({},e),{},{headers:as(as({},e.headers),{},{"X-HTTP-Method-Override":r,"Content-Type":"application/json"}),method:"POST"})),t(e)},ns];var bs=function(e){if(e.status>=200&&e.status<300)return e;throw e},ws=function(e){var t=e.url,n=e.path,r=e.data,a=e.parse,o=void 0===a||a,i=dl(e,["url","path","data","parse"]),l=e.body,c=e.headers;return c=hs(hs({},ys),c),r&&(l=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,hs(hs(hs({},gs),i),{},{body:l,headers:c})).then((function(e){return Promise.resolve(e).then(bs).catch((function(e){return ss(e,o)})).then((function(e){return us(e,o)}))}),(function(){throw{code:"fetch_error",message:Object(Cu.a)("You are probably offline.")}}))};function Es(e){return vs.reduceRight((function(e,t){return function(n){return t(n,e)}}),ws)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Es.nonceEndpoint).then(bs).then((function(e){return e.text()})).then((function(t){return Es.nonceMiddleware.nonce=t,Es(e)}))}))}Es.use=function(e){vs.unshift(e)},Es.setFetchHandler=function(e){ws=e},Es.createNonceMiddleware=Nu,Es.createPreloadingMiddleware=Uu,Es.createRootURLMiddleware=Fu,Es.fetchAllMiddleware=ns,Es.mediaUploadMiddleware=ds;var Os,Ss=Es,ks=n(11),_s=n.n(ks),js=n(62),xs=n.n(js);function Ps(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function Cs(e){return(Cs="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 Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function As(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach((function(t){Ns(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ls=n(120),Is=xs()(_s.a),Ds=TemplatelyAdmin,Ms=Ds.platform,Rs=Ds.post_id,Fs=Ds.nonce,zs=Ds.is_editor,Us=(Ds.current_url,Ds.rest_url),Bs=Ds.api_nonce;Ss.use(Ss.createNonceMiddleware(Bs)),Ss.use(Ss.createRootURLMiddleware(Us)),void 0===(null===(Os=window)||void 0===Os?void 0:Os.fetch)&&Ss.setFetchHandler((function(e){var t=e.url,n=e.path,r=e.data,a=e.method;return wu()({url:t||n,method:a,data:r}).then((function(e){return null==e?void 0:e.data})).catch((function(e){return Promise.reject(e.response.data)}))}));var Vs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={heightAuto:!1,customClass:{container:"templately-swal"},showConfirmButton:!1};if("string"==typeof e){var r=e;n=As(As({},n),{},{text:r})}else{var a=e;n=As(As({},n),{},{html:a})}return t=t!={}?As(As({},n),t):n,Is.fire(t)},Ws=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"remote",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={fileType:"elementor"};n=As(As({},r),n);var a=new FormData;a.append("action","get_templately"),a.append("content_type","template_content"),a.append("nonce",Fs),a.append("source",t),a.append("id",e),void 0!==n.fileType&&a.append("file_type",n.fileType),void 0!==n.is_editor&&a.append("is_editor",n.is_editor);var o=n.fileType;return wu.a.post(ajaxurl,a).then((function(e){if("elementor"===o){if(e.data.success&&e.data.hasOwnProperty("data")){if("undefined"!=typeof elementor){var t=window.TemplatelyIndex;if("undefined"!=typeof $e)for(var n=0;n<e.data.data.content.length;n++)$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:e.data.data.content[n],options:t>=0?{at:t++}:{}});else{var r=new Backbone.Model({getTitle:function(){return"Test"}});elementor.channels.data.trigger("template:before:insert",r);for(var a=window.TemplatelyIndex,i=0;i<e.data.data.content.length;i++)elementor.getPreviewView().addChildElement(e.data.data.content[i],a>=0?{at:a++}:null);elementor.channels.data.trigger("template:after:insert",{})}}return!0}return e}if("gutenberg"===o){var l=wp.blocks.parse,c=wp.data.dispatch("core/block-editor").insertBlocks;return e.data.success&&e.data.hasOwnProperty("data")?(c(l(e.data.data.content)),!0):e}})).catch((function(e){return console.error("Insert Error: ",e)}))},Hs=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cloud",n=new FormData;n.append("action","get_templately"),n.append("content_type","remove_from_cloud"),n.append("remove_from",t);var r="templately"===Ms?"elementor":Ms;return n.append("file_type",r),n.append("id",e),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},$s=function(e){window.open(e,"_blank"),window.focus()},qs=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"set_favourite",r=new FormData;return r.append("action","get_templately"),r.append("content_type",n),r.append("nonce",Fs),r.append("id",e),r.append("type",t),wu.a.post(ajaxurl,r).then((function(e){return e})).catch((function(e){return"Something went wrong."}))},Ks=function(){var e=new FormData;return e.append("action","get_templately"),e.append("content_type","logout"),e.append("nonce",Fs),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return console.error("Fav Error: ",e.response)}))},Qs=function(e,t){for(var n=0,r=0;r<t.length;r++)if(t[r].id===e){n=t[r].count;break}return n},Gs=function(e,t){return t.filter((function(t){return t.id!=e}))},Ys=function(e,t){for(var n=!1,r=0;r<t.length;r++)if(t[r].template_id===e){n=!0;break}return n},Xs=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},Js=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},Zs=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={page:-1};n=As(As({},r),n);var a=new FormData;if(a.append("action","get_templately"),a.append("content_type","get_workspace"),void 0!==n.page&&a.append("pagenum",n.page),void 0!==n.per_page&&a.append("per_page",n.per_page),!0===e&&a.append("shared",!0),a.append("nonce",Fs),t)return wu.a.post(ajaxurl,a).then((function(e){return e}));var o={};return null!=n.cancelToken&&(o.cancelToken=n.cancelToken),wu.a.post(ajaxurl,a,o).then((function(e){return e.data.success?e.data.data.data:e.data.data})).catch((function(e){return console.error("Error Getting WorkSpace List: ",e)}))},ef=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return null!=e&&e.length>0&&"object"==Cs(e)&&e.map((function(e){n.push({value:e.id,slug:e.slug,label:e.name,shared:t})})),n},tf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("content_type","clouds_sync"),null!=e.per_page&&t.append("per_page",e.per_page),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("fileType",e.platform),null!=e.search&&t.append("search",e.search),t.append("nonce",Fs),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},nf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new FormData;return n.append("action","get_templately"),n.append("content_type","workspace_details"),n.append("slug",e),null!=t.per_page&&n.append("per_page",t.per_page),null!=t.page&&n.append("page",t.page),null!=t.search&&n.append("search",t.search),null!=t.platform&&n.append("file_type",t.platform),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))},rf=function(e){var t=new FormData;return null!=e&&e.id&&t.append("id",e.id),e.hasOwnProperty("slug")&&t.append("slug",e.slug),e.hasOwnProperty("type")&&t.append("type",e.type),t.append("action","get_templately"),t.append("content_type","get_item"),t.append("nonce",Fs),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))},af=function(){var e,t=(e=regeneratorRuntime.mark((function e(){var t,n,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},r.length>1&&void 0!==r[1]&&r[1],null!=t.slug){e.next=4;break}return e.abrupt("return",{success:!1,loading:!1,error:!0,data:{errorMessage:"Something errormessage."}});case 4:return(n=new FormData).append("action","get_templately"),n.append("nonce",Fs),n.append("content_type","install_requirements"),n.append("requirements",JSON.stringify(t)),e.next=11,wu.a.post(ajaxurl,n).then((function(e){return e.data.data.hasOwnProperty("success")&&e.data.data.success?{success:!0,loading:!1,error:!1}:"pro_plugin"===e.data.data.errorCode?{success:!1,loading:!1,error:!1}:{success:!1,loading:!1,error:!0,data:{errorMessage:"Something went wrong."}}})).catch((function(e){return{loading:!1,error:!0,data:{errorMessage:e.response}}}));case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Ps(o,r,a,i,l,"next",e)}function l(e){Ps(o,r,a,i,l,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}(),of=function(e){if(e.length<8)return!1;return!!(/[A-Z]/g.test(e)&&/[a-z]/g.test(e)&&/[0-9]/g.test(e))},lf=function(){return new URLSearchParams(ue().search)},cf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null!=e&&e.id?Ss({path:"/clouds?id="+e.id}).then((function(e){var t=document.createElement("a");return t.setAttribute("download",null==e?void 0:e.file_name),t.href=null==e?void 0:e.fileURL,t.click(),t.remove(),!0})).catch((function(e){return console.error("DownloadError: ",null==e?void 0:e.code,null==e?void 0:e.message)})):(console.error("DownloadError: ID is missing to downlod."),!1)};function uf(e){return(uf="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)}var sf=function(e){return i.a.createElement("div",{className:"templately-modal-message ".concat(void 0!==e.className&&e.className)},e.icon&&e.icon,e.title&&i.a.createElement("h3",null," ",e.title," "),i.a.createElement("div",{className:"tmm-body"},"string"==typeof e.content&&i.a.createElement("p",null,e.content),"object"===uf(e.content)&&e.content))};function ff(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pf(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var df=TemplatelyAdmin,mf=df.nonce,hf=df.is_editor,yf=df.platform,gf=wp.i18n.__,vf=nt((function(e){return{preview:e.preview,items:e.items,packs:e.packs,errors:e.errors,successText:e.common.successText,user:e.admin.user}}))((function(e){var t=ff(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ff(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ue();return Object(o.useEffect)((function(){n&&(e.dispatch(vi([])),e.dispatch(bi([])),e.dispatch(Oi([])),"elementor"===yf&&window.TemplatelyModal.destroy(),"gutenberg"===yf&&Eu.close(),r(!1))}),[n]),Object(o.useEffect)((function(){if(l){var t=new FormData;t.append("action","get_templately"),t.append("content_type","clouds_sync"),t.append("nonce",mf);var n="templately"===yf?"elementor":yf;wu.a.post(ajaxurl,t).then((function(t){if(200===t.status&&t.data.success){var r=t.data.data.data.filter((function(e){return n===e.file_type}));e.dispatch(Oi({current_page:t.data.data.current_page,data:r,total_page:t.data.data.total_page,platform:e.platform})),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Synced",content:i.a.createElement("p",null,gf("Your Cloud is Successfully Synced with Your Templately Account.","templately"))})})}})).catch((function(e){return console.error("Sync Error From Actions: ",e)})),c(!1)}}),[l]),i.a.createElement("div",{className:"templately-modal-action-button"},"templately"===yf&&i.a.createElement(Pu,null),i.a.createElement(_u,null),0!==e.user.length&&"/clouds"===u.pathname&&i.a.createElement("button",{className:"templately-button templately-cloud-sync",onClick:function(){return c(!0)}},i.a.createElement("svg",{width:"28px",viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{d:"m357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245-20.397-11.367-43.345-17.35-66.911-17.35-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709-32.323 17.257-52.7 50.784-52.7 88.042 0 55.056 44.792 99.848 99.848 99.848h259.212c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),i.a.createElement("g",{id:"templatelySyncs",fill:"#6d7988",transform:"translate(260 22)"},i.a.createElement("path",{d:"m71.409 103.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012 10.467-15.689 20.775-31.488 30.891-47.406 4.201-6.609 1.861-10.715-5.963-11.07z"}),i.a.createElement("path",{d:"m250.088 84.992c-9.643-15.988-19.451-31.88-29.423-47.666-4.464-7.066-9.893-7.168-14.476-.301-10.26 15.376-20.364 30.86-30.321 46.435-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))),!hf&&0!==e.user.length&&i.a.createElement(ee,{exact:e.exact||!0,path:"/profile",children:function(t){var n=t.match;return i.a.createElement("button",{className:n?"templately-active templately-button":"templately-button",onClick:function(e){return e.preventDefault()}},i.a.createElement(ge,{className:e.className,onClick:function(){e.dispatch(ki({isOpen:!1,deep:0})),e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(Di([])),e.dispatch(Ii([])),e.dispatch(Ri(1))},to:"/profile"},e.user.hasOwnProperty("profile_photo")&&""!=e.user.profile_photo?i.a.createElement("img",{src:e.user.profile_photo}):i.a.createElement(fi,{color:"#a4b0c1"})))}}),("elementor"===yf||"gutenberg"===yf)&&i.a.createElement("button",{className:"templately-button templately-close",onClick:function(){return r(!0)}},i.a.createElement(si,{color:"#a4b0c1"})))})),bf=function(){return i.a.createElement("div",{className:"templately-modal-header"},i.a.createElement(Ji,null),i.a.createElement(vu,null),i.a.createElement(vf,null))},wf=function(e){return i.a.createElement("div",{onScroll:e.onScroll,className:"templately-modal-content-wrapper ".concat(null!=e.classes?e.classes:"")},e.children)},Ef=nt()((function(e){return i.a.createElement("div",{className:"templately-table ".concat(e.className&&e.className," ")},e.children)})),Of=nt()((function(e){return i.a.createElement("div",{className:"templately-table-row ".concat(void 0!==e.className?e.className:"")},e.children)})),Sf=nt()((function(e){return i.a.createElement("div",{className:"templately-table-col ".concat(null!=e.className?e.className:"")},e.children)})),kf=wp.i18n.__,_f=function(e){return i.a.createElement(Of,{className:"templately-table-head"},i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Name"))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Last Modified"))),i.a.createElement(Sf,null,i.a.createElement("p",null,kf("Action"))))))},jf=n(7),xf=n(8),Pf=n.n(xf),Cf=n(2),Tf=n(32),Af=Object.create(null);function Nf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.since,r=t.version,a=t.alternative,o=t.plugin,i=t.link,l=t.hint,c=o?" from ".concat(o):"",u=n?" since version ".concat(n):"",s=r?" and will be removed".concat(c," in version ").concat(r):"",f=a?" Please use ".concat(a," instead."):"",p=i?" See: ".concat(i):"",d=l?" Note: ".concat(l):"",m="".concat(e," is deprecated").concat(u).concat(s,".").concat(f).concat(p).concat(d);m in Af||(Object(Tf.b)("deprecated",e,t,m),console.warn(m),Af[m]=!0)}function Lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t,n){return jf.Children.forEach(t,(function(t,r){t&&"string"!=typeof t&&(t=Object(jf.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e}),[])}function If(e,t){0}function Df(e){if(!e.collapsed)return e.getBoundingClientRect();var t=e.startContainer,n=t.ownerDocument;if("BR"===t.nodeName){var r=t.parentNode;If();var a=Array.from(r.childNodes).indexOf(t);If(),(e=n.createRange()).setStart(r,a),e.setEnd(r,a)}var o=e.getClientRects()[0];if(!o){If();var i=n.createTextNode("");(e=e.cloneRange()).insertNode(i),o=e.getClientRects()[0],If(i.parentNode),i.parentNode.removeChild(i)}return o}var Mf=["[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",");function Rf(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function Ff(e){var t=e.querySelectorAll(Mf);return Array.from(t).filter((function(e){return!(!Rf(e)||function(e){return"iframe"===e.nodeName.toLowerCase()&&"-1"===e.getAttribute("tabindex")}(e))&&("AREA"!==e.nodeName||function(e){var t=e.closest("map[name]");if(!t)return!1;var n=e.ownerDocument.querySelector('img[usemap="#'+t.name+'"]');return!!n&&Rf(n)}(e))}))}function zf(e){var t=e.getAttribute("tabindex");return null===t?0:parseInt(t,10)}function Uf(e){return-1!==zf(e)}function Bf(e,t){return{element:e,index:t}}function Vf(e){return e.element}function Wf(e,t){var n=zf(e.element),r=zf(t.element);return n===r?e.index-t.index:n-r}function Hf(e){return e.filter(Uf).map(Bf).sort(Wf).map(Vf).reduce((t={},function(e,n){var r=n.nodeName,a=n.type,o=n.checked,i=n.name;if("INPUT"!==r||"radio"!==a||!i)return e.concat(n);var l=t.hasOwnProperty(i);if(!o&&l)return e;if(l){var c=t[i];e=Object(Cf.without)(e,c)}return t[i]=n,e.concat(n)}),[]);var t}function $f(e){return Hf(Ff(e))}function qf(e){var t=Ff(e.ownerDocument.body),n=t.indexOf(e);return t.length=n,Object(Cf.last)(Hf(t))}function Kf(e){var t=Ff(e.ownerDocument.body),n=t.indexOf(e),r=t.slice(n+1).filter((function(t){return!e.contains(t)}));return Object(Cf.first)(Hf(r))}var Qf={focusable:r,tabbable:a};function Gf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e){if("undefined"==typeof window)return!1;e=window}var t=e.navigator.platform;return-1!==t.indexOf("Mac")||Object(Cf.includes)(["iPad","iPhone"],t)}var Yf="alt",Xf="ctrl",Jf="meta",Zf="shift",ep={primary:function(e){return e()?[Jf]:[Xf]},primaryShift:function(e){return e()?[Zf,Jf]:[Xf,Zf]},primaryAlt:function(e){return e()?[Yf,Jf]:[Xf,Yf]},secondary:function(e){return e()?[Zf,Yf,Jf]:[Xf,Zf,Yf]},access:function(e){return e()?[Xf,Yf]:[Zf,Yf]},ctrl:function(){return[Xf]},alt:function(){return[Yf]},ctrlShift:function(){return[Xf,Zf]},shift:function(){return[Zf]},shiftAlt:function(){return[Zf,Yf]}},tp=(Object(Cf.mapValues)(ep,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf;return[].concat(Object(yl.a)(e(n)),[t.toLowerCase()]).join("+")}})),Object(Cf.mapValues)(ep,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf,a=r(),o=(n={},Object(pt.a)(n,Yf,a?"⌥":"Alt"),Object(pt.a)(n,Xf,a?"⌃":"Ctrl"),Object(pt.a)(n,Jf,"⌘"),Object(pt.a)(n,Zf,a?"⇧":"Shift"),n),i=e(r).reduce((function(e,t){var n=Object(Cf.get)(o,t,t);return[].concat(Object(yl.a)(e),a?[n]:[n,"+"])}),[]),l=Object(Cf.capitalize)(t);return[].concat(Object(yl.a)(i),[l])}})));Object(Cf.mapValues)(tp,(function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf;return e(t,n).join("")}})),Object(Cf.mapValues)(ep,(function(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gf,a=r(),o=(n={},Object(pt.a)(n,Zf,"Shift"),Object(pt.a)(n,Jf,a?"Command":"Control"),Object(pt.a)(n,Xf,"Control"),Object(pt.a)(n,Yf,a?"Option":"Alt"),Object(pt.a)(n,",",Object(Cu.a)("Comma")),Object(pt.a)(n,".",Object(Cu.a)("Period")),Object(pt.a)(n,"`",Object(Cu.a)("Backtick")),n);return[].concat(Object(yl.a)(e(r)),[t]).map((function(e){return Object(Cf.capitalize)(Object(Cf.get)(o,e,e))})).join(a?" ":" + ")}}));function np(e){return[Yf,Xf,Jf,Zf].filter((function(t){return e["".concat(t,"Key")]}))}Object(Cf.mapValues)(ep,(function(e){return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gf,a=e(r),o=np(t);return!Object(Cf.xor)(a,o).length&&(n?t.key===n:Object(Cf.includes)(a,t.key.toLowerCase()))}}));function rp(e){var t=hl(Object(jf.useState)((function(){return!(!e||"undefined"==typeof window||!window.matchMedia(e).matches)})),2),n=t[0],r=t[1];return Object(jf.useEffect)((function(){if(e){var t=function(){return r(window.matchMedia(e).matches)};t();var n=window.matchMedia(e);return n.addListener(t),function(){n.removeListener(t)}}}),[e]),e&&n}var ap={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},op={">=":"min-width","<":"max-width"},ip={">=":function(e,t){return t>=e},"<":function(e,t){return t<e}},lp=Object(jf.createContext)(null),cp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:">=",n=Object(jf.useContext)(lp),r=!n&&"(".concat(op[t],": ").concat(ap[e],"px)"),a=rp(r);return n?ip[t](ap[e],n):a};cp.__experimentalWidthProvider=lp.Provider;var up=cp,sp=n(64),fp=n.n(sp).a;function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mp=function(e){var t=e.className,n=e.isPressed,r=dp(dp({},dl(e,["className","isPressed"])),{},{className:Pf()(t,{"is-pressed":n})||void 0,role:"img","aria-hidden":!0,focusable:!1});return Object(jf.createElement)("svg",r)},hp=Object(jf.createElement)(mp,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(jf.createElement)((function(e){return Object(jf.createElement)("path",e)}),{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function yp(e){if(e){if(e.scrollHeight>e.clientHeight){var t=(If((n=e).ownerDocument.defaultView),n.ownerDocument.defaultView.getComputedStyle(n)).overflowY;if(/(auto|scroll)/.test(t))return e}var n;return yp(e.parentNode)}}function gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bp(e,t,n,r,a,o,i){var l=t.width,c="rtl"===document.documentElement.dir;"left"===n&&c?n="right":"right"===n&&c&&(n="left"),"left"===r&&c?r="right":"right"===r&&c&&(r="left");var u=Math.round(e.left+e.width/2),s={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)},f=e.left;"right"===r?f=e.right:"middle"!==o&&(f=u);var p=e.right;"left"===r?p=e.left:"middle"!==o&&(p=u);var d,m={popoverLeft:f,contentWidth:f-l>0?l:f},h={popoverLeft:p,contentWidth:p+l>window.innerWidth?window.innerWidth-p:l},y=n,g=null;if(!a)if("center"===n&&s.contentWidth===l)y="center";else if("left"===n&&m.contentWidth===l)y="left";else if("right"===n&&h.contentWidth===l)y="right";else{var v="left"===(y=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;g=v!==l?v:null}if(d="center"===y?s.popoverLeft:"left"===y?m.popoverLeft:h.popoverLeft,i){var b=i.getBoundingClientRect();d=Math.min(d,b.right-l)}return{xAxis:y,popoverLeft:d,contentWidth:g}}function Ep(e,t,n,r,a,o,i){var l=t.height;if(a){var c=(yp(o)||document.body).getBoundingClientRect().top+l-i;if(e.top<=c)return{yAxis:n,popoverTop:Math.min(e.bottom,c)}}var u=e.top+e.height/2;"bottom"===r?u=e.bottom:"top"===r&&(u=e.top);var s={popoverTop:u,contentHeight:(u-l/2>0?l/2:u)+(u+l/2>window.innerHeight?window.innerHeight-u:l/2)},f={popoverTop:e.top,contentHeight:e.top-10-l>0?l:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+l>window.innerHeight?window.innerHeight-10-e.bottom:l},d=n,m=null;if(!a)if("middle"===n&&s.contentHeight===l)d="middle";else if("top"===n&&f.contentHeight===l)d="top";else if("bottom"===n&&p.contentHeight===l)d="bottom";else{var h="top"===(d=f.contentHeight>p.contentHeight?"top":"bottom")?f.contentHeight:p.contentHeight;m=h!==l?h:null}return{yAxis:d,popoverTop:"middle"===d?s.popoverTop:"top"===d?f.popoverTop:p.popoverTop,contentHeight:m}}var Op=function(e,t){return function(n){var r=e(n),a=n.displayName,o=void 0===a?n.name||"Component":a;return r.displayName="".concat(Object(Cf.upperFirst)(Object(Cf.camelCase)(t)),"(").concat(o,")"),r}};function Sp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var kp=Object(jf.createContext)({focusHistory:[]}),_p=kp.Provider,jp=kp.Consumer;_p.displayName="FocusReturnProvider",jp.displayName="FocusReturnConsumer";jf.Component;function xp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Pp=Op((function e(t){if((r=t)instanceof jf.Component||"function"==typeof r){var n=t;return e({})(n)}var r,a=t.onFocusReturn,o=void 0===a?Cf.stubTrue:a;return function(e){var t=function(t){al(r,t);var n=xp(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return nl(r,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==o())for(var r,a=[].concat(Object(yl.a)(Cf.without.apply(void 0,[this.props.focus.focusHistory].concat(Object(yl.a)(n)))),[e]);r=a.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return Object(jf.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},Object(jf.createElement)(e,this.props.childProps))}}]),r}(jf.Component);return function(e){return Object(jf.createElement)(jp,null,(function(n){return Object(jf.createElement)(t,{childProps:e,focus:n})}))}}}),"withFocusReturn");function Cp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Tp=Op((function(e){return function(t){al(r,t);var n=Cp(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).focusContainRef=Object(jf.createRef)(),e.handleTabBehaviour=e.handleTabBehaviour.bind(il(e)),e}return nl(r,[{key:"handleTabBehaviour",value:function(e){if(9===e.keyCode){var t=Qf.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return Object(jf.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},Object(jf.createElement)(e,this.props))}}]),r}(jf.Component)}),"withConstrainedTabbing");function Ap(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Np=["button","submit"];function Lp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Ip=Op((function(e){return function(t){al(r,t);var n=Ap(r);function r(){var e;return Object(el.a)(this,r),(e=n.apply(this,arguments)).bindNode=e.bindNode.bind(il(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(il(e)),e.queueBlurCheck=e.queueBlurCheck.bind(il(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(il(e)),e}return nl(r,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;Object(Cf.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return Object(Cf.includes)(Np,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return Object(jf.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},Object(jf.createElement)(e,s({ref:this.bindNode},this.props)))}}]),r}(jf.Component)}),"withFocusOutside")(function(e){al(n,e);var t=Lp(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),n}(jf.Component));function Dp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Mp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.htmlDocument,n=void 0===t?document:t,r=e.className,a=void 0===r?"lockscroll":r,o=0,i=0;function l(e){var t=n.scrollingElement||n.body;e&&(i=t.scrollTop);var r=e?"add":"remove";t.classList[r](a),n.documentElement.classList[r](a),e||(t.scrollTop=i)}function c(){0===o&&l(!0),++o}function u(){1===o&&l(!1),--o}return function(e){al(n,e);var t=Dp(n);function n(){return Object(el.a)(this,n),t.apply(this,arguments)}return nl(n,[{key:"componentDidMount",value:function(){c()}},{key:"componentWillUnmount",value:function(){u()}},{key:"render",value:function(){return null}}]),n}(jf.Component)}();function Rp(e){e.stopPropagation()}var Fp=Object(jf.forwardRef)((function(e,t){var n=e.children,r=dl(e,["children"]);return Object(jf.createElement)("div",s({},r,{ref:t,onMouseDown:Rp}),n)})),zp=n(22);function Up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Up(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vp(e){var t=Object(jf.useContext)(zp.a),n=t.slots[e]||{},r=t.fills[e],a=Object(jf.useMemo)((function(){return r||[]}),[r]),o=Object(jf.useCallback)((function(n){t.updateSlot(e,n)}),[e,t.updateSlot]),i=Object(jf.useCallback)((function(n){t.unregisterSlot(e,n)}),[e,t.unregisterSlot]),l=Object(jf.useCallback)((function(n){t.registerFill(e,n)}),[e,t.registerFill]),c=Object(jf.useCallback)((function(n){t.unregisterFill(e,n)}),[e,t.unregisterFill]);return Bp(Bp({},n),{},{updateSlot:o,unregisterSlot:i,fills:a,registerFill:l,unregisterFill:c})}function Wp(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=cl(e)););return e}function Hp(){return(Hp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Wp(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}}).apply(this,arguments)}var $p=function(e){return!Object(Cf.isNumber)(e)&&(Object(Cf.isString)(e)||Object(Cf.isArray)(e)?!e.length:!e)},qp=n(65),Kp=n.n(qp);function Qp(e){var t=function(e,t){if("object"!==ol(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ol(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ol(t)?t:String(t)}function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xp(e){var t,n,r,a,o,i,l,c,u,s,f,p=e.children,d=(t=hl(Object(jf.useState)({}),2),n=t[0],r=t[1],a=hl(Object(jf.useState)({}),2),o=a[0],i=a[1],l=Object(jf.useCallback)((function(e,t,n){r((function(r){var a=r[e]||{};return Yp(Yp({},r),{},Object(pt.a)({},e,Yp(Yp({},a),{},{ref:t||a.ref,fillProps:n||a.fillProps||{}})))}))}),[]),c=Object(jf.useCallback)((function(e,t){r((function(n){var r=n[e],a=dl(n,[e].map(Qp));return(null==r?void 0:r.ref)===t?a:n}))}),[]),u=Object(jf.useCallback)((function(e,t){var r=n[e];if(r&&!Kp()(r.fillProps,t)){r.fillProps=t;var a=o[e];a&&a.map((function(e){return e.current.rerender()}))}}),[n,o]),s=Object(jf.useCallback)((function(e,t){i((function(n){return Yp(Yp({},n),{},Object(pt.a)({},e,[].concat(Object(yl.a)(n[e]||[]),[t])))}))}),[]),f=Object(jf.useCallback)((function(e,t){i((function(n){return n[e]?Yp(Yp({},n),{},Object(pt.a)({},e,n[e].filter((function(e){return e!==t})))):n}))}),[]),Object(jf.useMemo)((function(){return{slots:n,fills:o,registerSlot:l,updateSlot:u,unregisterSlot:c,registerFill:s,unregisterFill:f}}),[n,o,l,u,c,s,f]));return Object(jf.createElement)(zp.a.Provider,{value:d},p)}function Jp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var Zp=Object(jf.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),ed=Zp.Provider,td=Zp.Consumer;jf.Component;function nd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var rd=function(e){al(n,e);var t=nd(n);function n(){var e;return Object(el.a)(this,n),(e=t.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(il(e)),e}return nl(n,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,a=t.registerSlot;e.name!==n&&(r(e.name),a(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||Hp(cl(n.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.name,r=e.fillProps,a=void 0===r?{}:r,o=e.getFills,i=Object(Cf.map)(o(n,this),(function(e){var t=e.occurrence,n=Object(Cf.isFunction)(e.children)?e.children(a):e.children;return jf.Children.map(n,(function(e,n){if(!e||Object(Cf.isString)(e))return e;var r="".concat(t,"---").concat(e.key||n);return Object(jf.cloneElement)(e,{key:r})}))})).filter(Object(Cf.negate)($p));return Object(jf.createElement)(jf.Fragment,null,Object(Cf.isFunction)(t)?t(i):i)}}]),n}(jf.Component),ad=function(e){return Object(jf.createElement)(td,null,(function(t){var n=t.registerSlot,r=t.unregisterSlot,a=t.getFills;return Object(jf.createElement)(rd,s({},e,{registerSlot:n,unregisterSlot:r,getFills:a}))}))},od=n(140),id=0;function ld(e){var t=e.name,n=e.children,r=e.registerFill,a=e.unregisterFill,o=function(e){var t=Object(jf.useContext)(Zp),n=t.getSlot,r=t.subscribe,a=hl(Object(jf.useState)(n(e)),2),o=a[0],i=a[1];return Object(jf.useEffect)((function(){return i(n(e)),r((function(){i(n(e))}))}),[e]),o}(t),i=Object(jf.useRef)({name:t,children:n});return i.current.occurrence||(i.current.occurrence=++id),Object(jf.useLayoutEffect)((function(){return r(t,i.current),function(){return a(t,i.current)}}),[]),Object(jf.useLayoutEffect)((function(){i.current.children=n,o&&o.forceUpdate()}),[n]),Object(jf.useLayoutEffect)((function(){t!==i.current.name&&(a(i.current.name,i.current),i.current.name=t,r(t,i.current))}),[t]),o&&o.node?(Object(Cf.isFunction)(n)&&(n=n(o.props.fillProps)),Object(od.createPortal)(n,o.node)):null}var cd=function(e){return Object(jf.createElement)(td,null,(function(t){var n=t.registerFill,r=t.unregisterFill;return Object(jf.createElement)(ld,s({},e,{registerFill:n,unregisterFill:r}))}))};function ud(e){var t=e.name,n=e.fillProps,r=void 0===n?{}:n,a=e.as,o=void 0===a?"div":a,i=dl(e,["name","fillProps","as"]),l=Object(jf.useContext)(zp.a),c=Object(jf.useRef)();return Object(jf.useLayoutEffect)((function(){return l.registerSlot(t,c,r),function(){l.unregisterSlot(t,c)}}),[l.registerSlot,l.unregisterSlot,t]),Object(jf.useLayoutEffect)((function(){l.updateSlot(t,r)})),Object(jf.createElement)(o,s({ref:c},i))}function sd(e){var t,n=e.name,r=e.children,a=Vp(n),o=Object(jf.useRef)({rerender:(t=hl(Object(jf.useState)({}),2)[1],function(){return t({})})});return Object(jf.useEffect)((function(){return a.registerFill(o),function(){a.unregisterFill(o)}}),[a.registerFill,a.unregisterFill]),a.ref&&a.ref.current?("function"==typeof r&&(r=r(a.fillProps)),Object(od.createPortal)(r,a.ref.current)):null}function fd(e){var t=e.bubblesVirtually,n=dl(e,["bubblesVirtually"]);return t?Object(jf.createElement)(ud,n):Object(jf.createElement)(ad,n)}function pd(e){return Object(jf.createElement)(jf.Fragment,null,Object(jf.createElement)(cd,e),Object(jf.createElement)(sd,e))}function dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dd(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hd(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var a,o=hl(r.split(" "),2),i=o[0],l=o[1],c=void 0===l?"center":l;return Pf()("components-animate__appear",(a={},Object(pt.a)(a,"is-from-"+c,"center"!==c),Object(pt.a)(a,"is-from-"+i,"middle"!==i),a))}return"slide-in"===t?Pf()("components-animate__slide-in","is-from-"+r):"loading"===t?Pf()("components-animate__loading"):void 0}function yd(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:hd(md({type:t},r))})}var gd=Tp(Pp((function(e){return e.children})));function vd(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),a=r.paddingTop,o=r.paddingBottom,i=r.paddingLeft,l=r.paddingRight,c=a?parseInt(a,10):0,u=o?parseInt(o,10):0,s=i?parseInt(i,10):0,f=l?parseInt(l,10):0;return{x:e.left+s,y:e.top+c,width:e.width-s-f,height:e.height-c-u,left:e.left+s,right:e.right-f,top:e.top+c,bottom:e.bottom-u}}function bd(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function wd(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Ed(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Od=function(e){var t=e.headerTitle,n=e.onClose,r=e.onKeyDown,a=e.children,o=e.className,i=e.noArrow,l=void 0===i||i,c=e.isAlternate,u=e.position,f=void 0===u?"bottom right":u,p=(e.range,e.focusOnMount),d=void 0===p?"firstElement":p,m=e.anchorRef,h=e.shouldAnchorIncludePadding,y=e.anchorRect,g=e.getAnchorRect,v=e.expandOnMobile,b=e.animate,w=void 0===b||b,E=e.onClickOutside,O=e.onFocusOutside,S=e.__unstableSticky,k=e.__unstableSlotName,_=void 0===k?"Popover":k,j=e.__unstableObserveElement,x=e.__unstableBoundaryParent,P=dl(e,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),C=Object(jf.useRef)(null),T=Object(jf.useRef)(null),A=Object(jf.useRef)(),N=up("medium","<"),L=hl(Object(jf.useState)(),2),I=L[0],D=L[1],M=Vp(_),R=v&&N,F=hl(fp(),2),z=F[0],U=F[1];l=R||l,Object(jf.useLayoutEffect)((function(){if(R)return Ed(A.current,"is-without-arrow",l),Ed(A.current,"is-alternate",c),bd(A.current,"data-x-axis"),bd(A.current,"data-y-axis"),wd(A.current,"top"),wd(A.current,"left"),wd(T.current,"maxHeight"),void wd(T.current,"maxWidth");var e=function(){if(A.current&&T.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return Df(r);if(r instanceof window.Element){var o=r.getBoundingClientRect();return a?o:vd(o,r)}var i=r.top,l=r.bottom,c=i.getBoundingClientRect(),u=l.getBoundingClientRect(),s=new window.DOMRect(c.left,c.top,c.width,u.bottom-c.top);return a?s:vd(s,r)}if(e.current){var f=e.current.parentNode,p=f.getBoundingClientRect();return a?p:vd(p,f)}}(C,y,g,m,h);if(e){var t,n,r=A.current,a=r.offsetParent,o=r.ownerDocument,i=0;if(a&&a!==o.body){var u=a.getBoundingClientRect();i=u.top,e=new window.DOMRect(e.left-u.left,e.top-u.top,e.width,e.height)}if(x)t=null===(n=A.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode;var s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,l=n.split(" "),c=hl(l,3),u=c[0],s=c[1],f=void 0===s?"center":s,p=c[2],d=Ep(e,t,u,p,r,a,o),m=bp(e,t,f,p,r,d.yAxis,i);return vp(vp({},m),d)}(e,U.height?U:T.current.getBoundingClientRect(),f,S,A.current,i,t),p=s.popoverTop,d=s.popoverLeft,v=s.xAxis,b=s.yAxis,w=s.contentHeight,E=s.contentWidth;"number"==typeof p&&"number"==typeof d&&(wd(A.current,"top",p+"px"),wd(A.current,"left",d+"px")),Ed(A.current,"is-without-arrow",l||"center"===v&&"middle"===b),Ed(A.current,"is-alternate",c),bd(A.current,"data-x-axis",v),bd(A.current,"data-y-axis",b),wd(T.current,"maxHeight","number"==typeof w?w+"px":""),wd(T.current,"maxWidth","number"==typeof E?E+"px":"");D(({left:"right",right:"left"}[v]||"center")+" "+({top:"bottom",bottom:"top"}[b]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),a=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",a),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),j&&(n=new window.MutationObserver(e)).observe(j,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",a),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[R,y,g,m,h,f,U,S,j,x]),function(e,t){Object(jf.useEffect)((function(){var n=setTimeout((function(){if(e&&t.current)if("firstElement"!==e)"container"===e&&t.current.focus();else{var n=Qf.tabbable.find(t.current)[0];n?n.focus():t.current.focus()}}),0);return function(){return clearTimeout(n)}}),[])}(d,T);var B=function(e){27===e.keyCode&&n&&(e.stopPropagation(),n()),r&&r(e)};var V=Object(jf.createElement)(Ip,{onFocusOutside:function(e){if(O)O(e);else if(E){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),Nf("Popover onClickOutside prop",{alternative:"onFocusOutside"}),E(t)}else n&&n()}},Object(jf.createElement)(yd,{type:w&&I?"appear":null,options:{origin:I}},(function(e){var r=e.className;return Object(jf.createElement)(Fp,s({className:Pf()("components-popover",o,r,{"is-expanded":R,"is-without-arrow":l,"is-alternate":c})},P,{onKeyDown:B,ref:A}),R&&Object(jf.createElement)(Mp,null),R&&Object(jf.createElement)("div",{className:"components-popover__header"},Object(jf.createElement)("span",{className:"components-popover__header-title"},t),Object(jf.createElement)(Id,{className:"components-popover__close",icon:hp,onClick:n})),Object(jf.createElement)("div",{ref:T,className:"components-popover__content",tabIndex:"-1"},Object(jf.createElement)("div",{style:{position:"relative"}},z,a)))})));return d&&(V=Object(jf.createElement)(gd,null,V)),M.ref&&(V=Object(jf.createElement)(pd,{name:_},V)),m||y?V:Object(jf.createElement)("span",{ref:C},V)};Od.Slot=function(e){var t=e.name,n=void 0===t?"Popover":t;return Object(jf.createElement)(fd,{bubblesVirtually:!0,name:n,className:"popover-slot"})};var Sd=Od;var kd=function(e){var t,n,r=e.shortcut,a=e.className;return r?(Object(Cf.isString)(r)&&(t=r),Object(Cf.isObject)(r)&&(t=r.display,n=r.ariaLabel),Object(jf.createElement)("span",{className:a,"aria-label":n},t)):null};function _d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cl(e);if(t){var a=cl(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return ll(this,n)}}var jd=function(e){al(n,e);var t=_d(n);function n(){var e;return Object(el.a)(this,n),(e=t.apply(this,arguments)).delayedSetIsOver=Object(Cf.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return nl(n,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(e,t){var n=this.props.children;if(1===jf.Children.count(n)){var r=jf.Children.only(n);"function"==typeof r.props[e]&&r.props[e](t)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var a=Object(Cf.includes)(["focus","mouseenter"],r.type);a!==n.state.isOver&&(t?n.delayedSetIsOver(a):n.setState({isOver:a}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.position,r=e.text,a=e.shortcut;if(1!==jf.Children.count(t))return t;var o=jf.Children.only(t),i=this.state.isOver;return Object(jf.cloneElement)(o,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:Lf(o.props.children,i&&Object(jf.createElement)(Sd,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(jf.createElement)(kd,{className:"components-tooltip__shortcut",shortcut:a})))})}}]),n}(jf.Component);var xd=function(e){var t=e.icon,n=e.className,r=dl(e,["icon","className"]),a=["dashicon","dashicons","dashicons-"+t,n].filter(Boolean).join(" ");return Object(jf.createElement)("span",s({className:a},r))};function Pd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pd(Object(n),!0).forEach((function(t){Object(pt.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Td=function(e){var t=e.icon,n=void 0===t?null:t,r=e.size,a=dl(e,["icon","size"]);if("string"==typeof n)return Object(jf.createElement)(xd,s({icon:n},a));if(n&&xd===n.type)return Object(jf.cloneElement)(n,Cd({},a));var o=r||24;if("function"==typeof n)return n.prototype instanceof jf.Component?Object(jf.createElement)(n,Cd({size:o},a)):n(Cd({size:o},a));if(n&&("svg"===n.type||n.type===mp)){var i=Cd(Cd({width:o,height:o},n.props),a);return Object(jf.createElement)(mp,i)}return Object(jf.isValidElement)(n)?Object(jf.cloneElement)(n,Cd({size:o},a)):n};function Ad(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Nd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nd(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function Nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ld=["onMouseDown","onClick"];var Id=Object(jf.forwardRef)((function(e,t){var n=e.href,r=e.target,a=e.isPrimary,o=e.isSmall,i=e.isTertiary,l=e.isPressed,c=e.isBusy,u=e.isDefault,f=e.isSecondary,p=e.isLink,d=e.isDestructive,m=e.className,h=e.disabled,y=e.icon,g=e.iconSize,v=e.showTooltip,b=e.tooltipPosition,w=e.shortcut,E=e.label,O=e.children,S=e.__experimentalIsFocusable,k=dl(e,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);u&&Nf("Button isDefault prop",{alternative:"isSecondary"});var _=Pf()("components-button",m,{"is-secondary":u||f,"is-primary":a,"is-small":o,"is-tertiary":i,"is-pressed":l,"is-busy":c,"is-link":p,"is-destructive":d,"has-text":!!y&&!!O,"has-icon":!!y}),j=h&&!S,x=void 0===n||j?"button":"a",P="a"===x?{href:n,target:r}:{type:"button",disabled:j,"aria-pressed":l};if(h&&S){P["aria-disabled"]=!0;var C,T=Ad(Ld);try{for(T.s();!(C=T.n()).done;){k[C.value]=function(e){e.stopPropagation(),e.preventDefault()}}}catch(e){T.e(e)}finally{T.f()}}var A=!j&&(v&&E||w||!!E&&(!O||Object(Cf.isArray)(O)&&!O.length)&&!1!==v),N=Object(jf.createElement)(x,s({},P,k,{className:_,"aria-label":k["aria-label"]||E,ref:t}),y&&Object(jf.createElement)(Td,{icon:y,size:g}),O);return A?Object(jf.createElement)(jd,{text:E,shortcut:w,position:b},N):N})),Dd=TemplatelyAdmin.loadingImage,Md=function(e){return i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Dd}))};function Rd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zd=wp.i18n.__,Ud=TemplatelyAdmin,Bd=Ud.nonce,Vd=Ud.platform,Wd=Ud.is_block_editor,Hd=Ud.is_editor,$d=nt((function(e){return{is_verified:e.admin.user.is_verified,cloud_map:e.common.cloud_map,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Rd(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Rd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Rd(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Rd(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Object(o.useRef)(null),y=Object(o.useRef)(null),g=Object(o.useRef)(null),v=Object(o.useRef)(null),b=function(e){var t=h.current&&h.current.contains(e.target),n=y.current&&y.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){if(0!=s){var t=new FormData;t.append("action","get_templately"),t.append("content_type","push_to_cloud"),t.append("nonce",Bd),t.append("id",s);var n="templately"===Vd?"elementor":Vd;t.append("file_type",n),Vs("",{showConfirmButton:!1,showCloseButton:!0,html:i.a.createElement(Md,null)}),wu.a.post(ajaxurl,t).then((function(t){t.data.success?("success"==t.data.data.status&&(e.dispatch({type:"ALL_CLOUDS_MAP",payload:{template_id:s,cloud_item_id:t.data.data.data.myCloud_item}}),Vs(zd("Successfully Pushed to Cloud.","templately"),{timer:1500,icon:"success"})),"error"==t.data.data.status&&Vs(zd("Something went wrong.","templately"),{timer:1500,icon:"error"})):Vs(zd(t.data.data,"templately"),{timer:1500,icon:"error"})})).catch((function(e){return console.error("Pushed Related Issue: ",e)})),f(!1)}}),[s]),Object(o.useEffect)((function(){var t,n;0!=d&&(r(!1),(t=d,(n=new FormData).append("action","get_templately"),n.append("content_type","delete_template"),n.append("nonce",Fs),n.append("id",t),n.append("type","template"),wu.a.post(ajaxurl,n).then((function(e){return e.data})).catch((function(e){return{success:!1,data:"Something went wrong regarding delete this template."}}))).then((function(t){t.success?(e.dispatch({type:"REMOVE_TEMPLATE",payload:{id:d,page:e.pagination}}),Vs(t.data,{timer:2e3,icon:"success"})):Vs(t.data,{timer:2e3,icon:"error"})})),m(!1))}),[d]),Object(o.useEffect)((function(){return document.addEventListener("mousedown",b),function(){return document.removeEventListener("mousedown",b)}}),[]),Object(o.useEffect)((function(){0!=l&&(e.isLoading(!0),Ws(e.template.id,"local",{fileType:e.platform}).then((function(t){!0===t?(window.TemplatelyModal.destroy(),e.dispatch(setLoading(!0))):(e.dispatch(setLoading(!1)),e.isLoading(!1),Vs(t,{timer:2e3,icon:"error"}))})))}),[l]),i.a.createElement("div",{ref:v},i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("div",{className:"ttcol-header"},Js("elementor")&&i.a.createElement("img",{src:Js("elementor"),alt:e.name}),i.a.createElement("p",null,zd(e.name)))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,zd(e.date))),i.a.createElement(Sf,{className:"templately-col-actions-btn"},(!Hd||!Wd)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null),zd("Preview","templately")),(!Hd||!Wd)&&i.a.createElement("button",{className:"templately-cloud-item-action-btn tw-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){Boolean(e.is_verified)?f(e.template.id):Vs(zd("Please verify your account for inserting template.","templately"),{timer:1600,icon:"error"})}},i.a.createElement("i",null),zd("Push to Cloud","templately")),(Hd||Wd)&&i.a.createElement(Id,{className:"templately-cloud-item-action-btn tw-insert",ref:g,onClick:function(){return c(e.template.id)}},i.a.createElement("i",null),zd("Insert","templately")),i.a.createElement(Id,{className:"templately-cloud-item-action-btn",ref:h,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:y,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(Hd||Wd)&&i.a.createElement(i.a.Fragment,null,i.a.createElement("li",{className:"tw-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null)," ",zd("Preview","templately")),i.a.createElement("li",{className:"tw-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",zd("Push to Cloud","templately"))),i.a.createElement("li",{className:"twm-preview",onClick:function(){return $s(e.template.preview_url)}},i.a.createElement("i",null)," ",zd("Preview","templately")),i.a.createElement("li",{className:"twm-push-to-cloud",disabled:Ys(e.template.id,e.cloud_map)||!1!==s,onClick:function(){return f(e.template.id)}},i.a.createElement("i",null)," ",zd("Push To Cloud","templately")),i.a.createElement("li",{className:"tw-export"},i.a.createElement("a",{href:e.template.export_url},i.a.createElement("i",null)," ",zd("Export","templately"))),i.a.createElement("li",{className:"tw-delete",onClick:function(){return m(e.template.id)}},i.a.createElement("i",null)," ",zd("Delete","templately")))))))))})),qd=function(e){return i.a.createElement("div",e,e.children)};n(127);function Kd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gd=wp.i18n.__,Yd=nt((function(e){return{pagination:e.common.pagination,need_pagination:e.common.need_pagination}}))((function(e){var t=Kd(Object(o.useState)(1),2),n=t[0],r=t[1],a=Kd(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Kd(Object(o.useState)([]),2),s=u[0],f=u[1];Object(o.useEffect)((function(){r(e.count)}),[e.type,e.count]),Object(o.useEffect)((function(){l&&(e.dispatch(Ri(l)),e.dispatch(Hi(null)),e.categoryPagination||e.dispatch(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:""})),e.dispatch(zi(!0)))}),[l]),Object(o.useEffect)((function(){var t=1,r=n;n>10&&(t=Math.max(1,e.pagination-3),r=Math.min(e.pagination+3,n),e.pagination-1<=3&&(r=7),n-e.pagination<=3&&(t=n-6));var a=[];a.push(i.a.createElement("li",{className:1==e.pagination?"epage-link epage-active":"epage-link",key:1,onClick:function(){return c(1)}},Gd(1,"templately"))),t>1?a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdot"},Gd("...","templately"))):a.filter((function(e){return"dotdotdot"!=e.key}));for(var o=function(t){a.push(i.a.createElement("li",{className:e.pagination==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return c(t)}},Gd(t,"templately")))},l=t+1;l<r;l+=1)o(l);e.pagination+3<n&&r!==n&&a.push(i.a.createElement("li",{className:"epage-link",key:"dotdotdotdot"},Gd("...","templately"))),a.push(i.a.createElement("li",{className:e.pagination==n?"epage-link epage-active":"epage-link",key:n,onClick:function(){return c(n)}},Gd(n,"templately"))),n>=2?(e.dispatch(Fi(!0)),f(a)):e.dispatch(Fi(!1))}),[n,e.pagination]);var p,d=function(){var t=e.pagination-1>0?e.pagination-1:0;e.dispatch(Ri(t))},m=function(){var t=e.pagination+1<n?e.pagination+1:n;e.dispatch(Ri(t))};return i.a.createElement(i.a.Fragment,null,!(s.length<2||!e.need_pagination)&&i.a.createElement("div",{className:"templately-pagination"},i.a.createElement("ul",null,(p=!(e.pagination>1),i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return d()},disabled:p},i.a.createElement(Go,null)))),s,function(){var t=!(e.pagination<n);return i.a.createElement("li",{className:"epage-link pagination-arrow"},i.a.createElement("button",{onClick:function(){return m()},disabled:t},i.a.createElement(Yo,null)))}())))})),Xd=TemplatelyAdmin.loadingImage,Jd=nt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){var t;return i.a.createElement("div",{className:"templately-pre-loader"},(null===(t=e.retryMessage)||void 0===t?void 0:t.length)>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(ji(!0)),e.dispatch(pi(!e.retry)),e.dispatch(yi(""))}},"Retry")):i.a.createElement("img",{src:Xd}))}));function Zd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return em(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return em(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function em(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tm=TemplatelyAdmin.templates,nm=nt((function(e){return{templates:e.common.templates,isTemplate:e.common.isTemplate||!1,userID:e.admin.user.id||null,platform:e.common.platform,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination}}))((function(e){var t=Zd(Object(o.useState)([]),2),n=t[0],r=t[1],a=Zd(Object(o.useState)(1),2),l=a[0],c=a[1],u=Zd(Object(o.useState)(!1),2),s=u[0],f=u[1];return Object(o.useEffect)((function(){e.pagination>1&&!e.templates.hasOwnProperty(e.pagination)&&(f(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","get_templates"),null!=e.page&&t.append("page",e.page),null!=e.platform&&t.append("platform",e.platform),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({page:e.pagination,platform:e.platform}).then((function(t){t.data.success&&e.dispatch(wi(t.data.data)),f(!1)})).catch((function(e){console.error(e.response)})))}),[e.pagination]),Object(o.useEffect)((function(){e.isTemplate||(e.dispatch(wi(tm)),e.dispatch({type:"TEMPLATE_TRIGGER",payload:{isTemplate:!0}}))}),[e.templates,e.isTemplate]),Object(o.useEffect)((function(){if("elementor"===e.platform){var t=[];e.templates.hasOwnProperty(e.pagination)&&(e.templates[e.pagination].map((function(e){t.push(i.a.createElement($d,{isLoading:function(e){return f(e)},key:e.id,file_type:e.type,id:e.id,name:e.title,date:e.date,template:e}))})),r(t),c(e.templates.total_page))}}),[e.templates,e.pagination]),i.a.createElement(wf,null,i.a.createElement("div",{className:"templately-modal-content templately-templates"},s&&i.a.createElement(Jd,null),!s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ef,{className:"templately-clouds-table"},i.a.createElement(_f,null),i.a.createElement(qd,{className:"templately-table-body"},n)),i.a.createElement(Yd,{type:"templates",count:l}))))}));n(128);function rm(e){return(rm="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 am(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function om(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cm=wp.i18n.__,um=TemplatelyAdmin,sm=um.nonce,fm=um.cloud_activity,pm=wp.apiFetch,dm=nt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList}}))((function(e){var t=im(Object(o.useState)(""),2),n=t[0],r=t[1],a=im(Object(o.useState)(!0),2),l=a[0],c=a[1],u=im(Object(o.useState)(!1),2),s=u[0],f=u[1],p=im(Object(o.useState)(!1),2),d=p[0],m=p[1],h=im(Object(o.useState)(!1),2),y=h[0],g=h[1],v=im(Object(o.useState)([fm]),2),b=v[0],w=v[1],E=im(Object(o.useState)(fm),2),O=E[0],S=E[1],k=im(Object(o.useState)(!1),2),_=k[0],j=k[1],x=im(Object(o.useState)("/clouds?refresh"),2),P=x[0],C=x[1],T=im(Object(o.useState)([]),2),A=T[0],N=T[1];return Object(o.useEffect)((function(){e.dispatch({type:"SET_NEXT_ROUTE",payload:"/templates/save"}),e.isLoggedIn||e.dispatch(Vi("/sign-in"));var t=!0;return function(n,r){if(A.length<=0)Promise.all([Zs(!1,!1),Zs(!0,!1)]).then((function(n){if(n.length>0){var r=[];r.push({label:cm("My Clouds","templately"),value:"clouds"}),null!==n[0]&&(t&&e.dispatch(Qi(n[0])),r.push({label:cm("My WorkSpace","templately"),options:ef(n[0])})),null!==n[1]&&(t&&e.dispatch(Gi(n[1])),r.push({label:cm("Shared WorkSpace","templately"),options:ef(n[1],!0)})),t&&(w(r),N(r))}})).catch((function(e){wu.a.isCancel(e)||console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var a=[];if(a.push({label:cm("My Clouds","templately"),value:"clouds"}),e.workspaceList.length>0&&a.push({label:cm("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&a.push({label:cm("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList)}),a.length>0){var o=[];a.map((function(e){e&&null!=e.options&&(e.options=e.options.filter((function(e){return e.slug&&-1!==e.slug.indexOf(n.toLowerCase())}))),o.push(e)})),t&&w(a)}}}(),function(){return t=!1}}),[]),Object(o.useEffect)((function(){c(!(n.length>0))}),[n]),Object(o.useEffect)((function(){f(d)}),[d]),Object(o.useEffect)((function(){if("gutenberg"===e.platform&&s){var t=parseInt(O.value),r=wp.data.select("core/editor").getEditedPostAttribute("title"),a=wp.data.select("core/editor").getEditedPostContent(),o=wp.data.select("core/editor").getCurrentPostId(),i=wp.data.select("core/editor").getCurrentPostType(),l=wp.data.select("core/editor").isEditedPostEmpty(),c={title:r,content:a};0===c.content.length&&Vs("You have no content to save in Templately.",{timer:2e3,icon:"warning"}),l||(wp.data.dispatch("core/editor").savePost(),pm({path:"/wp/v2/".concat(i,"s/").concat(o),method:"POST",data:c}).then((function(r){var a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?am(Object(n),!0).forEach((function(t){om(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):am(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({__file:"wp_block"},c),o=new FormData;o.append("action","get_templately"),o.append("content_type","push_to_cloud"),o.append("nonce",sm),isNaN(t)||(o.append("workspace_id",t),o.append("workspaceActivity",JSON.stringify(O)),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),o.append("title",n),o.append("data",JSON.stringify(a)),o.append("file_type","gutenberg"),j(!0),wu.a.post(ajaxurl,o).then((function(t){if(t.data.success){var n=JSON.parse(t.data.data.data);null!=n?(n.hasOwnProperty("myCloud_item")&&e.dispatch(Wi(n.myCloud_item)),j("redirect")):(Vs("Something went wrong.",{timer:2e3,icon:"error"}),C("/templates/save"),j("redirect"))}else Vs(t.data.data,{timer:2e3,icon:"error"}),j("redirect"),C("/templates/save")}))}))),f(!1)}if(s&&"elementor"===e.platform){var u=parseInt(O.value),p={};isNaN(u)||((p={workspace_id:u}).workspaceActivity=JSON.stringify(O),O.shared?C("/shared/workspace/"+O.slug+"?refresh"):C("/workspace/"+O.slug+"?refresh")),j(!0);var d=null==e.page||!0===e.page?elementor.previewView.el.firstElementChild.firstElementChild:e.currentElement;navigator.userAgent.toLowerCase().indexOf("firefox");if(null!=d)(function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new FormData;o.append("action","get_templately"),o.append("content_type","save_template"),o.append("nonce",Fs),n=r.model?r.model.get("elType"):elementor.config.document.library&&elementor.config.document.library.save_as_same_type?elementor.config.document.type:"page",t=r.hasOwnProperty("model")?[r.model.toJSON({remove:["default"]})]:elementor.elements.toJSON({remove:["default"]}),o.append("content",JSON.stringify(t)),o.append("source","local"),o.append("type",n),o.append("title",e),o.append("post_id",Rs);var i="templately"===Ms?"elementor":Ms;return o.append("file_type",i),null!=a.thumbnail&&o.append("thumbnail",a.thumbnail),null!=a.workspace_id&&(o.append("workspace_id",a.workspace_id),o.append("workspaceActivity",a.workspaceActivity)),wu.a.post(ajaxurl,o).then((function(e){return e})).catch((function(e){return e}))})(n,d,p).then((function(t){if(t.data.success&&null!=t.data.data.data){var n=JSON.parse(t.data.data.data);"object"==rm(n)&&(n.hasOwnProperty("myCloud_item")&&e.dispatch(Wi(n.myCloud_item)),j("redirect"),Vs(t.data.data.message,{timer:2e3,icon:"success"}))}else Vs("Something went wrong.",{timer:2e3,icon:"error"}),j("redirect"),C("/templates/save")})).catch((function(e){return console.error("Pushed Error: ",e)}));f(!1)}}),[s]),Object(o.useEffect)((function(){y&&S(y)}),[y]),i.a.createElement(wf,null,i.a.createElement("div",{className:"templately-modal-content templately-templates-save"},_&&i.a.createElement(Jd,null),"redirect"===_&&i.a.createElement(Y,{to:P}),!1===_&&i.a.createElement("div",null,i.a.createElement("h3",null,cm("Save Your Template And Push to Cloud","templately")," "),i.a.createElement("div",{className:"templately-save-form"},i.a.createElement("div",null,i.a.createElement("input",{autoFocus:!0,type:"text",onKeyDown:function(e){return m(13===e.keyCode)},onChange:function(e){return r(e.currentTarget.value)},value:n,placeholder:"Template Name"}),i.a.createElement(mu,{maxMenuHeight:"200px",options:b,value:O,onChange:function(e){return g(e)}})),i.a.createElement("button",{disabled:l,className:"templately-button",onClick:function(){return f(!0)}},cm("Save & Push","templately"))))))}));n(38),n(39),n(55),n(129);function mm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ym=wp.i18n.__,gm=TemplatelyAdmin,vm=gm.nonce,bm=(gm.platform,function(e,t){return t.path===e}),wm=nt((function(e){return{cloudUsageLimit:e.common.cloud_usage_limit}}))((function(e){var t=function(e){var t=ue(),n=le(H).match;return e?Z(t.pathname,e):n}(),n=mm(Object(o.useState)(0),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){if(void 0===e.cloudUsageLimit.plan){var t=new FormData;t.append("action","get_templately"),t.append("content_type","cloud_usage_limit"),t.append("nonce",vm);wu.a.post(ajaxurl,t).then((function(t){200===t.status&&t.data.success&&"success"===t.data.data.status&&e.dispatch({type:"CLOUD_USAGE_LIMIT",payload:JSON.parse(t.data.data.data)})})).catch((function(e){console.error("Usages Limit: ",e)}))}}),[]),Object(o.useEffect)((function(){a(100*e.cloudUsageLimit.files/e.cloudUsageLimit.limit)}),[e.cloudUsageLimit]),i.a.createElement("div",{className:"templately-workspace-sidebar"},i.a.createElement("div",{className:"tws-menu-list"},i.a.createElement("ul",null,i.a.createElement(Zi,{to:"/clouds",className:"tws-menu-item tws-menu-item-cloud"},i.a.createElement("i",null),i.a.createElement("span",null,ym("My Cloud","templately"))),i.a.createElement(Zi,{to:"/workspace",active:bm("/workspace/:slug",t),className:"tws-menu-item tws-menu-item-workspaces"},i.a.createElement("i",null),i.a.createElement("span",null,ym("My WorkSpace","templately"))),i.a.createElement(Zi,{to:"/shared/workspace",active:bm("/shared/workspace/:slug",t),className:"tws-menu-item tws-menu-item-share"},i.a.createElement("i",null),i.a.createElement("span",null,ym("Shared with Me","templately"))),i.a.createElement(Zi,{to:"/profile",className:"tws-menu-item tws-menu-item-profile"},i.a.createElement("i",null),i.a.createElement("span",null,ym("Profile","templately"))))),i.a.createElement("div",{className:"tws-size"},i.a.createElement("div",null,i.a.createElement("p",null,ym("My Cloud Status","templately")),i.a.createElement("div",null,i.a.createElement("span",{style:{width:"".concat(r,"%")}})),i.a.createElement("p",null,"".concat(e.cloudUsageLimit&&e.cloudUsageLimit.files," of ").concat(e.cloudUsageLimit&&(-1===e.cloudUsageLimit.limit?"Unlimited":e.cloudUsageLimit.limit)," Files")))))})),Em=nt()((function(e){return i.a.createElement("div",{className:"templately-workspace"},i.a.createElement(wm,null),i.a.createElement("div",{className:"templately-workspace-content"},e.children))}));function Om(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var km=wp.i18n.__,_m=TemplatelyAdmin,jm=_m.loadingImage,xm=(_m.platform,_m.nonce,function(e){var t=Om(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Om(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Om(Object(o.useState)(""),2),s=u[0],f=u[1],p=Om(Object(o.useState)(!0),2),d=p[0],m=p[1],h=Om(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Om(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Om(Object(o.useState)([]),2),O=E[0],S=E[1];return Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)r(!0),Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.singleDispatch(t[0],"workspace"),n.push({label:km("My WorkSpace","templately"),options:ef(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.singleDispatch(t[1]),n.push({label:km("Shared WorkSpace","templately"),options:ef(t[1],!0)})),n.length>0?(r(!1),S(n)):f("string"==typeof t[0]?t[0]:"string"==typeof t[1]?t[1]:"")}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:km("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:km("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList,!0)}),t.length>0&&S(t)}}),[l]),Object(o.useEffect)((function(){m(!1===b)}),[b]),Object(o.useEffect)((function(){y&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"copy";if(null===e||null===t)return!1;var r=new FormData;return r.append("action","get_templately"),r.append("content_type","copy_or_move"),r.append("cloud_file_id",e),r.append("workspace_id",t),r.append("trigger_action",n),r.append("nonce",Fs),wu.a.post(ajaxurl,r).then((function(e){return e}))}(e.itemID,b.value,e.action).then((function(t){t.data.success&&"success"==t.data.data?_s.a.close({triggered:!0,action:e.action,name:b.label,fileTo:b.slug}):r(!1)})),g(!1))}),[y]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:jm})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,km("Item Name","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement("h3",null,e.title))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,"copy"===e.action?km("Copy to","templately"):km("Move to","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:O,onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:d,onClick:function(){return g(!0)}},km("Done","templately")))))});function Pm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pm(Object(n),!0).forEach((function(t){Tm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Am(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lm=wp.i18n.__,Im=TemplatelyAdmin,Dm=Im.platform,Mm=Im.is_block_editor,Rm=Im.is_editor,Fm=nt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Am(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Am(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Am(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Am(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Am(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Am(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Object(o.useRef)(null),O=Object(o.useRef)(null),S=Object(o.useRef)(null),k=Object(o.useRef)(null),_=function(e){var t=E.current&&E.current.contains(e.target),n=O.current&&O.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",_),function(){return document.removeEventListener("mousedown",_)}}),[]),Object(o.useEffect)((function(){!1!==l&&(e.isLoading(!0),Ws(l,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==Dm?window.TemplatelyModal.destroy():Eu.close()):(e.isLoading(!1),Vs(t,{icon:"error",timer:2e3}))})))}),[l]),Object(o.useEffect)((function(){s&&(cf({id:s}).then((function(e){e?Vs("Downloaded!",{icon:"success",timer:2e3}):Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})).catch((function(e){Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})),f(!1))}),[s]),Object(o.useEffect)((function(){if(!1!==d||!1!==y){var t=!1!==y?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==y?y:d;Vs("",{html:i.a.createElement(xm,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(Qi(t)):e.dispatch(Gi(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Oi({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?m(!1):g(!1)}}),[d,y]),Object(o.useEffect)((function(){if(!1!==b){Vs("",Cm(Cm({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(sf,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?Hs(b,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(Ki({fileFrom:e.currentWorkspace,id:b,page:e.pagination}))):(e.isDelete(!0),e.dispatch(Si({page:e.pagination,id:t.data.data,platform:e.platform}))),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:t})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),w(!1)}}),[b]),i.a.createElement("div",{ref:k},i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("div",{className:"ttcol-header"},Js(e.file_type)&&i.a.createElement("img",{src:Js(e.file_type),alt:e.name}),i.a.createElement("p",null,Lm(e.name)))),i.a.createElement(Sf,null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("p",null,Lm(e.date))),i.a.createElement(Sf,{className:"templately-col-actions-btn"},(Rm||Mm)&&i.a.createElement(Id,{className:"templately-cloud-item-action-btn tw-insert",ref:S,onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement(Id,{className:"templately-cloud-item-action-btn",ref:E,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:O,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-download",onClick:function(){return f(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Download"),i.a.createElement("li",{className:"tw-copy",onClick:function(){return m(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return w(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))))}));function zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Um(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zm(Object(n),!0).forEach((function(t){Bm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hm=wp.i18n.__,$m=TemplatelyAdmin,qm=$m.platform,Km=$m.is_block_editor,Qm=$m.is_editor,Gm=nt((function(e){return{clouds:e.common.cloud_files,workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,userID:e.admin.user.id||null,pagination:e.common.pagination,platform:e.common.platform}}))((function(e){var t=Vm(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Vm(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Vm(Object(o.useState)(!1),2),s=u[0],f=u[1],p=Vm(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Vm(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Vm(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Object(o.useRef)(null),O=Object(o.useRef)(null),S=(Object(o.useRef)(null),Object(o.useRef)(null)),k=function(e){var t=E.current&&E.current.contains(e.target),n=O.current&&O.current.contains(e.target);t||n||r(!1)};return Object(o.useEffect)((function(){return document.addEventListener("mousedown",k),function(){return document.removeEventListener("mousedown",k)}}),[]),Object(o.useEffect)((function(){!1!==s&&(e.isLoading(!0),Ws(s,"cloud",{fileType:e.platform}).then((function(t){!0===t?(e.isLoading(!1),"gutenberg"!==qm?window.TemplatelyModal.destroy():Eu.close()):(e.isLoading(!1),Vs(t,{icon:"error",timer:2e3}))})))}),[s]),Object(o.useEffect)((function(){l&&(cf({id:l}).then((function(e){e?Vs("Downloaded!",{icon:"success",timer:2e3}):Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})).catch((function(e){Vs("Something went wrong. Try again.",{icon:"error",timer:2e3})})),c(!1))}),[l]),Object(o.useEffect)((function(){if(!1!==d||!1!==y){var t=!1!==y?"move":"copy",n="copy"===t?"Copied":"Moved",r=!1!==y?y:d;Vs("",{html:i.a.createElement(xm,{title:e.name,singleDispatch:function(t,n){"workspace"===n?e.dispatch(Qi(t)):e.dispatch(Gi(t))},itemID:r,currentWorkspace:e.currentWorkspace,action:t,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.triggered){if("move"!==t.action||e.details)"move"===t.action&&e.details&&(e.itemDelete(!0),e.isLoading(!0));else{var a=e.clouds[e.platform][e.pagination].filter((function(e){return e.id!==r})),o=e.clouds.hasOwnProperty(e.platform)?e.clouds[e.platform].total_page:1;e.dispatch(Oi({current_page:e.pagination,data:a,total_page:o,platform:e.platform})),e.isDelete(!0)}return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully ".concat(n),content:i.a.createElement("p",null,"Your file has been ".concat(n.toLowerCase()," to a WorkSpace called")," ",i.a.createElement("strong",null,t.name))})})}})),"copy"===t?m(!1):g(!1)}}),[d,y]),Object(o.useEffect)((function(){if(!1!==b){Vs("",Um(Um({showConfirmButton:!0,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!0,reverseButtons:!0,html:i.a.createElement(sf,{title:"Are You Sure?",content:"You want to delete the file from your cloud."})},{}),{},{preConfirm:function(t){return t?Hs(b,e.details?"workspace":"cloud").then((function(t){return t.data.success?(e.details?(e.itemDelete(!0),e.dispatch(Ki({fileFrom:e.currentWorkspace,id:b,page:e.pagination}))):(e.isDelete(!0),e.dispatch(Si({page:e.pagination,id:t.data.data,platform:e.platform}))),{delete:!0,fileFrom:e.currentWorkspace}):{delete:!1}})):{delete:!1}}})).then((function(e){if(!e.dismiss){if(e.value&&e.value.delete){var t=e.value.fileFrom?"You have deleted a file from your WorkSpace called ".concat(e.value.fileFrom):"You have deleted a file from your cloud.";return Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:t})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."})})}})),w(!1)}}),[b]),i.a.createElement("div",{ref:S},i.a.createElement("div",{className:"tcloud-grid-item"},i.a.createElement("div",{className:"tcloud-grid-item-content"},Js(e.file_type)&&i.a.createElement("img",{src:Js(e.file_type),alt:e.name}),i.a.createElement("h4",null,Hm(e.name)),i.a.createElement("p",null,Hm(e.date))),i.a.createElement("div",{className:"tcloud-grid-item-context-menu grid-view"},i.a.createElement(Id,{className:"templately-cloud-item-action-btn grid-view",ref:E,onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:O,className:"templately-sw-cxt-menu ".concat(!0===n?"topen":"")},i.a.createElement("ul",null,(Qm||Km)&&i.a.createElement("li",{className:"tw-insert",onClick:function(){return f(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Insert"),i.a.createElement("li",{className:"tw-download",onClick:function(){return c(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Download"),i.a.createElement("li",{className:"tw-copy",onClick:function(){return m(e.details?e.cloud_id:e.id)}},i.a.createElement("i",null),"Copy to WorkSpace"),i.a.createElement("li",{className:"tw-move".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return g(e.owner.id===e.userID&&(e.details?e.cloud_id:e.id))}},i.a.createElement("i",null),"Move to WorkSpace"),i.a.createElement("li",{className:"tw-delete".concat(e.owner.id!==e.userID?" tw-disable":""),onClick:function(){return w(e.owner.id===e.userID&&e.id)}},i.a.createElement("i",null),"Delete"))))))})),Ym=wp.i18n.__,Xm=function(e){return i.a.createElement("div",{className:"ttemplately-loggein-message"},i.a.createElement("div",null,i.a.createElement("p",null,Ym("You have to logged in, in order to visit this page or view your items from cloud.","templately")),i.a.createElement(ge,{className:"templately-button btn-templately-login",to:"/sign-in"},Ym("Login","templately"))))},Jm=wp.i18n.__,Zm=function(e){var t=e.onClick,n=e.activeTab;return i.a.createElement("div",{className:"templately-profile-tab-menu"},i.a.createElement("ul",null,i.a.createElement("li",{className:"personal"===n?"active":"",onClick:function(){return t("personal")}},i.a.createElement(fi,null)," ",Jm("Personal Info","templately")),i.a.createElement("li",{className:"favourites"===n?"active":"",onClick:function(){return t("favourites")}},i.a.createElement(ni,null),Jm("My Favourites","templately")),i.a.createElement("li",{className:"downloads"===n?"active":"",onClick:function(){return t("downloads")}},i.a.createElement(Zo,null),Jm("My Downloads","templately"))))},eh=function(e){var t=e.render;return i.a.createElement("div",{className:"templately-profile-tab-content"},t())};n(130);function th(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rh=wp.i18n.__,ah=nt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform}}))((function(e){var t,n,r,a,l,c,u,s,f=th(Object(o.useState)(!1),2),p=f[0],d=f[1];return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){0!=p&&(Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(mi(!1)),e.dispatch(Ui([])),e.dispatch(Ei({platform:e.platform})),e.dispatch({type:"WORKSPACE_RESET"}),e.dispatch({type:"SHARED_WORKSPACE_RESET"}),e.dispatch({type:"WORKSPACE_DETAILS_RESET"}),Vs(rh("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(rh("Something went wrong.","templately"),{icon:"error",timer:1500})})),d(!1))}),[p]),i.a.createElement("div",{className:"templately-profile"},(null===(t=e.user)||void 0===t?void 0:t.profile_photo)&&i.a.createElement("img",{className:"templately-profile-photo",src:null===(n=e.user)||void 0===n?void 0:n.profile_photo,alt:null===(r=e.user)||void 0===r?void 0:r.name}),i.a.createElement("h1",null,(null===(a=e.user)||void 0===a?void 0:a.name)||"".concat(null===(l=e.user)||void 0===l?void 0:l.first_name," ").concat(null===(c=e.user)||void 0===c?void 0:c.last_name)),i.a.createElement("ul",null,i.a.createElement("li",null,"Email: ",null===(u=e.user)||void 0===u?void 0:u.email),i.a.createElement("li",null,"Joining Date: ",null===(s=e.user)||void 0===s?void 0:s.joined)),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},rh("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return d(!0)},className:"button templately-button"},rh("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return d(!0)},className:"button templately-button"},rh("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(ge,{className:"button templately-button",to:"/sign-in"},rh("Link My Account","templately"))))})),oh=n(66),ih=wp.i18n.__,lh=function(e){return i.a.createElement("div",{className:"templately-item-badge ".concat(e.pro?"templately-pro":"templately-free")},i.a.createElement("span",null,e.pro?ih("Pro","templately"):ih("Starter","templately")))};function ch(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sh=wp.i18n.__,fh=TemplatelyAdmin,ph=fh.loadingImage,dh=(fh.is_editor,function(e){var t=e.content,n=ch(Object(o.useState)(!1),2),r=n[0],a=n[1],l=ch(Object(o.useState)(!1),2),c=l[0],u=l[1],s=ch(Object(o.useState)(""),2),f=s[0],p=s[1],d=ch(Object(o.useState)(!1),2),m=d[0],h=d[1],y=ch(Object(o.useState)(!1),2),g=y[0],v=y[1],b=ch(Object(o.useState)(""),2),w=b[0],E=b[1],O=ch(Object(o.useState)(!1),2),S=O[0],k=O[1],_=ch(Object(o.useState)(!1),2),j=_[0],x=_[1];return Object(o.useEffect)((function(){var t,n,r,o;0!=g&&(a(!0),(t=g,n=w,r=e.platform,(o=new FormData).append("action","get_templately"),o.append("content_type","create_page"),o.append("title",n),o.append("nonce",Fs),o.append("id",t),o.append("platform",r),wu.a.post(ajaxurl,o).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),k(e))})),v(!1),E(""))}),[g]),Object(o.useEffect)((function(){var e,t;0!=m&&(a(!0),(e=m,(t=new FormData).append("action","get_templately"),t.append("content_type","import_to_library"),t.append("nonce",Fs),t.append("id",e),t.append("is_editor",Boolean(zs)),wu.a.post(ajaxurl,t).then((function(e){return e.data.success?e.data.data:e})).catch((function(e){return e}))).then((function(e){u(!1),e.hasOwnProperty("data")&&e.data.hasOwnProperty("success")&&!1===e.data.success?(e.data.hasOwnProperty("data")&&e.data.data.hasOwnProperty("errorCode")?(u("required_pro"===e.data.data.errorCode),p(e.data.data.message)):p(e.data.data),a(!1)):(a(!1),k(e))})).catch((function(e){return console.error("Importing went wrong: ",e)})),h(!1))}),[m]),Object(o.useEffect)((function(){a(!0),function(e){if(e.length<=0)return!1;var t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","platform_exists"),t.append("platform",e),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(e.platform).then((function(e){a(!1),e.data.data?x(!0):x(!1)}))}),[]),i.a.createElement(i.a.Fragment,null,r&&i.a.createElement("div",{className:"templately-pre-loader templately-platform-check"},i.a.createElement("img",{src:ph}),i.a.createElement("p",null,"Checking platform exists or not...")),!r&&i.a.createElement("div",{className:"templately-import-modal"},i.a.createElement("div",{className:"templately-im-header"},i.a.createElement("h3",null,e.title)),i.a.createElement("div",{className:"templately-im-body"},!1!==S&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,sh("Template imported successfully! You can now edit or preview the template and push to Templately cloud.","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:S.edit_link},sh("Edit Template","templately")),0!=S.elementor_edit_link&&i.a.createElement("a",{className:"templately-modal-button button",href:S.elementor_edit_link},sh("Edit Template with Elementor","templately")),i.a.createElement("a",{className:"templately-modal-button button",href:S.visit},sh("Preview Template","templately"))),""!==f&&i.a.createElement("div",{className:"templately-imb-section"},"html"==(null==f?void 0:f.type)&&null!=(null==f?void 0:f.message)&&i.a.createElement("p",{dangerouslySetInnerHTML:{__html:f.message}}),c&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},sh("Upgrade to Pro","templately"))),0==S&&j&&""===f&&i.a.createElement(i.a.Fragment,null,"elementor"===e.platform&&i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use."),i.a.createElement("button",{className:"templately-modal-button button",onClick:function(){return h(t.id)}},sh("Import to Library","templately"))),i.a.createElement("div",{className:"templately-imb-section"},i.a.createElement("p",null,"Create a new page from this template to make it available as a draft page in your Pages list."),i.a.createElement("div",{className:"templately-imb-new-form"},i.a.createElement("input",{className:"widefat",type:"text",value:w,onChange:function(e){return E(e.currentTarget.value)}}),i.a.createElement("button",{className:"templately-modal-button button",disabled:""===w,onClick:function(){return v(t.id)}},sh("Create a Page","templately"))))),0==S&&!j&&i.a.createElement(i.a.Fragment,null,i.a.createElement("p",null,"You should have install"," ",sh(e.platform,"templately")," first.")))))});function mh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mh(Object(n),!0).forEach((function(t){yh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gh(e){return function(e){if(Array.isArray(e))return wh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||bh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||bh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bh(e,t){if(e){if("string"==typeof e)return wh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wh(e,t):void 0}}function wh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Eh=wp.i18n.__,Oh=TemplatelyAdmin,Sh=Oh.loadingImage,kh=Oh.is_editor,_h=Oh.is_block_editor,jh=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,a=e.errors,l=vh(Object(o.useState)(!0),2),c=l[0],u=l[1],s=vh(Object(o.useState)(!1),2),f=s[0],p=s[1],d=vh(Object(o.useState)(!1),2),m=d[0],h=d[1],y=vh(Object(o.useState)({}),2),g=y[0],v=y[1];return t?(Object(o.useEffect)((function(){af(t).then((function(e){u(e.loading),p(e.error),v(e.data)}))}),[]),Object(o.useEffect)((function(){m&&(u(!0),p(!1),af(t).then((function(e){if(!e.error){var n=a.filter((function(e){return e.id!==t.id}));r(n)}u(e.loading),p(e.error),v(e.data)})),h(!1))}),[m]),Object(o.useEffect)((function(){c||n(f)}),[c]),Object(o.useEffect)((function(){f&&r([].concat(gh(a),[t]))}),[f]),i.a.createElement(i.a.Fragment,null,c?i.a.createElement("span",{className:"templately-installing"},i.a.createElement("span",{className:"dashicons dashicons-update"}),"Installing..."):null,f?g&&g.errorMessage?i.a.createElement("span",{className:"templately-error"},i.a.createElement("span",{className:"dashicons dashicons-no"}),g.errorMessage):i.a.createElement("button",{className:"button button-small templately-retry",onClick:function(){return h(!0)}},i.a.createElement("span",{className:"dashicons dashicons-no"}),"Retry & Proceed to Import"):null,c||f?null:i.a.createElement("span",{className:"templately-success"},i.a.createElement("span",{className:"dashicons dashicons-yes-alt"})," Success"))):(Object(o.useEffect)((function(){n()}),[]),i.a.createElement("span",{className:"templately-warning"},i.a.createElement("span",{className:"dashicons dashicons-warning"})," Ignored"))},xh=function(e){var t=vh(Object(o.useState)(!1),2),n=t[0],r=t[1],a=vh(Object(o.useState)(!0),2),l=a[0],c=a[1],u=vh(Object(o.useState)([]),2),s=u[0],f=u[1],p=vh(Object(o.useState)(!1),2),d=p[0],m=p[1],h=vh(Object(o.useState)(null),2),y=h[0],g=h[1],v=vh(Object(o.useState)({}),2),b=v[0],w=v[1],E=vh(Object(o.useState)([]),2),O=E[0],S=E[1];Object(o.useEffect)((function(){var t,n,a;return(n=e.dependencyList,(a=new FormData).append("action","get_templately"),a.append("content_type","check_dependency"),a.append("nonce",Fs),a.append("dependency",JSON.stringify(n)),a.append("platform",Ms),wu.a.post(ajaxurl,a).then((function(e){return e.data.success?e.data.data.dependency:[]}))).then((function(n){var a,o=[];n.length>0&&(n.map((function(e,t){o.push(e)})),a="name",o.sort(Ls(a)),f(o)),o.length>0?c(!1):t=setTimeout((function(){"elementor"===e.platform&&Boolean(kh)||Boolean(_h)&&"gutenberg"===e.platform?_s.a.close({insert:!0}):(c(!1),r(!0))}),1500)})),function(){return clearTimeout(t)}}),[]);var k=function(e){return void 0===b[e]||b[e]},_=function(){g((function(e){return e+1}))},j=function(e){S(e)};return Object(o.useEffect)((function(){null!=y&&y>s.length-1&&0===O.length&&("elementor"===e.platform&&Boolean(kh)||Boolean(_h)&&"gutenberg"===e.platform?_s.a.close({insert:!0}):r(!0))}),[y]),Object(o.useEffect)((function(){d&&_s.a.close({cancel:!0})}),[d]),i.a.createElement("div",{className:"templately-global-modal"},l&&i.a.createElement("div",{className:"templately-pre-loader templately-dependencies"},i.a.createElement("img",{src:Sh}),i.a.createElement("p",null,"Checking dependencies...")),n&&!l&&i.a.createElement(dh,{platform:e.platform,title:e.title,content:e.content}),!l&&!n&&i.a.createElement("div",{className:"templately-installer-widget align-left"},i.a.createElement("h4",null,"To import this item you need to install all the Plugin(s) listed below:"),s.length>0&&i.a.createElement("ul",null,s.map((function(e,t){return i.a.createElement("li",{key:t},i.a.createElement("div",{className:"templately-checkbox"},i.a.createElement("input",{value:"1",type:"checkbox",id:"requirement".concat(t),disabled:e.is_pro,checked:k(t)&&!e.is_pro,onChange:function(n){if(!e.is_pro){var r=!!n.target.checked;w((function(e){return hh(hh({},e),{},yh({},t,r))}))}}}),i.a.createElement("label",{htmlFor:"requirement".concat(t)},i.a.createElement("span",null,e.link&&"#"!=e.link&&""!=e.link?i.a.createElement("a",{target:"_blank",rel:"nofollow",href:e.link},e.name):e.name))),y===t||y>t?i.a.createElement(jh,{key:"installing".concat(t),requirement:k(t)&&!e.is_pro?e:null,completeCallback:_,errors:O,setErrors:function(e){return j(e)}}):null)}))),i.a.createElement("p",null,i.a.createElement("strong",null,"Note:")," Make sure you have manually installed & activated the ",i.a.createElement("em",null,"PRO Plugin(s)")," ","listed above"),i.a.createElement("div",{className:"templately-btn-group"},i.a.createElement("button",{disabled:null!==y,onClick:function(){return m(!0)},className:"button button-large templately-installer-btn"},Eh("Cancel","templately")),i.a.createElement("button",{disabled:null!==y,onClick:function(){return g(0)},className:"button button-large templately-installer-btn"},Eh("Install & Proceed to Import","templately")))))};function Ph(e){return(Ph="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 Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Th(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ch(Object(n),!0).forEach((function(t){Ah(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ah(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ih=TemplatelyAdmin,Dh=Ih.default_image,Mh=Ih.is_editor,Rh=Ih.platform,Fh=nt((function(e){return{preview:e.preview,favourites:e.admin.user.favourites,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,loading:e.common.loading,platform_exists:e.common.platforms}}))((function(e){var t=e.content,n=ue(),r=Nh(Object(o.useState)(!1),2),a=r[0],l=r[1],c=Nh(Object(o.useState)(!1),2),u=c[0],s=c[1],f=Nh(Object(o.useState)(!1),2),p=f[0],d=f[1],m=Nh(Object(o.useState)([]),2),h=m[0],y=m[1],g=Nh(Object(o.useState)(null==t?void 0:t.favourite_count),2),v=g[0],b=g[1],w="pack"===e.type;Object(o.useEffect)((function(){if(0!=a){if(!e.isLoggedIn)return e.dispatch(Vi("/sign-in")),void l(!1);Vs("",{showCloseButton:!0,allowOutsideClick:!1,target:Mh?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xh,{dependencyList:t.dependencies,platform:e.platform,title:t.name,content:t})}).then((function(t){null!=t.insert&&t.insert?(e.dispatch(_i(!0)),e.dispatch(gi(Th(Th({},e.platform_exists),{},Ah({},"elementor",!0)))),Ws(a,"remote",{fileType:e.platform,is_editor:Boolean(Mh)}).then((function(t){if(!0===t)"gutenberg"!==Rh?window.TemplatelyModal.destroy():Eu.close(),e.dispatch(_i(!1));else{e.dispatch(_i(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),Vs("",{icon:"error",html:i.a.createElement(sf,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},"Upgrade to Pro"))})})}}))):e.dispatch(_i(!1))})),l(!1)}}),[a]),Object(o.useEffect)((function(){var n;p&&(u?(n=qs(t.id,t.type,"set_unfavourite"),s(!1),b(v-1)):(n=qs(t.id,t.type),s(!0),b(v+1)),n.then((function(t){t.data.success&&e.dispatch(Ui(t.data.data))})),d(!1))}),[p]);var E=["block","page"].includes(t.type)?"item":"pack";return Object(o.useEffect)((function(){var n,r;if(s(void 0!==e.favourites&&(null===(n=e.favourites)||void 0===n?void 0:n[E])&&(null===(r=e.favourites)||void 0===r?void 0:r[E].includes(t.id))),t.dependencies&&t.dependencies.length>0){var a=[];t.dependencies.map((function(e,t){null!=e.icon&&a.push(i.a.createElement("img",{key:t,src:e.icon,alt:e.name}))})),y(a)}}),[]),i.a.createElement(i.a.Fragment,null,"object"==Ph(t)&&i.a.createElement("div",{className:Pf()("templately-single-item","templately-".concat("pack"===t.type?"pack":"block"),{"templately-preview-item":e.preview.isOpen})},i.a.createElement("div",null,i.a.createElement("div",{className:"templately-item-image"},i.a.createElement(lh,{pro:0!=t.price}),i.a.createElement(oh.LazyLoadImage,{height:"200px",effect:"blur",width:"100%",delayTime:"500",visibleByDefault:!0,alt:t.name,src:t.thumbnail||Dh}),i.a.createElement("div",{className:"templately-item-image-hover"},"pack"!=t.type&&i.a.createElement("span",null,i.a.createElement(ge,{to:"/".concat(t.type,"/").concat(t.slug,"?preview=true")},i.a.createElement(ti,{size:"20",color:"#fff"}))),(null==n?void 0:n.pathname)&&n.pathname!=="/".concat(t.type,"/").concat(t.slug)&&i.a.createElement("span",null,i.a.createElement(ge,{to:"/".concat(t.type,"/").concat(t.slug)},i.a.createElement(ri,{size:"20",color:"#fff"}))),h.length>0&&i.a.createElement("div",{className:"templately-item-dependencies-icon"},h))),i.a.createElement("div",{className:"templately-single-item-details"},i.a.createElement("div",{className:"templately-single-item-details-content"},i.a.createElement("p",{className:"item-title"},i.a.createElement("strong",null,t.name)),!w&&i.a.createElement("button",{className:"templately-button",onClick:function(){return l(t.id)}},i.a.createElement(Zo,{color:"#6072ff"}))),i.a.createElement("div",{className:"templately-single-item-details-hover"},i.a.createElement("div",{className:"templately-fav-rating"},i.a.createElement("button",{className:"templately-button templately-fav",onClick:function(){return d(!0)}},i.a.createElement(ni,{size:"16px",color:u?"#f5365b":"#ddd"}),i.a.createElement("span",null,v)),i.a.createElement("span",{className:"templately-ratings"},i.a.createElement(li,{size:"16px",color:"#ffdc63"}),i.a.createElement("span",null,null==t.rating?0:t.rating.toFixed(1)))),("block"==e.type||"page"==e.type||e.preview.isOpen)&&i.a.createElement("button",{className:"templately-button",onClick:function(){return l(t.id)}},i.a.createElement(Zo,{color:"#6072ff"})))))))})),zh=function(e){var t=e.items,n=e.isLoading,r=(e.itemsType,Object(o.useRef)(null));return Object(o.useEffect)((function(){return r.current=!0,function(){return r.current=!1}}),[]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement(Jd,null),!n&&(null==t?void 0:t.length)>0&&i.a.createElement(i.a.Fragment,null,t.map((function(e){return i.a.createElement(Fh,{type:e.type,key:e.id,content:e})}))))},Uh=["active","numbers","itemsFor","setActive"];function Bh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Vh=function(e){var t,n,r,a=e.active,o=e.numbers,l=e.itemsFor,c=e.setActive,u=Bh(e,Uh),s=Pf()("templately-plan-switcher",u.className);return i.a.createElement("div",{className:s},i.a.createElement("button",{onClick:function(){return c("all")},className:"components-button templately-plan-all ".concat("all"===a?"tactive":"")},"All ",u.showNumber&&"(".concat(null===(t=o[l])||void 0===t?void 0:t.total,")")),i.a.createElement("button",{onClick:function(){return c("starter")},className:"components-button templately-plan-starter ".concat("starter"===a?"tactive":"")},"Starter ",u.showNumber&&"(".concat(null===(n=o[l])||void 0===n?void 0:n.starter,")")),i.a.createElement("button",{onClick:function(){return c("pro")},className:"components-button templately-plan-pro ".concat("pro"===a?"tactive":"")},"Pro ",u.showNumber&&"(".concat(null===(r=o[l])||void 0===r?void 0:r.pro,")")))},Wh=["active","setActive"];function Hh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var $h=function(e){var t=e.active,n=e.setActive,r=Hh(e,Wh),a=Pf()("templately-items-switcher",r.className);return i.a.createElement("div",{className:a},i.a.createElement("button",{onClick:function(){return n("all")},className:"components-button ".concat("all"===t?"tactive":"")},"All"),i.a.createElement("button",{onClick:function(){return n("blocks")},className:"components-button ".concat("blocks"===t?"tactive":"")},"Blocks"),i.a.createElement("button",{onClick:function(){return n("pages")},className:"components-button ".concat("pages"===t?"tactive":"")},"Pages"),i.a.createElement("button",{onClick:function(){return n("packs")},className:"components-button ".concat("packs"===t?"tactive":"")},"Packs"))};function qh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qh=nt((function(e){return{favourites:e.profile.favourites,user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform,pagination:e.common.pagination}}))((function(e){var t=qh(Object(o.useState)([]),2),n=t[0],r=t[1],a=qh(Object(o.useState)(!0),2),l=a[0],c=a[1],u=qh(Object(o.useState)("all"),2),s=u[0],f=u[1],p=Object(o.useRef)(null),d=qh(Object(o.useState)(1),2),m=d[0],h=d[1],y=qh(Object(o.useState)("all"),2),g=y[0],v=y[1],b=Object(o.useCallback)((function(){switch(s){case"starter":return"plan_type=2";case"pro":return"plan_type=3";default:return"plan_type=1"}}),[s]),w=Object(o.useCallback)((function(){switch(g){case"blocks":return"&type=block";case"pages":return"&type=page";case"packs":return"&type=pack";default:return""}}),[g]);return Object(o.useEffect)((function(){return function(){e.dispatch(Ri(1))}}),[]),Object(o.useEffect)((function(){var t,n,a,o;if(!(null!==(t=e.favourites)&&void 0!==t&&t[s]&&null!==(n=e.favourites[s])&&void 0!==n&&n[e.platform]&&null!==(a=e.favourites[s][e.platform])&&void 0!==a&&a[g]&&null!==(o=e.favourites[s][e.platform][g])&&void 0!==o&&o[e.pagination]))return p.current=!0,c(!0),Ss({path:"/my-favourites?".concat(b()).concat(w(),"&page=").concat(e.pagination)}).then((function(t){p.current&&(null!=t&&t.data&&(r(t.data),h(t.total_page),e.dispatch({type:"SET_USER_FAVOURITES",payload:{category:g,plan:s,platform:e.platform,currentPage:t.current_page,totalPage:t.total_page,data:t.data}})),c(!1))})).catch((function(t){console.error("Error: Fetching My Favourites",t),e.dispatch(yi("Error: Fetching My Favourites"))})),function(){p.current=!1}}),[s,e.pagination,g]),Object(o.useEffect)((function(){var t,n,a,o;null!==(t=e.favourites)&&void 0!==t&&t[s]&&null!==(n=e.favourites[s])&&void 0!==n&&n[e.platform]&&null!==(a=e.favourites[s][e.platform])&&void 0!==a&&a[g]&&null!==(o=e.favourites[s][e.platform][g])&&void 0!==o&&o[e.pagination]&&(r(e.favourites[s][e.platform][g][e.pagination]),c(!1))}),[s,e.pagination,g]),i.a.createElement("div",{className:"templately-my-favourites"},i.a.createElement("div",{className:"my-favourites-header"},i.a.createElement($h,{className:"favourites-item-menu",active:g,setActive:v}),i.a.createElement(Vh,{className:"favourites-item-subs",active:s,setActive:f})),i.a.createElement("div",{className:"favourites-item-list"},i.a.createElement(zh,{itemsType:"block",items:n,isLoading:l})),i.a.createElement(Yd,{type:"favourites",count:m}))})),Gh=function(e){return i.a.createElement("div",e,e.children)};function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(n),!0).forEach((function(t){Jh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ey(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ey(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ey(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ty=Object(o.createContext)({includes:[],excludes:[],setIncludes:function(e){return e},setExcludes:function(e){return e}}),ny=function(e){var t=e.children,n=e.dependencies,r=e.giveAwayControls,a=e.activeFilter,l=e.setActiveFilter,c=Zh(Object(o.useState)(n.map((function(e){return e.id}))),2),u=c[0],s=(c[1],Zh(Object(o.useState)(n.map((function(e){return Xh(Xh({},e),{},{action:"none"})}))),2)),f=s[0],p=s[1],d=Zh(Object(o.useState)("none"),2),m=d[0],h=d[1];return Object(o.useEffect)((function(){p(n.map((function(e){return Xh(Xh({},e),{},{action:"none"})})))}),[n]),Object(o.useEffect)((function(){f.every((function(e){return"none"===e.action}))?h("none"):f.every((function(e){return"include"===e.action}))?h("include"):f.every((function(e){return"exclude"===e.action}))?h("exclude"):h("mixed")}),[f]),Object(o.useEffect)((function(){r(f)}),[f]),i.a.createElement(ty.Provider,{value:{activeFilter:a,setActiveFilter:l,controls:u,activeControls:f,setActiveControls:p,activeState:m,setActiveState:h}},t)},ry=ty,ay=["children","className"];function oy(){return(oy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ly(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iy(Object(n),!0).forEach((function(t){cy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var sy=function(e){e.children;var t=e.className,n=uy(e,ay),r=Object(o.useContext)(ry),a=r.activeControls,l=r.setActiveControls,c=r.activeState,u=r.setActiveState,s=r.activeFilter,f=r.setActiveFilter,p=Object(o.useCallback)((function(){switch(c){case"none":case"mixed":l(a.map((function(e){return ly(ly({},e),{},{action:"include"})}))),u("include");break;case"include":l(a.map((function(e){return ly(ly({},e),{},{action:"exclude"})}))),u("exclude");break;case"exclude":default:l(a.map((function(e){return ly(ly({},e),{},{action:"none"})}))),u("none")}}),[a,l,u,c]);return i.a.createElement("div",{className:"templately-sidebar-filter-head"},i.a.createElement("div",{className:"templately-pro-batch-select","aria-checked":c},i.a.createElement("span",oy({role:"checkbox","aria-checked":c,tabIndex:0,onClick:p,onKeyDown:function(e){return 32===e.keyCode&&p()},className:t?"".concat(t," tri-state-all-checkbox"):"tri-state-all-checkbox"},n),n.title),i.a.createElement("span",{className:"tsdf-actions",onClick:function(){var e="";"pro"===n.filter&&"pro"!==s&&(e="pro"),"free"===n.filter&&"free"!==s&&(e="free"),f(e)}},"free"===s&&"free"===n.filter||"pro"===s&&"pro"===n.filter?i.a.createElement(Xo,null):i.a.createElement(Qo,null))))},fy=["id","content"];function py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?py(Object(n),!0).forEach((function(t){my(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function my(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hy(e){return function(e){if(Array.isArray(e))return yy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yy(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vy=function(e){var t=e.id,n=e.content,r=(gy(e,fy),Object(o.useContext)(ry)),a=r.activeControls,l=r.setActiveControls,c=Object(o.useCallback)((function(){var e=hy(a);e=e.map((function(e){return e.id===t?dy(dy({},e),{},{action:"none"===e.action?"include":"include"===e.action?"exclude":"exclude"===e.action?"none":"include"}):e})),l(e)}),[a,t,l]),u=Object(o.useCallback)((function(e){var t=a.find((function(t){return t.id===e}));return t?t.action:"none"}),[a]),s=Pf()("tri-state-checkbox",{"tri-state-include":"include"===u(t),"tri-state-exclude":"exclude"===u(t)});return i.a.createElement("li",{className:s},i.a.createElement("input",{checked:"include"===u(t),type:"checkbox",id:"tsdf-".concat(t),onChange:c}),i.a.createElement("label",{htmlFor:"tsdf-".concat(t)},n.name))},by=wp.i18n.__,wy=function(e){return i.a.createElement(Of,{className:"templately-table-head"},i.a.createElement(Sf,null,i.a.createElement("p",null,by("Thumbnail","templately"))),i.a.createElement(Sf,null,i.a.createElement("p",null,by("Item Name","templately"))),i.a.createElement(Sf,null,i.a.createElement("p",null,by("Downloaded Date","templately"))))},Ey=wp.i18n.__,Oy=function(e){return i.a.createElement("div",null,i.a.createElement(Of,null,i.a.createElement(Sf,null,i.a.createElement("img",{src:e.thumbnail,alt:e.name})),i.a.createElement(Sf,null,i.a.createElement(ge,{to:"/".concat(e.type,"/").concat(e.slug,"?preview=true")},i.a.createElement("p",null,Ey(e.name)))),i.a.createElement(Sf,null,i.a.createElement("p",null,Ey(e.downloaded_at)))))};function Sy(){return(Sy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ky(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _y(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jy=nt((function(e){return{downloads:e.profile.downloads,user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform,retry:e.common.retry,pagination:e.common.pagination}}))((function(e){var t=ky(Object(o.useState)([]),2),n=t[0],r=t[1],a=ky(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Object(o.useRef)(null),s=ky(Object(o.useState)(1),2),f=s[0],p=s[1];return Object(o.useEffect)((function(){return u.current=!0,function(){u.current=!1,e.dispatch(Ri(1))}}),[]),Object(o.useEffect)((function(){var t;e.downloads&&null!==(t=e.downloads)&&void 0!==t&&t[e.pagination]||Ss({path:"/my-downloads?page=".concat(e.pagination)}).then((function(t){if(u.current){if(null!=t&&t.data){var n=[];p(t.total_page),e.dispatch({type:"SET_USER_DOWNLOADS",payload:{currentPage:t.current_page,totalPage:t.total_page,data:t.data}}),t.data.map((function(e){n.push(i.a.createElement(Oy,Sy({key:e.slug},e)))})),r(n)}c(!1)}})).catch((function(t){console.error("Error: Fetching My Downloads"),e.dispatch(yi("Error: Fetching My Downloads"))}))}),[e.retry,e.pagination]),Object(o.useEffect)((function(){var t;if(e.downloads&&null!==(t=e.downloads)&&void 0!==t&&t[e.pagination]){var n=[];e.downloads[e.pagination].map((function(e){n.push(i.a.createElement(Oy,Sy({key:e.slug},e)))})),r(n),c(!1)}}),[e.retry,e.pagination]),i.a.createElement("div",{className:"downloads-list"},l&&i.a.createElement(Jd,null),!l&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ef,{className:"templately-downloads-table"},i.a.createElement(wy,null),i.a.createElement(Gh,{className:"templately-table-body"},n)),i.a.createElement(Yd,{type:"downloads",count:f})))}));function xy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Py(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}wp.i18n.__;var Cy=nt((function(e){return{is_verified:e.admin.user.is_verified,isLoggedIn:e.common.isLoggedIn,platform:e.common.platform,loading:e.common.loading,retry:e.common.retry}}))((function(e){var t=xy(Object(o.useState)(!1),2),n=t[0],r=(t[1],xy(Object(o.useState)("personal"),2)),a=r[0],l=r[1];return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Xm,null),e.isLoggedIn&&i.a.createElement(Em,null,n&&i.a.createElement(Jd,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Zm,{onClick:function(e){return l(e)},activeTab:a}),i.a.createElement(eh,{render:function(){return"personal"===a?i.a.createElement(ah,null):"favourites"===a?i.a.createElement(Qh,null):"downloads"===a?i.a.createElement(jy,null):void 0}}))))}));function Ty(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ay(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ay(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ny=wp.i18n.__,Ly=nt((function(e){return{user:e.admin.user,isLoggedIn:e.common.isLoggedIn,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login,platform:e.common.platform}}))((function(e){var t=Ty(Object(o.useState)(!1),2),n=t[0],r=t[1],a=e.user;return Object(o.useEffect)((function(){e.isLoggedIn||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){0!=n&&(Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(mi(!1)),e.dispatch(Ui([])),e.dispatch(Ei({platform:e.platform})),e.dispatch({type:"WORKSPACE_RESET"}),e.dispatch({type:"SHARED_WORKSPACE_RESET"}),e.dispatch({type:"WORKSPACE_DETAILS_RESET"}),Vs(Ny("Successfully Logged Out.","templately"),{icon:"success",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(Ny("Something went wrong.","templately"),{icon:"error",timer:1500})})),r(!1))}),[n]),i.a.createElement("div",{className:"templately-admin-form-inner templately-profile"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-manage-accounts"},i.a.createElement("h1",null,Ny("Hey","templately")," ",a.display_name||a.name,","," ",Ny("Welcome Back!","templately")),i.a.createElement("div",{className:"templately-account-details"},i.a.createElement("strong",null,Ny("Account Details","templately"),":"),i.a.createElement("table",{bgcolor:"transparent",border:"0",cellPadding:"0",cellSpacing:"0"},i.a.createElement("tbody",null,a.email&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Email","templately"),":")),i.a.createElement("td",null,a.email)),a.plan&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Plan","templately"),":")),i.a.createElement("td",{className:"templately-plan"},"free"===a.plan?"Starter":a.plan)),a.joined&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Joining Date","templately"),":")),i.a.createElement("td",null,a.joined)),""!=a.plan_expire_at&&i.a.createElement("tr",null,i.a.createElement("th",null,i.a.createElement("strong",null,Ny("Expiry Date","templately"),":")),i.a.createElement("td",null,a.plan_expire_at))))),i.a.createElement("div",null,i.a.createElement("a",{className:"button templately-button",target:"_blank",href:"https://templately.com/profile"},Ny("Manage Account","templately")),e.user_can_logout&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},Ny("Logout","templately"))),e.is_linked_login&&!e.user_can_logout&&i.a.createElement("button",{onClick:function(){return r(!0)},className:"button templately-button"},Ny("Unlink My Account","templately")),!e.user_can_logout&&!e.is_linked_login&&i.a.createElement(ge,{className:"button templately-button",to:"/sign-in"},Ny("Link My Account","templately"))))))}));n(131);function Iy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var My=wp.i18n.__,Ry=function(e){return i.a.createElement("input",{type:e.type||"text",className:"widefat templately-input",placeholder:e.placeholder,name:e.name,value:e.value,onBlur:function(t){return e.onBlur&&e.onBlur(t.target.value)},onChange:function(t){return e.onChange(t.target.value)}})},Fy=nt()((function(e){var t=Iy(Object(o.useState)(""),2),n=t[0],r=t[1],a=Iy(Object(o.useState)(""),2),l=a[0],c=a[1],u=Iy(Object(o.useState)(""),2),s=u[0],f=u[1],p=Iy(Object(o.useState)(""),2),d=p[0],m=p[1],h=Iy(Object(o.useState)(null),2),y=h[0],g=h[1],v=Iy(Object(o.useState)(""),2),b=v[0],w=v[1],E=Iy(Object(o.useState)(!0),2),O=E[0],S=E[1],k=Iy(Object(o.useState)(!1),2),_=k[0],j=k[1],x=Iy(Object(o.useState)(!1),2),P=x[0],C=x[1],T=Iy(Object(o.useState)(!1),2),A=T[0],N=T[1],L=Iy(Object(o.useState)(!1),2),I=L[0],D=L[1];return Object(o.useEffect)((function(){S(!0),""!=n&&""!=l&&""!=d&&""!=b&&""!=s&&_&&P&&Xs(s)&&d===b&&of(d)&&S(!1)}),[n,l,s,d,b,_,P]),Object(o.useEffect)((function(){null!==y&&("password"!==y&&"confirm_password"!==y||!(d.length>0||b.length>0)||(of(d)||Vs(My("Password must contain at least 8 characters, uppercase, lowercase and numbers."),{icon:"warning",showCloseButton:!0}),"confirm_password"===y&&d!==b&&Vs(My("Passwords do not match."),{icon:"warning",showCloseButton:!0})),"email"===y&&s.length>0&&!Xs(s)&&Vs(My("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),g(null))}),[y]),Object(o.useEffect)((function(){A&&(D(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return null!=e.first_name&&t.append("first_name",e.first_name),null!=e.last_name&&t.append("last_name",e.last_name),null!=e.email&&t.append("email",e.email),null!=e.password&&t.append("password",e.password),t.append("nonce",Fs),t.append("action","get_templately"),t.append("content_type","create_user"),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}({first_name:n,last_name:l,email:s,password:d}).then((function(t){var n,r;if(null!=t&&t.data&&null!=t&&null!==(n=t.data)&&void 0!==n&&n.success)D(!1),TemplatelyAdmin.is_logged_in=!0,e.dispatch(xi(!0)),null!==e.next_route?e.dispatch(Vi(e.next_route)):e.dispatch(Vi("/settings")),e.dispatch(Bi(t.data.data)),e.dispatch(Ui(t.data.data.admin)),e.dispatch(di(null===(r=t.data.data.admin)||void 0===r?void 0:r.is_global_login));else if(D(!1),"string"==typeof t.data.data)Vs(t.data.data,{timer:2e3,icon:"error"});else{var a=Object.keys(t.data.data).map((function(e){return i.a.createElement("div",null,t.data.data[e])}));Vs(i.a.createElement("div",null,a),{timer:2e3,icon:"error"})}})).catch((function(e){return console.error("Error:",e)})),N(!1))}),[A]),i.a.createElement(i.a.Fragment,null,I&&i.a.createElement(Jd,null),i.a.createElement("h3",null,My("Create Account!","templately")),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Ry,{placeholder:"First Name",name:"first_name",value:n,onChange:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Ry,{placeholder:"Last Name",name:"last_name",value:l,onChange:function(e){return c(e)}}))),i.a.createElement(Ry,{placeholder:"Email",name:"email",value:s,onBlur:function(){return g("email")},onChange:function(e){return f(e)}}),i.a.createElement("div",{className:"tadmin-form-row"},i.a.createElement("div",{className:"templately-left"},i.a.createElement(Ry,{placeholder:"Password",name:"password",type:"password",value:d,onBlur:function(){return g("password")},onChange:function(e){return m(e)}})),i.a.createElement("div",{className:"templately-right"},i.a.createElement(Ry,{placeholder:"Confirm Password",name:"confirm_password",type:"password",value:b,onBlur:function(){return g("confirm_password")},onChange:function(e){return w(e)}}))),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent",type:"checkbox",onChange:function(e){return j(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/privacy-policy",target:"_blank"},"Privacy Policy"),".")),i.a.createElement("div",{className:"widefat templately-input-consent"},i.a.createElement("input",{id:"elem-consent-terms",type:"checkbox",onChange:function(e){return C(e.currentTarget.checked)},name:"consent"}),i.a.createElement("label",{htmlFor:"elem-consent-terms"},"I agree to the Templately"," ",i.a.createElement("a",{href:"https://templately.com/terms-of-services",target:"_blank"},"Terms of Services"),".")),i.a.createElement("button",{disabled:O,onClick:function(){return N(!0)},className:"button button-primary templately-button",type:"submit"},My("Create Account","templately")),i.a.createElement("p",{className:"templately-new-here"},i.a.createElement("span",{onClick:function(){return e.tab(1)}}," ",My("Already have an account?","templately"))))})),zy=wp.i18n.__,Uy=function(e){var t=e.global_signin,n=e.setGlobal_signin;return i.a.createElement(i.a.Fragment,null,i.a.createElement("label",{htmlFor:"global-sign-in",className:"global-sign-in"},i.a.createElement("input",{type:"checkbox",className:"templately-input",id:"global-sign-in",name:"global-sign-in",onChange:function(){return n(!t)}}),i.a.createElement("span",null,zy("Global Sign In","templately"))),i.a.createElement("p",{className:"templately-helptext"},zy("All the sitewide users will be logged in with this Templately account","templately")))};function By(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wy=wp.i18n.__,Hy=nt((function(e){return{isLoggedIn:e.common.isLoggedIn,errorText:e.admin.errorText,next_route:e.common.next_route,is_global_login:e.common.is_global_login,user_can_logout:e.common.user_can_logout,is_linked_login:e.common.is_linked_login}}))((function(e){var t,n=By(Object(o.useState)(""),2),r=n[0],a=n[1],l=By(Object(o.useState)(""),2),c=l[0],u=l[1],s=By(Object(o.useState)(""),2),f=s[0],p=s[1],d=By(Object(o.useState)("password"),2),m=d[0],h=d[1],y=By(Object(o.useState)(!0),2),g=y[0],v=y[1],b=By(Object(o.useState)(!1),2),w=b[0],E=b[1],O=By(Object(o.useState)(!1),2),S=O[0],k=O[1],_=By(Object(o.useState)(null),2),j=_[0],x=_[1],P=By(Object(o.useState)(!1),2),C=P[0],T=P[1];return Object(o.useEffect)((function(){return function(){clearTimeout(t)}}),[]),Object(o.useEffect)((function(){null!==j&&("email"===j&&r.length>0&&!Xs(r)&&Vs(Wy("Please insert a valid email address."),{icon:"warning",showCloseButton:!0}),x(null))}),[j]),Object(o.useEffect)((function(){if(w){var n={};"api"===m?n.api_key=f:(n.email=r,n.password=c),n.global_signin=C,k(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new FormData;return n.append("withApi",t),t?null!=e.api_key&&n.append("api_key",e.api_key):(null!=e.email&&n.append("email",e.email),null!=e.password&&n.append("password",e.password)),null!=e.global_signin&&n.append("global_signin",e.global_signin),n.append("nonce",Fs),n.append("action","get_templately"),n.append("content_type","login_user"),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(n,"api"===m).then((function(t){t.hasOwnProperty("data")?t.data.success?(k(!1),TemplatelyAdmin.is_logged_in=!0,e.is_linked_login||C?C&&e.dispatch(di(!0)):(e.dispatch(di(!1)),e.dispatch(hi(!0))),e.dispatch(yi("")),e.dispatch(xi(!0)),null!==e.next_route?e.dispatch(Vi(e.next_route)):e.user_can_logout||e.is_linked_login?e.dispatch(Vi("/settings")):e.dispatch(Vi("/settings?refresh")),e.dispatch(Bi(t.data.data)),e.dispatch(Ui(t.data.data.admin))):(Vs(t.data.data,{timer:1500,icon:"error"}),k(!1)):(k(!1),Vs(Wy("Something went wrong.","elmentorify"),{timer:1500,icon:"error"}))})).catch((function(e){k(!1),Vs(Wy("Something went wrong.","elmentorify"),{timer:1500,icon:"error"})})).finally((function(){t=setTimeout((function(){e.dispatch(Bi(null))}),5e3)})),E(!1)}}),[w]),Object(o.useEffect)((function(){e.errorText&&e.dispatch(Hi(null)),v(!0),"api"===m?f.length>=20&&v(!1):Xs(r)&&c.length>=8&&v(!1)}),[c,r,f]),i.a.createElement(i.a.Fragment,null,"password"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("h3",null,Wy("Great to have you back!","templately")),i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("api")}},"Connect via API"),i.a.createElement("input",{className:"widefat templately-input",placeholder:"Email",name:"email",onBlur:function(){return x("email")},value:r,onChange:function(e){return a(e.target.value)}}),i.a.createElement("input",{type:"password",className:"widefat templately-input",placeholder:"Password",name:"password",value:c,onChange:function(e){return u(e.target.value)}}),!e.is_global_login&&i.a.createElement(Uy,{global_signin:C,setGlobal_signin:T}),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Wy(S?"Signing In...":"Sign In","templately"))),"api"===m&&i.a.createElement(i.a.Fragment,null,i.a.createElement("button",{className:"button templately-connect-btn",onClick:function(){return h("password")}},"Connect via Login Credentials"),i.a.createElement("div",{className:"templately-api-input-wrapper"},i.a.createElement("input",{className:"widefat templately-input",placeholder:"API Key",name:"api_key",value:f,onChange:function(e){return p(e.target.value)}}),i.a.createElement(Uy,{global_signin:C,setGlobal_signin:T}),i.a.createElement("a",{href:"https://templately.com/manageapis",target:"_blank"},Wy("Get API Key","templately"))),i.a.createElement("button",{disabled:g,onClick:function(){return E(!0)},className:"button templately-button",type:"submit"},Wy("Connect","templately"))),i.a.createElement("p",{className:"templately-new-here"},Wy("New here?","templately")," ",i.a.createElement("span",{onClick:function(){return e.tab(2)}}," ",Wy("Create an account!","templately")),i.a.createElement("a",{href:"https://templately.com/forgot-password",target:"_blank"},Wy("Forgot Password?","templately"))))}));function $y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ky=wp.i18n.__,Qy=nt((function(e){return{isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=$y(Object(o.useState)(1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Vi("/profile"))}),[]),Object(o.useEffect)((function(){e.isLoggedIn&&e.dispatch(Vi("/profile"))}),[e.isLoggedIn]),i.a.createElement("div",{className:"templately-admin-form-inner"},i.a.createElement("div",{className:"templately-login-form"},i.a.createElement("div",{className:"templately-admin-header"},i.a.createElement("div",{className:"templately-admin-title"},i.a.createElement("h1",null,Ky("1500+ Stunning Templates for WordPress","templately")),i.a.createElement("p",null,Ky("From multipurpose themes to niche templates, you’ll always find something that catches your eye.","templately")))),i.a.createElement("div",{className:"templately-admin-content"},i.a.createElement("div",{className:"templately-left"},i.a.createElement("div",{className:"templately-cloud-video-container"},i.a.createElement("iframe",{height:"350",src:"https://www.youtube.com/embed/coLxfjnrm3I",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))),i.a.createElement("div",{className:"templately-right"},i.a.createElement("div",{className:"templately-admin-tab"},i.a.createElement("ul",null,i.a.createElement("li",{onClick:function(){return r(1)},className:"".concat(1===n?"active":""," ")},Ky("Sign In","templately")),i.a.createElement("li",{onClick:function(){return r(2)},className:"".concat(2===n?"active":""," ")},Ky("Sign Up","templately"))),i.a.createElement("div",{className:"templately-admin-tab-content"},i.a.createElement("div",{className:"templately-admin-tcontent ".concat(1===n?"active":"")},i.a.createElement(Hy,{tab:function(e){return r(e)}})),i.a.createElement("div",{className:"templately-admin-tcontent ".concat(2===n?"active":"")},i.a.createElement(Fy,{tab:function(e){return r(e)}}))))))))}));function Gy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yy(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xy=function(e){var t=Gy(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Object(o.useRef)(null),l=function(){a.current&&r(a.current.getBoundingClientRect().top<=0)};return Object(o.useEffect)((function(){return window.addEventListener("scroll",l),function(){window.addEventListener("scroll",(function(){return l}))}}),[]),i.a.createElement("div",{className:"templately-modal-sidebar".concat(n?" sticky":""),ref:a},i.a.createElement("div",{className:"templately-modal-sidebar-inner"},e.children))},Jy=["content"];function Zy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tg(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ng=function e(t){var n,r,a,l=t.content,c=tg(t,Jy),u=Zy(Object(o.useState)(!1),2),s=u[0],f=u[1],p=lt(),d=ft((function(e){return e.common.activeSidebar})),m=lf(),h=null==m?void 0:m.get("cat_id"),y=Object(o.useCallback)((function(e){var t,n,r,a,o,i,l,u,s,f,d,m=null===(t=e.target)||void 0===t||null===(n=t.dataset)||void 0===n?void 0:n.id,h=null===(r=e.target)||void 0===r||null===(a=r.dataset)||void 0===a?void 0:a.parent;m||(m=null===(i=e.target)||void 0===i||null===(l=i.offsetParent)||void 0===l||null===(u=l.dataset)||void 0===u?void 0:u.id);h||(h=null===(s=e.target)||void 0===s||null===(f=s.offsetParent)||void 0===f||null===(d=f.dataset)||void 0===d?void 0:d.parent);(m||h)&&(p(Ci({activeSidebarMenu:"all"===m?m:+m,activeParentSidebarMenu:null!==(o=+h)&&void 0!==o?o:"",categoryFor:c.type})),p(Hi(null)),p(ji(!0)),p(Ri(1)))}),[d,l]),g=Object(o.useMemo)((function(){return d.activeSidebarMenu===l.id||d.activeParentSidebarMenu===l.id}),[d,c.type]);return Object(o.useEffect)((function(){var e;+h===l.id&&(p(Ci({activeSidebarMenu:l.id,activeParentSidebarMenu:null!==(e=null==l?void 0:l.parent)&&void 0!==e?e:"",categoryFor:c.type})),p(Hi(null)),p(ji(!0)),p(Ri(1)))}),[h]),i.a.createElement("li",{className:Pf()("templately-sidebar-menu-item",{"templately-has-child":(null==l||null===(n=l.child)||void 0===n?void 0:n.length)>0,"templately-active":g,"ts-collapesed":s}),"data-id":l.id,"data-parent":null==l?void 0:l.parent,onClick:y},i.a.createElement("span",null,l.name),(null==l||null===(r=l.child)||void 0===r?void 0:r.length)>0&&i.a.createElement(i.a.Fragment,null,s?i.a.createElement(Xo,{onClick:function(){return f(!s)}}):i.a.createElement(Qo,{onClick:function(){return f(!s)}}),(null==l||null===(a=l.child)||void 0===a?void 0:a.length)>0&&i.a.createElement("ul",{className:Pf()("templately-sidebar-submenu",{"tcollapse-submenu":s})},l.child.map((function(t){return i.a.createElement(e,{content:t,key:t.id,type:c.type})})))))},rg=TemplatelyAdmin.categories,ag=wp.i18n.__,og=function(e){var t=lt(),n=Object(o.useCallback)((function(){t(ji(!0)),t(Ci({activeSidebarMenu:"all",activeParentSidebarMenu:"",categoryFor:e.type}))}),[]),r=Object(o.useMemo)((function(){return{id:"all",name:ag("All Categories","templately")}}),[]),a=Object(o.useMemo)((function(){return rg}),[]),l=e.collapse===e.title&&""!=e.collapse;return i.a.createElement("div",{className:Pf()("templately-categories","templately-".concat(e.type,"-categories"),null==e?void 0:e.className)},(null==e?void 0:e.title)&&i.a.createElement("h3",{className:"ts-filter-title",onClick:function(){return e.setCollapse(e.title===e.collapse?"":e.title)}},e.title," ",i.a.createElement("span",{className:"ts-collapse-action"},l?i.a.createElement(Xo,null):i.a.createElement(Qo,null))),l&&e.collapse===e.title&&i.a.createElement("ul",{className:"templately-sidebar-menu"},i.a.createElement(ng,{onClick:n,content:r,key:"all",type:e.type}),a[e.type].map((function(t){return i.a.createElement(ng,{type:e.type,content:t,key:t.id})}))))},ig=i.a.memo(og);wp.i18n.__;function lg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lg(Object(n),!0).forEach((function(t){ug(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ug(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}wp.i18n.__;var pg=function(e){var t=sg(Object(o.useState)("free"),2),n=t[0],r=t[1],a=sg(Object(o.useState)([]),2),l=a[0],c=a[1],u=sg(Object(o.useState)([]),2),s=u[0],f=u[1],p=sg(Object(o.useState)([]),2),d=p[0],m=p[1],h=sg(Object(o.useState)([]),2),y=h[0],g=h[1],v=sg(Object(o.useState)([]),2),b=v[0],w=v[1],E=ft((function(e){return e.common.platform}));Object(o.useEffect)((function(){(function(){var e=new FormData;return e.append("action","get_templately"),e.append("nonce",Fs),e.append("content_type","get_dependencies"),e.append("platform",Ms),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))})().then((function(e){var t;if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.data){var n=e.data.data.filter((function(e){return e.platform===E})),r=n.filter((function(e){return e.is_pro}));f(r);var a=n.filter((function(e){return!e.is_pro}));m(a),c(n)}})).catch((function(e){return console.error("ERROR: On Getting Dependencies: ",e)}))}),[]),Object(o.useEffect)((function(){e.isReset&&(f(l.filter((function(e){return e.is_pro}))),m(l.filter((function(e){return!e.is_pro}))))}),[e.isReset]);var O=Object(o.useMemo)((function(){return s.map((function(e){return cg(cg({},e),{},{action:"none"})}))}),[s]),S=Object(o.useMemo)((function(){return d.map((function(e){return cg(cg({},e),{},{action:"none"})}))}),[d]);return Object(o.useEffect)((function(){var t=[],n=[];y.map((function(e){"include"===e.action&&t.push(e.id),"exclude"===e.action&&n.push(e.id)})),b.map((function(e){"include"===e.action&&t.push(e.id),"exclude"===e.action&&n.push(e.id)})),e.setDependencies({include:t,exclude:n})}),[y,b]),i.a.createElement("div",{className:"templately-dependencies"},O.length>0&&i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("pro"===n?"tsdf-open":"")},i.a.createElement(ny,{activeFilter:n,setActiveFilter:r,dependencies:O,giveAwayControls:g},i.a.createElement(sy,{filter:"pro",title:"Pro Plugins Dependencies"}),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},O.map((function(e){return i.a.createElement(vy,{key:e.id,id:e.id,content:e})}))))),S.length>0&&i.a.createElement("div",{className:"templately-sidebar-dependency-filter ".concat("free"===n?"tsdf-open":"")},i.a.createElement(ny,{activeFilter:n,setActiveFilter:r,dependencies:S,giveAwayControls:w},i.a.createElement(sy,{filter:"free",title:"Free Plugins Dependencies"}),i.a.createElement("ul",{className:"templately-sidebar-dependency-filter-list"},S.map((function(e){return i.a.createElement(vy,{key:e.id,id:e.id,content:e})}))))))},dg=i.a.memo(pg),mg=wp.i18n.__,hg=function(e){return i.a.createElement("div",{className:"templately-sidebar-dependency-filter"},i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary",onClick:function(){return e.setFilter(!0)}},mg("Filter","templately")),e.isResetVisible&&i.a.createElement("button",{className:"templately-filter-button button button-medium button-primary templately-filter-clear",onClick:function(){return e.setReset(!0)}},mg("Reset","templately")))},yg=i.a.memo(hg);function gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bg=wp.i18n.__,wg=function(e){var t=gg(Object(o.useState)([]),2),n=t[0],r=t[1],a=gg(Object(o.useState)([]),2),l=a[0],c=a[1],u=gg(Object(o.useState)([]),2),s=u[0],f=u[1],p=lt(),d=lf(),m=+(null==d?void 0:d.get("tag_id"));Object(o.useEffect)((function(){var e;(e=new FormData,e.append("action","get_templately"),e.append("nonce",Fs),e.append("content_type","get_tags"),wu.a.post(ajaxurl,e).then((function(e){return e})).catch((function(e){return e}))).then((function(e){var t;null!=e&&null!==(t=e.data)&&void 0!==t&&t.data&&r(function(e){return e.map((function(e){return{value:e.id,label:bg(e.name,"templately")}}))}(e.data.data))})).catch((function(e){return console.error("On Gettings Tags: ",e)}))}),[]);var h=Object(o.useCallback)((function(e){null!=e?(f(e),e=e.map((function(e){return e.value})),c(e)):(f([]),c([]))}),[]);return Object(o.useEffect)((function(){e.setTags(l)}),[l]),Object(o.useEffect)((function(){e.isReset&&(c([]),f([]))}),[e.isReset]),Object(o.useEffect)((function(){if(m&&(null==n?void 0:n.length)>0){var t=n.filter((function(e){return e.value==m}));f(t),c([m]),e.setTags([m]),p(Ti(!0)),p(Hi(null)),p(ji(!0)),p(Ri(1))}}),[m,n]),i.a.createElement("div",{className:"templately-tags templately-sidebar-dependency-filter"},i.a.createElement("label",{htmlFor:"templately_tags"},"Filter Items by Tags"),i.a.createElement(mu,{isMulti:!0,placeholder:"Select Tags",name:"templately_tags",options:n,classNamePrefix:"templately-tags",onChange:h,value:s,maxMenuHeight:200}))},Eg=i.a.memo(wg);n(132);function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kg=TemplatelyAdmin.categories,_g=function(e){var t=Og(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Og(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Og(Object(o.useState)(""),2),s=u[0],f=u[1],p=Og(Object(o.useState)(!1),2),d=p[0],m=p[1],h=Og(Object(o.useState)([]),2),y=h[0],g=h[1],v=Og(Object(o.useState)([]),2),b=v[0],w=v[1],E=lt(),O=!(null==e||!e.from)&&"search"===e.from;return Object(o.useEffect)((function(){var e,t;l&&(O&&E(Ai("search"+Date.now())),((null==b?void 0:b.length)>0||(null==y||null===(e=y.include)||void 0===e?void 0:e.length)>0||(null==y||null===(t=y.exclude)||void 0===t?void 0:t.length)>0)&&(E(Ti(!0)),m(!0)),E(Ni(y)),E(Li(b)),c(!1))}),[l]),Object(o.useEffect)((function(){n&&(O&&E(Ai("wrapper")),E(Ti(!1)),E(Ni(null)),w([]),E(Li([])),m(!1),r(!1))}),[n]),i.a.createElement(i.a.Fragment,null,O&&Object.keys(kg).map((function(e){return i.a.createElement(ig,{key:e,type:e,title:e,className:"templately-search-tags",isCollapsible:!0,collapse:s,setCollapse:function(e){return f(e)}})})),!O&&void 0!==(null==e?void 0:e.type)&&i.a.createElement(ig,{type:null==e?void 0:e.type}),i.a.createElement(dg,{setDependencies:function(e){return g(e)},isReset:n}),i.a.createElement(Eg,{setTags:function(e){return w(e)},isReset:n}),i.a.createElement(yg,{setFilter:function(e){return c(e)},setReset:function(e){return r(e)},isReset:n,isResetVisible:d}))},jg=i.a.memo(_g);n(133);function xg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cg=TemplatelyAdmin.items_count,Tg=nt((function(e){return{plan:e.common.plan,platform:e.common.platform}}))((function(e){var t,n,r,a=e.itemsFor,l=xg(Object(o.useState)(e.plan),2),c=l[0],u=l[1],s=Cg[e.platform];return Object(o.useEffect)((function(){c!=e.plan&&(e.dispatch({type:"SET_PLAN",payload:c}),e.dispatch(Ri(1)))}),[c]),i.a.createElement("div",{className:"templately-items-header-wrapper".concat(" ".concat(e.sticky))},i.a.createElement("div",{className:"templately-items-header-wrapper-inner"},i.a.createElement("div",{className:"templately-items-header"},i.a.createElement("h3",null,"All ",e.title)),i.a.createElement("div",{className:"templately-plan-switcher"},i.a.createElement("button",{onClick:function(){return u("all")},className:"components-button templately-plan-all ".concat("all"===e.plan?"tactive":"")},"All (",null===(t=s[a])||void 0===t?void 0:t.total,")"),i.a.createElement("button",{onClick:function(){return u("starter")},className:"components-button templately-plan-starter ".concat("starter"===e.plan?"tactive":"")},"Starter (",null===(n=s[a])||void 0===n?void 0:n.starter,")"),i.a.createElement("button",{onClick:function(){return u("pro")},className:"components-button templately-plan-pro ".concat("pro"===e.plan?"tactive":"")},"Pro (",null===(r=s[a])||void 0===r?void 0:r.pro,")"))))}));function Ag(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ng(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lg=TemplatelyAdmin,Ig=Lg.not_found,Dg=Lg.platform,Mg=nt((function(e){return{blocks:e.blocks,pages:e.pages,packs:e.packs,sidebar:e.common.activeSidebar,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,activeSidebar:e.common.activeSidebar,loading:e.common.loading,platform:e.common.platform,plan:e.common.plan,itemLoading:e.common.itemLoading,retry:e.common.retry,dependencyFiltersID:e.common.dependencyFilter.filtersID,dependencyFilterActive:e.common.dependencyFilter.filterActive,dependencyFilterResults:e.common.dependencyFilter.filtersResults,selectedTags:e.common.tags}}))((function(e){var t,n=(null===(t=e.location.pathname)||void 0===t?void 0:t.replace(/^\/+/,""))||("gutenberg"===e.platform?"blocks":"packs"),r=n.substring(0,n.length-1),a=Ag(Object(o.useState)([]),2),l=a[0],c=a[1],u=Ag(Object(o.useState)(1),2),s=u[0],f=u[1],p=Ag(Object(o.useState)(""),2),d=p[0],m=p[1],h=Object(o.useRef)(null);Object(o.useEffect)((function(){return h.current=!0,function(){return h.current=!1}}),[]);var y=Object(o.useMemo)((function(){return e.selectedTags}),[e.selectedTags]),g=Object(o.useMemo)((function(){return e.dependencyFiltersID}),[e.dependencyFiltersID]);Object(o.useEffect)((function(){m("")}),[e]);var v=Object(o.useCallback)((function(e){null!=h&&h.current&&(e.target.scrollTop>250&&""===d?m("templately-header-sticky"):m(""))}),[]),b=Object(o.useMemo)((function(){return e.sidebar}),[e.sidebar]),w=Object(o.useMemo)((function(){return e.blocks}),[e.blocks]),E=Object(o.useMemo)((function(){return e.pages}),[e.pages]),O=Object(o.useMemo)((function(){return e.packs}),[e.packs]),S=Object(o.useMemo)((function(){return e.pagination}),[e.pagination]),k=Object(o.useMemo)((function(){return e.platform}),[e.platform]),_=Object(o.useMemo)((function(){return e.plan}),[e.plan]),j=Object(o.useMemo)((function(){return e.dependencyFilterActive}),[e.dependencyFilterActive]),x=Object(o.useMemo)((function(){return e.dependencyFilterResults}),[e.dependencyFilterResults]);return Object(o.useEffect)((function(){if(null!==e.pagination){var t,r,a,o,i,l,c,u,s;if(!1===j)if("all"===e.sidebar.activeSidebarMenu){if(null!==(t=e[n])&&void 0!==t&&null!==(r=t[e.plan])&&void 0!==r&&null!==(a=r[e.platform])&&void 0!==a&&a[e.pagination])return f(e[n][e.plan][e.platform].total_page),e.dispatch(_i(!1)),e.dispatch(ji(!1)),void e.dispatch(zi(!1))}else if((null===(o=e[n])||void 0===o||null===(i=o[e.plan])||void 0===i||null===(l=i[e.platform])||void 0===l||null===(c=l.categoryData)||void 0===c||null===(u=c[e.sidebar.activeSidebarMenu])||void 0===u||null===(s=u[e.pagination])||void 0===s?void 0:s.length)>0)return f(e[n][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu].total_page),e.dispatch(_i(!1)),e.dispatch(ji(!1)),void e.dispatch(zi(!1));e.dispatch(ji(!0));try{(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={content_type:"blocks",per_page:48,page:1};e=As(As({},t),e);var n=new FormData;return n.append("action","get_templately"),n.append("nonce",Fs),n.append("content_type",e.content_type),n.append("pagenum",e.page),n.append("per_page",e.per_page),null!=e.platform&&n.append("platform",e.platform),null!=e.category_id&&n.append("category_id",e.category_id),null!=e.dependencies&&n.append("dependencies",JSON.stringify(e.dependencies)),null!=e.tag_id&&e.tag_id.length>0&&n.append("tag_id",JSON.stringify(e.tag_id)),null!=e.plan_type&&"all"!==e.plan_type&&n.append("plan_type",e.plan_type),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))})({content_type:n,page:e.pagination,platform:e.platform,plan_type:e.plan,per_page:"templately"===Dg?52:51,category_id:"all"!==e.sidebar.activeSidebarMenu?e.sidebar.activeSidebarMenu:void 0,dependencies:g,tag_id:y}).then((function(t){if(null!=h&&h.current){if(!t.data.success)return void e.dispatch(yi(t.data.data));if(!t.data.data.hasOwnProperty("data"))return void e.dispatch(yi(t.data.data));if(e.dependencyFilterActive)return f(t.data.data.total_page),e.dispatch({type:"FILTER_DEPENDENCIES_RESULTS",payload:{current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}}),e.dispatch(ji(!1)),e.dispatch(_i(!1)),void e.dispatch(zi(!1));"blocks"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(vi({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_ITEMS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),"packs"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(bi({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PACKS",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),"pages"===n&&(f(t.data.data.total_page),"all"===e.sidebar.activeSidebarMenu?e.dispatch(function(e){return{type:"ALL_PAGES",payload:e}}({current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page})):e.dispatch(function(e){return{type:"ALL_CATEGORY_PAGES",payload:e}}({categoryID:e.sidebar.activeSidebarMenu,current_page:e.pagination,data:t.data.data.data,platform:e.platform,plan:e.plan,total_page:t.data.data.total_page}))),e.dispatch(ji(!1)),e.dispatch(_i(!1)),e.dispatch(zi(!1))}}))}catch(t){return void(null!=h&&h.current&&(e.dispatch(yi(res.data.data)),console.error("Catched Error: ",t)))}}}),[e.pagination,b,e.platform,e.plan,e.retry,j,g,y]),Object(o.useEffect)((function(){var t,r,a,o,i,l,u,s,f,p,d;if(!0!==e.dependencyFilterActive){if("all"!=e.sidebar.activeSidebarMenu){if(null!==(t=e[n])&&void 0!==t&&null!==(r=t[e.plan])&&void 0!==r&&null!==(a=r[e.platform])&&void 0!==a&&null!==(o=a.categoryData)&&void 0!==o&&null!==(i=o[e.sidebar.activeSidebarMenu])&&void 0!==i&&i[e.pagination]){var m=e[n][e.plan][e.platform].categoryData[e.sidebar.activeSidebarMenu][e.pagination];c(m)}}else if(null!==(l=e[n])&&void 0!==l&&null!==(u=l[e.plan])&&void 0!==u&&null!==(s=u[e.platform])&&void 0!==s&&s[e.pagination]){var h=e[n][e.plan][e.platform][e.pagination];c(h)}}else if(null!==(f=e.dependencyFilterResults)&&void 0!==f&&null!==(p=f[e.plan])&&void 0!==p&&null!==(d=p[e.platform])&&void 0!==d&&d[e.pagination]){var y=e.dependencyFilterResults[e.plan][e.platform][e.pagination];c(y)}}),[w,E,O,S,b,k,_,j,x]),i.a.createElement(i.a.Fragment,null,e.loading&&i.a.createElement(wf,null,i.a.createElement(Jd,null)),!e.loading&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Xy,null,i.a.createElement(jg,{type:n})),e.itemLoading&&i.a.createElement(Jd,null),!e.itemLoading&&i.a.createElement(wf,{classes:"".concat(""!=d?"has-sticky-header":""),onScroll:v},i.a.createElement(Tg,{itemsFor:n,sticky:d,title:n}),0===l.length&&!e.itemLoading&&!e.pagination_loading&&i.a.createElement("div",{className:"templately-empty-clouds"},i.a.createElement("img",{src:Ig,alt:"Items Not Found"})),i.a.createElement("div",{className:Pf()("templately-modal-content","templately-blocks","templately-tab-".concat(n),{"templately-has-pagination":e.need_pagination})},!e.pagination_loading&&i.a.createElement(zh,{itemsType:r,items:l,isLoading:e.pagination_loading}),e.pagination_loading&&i.a.createElement(Jd,null)),i.a.createElement(Yd,{type:r,count:s,categoryPagination:"all"!==e.sidebar.activeSidebarMenu}))))}));function Rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zg=wp.i18n.__,Ug=TemplatelyAdmin.not_found,Bg=nt((function(e){return{searchQuery:e.common.searchQuery.query,isSearching:e.common.searchQuery.isSearching||!1,searchResults:e.common.searchQuery.results,loading:e.common.loading,platform:e.common.platform,activeSidebar:e.common.activeSidebar,filterFrom:e.common.filter.from,selectedTags:e.common.tags,dependencyFiltersID:e.common.dependencyFilter.filtersID}}))((function(e){var t=se().query,n=Rg(Object(o.useState)([]),2),r=n[0],a=n[1],l=Rg(Object(o.useState)(!0),2),c=l[0],u=l[1],s=Rg(Object(o.useState)(!1),2),f=s[0],p=s[1];Object(o.useEffect)((function(){null!=t&&t.length>0&&e.dispatch($i({query:t,isSearching:!0}))}),[]),Object(o.useEffect)((function(){0==e.isSearching&&e.searchQuery.length>0&&e.dispatch($i({query:e.searchQuery,isSearching:!0}))}),[e.platform]);var d=Object(o.useMemo)((function(){return e.filterFrom}),[e.filterFrom]),m=Object(o.useMemo)((function(){return e.selectedTags}),[e.selectedTags]),h=Object(o.useMemo)((function(){return e.dependencyFiltersID}),[e.dependencyFiltersID]),y=Object(o.useMemo)((function(){return e.activeSidebar}),[e.activeSidebar]);return Object(o.useEffect)((function(){e.dispatch(Ai("search"+Date.now()))}),[y]),Object(o.useEffect)((function(){if(e.searchQuery.length>0&&(e.isSearching||"wrapper"!=d)){var t={platform:e.platform,searchQuery:e.searchQuery,query_type:"pack,block,page"};"wrapper"!==d&&(t.dependencies=h,t.tags=m,t.categories=y.activeSidebarMenu),p(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new FormData;return t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","search"),null!=e&&e.searchQuery&&t.append("search",e.searchQuery),null!=e&&e.platform&&t.append("platform",e.platform),null!=e&&e.categories&&t.append("category_id",e.categories),null!=e&&e.dependencies&&t.append("dependencies",e.dependencies),null!=e&&e.query_type&&t.append("query_type",e.query_type),null!=e&&e.tags&&t.append("tag_id",e.tags),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))}(t).then((function(t){200==t.status&&t.data.success&&e.dispatch($i({query:e.searchQuery,results:t.data.data,isSearching:!1})),p(!1),u(!1)})).catch((function(e){console.error(e.response),u(!1),p(!1)}))}}),[e.isSearching,d,y]),Object(o.useEffect)((function(){var t=[];e.searchResults&&e.searchResults.length>0&&(t=e.searchResults),a(t)}),[e.searchResults]),Object(o.useEffect)((function(){e.loading&&u(!0)}),[e.loading]),i.a.createElement(i.a.Fragment,null,c&&i.a.createElement(wf,null,i.a.createElement(Jd,null)),!c&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Xy,null,i.a.createElement(jg,{from:"search"})),i.a.createElement("div",{className:"templately-modal-search"},i.a.createElement("div",{className:"templately-searched"},i.a.createElement("p",null,i.a.createElement("strong",null,zg("You are looking for: ","templately")),t)),i.a.createElement("div",{className:"templately-searched-items templately-modal-content templately-blocks"},r.length>0&&!f&&i.a.createElement(zh,{items:r,isLoading:e.pagination_loading}),r.length<=0&&!c&&!f&&i.a.createElement("div",{className:"templately-search-not-found"},i.a.createElement("div",null,i.a.createElement("img",{src:Ug,alt:"Searched Item Not Found"}))),f&&i.a.createElement(Jd,null)))))}));n(134);function Vg(){return(Vg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Wg=function(e){return i.a.createElement("div",{className:e.className},i.a.createElement("div",null,i.a.createElement("input",Vg({type:"text"},e))))};function Hg(e){return function(e){if(Array.isArray(e))return Kg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||qg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||qg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qg(e,t){if(e){if("string"==typeof e)return Kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kg(e,t):void 0}}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qg=wp.i18n.__,Gg=TemplatelyAdmin,Yg=Gg.loadingImage,Xg=Gg.nonce,Jg=function(e){var t=$g(Object(o.useState)(e.isLoading||!1),2),n=t[0],r=t[1],a=$g(Object(o.useState)(!0),2),l=a[0],c=a[1],u=$g(Object(o.useState)(!1),2),s=u[0],f=u[1],p=$g(Object(o.useState)(e.content.name),2),d=p[0],m=p[1],h=$g(Object(o.useState)([]),2),y=h[0],g=h[1],v=$g(Object(o.useState)([]),2),b=v[0],w=v[1],E=$g(Object(o.useState)(!1),2),O=E[0],S=E[1],k=$g(Object(o.useState)(!1),2),_=k[0],j=k[1],x=$g(Object(o.useState)(!1),2),P=x[0],C=x[1],T=$g(Object(o.useState)(""),2),A=T[0],N=T[1],L=$g(Object(o.useState)(!1),2),I=L[0],D=L[1],M=$g(Object(o.useState)([]),2),R=M[0],F=M[1],z=$g(Object(o.useState)([]),2),U=z[0],B=z[1],V=$g(Object(o.useState)([]),2),W=(V[0],V[1]),H=$g(Object(o.useState)([]),2),$=H[0],q=H[1];return Object(o.useEffect)((function(){var t=[],n=[];if(e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.map((function(e,r){n.push(e.email),t.push(i.a.createElement("li",{key:r},e.profile_photo&&i.a.createElement("img",{src:e.profile_photo}),i.a.createElement("span",{className:"tae-name "},e.name),i.a.createElement("span",{className:"tae-remove",onClick:function(t){j({email:e.email,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e.email,currentTarget:t.currentTarget.parentElement})}})))})),F(n),g(t)),e.content.pending_invitations&&e.content.pending_invitations.length>0){var r=JSON.parse(e.content.pending_invitations),a=[],o=[];r.map((function(e){Xs(e)&&(o.push(e),a.push(i.a.createElement("li",{key:e},i.a.createElement("span",{className:"tae-name "},e,i.a.createElement("em",null,Qg("invited","templately"))),i.a.createElement("span",{className:"tae-remove",onClick:function(t){j({email:e,currentTarget:t.currentTarget.parentElement})}}),i.a.createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))})),W(o),F([].concat(n,o)),g([].concat(t,a))}}),[]),Object(o.useEffect)((function(){if(O){var e=Hg(U),t=A.toLowerCase();Xs(t)&&(e.includes(t)||(e.push(t),B(e)),N("")),S(!1)}}),[O]),Object(o.useEffect)((function(){if(!1!==I){var e=Hg(U).filter((function(e){return I!=e}));B(e),D(!1)}}),[I]),Object(o.useEffect)((function(){if(!1!==_||!1!==P){var e=Hg(R),t=Hg($);if(0!=_&&(_.currentTarget.classList.add("removed"),t.push(_.email),e=e.filter((function(e){return _.email!=e})),F(e),q(t),j(!1)),0!=P){P.currentTarget.classList.remove("removed"),e.push(P.email);var n=t.filter((function(e){return P.email!=e}));F(e),q(n),C(!1)}}}),[_,P]),Object(o.useEffect)((function(){var e=[];U.length>0&&U.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return D(t)}})))})),w(e)}),[U]),Object(o.useEffect)((function(){U.length>0||$.length>0?c(!1):c(!0)}),[R,U,$]),Object(o.useEffect)((function(){if(!0===s){r(!0);var t=U,n=Hg($),a=new FormData;a.append("action","get_templately"),a.append("content_type","edit_workspace"),a.append("id",e.content.id),a.append("title",d),a.append("share_with",t.join()),a.append("remove",n.join()),a.append("nonce",Xg),a.append("platform",e.platform),wu.a.post(ajaxurl,a).then((function(t){t.data.success&&("success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),_s.a.close({saved:!0})):_s.a.close({saved:!1}))})),f(!1)}}),[s]),i.a.createElement(i.a.Fragment,null,n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:Yg})),!n&&i.a.createElement("div",{className:"templately-workspace-edit-modal"},i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement(Wg,{value:d,onChange:function(e){c(!1),m(e.target.value)}}))),y.length>0&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Qg("Shared with","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-shared-with"},i.a.createElement("ul",{className:"templately-added-email-list"},y))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Qg("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},b),i.a.createElement("div",null,i.a.createElement(Wg,{onKeyUp:function(e){return S(13===e.keyCode)},onChange:function(e){return N(e.target.value)},value:A,placeholder:Qg("Type email to add","templately")}),i.a.createElement(Id,{disabled:0===A.length,onClick:function(){return S(!0)}},Qg("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:l,onClick:function(){return f(!0)}},Qg("Save","templately")))))},Zg=function(e){return i.a.createElement("div",{className:"templately-delete-confirm-text"},i.a.createElement("h3",null,"Are You Sure?"),i.a.createElement("p",null,"The WorkSpace will be permanently deleted including the files."))};function ev(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nv=wp.i18n.__,rv=nt((function(e){return{pagination:e.common.pagination,userID:e.admin.user.id||null}}))((function(e){var t=ev(Object(o.useState)(!1),2),n=t[0],r=t[1],a=ev(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ev(Object(o.useState)(!1),2),s=u[0],f=u[1],p=ev(Object(o.useState)([]),2),d=p[0],m=p[1],h=ev(Object(o.useState)(!1),2),y=h[0],g=h[1],v=ue(),b=Object(o.useRef)(null),w=Object(o.useRef)(null),E=function(t){if(e.userID===e.content.owner.id){var n=b.current.contains(t.target),a=w.current&&w.current.contains(t.target);n||a||r(!1)}};return Object(o.useEffect)((function(){l&&(Vs("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(Jg,{singleDispatch:function(t){e.dispatch({type:"EDIT_WORKSPACE",payload:{page:e.pagination,slug:t.slug,data:t,platform:e.platform}}),e.dispatch(function(e){return{type:"EDIT_WORKSPACE_DETAILS",payload:e}}({page:e.pagination,slug:t.slug,data:t,platform:e.platform}))},pagination:e.pagination,content:e.content,platform:e.platform})}).then((function(e){return e.saved?Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Saved",content:"You have succesfully saved your WorkSpace changes."})}):e.dismiss?void 0:Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding changes in your WorkSpace. Try Later or Contact support."})})})),c(!1))}),[l]),Object(o.useEffect)((function(){s&&(Vs("",{showConfirmButton:!0,allowOutsideClick:!1,confirmButtonText:"Delete",cancelButtonText:"Cancel",showCancelButton:!0,showCloseButton:!0,showLoaderOnConfirm:!1,reverseButtons:!0,customClass:{container:"templately-delete-modal",confirmButton:"templately-delete-confirm",cancelButton:"templately-delete-cancel"},html:i.a.createElement(Zg,null),input:"checkbox",inputValue:0,inputPlaceholder:"Delete WorkSpace Files?",target:".templately-workspace-content",preConfirm:function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","delete_workspace"),n.append("id",e),n.append("withFiles",t),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e}))}}(s,t).then((function(t){return t.data.success&&"success"==t.data.data?(e.dispatch({type:"DELETE_WORKSPACE",payload:{page:e.pagination,data:s}}),{delete:!0}):{delete:!1}}))}}).then((function(t){if(t.hasOwnProperty("value")&&t.value.hasOwnProperty("delete")){if(t.value.delete){var n=v.pathname.replace(e.content.slug,"");return e.dispatch(Vi(n)),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Deleted",content:"You have deleted a WorkSpace from your account."})})}return Vs("",{icon:"error",timer:1500,html:i.a.createElement(sf,{title:"Something went wrong.",content:"Something went wrong regarding deleting your WorkSpace. Try Later."})})}})),f(!1))}),[s]),Object(o.useEffect)((function(){var t=[];e.content.sharedWith&&e.content.sharedWith.length>0&&(e.content.sharedWith.slice(0,e.shared||e.userID!==e.content.owner.id?5:4).map((function(e,n){null!=e.profile_photo?t.push(i.a.createElement("img",{key:n,src:e.profile_photo,alt:e.name})):t.push(i.a.createElement("span",{key:n},e.name.slice(0,1)))})),m(t));return document.addEventListener("mousedown",E),function(){return document.removeEventListener("mousedown",E)}}),[]),Object(o.useEffect)((function(){e.details||(!1!==y&&!1===n&&!1===l&&e.dispatch(Vi(e.shared?"/shared/workspace/".concat(y):"/workspace/".concat(y))),g(!1))}),[y]),i.a.createElement("div",{onClick:function(){return g(e.content.slug)},className:"".concat(e.details?"tsw-active ":"","templately-single-workspace").concat(!0===n?" templately-ctxmenu-open":"")},i.a.createElement("div",{className:"templately-single-workspace-inner"},e.userID===e.content.owner.id&&i.a.createElement("div",{className:"templately-sw-cxt-menu-wrapper"},i.a.createElement(Id,{ref:b,className:"templately-sw-action-btn",onClick:function(){return r(!n)}},i.a.createElement(ei,null)),n&&i.a.createElement("div",{ref:w,className:"templately-sw-cxt-menu".concat(!0===n?" topen":"")},i.a.createElement("ul",null,i.a.createElement("li",{className:"tw-edit",onClick:function(){return c(e.content.id)}},i.a.createElement("i",null),nv("Edit","templately")),i.a.createElement("li",{className:"tw-delete",onClick:function(){return f(e.content.id)}},i.a.createElement("i",null),nv("Delete","templately"))))),i.a.createElement("header",null,i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("div",null,i.a.createElement("span",{className:"tw-title"},nv(e.content.name,"templately")),(e.shared||e.details)&&i.a.createElement("span",{className:"tw-author"},nv("by "+e.content.owner.name,"templately")))),i.a.createElement("div",{className:"templately-workspace-sharewith"},i.a.createElement("p",null,nv("Shared with","templately")," "),i.a.createElement("div",{className:"templately-workspace-sharewith-image"},d,e.userID===e.content.owner.id&&i.a.createElement(Id,{onClick:function(){return c(!0)}},i.a.createElement(oi,null))))))}));function av(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ov(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?av(Object(n),!0).forEach((function(t){iv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):av(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lv(e){return function(e){if(Array.isArray(e))return sv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uv(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||uv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uv(e,t){if(e){if("string"==typeof e)return sv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sv(e,t):void 0}}function sv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fv=wp.i18n.__,pv=TemplatelyAdmin.loadingImage,dv=function(e){var t=cv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=cv(Object(o.useState)(!0),2),l=a[0],c=a[1],u=cv(Object(o.useState)(!1),2),s=u[0],f=u[1],p=cv(Object(o.useState)(""),2),d=p[0],m=p[1],h=cv(Object(o.useState)([]),2),y=h[0],g=h[1],v=cv(Object(o.useState)(!1),2),b=v[0],w=v[1],E=cv(Object(o.useState)(""),2),O=E[0],S=E[1],k=cv(Object(o.useState)(!1),2),_=k[0],j=k[1],x=cv(Object(o.useState)([]),2),P=x[0],C=x[1];return Object(o.useEffect)((function(){if(b){var e=lv(P),t=O.toLowerCase();Xs(t)&&(e.includes(t)||(e.push(t),C(e)),S("")),w(!1)}}),[b]),Object(o.useEffect)((function(){if(!1!==_){var e=lv(P).filter((function(e){return _!=e}));C(e),j(!1)}}),[_]),Object(o.useEffect)((function(){var e=[];P.length>0&&P.map((function(t,n){return e.push(i.a.createElement("li",{key:n},t,i.a.createElement("span",{onClick:function(){return j(t)}})))})),g(e)}),[P]),Object(o.useEffect)((function(){c(!(P.length>0||d.length>0))}),[P,d]),Object(o.useEffect)((function(){s&&(r(!0),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null!==e){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","create_workspace"),n.append("title",e),n.append("share_with",t.join()),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}}(d,P).then((function(t){t.data.success?"success"===t.data.data.status?(e.singleDispatch(t.data.data.workspace),_s.a.close(ov({created:!0},t.data.data))):_s.a.close(ov({created:!1},t.data.data)):r(!1)})),f(!1))}),[s]),i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-create-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},i.a.createElement("img",{src:pv})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("span",{className:"wem-title-icon"})),i.a.createElement("div",{className:"templately-wem-input templately-workspace-name"},i.a.createElement("input",{autoFocus:!0,type:"text",value:d,onChange:function(e){return m(e.target.value)},placeholder:fv("WorkSpace Name","templately")}))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,fv("Add People","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input templately-new-shared"},i.a.createElement("ul",{className:"templately-wem-new-email-list"},y),i.a.createElement("div",null,i.a.createElement(Wg,{onChange:function(e){return S(e.currentTarget.value)},onKeyUp:function(e){return w(13===e.keyCode)},value:O,placeholder:fv("Type email to add","templately")}),i.a.createElement(Id,{disabled:0===O.length,onClick:function(){return w(!0)}},fv("Add","templately"))))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:l,onClick:function(){return f(!0)}},fv("Create WorkSpace","templately")))))};function mv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yv=function(e){var t=mv(Object(o.useState)(!0),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!1)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-single-workspace-placeholder ".concat(e.grid?"tworkspace-grid-placeholder":"tworkspace-list-placeholder")},e.grid?i.a.createElement("svg",{"aria-labelledby":"loading-aria",preserveAspectRatio:"none",viewBox:"0 0 305 159"},i.a.createElement("rect",{width:"100%",height:"100%",fill:'url("#fill")',clipPath:"url(#clip-path)"}),i.a.createElement("defs",null,i.a.createElement("clipPath",{id:"clip-path"},i.a.createElement("circle",{cx:"300",cy:"22",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"29",r:"3"}),i.a.createElement("circle",{cx:"300",cy:"36",r:"3"}),i.a.createElement("path",{d:"M207.4 72.6H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2zM82.3 97.4H5.1c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{cx:"21",cy:"22",r:"21"}),i.a.createElement("path",{d:"M34.8 125C27 118 15 118.6 8 126.4c-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{d:"M59.8 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{d:"M90 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{d:"M120 138.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4-7 7.8-6.4 19.8 1.4 26.8 3.5 3.1 8 4.9 12.7 4.9 4.7 0 9.2-1.7 12.7-4.8-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{cx:"142",cy:"139",r:"19"})),i.a.createElement("linearGradient",{id:"fill"},i.a.createElement("stop",{offset:"0.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-2; -2; 1"})),i.a.createElement("stop",{offset:"1.6",stopColor:"#6c7dff"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"-1; -1; 2"})),i.a.createElement("stop",{offset:"2.6",stopColor:"#f3f3f3"},i.a.createElement("animate",{attributeName:"offset",dur:"2s",keyTimes:"0; 0.25; 1",repeatCount:"indefinite",values:"0; 0; 3"}))))):i.a.createElement("svg",{id:"prefix__Layer_1",xmlns:"http://www.w3.org/2000/svg",x:0,y:0,viewBox:"0 0 1180 102",xmlSpace:"preserve"},i.a.createElement("style",null,".prefix__st0{fill:#edeeef}.prefix__st1{fill:#f3f3f3}"),i.a.createElement("circle",{id:"prefix__Ellipse_1",className:"prefix__st0",cx:1149.7,cy:21.1,r:2.7}),i.a.createElement("circle",{id:"prefix__Ellipse_2",className:"prefix__st0",cx:1149.7,cy:28.3,r:2.7}),i.a.createElement("circle",{id:"prefix__Ellipse_3",className:"prefix__st0",cx:1149.7,cy:35.4,r:2.7}),i.a.createElement("g",null,i.a.createElement("path",{id:"prefix__Path_1",className:"prefix__st1",d:"M300.9 44.8H98.6c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h202.2c2.8 0 5.1 2.3 5.1 5.1.1 2.7-2.1 5-4.8 5.1h-.2z"}),i.a.createElement("path",{id:"prefix__Path_2",className:"prefix__st1",d:"M175.8 69.6H98.6c-2.8 0-5.1-2.3-5.1-5.1s2.3-5.1 5.1-5.1h77.3c2.8 0 5.1 2.3 5.1 5.1-.1 2.8-2.3 5.1-5.2 5.1.1 0 .1 0 0 0z"}),i.a.createElement("circle",{id:"prefix__Ellipse_4",className:"prefix__st1",cx:49,cy:52.1,r:21.2})),i.a.createElement("g",{id:"prefix__Group_1",transform:"translate(-3.146)"},i.a.createElement("path",{id:"prefix__Path_3",className:"prefix__st1",d:"M690 38c-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-6.6-8.4-6.6-20.1 0-28.3z"}),i.a.createElement("path",{id:"prefix__Path_4",className:"prefix__st1",d:"M715 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-4.9-9.1-5-14.3z"}),i.a.createElement("path",{id:"prefix__Path_5",className:"prefix__st1",d:"M745.2 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("path",{id:"prefix__Path_6",className:"prefix__st1",d:"M775.2 51.9c0-5.1 1.7-10 5-14-7.8-7-19.8-6.4-26.8 1.4s-6.4 19.8 1.4 26.8c3.5 3.1 8 4.9 12.7 4.9s9.2-1.7 12.7-4.8c-3.2-4.1-5-9.1-5-14.3z"}),i.a.createElement("circle",{id:"prefix__Ellipse_5",className:"prefix__st1",cx:797.6,cy:51.9,r:18.9})))):i.a.createElement("div",null)};function gv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bv=wp.i18n.__,wv=function(e){var t=gv(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){var t=setTimeout((function(){r(!0)}),[e.delay]);return function(){return clearTimeout(t)}}),[]),n?i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace no-workspace-found-wrapper"},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},bv("No Workspaces Found.","templately")))):i.a.createElement("div",null)},Ev=function(e){return void 0===e.visibility||e.visibility||e.title&&e.title.length<=0?"":i.a.createElement("div",{className:"templately-workspace-header"},i.a.createElement("h1",null,e.title),e.children)},Ov=function(e){var t=e.grid,n=e.setGrid,r=function(e){return n("grid"===e)};return i.a.createElement("div",{className:"tview-action"},i.a.createElement(Id,{onClick:function(){return r("grid")},className:"templately-grid-view ".concat(t?"activated-view":"")},i.a.createElement(ui,null)),i.a.createElement(Id,{onClick:function(){return r("list")},className:"templately-list-view ".concat(t?"":"activated-view")},i.a.createElement(Ko,null)))};function Sv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _v=wp.i18n.__,jv=nt((function(e){return{workspaces:e.workspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,workspaceList:e.workspaces.workspacesList}}))((function(e){var t=Sv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Sv(Object(o.useState)([]),2),l=a[0],c=a[1],u=Sv(Object(o.useState)(1),2),s=u[0],f=u[1],p=Sv(Object(o.useState)(!0),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0||Zs(!1,!0,{page:e.pagination}).then((function(t){t.data.success&&(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"ALL_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}))})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}))}),[e.pagination]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(rv,{key:e.id,content:e}))})),c(t)}}),[e.workspaces,e.pagination]),Object(o.useEffect)((function(){n&&(Vs("",{showConfirmButton:!1,showCloseButton:!0,allowOutsideClick:!1,html:i.a.createElement(dv,{singleDispatch:function(t,n){e.workspaceList.length>0&&e.dispatch({type:"ADD_WORKSPACE_IN_LIST",payload:[{id:t.id,name:t.name,slug:t.slug}]}),e.dispatch(function(e){return{type:"CREATE_WORKSPACE",payload:e}}({page:e.pagination,data:t}))}})}).then((function(e){if(e.hasOwnProperty("created"))return e.created?Vs("",{icon:"success",timer:2e3,html:i.a.createElement(sf,{title:"Successfully Created",content:i.a.createElement("p",null,"You have created a WorkSpace called"," ",i.a.createElement("strong",null,e.workspace.name))})}):Vs("",{icon:"error",showCloseButton:!0,html:i.a.createElement(sf,{title:"Something went wrong.",content:i.a.createElement("div",null,i.a.createElement("p",null,e.message),i.a.createElement("a",{href:"https://templately.com/subscription",target:"_blank"},_v("Upgrade to Pro","templately")))})})})),r(!1))}),[n]),i.a.createElement(Em,null,i.a.createElement(Ev,{title:"My WorkSpace"}),i.a.createElement("div",{className:"templately-my-workspace-item-view-buttons"},i.a.createElement(Ov,{grid:d,setGrid:m})),i.a.createElement("div",{className:"templately-my-workspace templately-workspace-list ".concat(d?"":"templately-list-view")},i.a.createElement("div",{className:"templately-single-workspace templately-add-workspace",onClick:function(){return r(!0)}},i.a.createElement("div",{className:"templately-add-workspace-inner"},i.a.createElement("span",{className:"tw-icon"}),i.a.createElement("span",{className:"tw-title"},_v("Add New WorkSpace","templately"))))," ",l.length>0?l:i.a.createElement(i.a.Fragment,null,i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(yv,{delay:3e3,grid:d}),i.a.createElement(wv,{delay:3e3}))),i.a.createElement(Yd,{type:"workspace",count:s}))})),xv=TemplatelyAdmin.not_found,Pv=nt((function(e){return{retry:e.common.retry,retryMessage:e.common.retryMessage}}))((function(e){return i.a.createElement("div",{className:"templately-nothing-is-there"},""!=e.retryMessage?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,e.retryMessage),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){e.dispatch(pi(!e.retry)),e.dispatch(yi(""))}},"Retry")):i.a.createElement("img",{src:xv}))}));function Cv(e){return function(e){if(Array.isArray(e))return Dv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Iv(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Av(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach((function(t){Nv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Nv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||Iv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Iv(e,t){if(e){if("string"==typeof e)return Dv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dv(e,t):void 0}}function Dv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mv=wp.i18n.__,Rv=TemplatelyAdmin.loadingImage,Fv=function(e){var t=Lv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=Lv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=Lv(Object(o.useState)(""),2),s=u[0],f=u[1],p=Lv(Object(o.useState)(!0),2),d=p[0],m=p[1],h=Lv(Object(o.useState)(!1),2),y=h[0],g=h[1],v=Lv(Object(o.useState)(!1),2),b=v[0],w=v[1],E=Lv(Object(o.useState)(!1),2),O=E[0],S=E[1],k=Lv(Object(o.useState)({value:"clouds",label:Mv("My Clouds","templately")}),2),_=k[0],j=k[1],x=Lv(Object(o.useState)([]),2),P=x[0],C=x[1],T=Lv(Object(o.useState)([]),2),A=T[0],N=T[1],L=Lv(Object(o.useState)([]),2),I=L[0],D=L[1],M=Lv(Object(o.useState)([]),2),R=M[0],F=M[1],z=Lv(Object(o.useState)(e.cloudFiles),2),U=z[0],B=z[1];Object(o.useEffect)((function(){if(F([]),"clouds"==_.value)if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}else D([]);if("workspaces"==_.value&&!1!==O)if(U.hasOwnProperty(O.slug)){var n=[];U[O.slug].map((function(e){n.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(n)}else{r(!0),nf(O.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=Av({},U);n[O.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:O.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}if("shared_workspaces"==_.value&&!1!==b)if(U.hasOwnProperty(b.slug)){var a=[];U[b.slug].map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else{r(!0),nf(b.slug,{per_page:-1,platform:e.platform}).then((function(t){if(t.data.success)if(r(!1),null!==t.data.data.files){var n=Av({},U);n[b.slug]=t.data.data.files.data,B(n),e.singleDispatch({data:t.data.data.files.data,slug:b.slug});var a=[];t.data.data.files.data.map((function(e){a.push({label:e.name,value:e.my_cloud_id,file_type:e.file_type})})),D(a)}else D([]);else f("string"==typeof t.data.data?t.data.data:"")}))}}),[_,O,b,U,l]),Object(o.useEffect)((function(){if(r(!0),U.hasOwnProperty("clouds")){if(U.hasOwnProperty("clouds")){var t=[];U.clouds.map((function(e){t.push({label:e.name,value:e.id,file_type:e.file_type})})),D(t)}}else tf({per_page:-1,platform:e.platform}).then((function(t){if(t.data.success){if(t.data.data.data.length>0){var n=[];t.data.data.data.map((function(e){n.push({label:e.name,value:e.id,file_type:e.file_type})})),D(n);var a=Av({},U);a.clouds=t.data.data.data,B(a),e.singleDispatch({slug:"clouds",data:t.data.data.data}),r(!1)}}else r(!0),f("string"==typeof t.data.data?t.data.data:"")}));e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0?Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[],a=[];null!==t[0]&&"string"!=typeof t[0]?(e.singleDispatch(t[0],"workspace"),n=ef(t[0])):f("string"==typeof t[0]?t[0]:""),null!==t[1]&&"string"!=typeof t[1]?(e.singleDispatch(t[1]),a=ef(t[1],!0)):f("string"==typeof t[1]?t[1]:""),n.length>0&&C(n),a.length>0&&N(a),(a.length>0||n.length>0)&&r(!1)}})).catch((function(e){return console.error("Error Regarding Fetching WorkSpace List:",e)})):(e.workspaceList.length>0&&C(ef(e.workspaceList)),e.sharedWorkspaceList.length>0&&N(ef(e.sharedWorkspaceList)),r(!1))}),[l]),Object(o.useEffect)((function(){null!==R?("workspaces"===_.value&&!1!==O&&R.length>0&&m(!1),"shared_workspaces"===_.value&&!1!==b&&R.length>0&&m(!1),"clouds"===_.value&&!b&&!O&&R.length>0&&m(!1)):m(!0)}),[b,O,R]),Object(o.useEffect)((function(){if(y){var t=R.reduce((function(e,t){var n=Cv(e);return n.push(t.value),n}),[]);r(!0),function(e,t){var n=new FormData;return n.append("action","get_templately"),n.append("content_type","add_files_to_workspace"),n.append("workspace_id",e),n.append("files",t),n.append("nonce",Fs),wu.a.post(ajaxurl,n).then((function(e){return e})).catch((function(e){return e}))}(e.workspaceID,JSON.stringify(t)).then((function(t){if(t.data.success){if("success"===t.data.data.status){var n=JSON.parse(t.data.data.data);if(n.files.length>0){var a=[];n.files.map((function(e){a.push({id:e.id,my_cloud_id:e.my_cloud_item_id,name:e.name,file_type:e.file_type,created_at:e.created_at,last_modified:e.last_modified,owner:e.owner})})),e.singleDispatch({slug:e.workspaceSlug,data:a},"workspace_details"),_s.a.close({added:!0})}}}else r(!1)})),g(!1)}}),[y]);return i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{className:"templately-workspace-edit-modal templately-workspace-copy-modal"},n&&i.a.createElement("div",{className:"templately-pre-loader"},s.length>0?i.a.createElement("div",{className:"templately-retry"},i.a.createElement("p",null,s),i.a.createElement("button",{className:"templately-retry-button button-primary",onClick:function(){r(!0),c(!l),f("")}},"Retry")):i.a.createElement("img",{src:Rv})),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Add Template to WorkSpace","templately"),": "))),i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select Source","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{isSearchable:!1,defaultValue:{value:"clouds",label:Mv("My Clouds","templately")},options:[{value:"clouds",label:Mv("My Clouds","templately")},{value:"workspaces",label:Mv("My Workspaces","templately")},{value:"shared_workspaces",label:Mv("Shared Workspaces","templately")}],onChange:function(e){return j(e)}}))),"workspaces"===_.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:P,noOptionsMessage:function(){return Mv("No WorkSpace Found","templately")},onChange:function(e){return S(e)}}))),"shared_workspaces"===_.value&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select WorkSpace","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{options:A,noOptionsMessage:function(){return Mv("No Shared WorkSpace Found","templately")},onChange:function(e){return w(e)}}))),("shared_workspaces"===_.value&&!1!==b||"workspaces"===_.value&&!1!==O||"clouds"===_.value)&&i.a.createElement("div",{className:"templately-wem-row"},i.a.createElement("div",{className:"templately-wem-title"},i.a.createElement("p",null,Mv("Select Templates","templately"),": ")),i.a.createElement("div",{className:"templately-wem-input"},i.a.createElement(mu,{value:R,noOptionsMessage:function(){return Mv("No Saved Templates Found","templately")},classNamePrefix:"templately",isMulti:!0,options:I,onChange:function(e){return F(e)}}))),i.a.createElement("div",{className:"templately-wem-row templately-wem-save-btn"},i.a.createElement(Id,{disabled:d,onClick:function(){return g(!0)}},Mv("Add To WorkSpace","templately")))))};function zv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Uv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Uv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bv=wp.i18n.__,Vv=nt((function(e){return{workspaceList:e.workspaces.workspacesList,sharedWorkspaceList:e.sharedWorkspaces.sharedWorkspaceList,clouds_file_list:e.workspacesDetails.filesList,platform:e.common.platform,pagination:e.common.pagination}}))((function(e){var t=zv(Object(o.useState)(!1),2),n=t[0],r=t[1],a=zv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=zv(Object(o.useState)(""),2),s=u[0],f=u[1],p=zv(Object(o.useState)(!1),2),d=p[0],m=p[1],h=zv(Object(o.useState)([]),2),y=h[0],g=h[1],v=zv(Object(o.useState)(void 0),2),b=v[0],w=v[1],E=Object(o.useMemo)((function(){return null!=e&&e.shared?"/shared/workspace":"/workspace"}),[e.shared]);return Object(o.useEffect)((function(){!1!==n&&e.workspaceSlug!==n.slug?(e.setSearch(!1),e.setLoading(!0),e.dispatch(Ri(1)),e.dispatch(Vi(n.shared?"/shared/workspace/".concat(n.slug):"/workspace/".concat(n.slug))),e.dispatch(Yi(n.slug)),r(!1)):e.dispatch(Yi(!1))}),[n]),Object(o.useEffect)((function(){(e.pagination>1&&s.length>0||d&&s.length>0)&&(e.setItemLoading(!0),e.setSearch(!0),nf(e.workspaceSlug,{search:s,per_page:10,page:e.pagination}).then((function(t){var n,r,a;t.data.success&&(null!=t&&null!==(n=t.data)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(a=r.files)&&void 0!==a&&a.data&&(e.setTotalPage(t.data.data.files.total_page),e.setSearchedItem(t.data.data.files.data)),e.setItemLoading(!1))})),m(!1)),d&&0===s.length&&e.setSearch(!1)}),[d,e.pagination]),Object(o.useEffect)((function(){if(e.workspaceList.length<=0||e.sharedWorkspaceList.length<=0)Promise.all([Zs(),Zs(!0)]).then((function(t){if(t.length>0){var n=[];null!==t[0]&&"string"!=typeof t[0]&&(e.dispatch(Qi(t[0])),n.push({label:Bv("My WorkSpace","templately"),options:ef(t[0])})),null!==t[1]&&"string"!=typeof t[1]&&(e.dispatch(Gi(t[1])),n.push({label:Bv("Shared WorkSpace","templately"),options:ef(t[1],!0)})),n.length>0&&g(n)}})).catch((function(e){return console.error("Something went wrong: regarding fetching WorkSpace list",e)}));else{var t=[];e.workspaceList.length>0&&t.push({label:Bv("My WorkSpace","templately"),options:ef(e.workspaceList)}),e.sharedWorkspaceList.length>0&&t.push({label:Bv("Shared WorkSpace","templately"),options:ef(e.sharedWorkspaceList,!0)}),t.length>0&&g(t)}}),[e.retry]),Object(o.useEffect)((function(){l&&(Vs("",{html:i.a.createElement(Fv,{title:e.name,singleDispatch:function(t,n){"workspace_details"===n||e.dispatch({type:"ALL_CLOUDS_FILE_LIST",payload:{slug:t.slug,data:t.data,platform:e.platform}})},platform:e.platform,workspaceSlug:e.workspaceSlug,workspaceID:e.workspaceID,cloudFiles:e.clouds_file_list[e.platform]||[],currentWorkspace:e.currentWorkspace,workspaceList:e.workspaceList,sharedWorkspaceList:e.sharedWorkspaceList})}).then((function(t){if(t.added)return e.setFileAdded(!0),Vs("",{icon:"success",timer:1500,html:i.a.createElement(sf,{title:"Successfully Added.",content:i.a.createElement("p",null,"Your file has been added to this workspace."," ",i.a.createElement("strong",null,t.name))})})})),c(!1))}),[l]),Object(o.useEffect)((function(){if((null==y?void 0:y.length)>0&&void 0===b){var t,n,r=[];if(y.map((function(t){var n;null!==(n=r)&&void 0!==n&&n.length||(r=t.options.filter((function(t){return t.slug===e.workspaceSlug})))})),null!==(t=r)&&void 0!==t&&t[0])w(null===(n=r)||void 0===n?void 0:n[0])}}),[e.workspaceSlug,y]),i.a.createElement("div",{className:"templately-workspace-file-add"},i.a.createElement("div",{className:"twfa-header twfa-action"},i.a.createElement(ge,{onClick:function(){e.dispatch(Vi(null))},to:E,className:"twfa-header-back-button"},i.a.createElement($o,null)),i.a.createElement("h3",null,Bv("My Files","templately"))),i.a.createElement("div",{className:"twfa-search twfa-action"},i.a.createElement("div",null,i.a.createElement(mu,{className:"templately-select-workspace",classNamePrefix:"templately",options:y,value:b,onChange:function(e){return r(e)}}),i.a.createElement("div",{className:"templately-workspace-search-wrapper"},i.a.createElement(Wg,{onChange:function(e){return f(e.target.value)},onKeyDown:function(e){var t=e.keyCode;return m(13===t)},placeholder:Bv("Search...","templately")}),i.a.createElement("button",{onClick:function(){return m(!0)}},i.a.createElement(ii,null))))),i.a.createElement("div",{className:"twfa-add twfa-action"},i.a.createElement(Id,{onClick:function(){return c(!0)}},i.a.createElement(oi,null))),i.a.createElement(Ov,{grid:e.grid,setGrid:e.setGrid}))}));function Wv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $v=nt((function(e){return{isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,workspace_slug:e.common.workspace_slug,workspacesDetails:e.workspacesDetails||!1,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,platform:e.common.platform,retry:e.common.retry}}))((function(e){var t,n=Wv(Object(o.useState)({}),2),r=n[0],a=n[1],l=Wv(Object(o.useState)([]),2),c=l[0],u=l[1],s=Wv(Object(o.useState)([]),2),f=s[0],p=s[1],d=Wv(Object(o.useState)([]),2),m=d[0],h=d[1],y=Wv(Object(o.useState)(!0),2),g=y[0],v=y[1],b=Wv(Object(o.useState)(!1),2),w=b[0],E=b[1],O=Wv(Object(o.useState)(!1),2),S=O[0],k=O[1],_=Wv(Object(o.useState)(!1),2),j=_[0],x=_[1],P=Wv(Object(o.useState)(!1),2),C=P[0],T=P[1],A=Wv(Object(o.useState)(!1),2),N=A[0],L=A[1],I=Wv(Object(o.useState)(1),2),D=I[0],M=I[1],R=Wv(Object(o.useState)(!1),2),F=R[0],z=R[1],U=se(),B=ue(),V=Wv(Object(o.useState)(!1!==e.workspace_slug?e.workspace_slug:U.slug),2),W=V[0],H=V[1];return Object(o.useEffect)((function(){!1!==e.workspace_slug&&H(e.workspace_slug)}),[e.workspace_slug]),Object(o.useEffect)((function(){var t,n,r,o,i;if(!1!==W)if(null!==(t=e.workspacesDetails)&&void 0!==t&&null!==(n=t[W])&&void 0!==n&&null!==(r=n.files)&&void 0!==r&&null!==(o=r[e.platform])&&void 0!==o&&o[e.pagination]&&0===(null==B||null===(i=B.search)||void 0===i?void 0:i.length))M(e.workspacesDetails[W].files[e.platform].total_page);else if(!e.workspacesDetails.hasOwnProperty(W)||!e.workspacesDetails[W].files.hasOwnProperty(e.platform)||!e.workspacesDetails[W].files[e.platform].hasOwnProperty(e.pagination)||0!==B.search.length){var l=!1;g||(l=!0,x(!0)),nf(W,{page:e.pagination,platform:e.platform}).then((function(t){if(200===t.status){if(t.data.success)if(t.data.hasOwnProperty("data")&&null!==t.data.data){if(t.data.data.hasOwnProperty("files")&&null!==t.data.data.files){if("refresh"===w&&e.pagination===D)return e.dispatch(Ri(t.data.data.files.total_page)),void x(!1);M(t.data.data.files.total_page)}a({label:t.data.data.name,slug:t.data.data.slug,value:t.data.data.id}),e.dispatch({type:"ADD_WORKSPACE_WITH_DETAILS",payload:{slug:W,data:t.data.data,platform:e.platform,page:e.pagination,iLoading:l}})}else{var n=B.pathname.replace(U.slug,"");e.dispatch(Vi(n))}else e.dispatch(yi("string"==typeof t.data.data?t.data.data:""));v(!1),x(!1)}else v(!1),x(!1)})).catch((function(e){v(!1),console.error("WorkSpace Details Error: ",e)}))}}),[W,e.pagination,w,S,e.platform,e.retry]),Object(o.useEffect)((function(){!0===S&&(e.dispatch(qi({page:e.pagination,slug:W,platform:e.platform,fileAdded:!0})),k("refresh")),!0===w&&(e.dispatch(qi({page:e.pagination,slug:W,platform:e.platform})),E("refresh"))}),[w,S]),Object(o.useEffect)((function(){if(!1!==W&&e.workspacesDetails.hasOwnProperty(W)){if(L(e.workspacesDetails[W].id),e.workspacesDetails[W].hasOwnProperty("files")&&null!=e.workspacesDetails[W].files){var t=[];if(!e.workspacesDetails[W].files.hasOwnProperty(e.platform))return void u([]);e.workspacesDetails[W].files[e.platform].hasOwnProperty(e.pagination)&&e.workspacesDetails[W].files[e.platform][e.pagination].length>0?(e.workspacesDetails[W].files[e.platform][e.pagination].map((function(e){t.push(F?i.a.createElement(Gm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:e.id,currentWorkspace:W,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}):i.a.createElement(Fm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:e.id,currentWorkspace:W,owner:e.owner,file_type:e.file_type,cloud_id:e.my_cloud_id,id:e.id,name:e.name,date:e.last_modified}))})),M(e.workspacesDetails[W].files[e.platform].total_page),u(t)):u([])}else u([]);v(!1),"refresh"===w&&E(!1)}}),[e.workspacesDetails,W,e.pagination,e.platform,C,F]),Object(o.useEffect)((function(){if(f.length>0){if(!1===W)return;var e=[];f.map((function(t){e.push(F?i.a.createElement(Gm,{details:!0,itemDelete:function(e){return E(e)},isLoading:function(e){return v(e)},key:t.id,currentWorkspace:W,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}):i.a.createElement(Fm,{details:!0,isLoading:function(e){return v(e)},key:t.id,currentWorkspace:W,owner:t.owner,file_type:t.file_type,cloud_id:t.my_cloud_id,id:t.id,name:t.name,date:t.last_modified}))})),h(e)}else h([])}),[f]),Object(o.useEffect)((function(){var t,n,r;null!==(t=e.workspacesDetails)&&void 0!==t&&null!==(n=t[W])&&void 0!==n&&null!==(r=n.files)&&void 0!==r&&r[e.platform]&&M(e.workspacesDetails[W].files[e.platform].total_page)}),[e.platform,e.workspacesDetails,W,w,S]),i.a.createElement(Em,null,i.a.createElement("div",{className:"".concat(D>1?"thas-pagination ":"","templately-my-workspace templately-workspace-details templately-list-view").concat(g?" templately-loading":"")},g&&i.a.createElement(Jd,null),e.workspacesDetails[U.slug]&&!g&&i.a.createElement(rv,{details:!0,content:e.workspacesDetails[U.slug],platform:e.platform}),!g&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Vv,{retry:e.retry,setFileAdded:function(e){return k(e)},setLoading:function(e){return v(e)},setItemLoading:function(e){return x(e)},setSearch:function(e){return T(e)},setSearchedItem:function(e){return p(e)},setTotalPage:function(e){return M(e)},workspaceSlug:W,workspaceID:N,currentDetails:r,grid:F,setGrid:z,shared:-1!==(null===(t=e.location)||void 0===t?void 0:t.pathname.indexOf("shared"))}),i.a.createElement(Ef,{className:"templately-clouds-table"},(c.length>0&&!C||m.length>0&&C)&&i.a.createElement(i.a.Fragment,null,!F&&i.a.createElement(_f,null),j&&i.a.createElement(Jd,{small:!0}),C&&!j&&i.a.createElement(qd,{className:"templately-table-body ".concat(F?"templately-templates-grid-view":"")},m),!j&&!C&&i.a.createElement(qd,{className:"templately-table-body ".concat(F?"templately-templates-grid-view":"")},c)),(0===c.length&&j||0===m.length&&j)&&i.a.createElement(i.a.Fragment,null,j&&i.a.createElement(Jd,{small:!0})),!C&&0===c.length&&!j&&i.a.createElement(Pv,null),C&&0===m.length&&!j&&i.a.createElement(Pv,null)),D>1&&i.a.createElement(Yd,{type:"workspace",count:D}))))}));function qv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Qv=wp.i18n.__,Gv=nt((function(e){return{is_verified:e.admin.user.is_verified,isLoggedIn:e.common.isLoggedIn,clouds:e.common.cloud_files,platform:e.common.platform,loading:e.common.loading,pushed_time:e.common.pushed_time,userID:e.admin.user.id||null,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=qv(Object(o.useState)(!0),2),n=t[0],r=t[1],a=qv(Object(o.useState)(!1),2),l=a[0],c=a[1],u=qv(Object(o.useState)(!1),2),s=u[0],f=u[1],p=qv(Object(o.useState)([]),2),d=p[0],m=p[1],h=qv(Object(o.useState)(1),2),y=h[0],g=h[1],v=qv(Object(o.useState)(""),2),b=v[0],w=v[1],E=qv(Object(o.useState)(""),2),O=E[0],S=E[1],k=qv(Object(o.useState)(!1),2),_=k[0],j=k[1],x=qv(Object(o.useState)(!1),2),P=x[0],C=x[1],T=qv(Object(o.useState)(!1),2),A=T[0],N=T[1],L=qv(Object(o.useState)({}),2),I=L[0],D=L[1],M=qv(Object(o.useState)(1),2),R=M[0],F=M[1],z=qv(Object(o.useState)(!1),2),U=z[0],B=z[1],V=ue();return Object(o.useEffect)((function(){A&&(e.dispatch(Ri(1)),C(!1),w(""),S(""),D({}),N(!1))}),[A]),Object(o.useEffect)((function(){if(R!==e.pagination||_){if(b.length>0){if(I.hasOwnProperty(e.pagination)&&O===b)return void f(!1);S(b),F(e.pagination),f(!0),tf({per_page:10,page:e.pagination,platform:e.platform,search:b}).then((function(t){if(200===t.status)if(t.data.success){C(!0),g(t.data.data.total_page);var n={};n[e.pagination]=t.data.data.data,D(n),f(!1)}else f(!1)})).catch((function(e){return console.error("Search MyClouds Error: ",e)}))}j(!1)}}),[_,e.pagination]),Object(o.useEffect)((function(){if(!P)return e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&!l&&"?refresh"!==V.search?(f(!1),void r(!1)):void(e.isLoggedIn&&(r(!0),f(!0),tf({page:e.pagination,platform:e.platform,per_page:10}).then((function(t){200===t.status&&(t.data.success?(g(t.data.data.total_page),e.dispatch(Oi({current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page,platform:e.platform})),f(!1),r(!1),e.dispatch({type:"SET_SUCCESS_TEXT",payload:Qv("Successfully Synced","templately")})):Ks().then((function(t){t.data.success?(TemplatelyAdmin.is_logged_in=!1,e.dispatch(xi(!1)),e.dispatch(Ui([])),Vs(Qv("You have to logged in again.","templately"),{icon:"error",timer:1500}),e.dispatch(Vi("/sign-in"))):Vs(Qv("Something went wrong. You have to re-login.","templately"),{icon:"error",timer:1500})})))})).catch((function(e){r(!1),console.error("Sync Error From MyClouds: ",e)}))))}),[e.pagination,l,e.platform,e.retry]),Object(o.useEffect)((function(){if(P){if(!I.hasOwnProperty(e.pagination))return;if(I.hasOwnProperty(e.pagination)){var t=[];I[e.pagination]&&I[e.pagination].length>0&&I[e.pagination].map((function(n){t.push(U?i.a.createElement(Gm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}):i.a.createElement(Fm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:n.id,file_type:n.file_type,owner:{id:e.userID},id:n.id,name:n.name,date:n.created_at}))})),m(t)}}else if(e.clouds.hasOwnProperty(e.platform)&&e.clouds[e.platform].hasOwnProperty(e.pagination)&&(l||s||!1===n)){g(e.clouds[e.platform].total_page);var a=[];e.clouds[e.platform][e.pagination].length>0&&e.clouds[e.platform][e.pagination].map((function(t){a.push(U?i.a.createElement(Gm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}):i.a.createElement(Fm,{isDelete:function(e){return c(e)},isLoading:function(e){return r(e)},key:t.id,file_type:t.file_type,owner:{id:e.userID},id:t.id,name:t.name,date:t.created_at}))})),m(a),c(!1)}}),[e.clouds,s,n,e.pagination,l,e.platform,A,_,U]),Object(o.useEffect)((function(){e.clouds.hasOwnProperty(e.platform)&&g(e.clouds[e.platform].total_page||0)}),[e.platform]),i.a.createElement(i.a.Fragment,null,!e.isLoggedIn&&i.a.createElement(Xm,null),e.isLoggedIn&&i.a.createElement(Em,null,n&&i.a.createElement(Jd,null),!n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Ev,{visibility:!1,title:"My Cloud"},i.a.createElement("div",{className:"templately-cloud-searchbox"},i.a.createElement(Wg,{className:"templately-cloud-search",value:b,onChange:function(e){return w(e.target.value)},onKeyDown:function(e){return j(13===e.keyCode)},placeholder:Qv("Type and press enter...","templately")}),!P&&i.a.createElement(Id,{onClick:function(){return j(!0)},className:"templately-cloud-search-clear tsearch"},i.a.createElement(ii,null)),P&&i.a.createElement(Id,{onClick:function(){return N(!0)},className:"templately-cloud-search-clear"},i.a.createElement(si,null))),i.a.createElement(Ov,{grid:U,setGrid:B})),i.a.createElement("div",{className:"templately-my-clouds"},i.a.createElement(Ef,{className:"templately-clouds-table"},d.length>0&&i.a.createElement(i.a.Fragment,null,!U&&i.a.createElement(_f,null),!s&&i.a.createElement(qd,{className:"templately-table-body ".concat(U?"templately-templates-grid-view":"")},d),s&&i.a.createElement(Jd,null)),0===d.length&&!s&&i.a.createElement(Pv,null)),i.a.createElement(Yd,{type:"clouds",count:y})))))}));function Yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Jv=nt((function(e){return{workspaces:e.sharedWorkspaces||null,need_pagination:e.common.need_pagination,pagination_loading:e.common.pagination_loading,pagination:e.common.pagination,retry:e.common.retry}}))((function(e){var t=Yv(Object(o.useState)([]),2),n=t[0],r=t[1],a=Yv(Object(o.useState)(!0),2),l=a[0],c=a[1],u=Yv(Object(o.useState)(1),2),s=u[0],f=u[1],p=Yv(Object(o.useState)(!1),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0?c(!1):(c(!0),Zs(!0,!0,{page:1}).then((function(t){t.data.success?(t.data.hasOwnProperty("data")&&t.data.data.hasOwnProperty("total_page")&&f(t.data.data.total_page),e.dispatch({type:"SHARED_WORKSPACE_QUERY",payload:{current_page:t.data.data.current_page,data:t.data.data.data,total_page:t.data.data.total_page}}),c(!1)):(c(!1),e.dispatch(yi("string"==typeof t.data.data?t.data.data:"")))})).catch((function(e){return console.error("Something went wrong: regarding fetching Shared WorkSpace list",e)})))}),[e.retry]),Object(o.useEffect)((function(){if(null!=e.workspaces){var t=[];e.workspaces.hasOwnProperty(e.pagination)&&e.workspaces[e.pagination].length>0&&e.workspaces[e.pagination].map((function(e,n){t.push(i.a.createElement(rv,{key:n,shared:!0,content:e}))})),r(t)}}),[e.workspaces]),i.a.createElement(Em,null,i.a.createElement("div",{className:"templately-my-workspace-item-view-buttons"},i.a.createElement(Ov,{grid:d,setGrid:m})),i.a.createElement("div",{className:"templately-my-workspace templately-shared-workspace-wrapper ".concat(d?"":"templately-list-view")},!l&&n,!l&&0===n.length&&i.a.createElement(Pv,null),l&&i.a.createElement(Jd,null)),i.a.createElement(Yd,{type:"shared_workspace",count:s}))})),Zv=(TemplatelyAdmin.default_image,wp.i18n.__),eb=function(e){var t,n,r=e.categoryName,a=e.pack,o=e.content;return i.a.createElement("div",{className:"templately-preview-widget"},i.a.createElement("div",{className:"templately-item-meta"},r&&i.a.createElement("p",null,i.a.createElement("span",null,Zv("Category","templately")," : "),i.a.createElement(ge,{to:"/".concat(a?"".concat(o.type,"s"):"","?cat_id=").concat(null===(t=o.category)||void 0===t?void 0:t.id)},i.a.createElement("span",null,r))),a&&i.a.createElement("p",null,i.a.createElement("span",null,Zv("Item Parent","templately")," : "),i.a.createElement(ge,{to:"/pack/".concat(null==a?void 0:a.slug)},i.a.createElement("span",null,null==a?void 0:a.name)))),(null==o||null===(n=o.dependencies)||void 0===n?void 0:n.length)>0&&i.a.createElement("div",{className:"templately-item-meta templately-dependencies-wrapper"},i.a.createElement("p",null,i.a.createElement("span",null,Zv("Dependencies","templately")," :")),i.a.createElement("ul",{className:"templately-dependencies"},o.dependencies.map((function(e,t){return i.a.createElement("li",{key:t,"data-name":e.name},(null==e?void 0:e.icon)&&i.a.createElement("img",{src:e.icon,alt:e.name}))})))),i.a.createElement("div",{className:"templately-item-meta"},i.a.createElement("ul",null,i.a.createElement("li",null,i.a.createElement(ni,{fontSize:"20px",color:"rgb(245, 54, 91)"})," ",null!=e.favourite?e.favourite:0),i.a.createElement("li",null,i.a.createElement(li,{fontSize:"20px",color:"rgb(255, 220, 99)"})," ",null!=e.rating?e.rating.toFixed(1):0),i.a.createElement("li",null,i.a.createElement(Zo,{fontSize:"20px",color:"rgb(96, 114, 255)"})," ",null!=e.downloads?e.downloads:0))))};function tb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rb=nt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=e.items,n=null!=t.items&&t.items,r=tb(Object(o.useState)([]),2),a=r[0],l=r[1];return Object(o.useEffect)((function(){n&&(e.dispatch(Ii(n)),e.dispatch(Di(n)))}),[e.items]),Object(o.useEffect)((function(){if(n.length>0&&n){var t=[];e.filtered.map((function(e,n){t.push(i.a.createElement(Fh,{type:e.type,key:n,content:e}))})),l(t)}}),[e.filtered]),i.a.createElement("div",{className:"templately-item-details-preview"},n.length>0&&null!=n.length&&a,!1===n&&i.a.createElement(Fh,{key:t.id,type:t.type,content:t}))})),ab=wp.i18n.__,ob=function(e){var t,n,r,a=e.content,o=e.pack;return null!=a&&null!==(t=a.tags)&&void 0!==t&&t.length?i.a.createElement("div",{className:"templately-item-details-box"},(null==a||null===(n=a.tags)||void 0===n?void 0:n.length)>0&&i.a.createElement("div",{className:"templately-item-tags"},i.a.createElement("h3",null,ab("Tags","templately")),i.a.createElement("p",null,null==a||null===(r=a.tags)||void 0===r?void 0:r.map((function(e){return i.a.createElement(ge,{to:"/".concat(o?"".concat(a.type,"s"):"","?tag_id=").concat(null==e?void 0:e.id),key:null==e?void 0:e.id},i.a.createElement("span",null,e.name))}))))):""};function ib(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cb=nt((function(e){return{all_items:e.common.all_items,filtered:e.common.filtered_items}}))((function(e){var t=ib(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(!1!==n){var t=e.all_items.filter((function(e){return e.category.id===n}));e.dispatch(Di(t)),e.dispatch(Mi({ulActive:!1})),r(!1)}}),[n]),i.a.createElement("li",null,i.a.createElement("span",{onClick:function(){return r(e.catID)}},e.name,i.a.createElement("span",null,"( ",e.count," )")))}));function ub(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var fb=wp.i18n.__,pb=nt((function(e){return{all_items:e.common.all_items,ulActive:e.common.activeBlockOrPage.ulActive,blockClick:e.common.activeBlockOrPage.blocksBtnClick,pageClick:e.common.activeBlockOrPage.pagesBtnClick}}))((function(e){var t=ub(Object(o.useState)("all"),2),n=t[0],r=t[1],a=ub(Object(o.useState)(!1),2),l=a[0],c=a[1],u=ub(Object(o.useState)(!1),2),s=u[0],f=u[1],p=ub(Object(o.useState)(!1),2),d=(p[0],p[1],e.items.items),m=[],h=[],y=0,g=0;null!=d&&d.map((function(e,t){var n=e.category&&null!=e.category.name?e.category.name:"None",r={};if("block"==e.type&&null!==e.category){var a=Qs(e.category.id,m),o=Gs(e.category.id,m);m=o,y++,r.name=n,r.id=e.category.id,r.count=++a,m.push(r),r={}}if("page"==e.type&&null!==e.category){var i=Qs(e.category.id,h),l=Gs(e.category.id,h);h=l,g++,r.name=n,r.id=e.category.id,r.count=++i,h.push(r),r={}}}));var v=[],b=[];return m.map((function(e){v.push(i.a.createElement(cb,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),h.map((function(e){b.push(i.a.createElement(cb,{key:e.id,name:e.name,count:e.count,catID:e.id}))})),Object(o.useEffect)((function(){e.ulActive||(f(!1),c(!1))}),[e.ulActive]),Object(o.useEffect)((function(){"blocks"===n&&l&&e.dispatch(Mi({ulActive:"blocks"})),"blocks"!==n||l||e.dispatch(Mi({ulActive:!1})),"pages"===n&&s&&e.dispatch(Mi({ulActive:"pages"})),"pages"!==n||s||e.dispatch(Mi({ulActive:!1}))}),[s,l,n]),i.a.createElement("div",{className:"templately-pack-preview-header"},i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("all"===n?"epp-btn-active":""),onClick:function(){r("all"),f(!1),c(!1),e.dispatch(Di(e.all_items))}},fb("All","templately"))),y>0&&i.a.createElement("div",{className:"epp-left epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-blocks ".concat("blocks"===n?"epp-btn-active":""),onClick:function(){r("blocks"),f(!1),c(!l)}},i.a.createElement("span",{className:"epp-item-count"},"(",y,")"),fb("Blocks","templately")," ",i.a.createElement(Qo,null)),v.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("blocks"===e.ulActive&&"epp-active")},v)),g>0&&i.a.createElement("div",{className:"epp-right epp-button"},i.a.createElement("button",{className:"templately-preview-button templately-preview-pages ".concat("pages"===n?"epp-btn-active":""),onClick:function(){r("pages"),c(!1),f(!s)}},i.a.createElement("span",{className:"epp-item-count"},"(",g,")"),fb("Pages","templately")," ",i.a.createElement(Qo,null)),b.length>0&&i.a.createElement("ul",{className:"epp-type-child ".concat("pages"===e.ulActive&&"epp-active")},b)))}));function db(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hb=nt((function(e){return{common:e.common,retry:e.common.retry,loading:e.common.loading}}))((function(e){var t,n=db(Object(o.useState)(!1),2),r=n[0],a=n[1],l=db(Object(o.useState)(!1),2),c=l[0],u=l[1],s=db(Object(o.useState)(!0),2),f=s[0],p=s[1];return Object(o.useEffect)((function(){var t=e.preview.slug;p(!0),rf({id:e.preview.id,slug:t,type:e.preview.type}).then((function(t){var n,r,o,i,l,c;null!=t&&null!==(n=t.data)&&void 0!==n&&n.success?(p(!1),(null==t||null===(r=t.data)||void 0===r||null===(o=r.data)||void 0===o?void 0:o.length)>0&&null!=t&&null!==(i=t.data)&&void 0!==i&&null!==(l=i.data)&&void 0!==l&&null!==(c=l[0])&&void 0!==c&&c.author&&(a(t.data.data[0].author),u(t.data.data[0]))):null!=t&&t.data&&"string"==typeof t.data&&(p(!1),e.dispatch(yi(t.data)))})).catch((function(e){return console.error("Preview Layout Error: ",e)}))}),[e.preview,e.retry]),i.a.createElement(wf,null,(!c||!r||f||e.loading)&&i.a.createElement(Jd,null),c&&r&&!f&&!e.loading&&i.a.createElement("div",{className:"templately-preview-wrapper",onClick:function(){return e.dispatch(Mi({ulActive:!1}))}},i.a.createElement("div",{className:"templately-preview-body"},"pack"===e.rootType&&i.a.createElement(i.a.Fragment,null,i.a.createElement(pb,{items:c})),i.a.createElement(rb,{singleItem:e.singleItem,rootType:e.rootType,items:c})),i.a.createElement("div",{className:"templately-preview-sidebar"},i.a.createElement(eb,{content:c,categoryName:null==c||null===(t=c.category)||void 0===t?void 0:t.name,pack:null==c?void 0:c.pack,rating:null==c?void 0:c.rating,favourite:null==c?void 0:c.favourite_count,downloads:null==c?void 0:c.downloads}),i.a.createElement(ob,{content:c,pack:null==c?void 0:c.pack}))))}));function yb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yb(Object(n),!0).forEach((function(t){vb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Eb=wp.i18n.__,Ob=TemplatelyAdmin,Sb=Ob.is_editor,kb=Ob.platform,_b=nt((function(e){return{preview:e.preview,platform:e.common.platform,platform_exists:e.common.platforms,isLoggedIn:e.common.isLoggedIn}}))((function(e){var t=bb(Object(o.useState)(!1),2),n=t[0],r=t[1];return Object(o.useEffect)((function(){if(0!=n){if(!e.isLoggedIn)return e.dispatch(Vi("/sign-in")),void r(!1);Vs("",{showCloseButton:!0,allowOutsideClick:!1,target:Sb?"#templately-app-modal":"#templatelyAdmin",html:i.a.createElement(xh,{dependencyList:e.content.dependencies,platform:e.platform,title:e.content.name,content:e.content})}).then((function(t){null!=t.insert&&t.insert&&(e.dispatch(gi(gb(gb({},e.platform_exists),{},vb({},"elementor",!0)))),e.dispatch(_i(!0)),Ws(n,"remote",{fileType:e.platform,is_editor:Boolean(Sb)}).then((function(t){if(!0===t)"gutenberg"!==kb?window.TemplatelyModal.destroy():Eu.close(),e.dispatch(_i(!0));else{e.dispatch(_i(!1));var n="",r=!1;t.data&&t.data.data&&t.data.data.errorCode?("required_pro"===t.data.data.errorCode&&(r=!0),n=t.data.data.message):"string"==typeof t.data.data&&(n=t.data.data),Vs("",{icon:"error",html:i.a.createElement(sf,{content:i.a.createElement("div",null,i.a.createElement("p",null,n),r&&i.a.createElement("a",{href:"https://templately.com#pricing",target:"_blank"},"Upgrade to Pro"))})})}})))})),r(!1)}}),[n]),i.a.createElement("div",{className:"templately-block-preview-header"},i.a.createElement("div",{className:"ep-right"},i.a.createElement("button",{onClick:function(){return r(e.itemID)},className:"ep-preview-insert"},Eb("Insert","templately")," ",i.a.createElement(Zo,null))))}));n(135);function jb(e){return(jb="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 xb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cb=function(e){var t=xb(Object(o.useState)(!0),2),n=t[0],r=t[1],a=xb(Object(o.useState)(!1),2),l=a[0],c=a[1],u=xb(Object(o.useState)("desktop"),2),s=u[0],f=u[1],p=xb(Object(o.useState)("100%"),2),d=p[0],m=p[1];return Object(o.useEffect)((function(){"mobile"==s&&m("480px"),"tablet"==s&&m("786px"),"desktop"==s&&m("100%")}),[s,l]),Object(o.useEffect)((function(){"page"===e.preview.type&&e.preview.pageSlug,"block"===e.preview.type&&e.preview.itemSlug,"pack"===e.preview.type&&e.preview.packSlug,rf({type:e.preview.type,slug:e.preview.slug}).then((function(e){e.data.success&&c(e.data.data[0])})).catch((function(e){return console.error("GetItem Error For Preview: ",e)}))}),[e]),i.a.createElement("div",{className:"templately-preview-html-or-image"},!l&&i.a.createElement(Jd,null),"object"==jb(l)&&i.a.createElement(i.a.Fragment,null,i.a.createElement(_b,{itemID:l.id,content:l}),i.a.createElement("div",{className:"templately-preview-image-wrapper"},i.a.createElement("div",{className:"templately-preview-hover"},i.a.createElement("button",{onClick:function(){return f("mobile")},className:"mobile"==s?"preview-active":""},i.a.createElement(ai,null)),i.a.createElement("button",{onClick:function(){return f("tablet")},className:"tablet"==s?"preview-active":""},i.a.createElement(ci,null)),i.a.createElement("button",{onClick:function(){return f("desktop")},className:"desktop"==s?"preview-active":""},i.a.createElement(Jo,null))),n&&i.a.createElement(Jd,null),i.a.createElement("iframe",{onLoad:function(){return r(!1)},loading:"eager",id:"templately-preview-iframe",className:Pf()("templately-preview-iframe",{"templately-iframe-loaded":!n}),width:d,height:"100%",src:l.live_url}))))},Tb=nt((function(e){return{loading:e.common.loading}}))((function(e){var t=se(),n=lf(),r=Object(o.useRef)(null);return Object(o.useEffect)((function(){return r.current=!0,r.current&&e.dispatch(ki({isOpen:!0,isSingle:!0})),function(){r.current=!1,e.dispatch(ki({isOpen:!1,isSingle:!1}))}}),[]),i.a.createElement(i.a.Fragment,null,Boolean(n.get("preview"))&&i.a.createElement(Cb,{rootType:t.type,preview:{slug:t.slug,type:t.type}}),!Boolean(n.get("preview"))&&i.a.createElement(hb,{singleItem:!0,rootType:t.type,preview:{slug:t.slug,type:t.type}}))}));function Ab(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Db=TemplatelyAdmin.is_editor,Mb=wp.i18n.__,Rb=nt((function(e){return{user:e.admin.user||!1,isLoggedIn:e.common.isLoggedIn,currentRoutes:e.common.current_route,platform:e.common.platform}}))((function(e){var t=ue(),n=Lb(Object(o.useState)(!1),2),r=n[0],a=n[1];return Object(o.useEffect)((function(){var t;r&&(t=new FormData,t.append("action","get_templately"),t.append("nonce",Fs),t.append("content_type","verification_done"),wu.a.post(ajaxurl,t).then((function(e){return e})).catch((function(e){return e}))).then((function(t){if(t.data.data){a(!1);var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ab(Object(n),!0).forEach((function(t){Nb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ab(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.user);delete n.is_verified,e.dispatch(Ui(n))}})).catch((function(e){return console.error("ERROR: ",e)}))}),[r]),Object(o.useEffect)((function(){e.isLoggedIn||"/"!==t.pathname||window.elementorFrontend||e.dispatch(Vi("/sign-in"))}),[]),Object(o.useEffect)((function(){switch(t.pathname){case"/templates":"gutenberg"===e.platform&&e.dispatch(Vi("/"));break;case"/blocks":"gutenberg"===e.platform?e.dispatch(Vi("/")):e.dispatch(Vi("/blocks"));break;case"/packs":"gutenberg"===e.platform?e.dispatch(Vi("/packs")):e.dispatch(Vi("/"))}}),[e.platform,t]),i.a.createElement("div",{className:"templately-modal-body templately-".concat(e.platform,"-platform ").concat(!Db&&!e.user.hasOwnProperty("status")&&e.isLoggedIn||"/settings"===t.pathname||"/sign-in"===t.pathname?"templately-admin-form":"")},null!=e.currentRoutes&&i.a.createElement(Y,{to:"".concat(e.currentRoutes)}),i.a.createElement(ie,null,i.a.createElement(ee,{exact:!0,path:"/sign-in",component:Qy}),i.a.createElement(ee,{exact:!0,path:"/pages",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/search/:query",component:Bg}),i.a.createElement(ee,{exact:!0,path:"/blocks",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/packs",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/",component:Mg}),i.a.createElement(ee,{exact:!0,path:"/templates",component:nm}),i.a.createElement(ee,{exact:!0,path:"/templates/save",component:function(){return i.a.createElement(dm,e)}}),i.a.createElement(ee,{exact:!0,path:"/clouds",component:Gv}),i.a.createElement(ee,{exact:!0,path:"/workspace",component:jv}),i.a.createElement(ee,{exact:!0,path:"/workspace/:slug",component:$v}),i.a.createElement(ee,{exact:!0,path:"/shared/workspace",component:Jv}),i.a.createElement(ee,{exact:!0,path:"/shared/workspace/:slug",component:$v}),i.a.createElement(ee,{exact:!0,path:"/settings",component:Ly}),i.a.createElement(ee,{exact:!0,path:"/profile",component:Cy}),i.a.createElement(ee,{exact:!0,path:"/:type/:slug",component:Tb})),!1===e.user.is_verified&&i.a.createElement("div",{className:"templately-verification"},i.a.createElement("p",null,Mb("Please complete your account by the verification email we sent you, If you don't get an email","templately")," ",i.a.createElement("a",{target:"_blank",href:"https://templately.dev/resend-verification-email?email=".concat(window.btoa(e.user.email),"&from=plugin")},Mb("click here","templately"))," ",Mb("to resend verification mail.","templately")),i.a.createElement("button",{onClick:function(){return a(!0)},className:"templately-button button-primary"},"I've verified & Close")))}));function Fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ub=TemplatelyAdmin,Bb=Ub.is_logged_in,Vb=Ub.platform_exists,Wb=Ub.user_can_logout,Hb=Ub.is_linked_login,$b=Ub.is_global_login,qb=Ub.prettyurl,Kb=Ub.current_url,Qb=function(e){var t=e.toggle,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fb(Object(n),!0).forEach((function(t){zb(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return delete n.toggle,Fo.dispatch(gi(Vb)),""!=qb?window.history.replaceState({},"","".concat(Kb,"#").concat(qb)):Fo.dispatch(Vi(e.route)),Fo.dispatch(xi(Boolean(Bb))),Fo.dispatch(di(Boolean(Wb))),Fo.dispatch(hi(Boolean(Hb))),Fo.dispatch(mi(Boolean($b))),t&&i.a.createElement(je,{store:Fo},i.a.createElement(fe,null,i.a.createElement("div",{className:"templately-modal-templately"},i.a.createElement(bf,null),i.a.createElement(Rb,n))))};function Gb(){return(Gb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yb=function(e){var t=e.toggle;return i.a.createElement("div",{id:"templatelyGutenberg"},i.a.createElement("div",{className:"templately-modal-templately-overlay",onClick:function(){return Eu.close()}}),i.a.createElement(Qb,Gb({toggle:t},e)))};function Xb(){return(Xb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Jb=TemplatelyAdmin.platform;if(window.Templately={modalOpen:function(e,t,n){c.a.render(i.a.createElement(Qb,Xb({toggle:e},t)),n)}},null!=document.getElementById("templatelyAdmin")&&c.a.render(i.a.createElement(Qb,{toggle:!0}),document.getElementById("templatelyAdmin")),"gutenberg"===Jb){var Zb=function(){Eu.open(i.a.createElement(Yb,{toggle:!0}))},ew=function(){Eu.open(i.a.createElement(Yb,{toggle:!0,route:"/templates/save",editor:"gutenberg"}))};wp.data.subscribe((function(){setTimeout((function(){var e,t,n,r;e=wp.data.select("core/editor").getCurrentPostType().toLowerCase().replace("/(?<= )[^s]|^./g",(function(e){return e.toUpperCase()})),t=document.querySelector("#editor"),n=document.querySelector(".edit-post-header-toolbar"),(r=document.createElement("div")).id="templately-guten-icon",r.innerHTML="<button class='gutenberg-add-templately-button' id='templatelyGutenbergButton'><span class='gutenberg-templately-icon'></span>Templately</button><button id='templatelyGutenbergPushButton' class='gutenberg-add-templately-button'>Save "+e+" in Templately</button>",null===t.querySelector("#templatelyGutenbergButton")&&(n.appendChild(r),document.getElementById("templatelyGutenbergButton").addEventListener("click",Zb),document.getElementById("templatelyGutenbergPushButton").addEventListener("click",ew))}),1)}))}},,,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(124)}]);
|
templately.php
CHANGED
@@ -4,14 +4,14 @@
|
|
4 |
* Description: The Best Templates Cloud for Elementor & Gutenberg. Get access to stunning templates, WorkSpace, Cloud Library & many more.
|
5 |
* Plugin URI: https://templately.com
|
6 |
* Author: Templately
|
7 |
-
* Version: 1.3.
|
8 |
* Author URI: https://templately.com/
|
9 |
* Text Domain: templately
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
define('TEMPLATELY_FILE', __FILE__);
|
14 |
-
define('TEMPLATELY_VERSION', '1.3.
|
15 |
define('TEMPLATELY_PATH', plugin_dir_path(TEMPLATELY_FILE));
|
16 |
define('TEMPLATELY_URL', plugin_dir_url(TEMPLATELY_FILE));
|
17 |
define('TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/');
|
4 |
* Description: The Best Templates Cloud for Elementor & Gutenberg. Get access to stunning templates, WorkSpace, Cloud Library & many more.
|
5 |
* Plugin URI: https://templately.com
|
6 |
* Author: Templately
|
7 |
+
* Version: 1.3.3
|
8 |
* Author URI: https://templately.com/
|
9 |
* Text Domain: templately
|
10 |
* Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
define('TEMPLATELY_FILE', __FILE__);
|
14 |
+
define('TEMPLATELY_VERSION', '1.3.3');
|
15 |
define('TEMPLATELY_PATH', plugin_dir_path(TEMPLATELY_FILE));
|
16 |
define('TEMPLATELY_URL', plugin_dir_url(TEMPLATELY_FILE));
|
17 |
define('TEMPLATELY_ASSETS', TEMPLATELY_URL . 'assets/');
|