Cloud Templates & Patterns collection - Version 1.1.14

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon 128x128 Cloud Templates & Patterns collection
Version 1.1.14
Comparing to
See all releases

Code changes from version 1.1.13 to 1.1.14

CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
2
 
3
  * Fix compatibility with WooCommerce specific pages on import
1
+ ##### [Version 1.1.14](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.13...v1.1.14) (2021-07-05)
2
+
3
+ - Allow Page Templates Support
4
+
5
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
6
 
7
  * Fix compatibility with WooCommerce specific pages on import
README.md CHANGED
@@ -2,7 +2,7 @@
2
  **Contributors:** [themeisle](https://profiles.wordpress.org/themeisle)
3
  **Tags:** neve, templates, patterns, blocks, starter, sites, demo, content, import
4
  **Requires at least:** 4.7
5
- **Tested up to:** 5.7
6
  **Requires PHP:** 5.6
7
  **Stable tag:** trunk
8
  **License:** GPLv3
@@ -39,6 +39,13 @@ Yes, you can. You can either chose to import one template or the entire starter
39
 
40
  ## Changelog ##
41
 
 
 
 
 
 
 
 
42
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
43
 
44
  * Fix compatibility with WooCommerce specific pages on import
2
  **Contributors:** [themeisle](https://profiles.wordpress.org/themeisle)
3
  **Tags:** neve, templates, patterns, blocks, starter, sites, demo, content, import
4
  **Requires at least:** 4.7
5
+ **Tested up to:** 5.8
6
  **Requires PHP:** 5.6
7
  **Stable tag:** trunk
8
  **License:** GPLv3
39
 
40
  ## Changelog ##
41
 
42
+ ##### [Version 1.1.14](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.13...v1.1.14) (2021-07-05)
43
+
44
+ - Allow Page Templates Support
45
+
46
+
47
+
48
+
49
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
50
 
51
  * Fix compatibility with WooCommerce specific pages on import
editor/build/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '6dee5b8d2c58119d8483ef50207dfa20');
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'e0e46189f874af1ba2715737a636a00d');
editor/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=29)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t){function r(e,t,r,n,c,a,i){try{var o=e[a](i),s=o.value}catch(e){return void r(e)}o.done?t(s):Promise.resolve(s).then(n,c)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(c,a){var i=e.apply(t,n);function o(e){r(i,c,a,o,s,"next",e)}function s(e){r(i,c,a,o,s,"throw",e)}o(void 0)}))}}},function(e,t,r){var n=r(21),c=r(22),a=r(23),i=r(25);e.exports=function(e,t){return n(e)||c(e,t)||a(e,t)||i()}},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=c.apply(null,n);i&&e.push(i)}else if("object"===a)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){"use strict";const n=r(26),c=r(27),a=r(28);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function s(e,t){return t.decode?c(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const c="string"==typeof r&&r.includes(e.arrayFormatSeparator),a="string"==typeof r&&!c&&s(r,e).includes(e.arrayFormatSeparator);r=a?s(r,e):r;const i=c||a?r.split(e.arrayFormatSeparator).map(t=>s(t,e)):null===r?r:s(r,e);n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const c of e.split("&")){let[e,i]=a(t.decode?c.replace(/\+/g," "):c,"=");i=void 0===i?null:["comma","separator"].includes(t.arrayFormat)?i:s(i,t),r(s(e,t),i,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=u,t.parse=b,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const c=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[",c,"]"].join("")]:[...r,[o(t,e),"[",o(c,e),"]=",o(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[]"].join("")]:[...r,[o(t,e),"[]=",o(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[o(t,e),"=",o(n,e)].join("")]:[[r,o(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,o(t,e)]:[...r,[o(t,e),"=",o(n,e)].join("")]}}(t),c={};for(const t of Object.keys(e))r(t)||(c[t]=e[t]);const a=Object.keys(c);return!1!==t.sort&&a.sort(t.sort),a.map(r=>{const c=e[r];return void 0===c?"":null===c?o(r,t):Array.isArray(c)?c.reduce(n(r),[]).join("&"):o(r,t)+"="+o(c,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=a(e,"#");return Object.assign({url:r.split("?")[0]||"",query:b(u(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:s(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(e.url).split("?")[0]||"",c=t.extract(e.url),a=t.parse(c,{sort:!1}),i=Object.assign(a,e.query);let s=t.stringify(i,r);s&&(s="?"+s);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+o(e.fragmentIdentifier,r)),`${n}${s}${u}`}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.editPost},,,function(e,t){e.exports=window.wp.plugins},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.keycodes},function(e,t,r){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,c=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){c=!0,a=e}finally{try{n||null==o.return||o.return()}finally{if(c)throw a}}return r}}},function(e,t,r){var n=r(24);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=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(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),c=new RegExp("(%[a-f0-9]{2})+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function i(e){try{return decodeURIComponent(e)}catch(c){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=a(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=c.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=i(r[0]);n!==r[0]&&(t[r[0]]=n)}r=c.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var s=a[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";r.r(t);var n=r(1),c=r(17),a=r(12),i=(r(20),r(10)),o=r.n(i),s=r(4);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p={isFetching:!0,isPreview:!1,tab:3===parseInt(window.tiTpc.tier)?"library":"templates",templates:[],patterns:[],library:{items:[],currentPage:0,totalPages:0},preview:{type:"templates",item:{}}};Object(s.registerStore)("tpc/block-editor",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;return"SET_FETCHING"===t.type?u(u({},e),{},{isFetching:t.isFetching}):"TOGGLE_PREVIEW"===t.type?u(u({},e),{},{isPreview:!e.isPreview}):"UPDATE_CURRENT_TAB"===t.type?u(u({},e),{},{tab:t.tab,isPreview:!1}):"UPDATE_TEMPLATES"===t.type?u(u({},e),{},{templates:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"UPDATE_PATTERNS"===t.type?u(u({},e),{},{patterns:t.items}):"UPDATE_LIBRARY"===t.type?u(u({},e),{},{library:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"SET_PREVIEW_DATA"===t.type?u(u({},e),{},{preview:t.preview}):e},selectors:{isFetching:function(e){return e.isFetching},isPreview:function(e){return e.isPreview},getCurrentTab:function(e){return e.tab},getTemplates:function(e){return e.templates},getPatterns:function(e){return e.patterns},getLibrary:function(e){return e.library},getPreview:function(e){return e.preview}},actions:{setFetching:function(e){return{type:"SET_FETCHING",isFetching:e}},togglePreview:function(e){return{type:"TOGGLE_PREVIEW",isPreview:e}},updateCurrentTab:function(e){return{type:"UPDATE_CURRENT_TAB",tab:e}},updateTemplates:function(e,t,r){return{type:"UPDATE_TEMPLATES",items:e,currentPage:t,totalPages:r}},updatePatterns:function(e){return{type:"UPDATE_PATTERNS",items:e}},updateLibrary:function(e,t,r){return{type:"UPDATE_LIBRARY",items:e,currentPage:t,totalPages:r}},setPreviewData:function(e){return{type:"SET_PREVIEW_DATA",preview:e}}}});var b,m=r(0),f=r(8),d=r.n(f),O=wp.primitives,g=O.Path,j=O.SVG,y=function(e){var t=e.className;return Object(m.createElement)(j,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d()(["tpc-icon",t])},Object(m.createElement)(g,{d:"M22.8063 24H1.19365C0.534714 24 0 23.4653 0 22.8063V1.19365C0 0.534714 0.534714 0 1.19365 0H22.8063C23.4653 0 24 0.534714 24 1.19365V22.8063C24 23.4653 23.4653 24 22.8063 24Z",fill:"#14171C"}),Object(m.createElement)(g,{d:"M19.8466 20.8187V7.39687V4.43164H16.884H3.45947L6.422 7.39687H16.884V17.8562L19.8466 20.8187Z",fill:"white"}),Object(m.createElement)(g,{d:"M10.138 14.1429L10.1407 17.0838L12.7764 19.7195L12.7656 11.5152L4.55859 11.5044L7.19435 14.1375L10.138 14.1429Z",fill:"white"}))},h=function(){return Object(m.createElement)(j,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tpc-template-cloud-icon"},Object(m.createElement)(g,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(m.createElement)(g,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(m.createElement)(g,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},v=r(3),w=r.n(v),_=r(6),E=r.n(_),k=r(7),P=r.n(k),x=r(11),S=r.n(x),T=r(2),C=r(14),N=r(9),B=new Uint8Array(16);function D(){if(!b&&!(b="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return b(B)}for(var I=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,A=function(e){return"string"==typeof e&&I.test(e)},F=[],L=0;L<256;++L)F.push((L+256).toString(16).substr(1));var V=function(e,t,r){var n=(e=e||{}).random||(e.rng||D)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var c=0;c<16;++c)t[r+c]=n[c];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase();if(!A(r))throw TypeError("Stringified UUID is invalid");return r}(n)};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=lodash.omit,z=Object(s.dispatch)("tpc/block-editor"),H=z.updateLibrary,G=z.updateTemplates,Q=Object(s.dispatch)("core/notices").createNotice,q=function(e){Q("warning",e,{context:"themeisle-blocks/notices/templates-cloud",isDismissible:!0})},$=function(){var e=E()(w.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),{},{per_page:12,page:0,premade:!0,template_site_slug:"general"},t),n=Object(N.stringifyUrl)({url:tiTpc.endpoint+"page-templates",query:r}),e.prev=3,e.next=6,S()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",q(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,G(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&q(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=E()(w.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=M({per_page:12,page:0},t),n=Object(N.stringifyUrl)({url:tiTpc.endpoint+"templates",query:M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),r)}),e.prev=3,e.next=6,S()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",q(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,H(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&q(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t.template_id),query:M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)},t)}),e.prev=1,e.next=4,S()({url:r,method:"POST",parse:!1});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",q(c.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,$();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&q(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta"))}),e.prev=1,e.next=4,S()({url:r,method:"GET",parse:!1});case 4:if(!(n=e.sent).ok){e.next=12;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",c);case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/import"),query:M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta"))}),n={},e.prev=2,e.next=5,S()({url:r,method:"GET",parse:!1});case 5:if(!(c=e.sent).ok){e.next=12;break}return e.next=9,c.json();case 9:if(!(n=e.sent).message){e.next=12;break}return e.abrupt("return",q(n.message));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0.message&&q(e.t0.message);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=E()(w.a.mark((function e(t,r){var n,c,a;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t),query:M({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},R(tiTpc.params,"meta"))}),e.prev=1,e.next=4,S()({url:n,method:"POST"});case 4:if(!(c=e.sent).ok){e.next=11;break}return e.next=8,c.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",q(a.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,W(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&q(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t,r){return e.apply(this,arguments)}}(),X=function(){var e=E()(w.a.mark((function e(t,r,n,c,a){var i,o,s;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/publish"),query:M(M({cache:localStorage.getItem("tpcCacheBuster"),method:"POST",template_site_slug:r,template_thumbnail:n,premade:c?"yes":"no",link:a},R(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)})}),e.prev=1,e.next=4,S()({url:i,method:"POST",headers:{Authorization:"Bearer ".concat(tiTpc.bearer||""," ")}});case 4:if(!(o=e.sent).ok){e.next=14;break}return e.next=8,o.json();case 8:if(!(s=e.sent).message){e.next=12;break}return q(s.message),e.abrupt("return",{success:!1});case 12:e.next=17;break;case 14:if(!o.message){e.next=17;break}return q(o.message),e.abrupt("return",{success:!1});case 17:return localStorage.setItem("tpcCacheBuster",V()),e.abrupt("return",{success:!0});case 21:if(e.prev=21,e.t0=e.catch(1),!e.t0.message){e.next=26;break}return q(e.t0.message),e.abrupt("return",{success:!1});case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t,r,n,c,a){return e.apply(this,arguments)}}(),ee=function(){var e=Object(s.useSelect)((function(e){return e("core/notices").getNotices("themeisle-blocks/notices/templates-cloud")})),t=Object(s.useDispatch)("core/notices").removeNotice;return Object(m.createElement)("div",{className:"notices"},e.map((function(e){return Object(m.createElement)(T.Notice,{key:e.id,status:e.status,isDismissible:e.isDismissible,onRemove:function(){return t(e.id,"themeisle-blocks/notices/templates-cloud")},actions:e.actions},e.content)})))};function te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?te(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ne=lodash.omit,ce=r(13),ae=r(5),ie=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{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"})),oe=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(m.createElement)(ae.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"})),se=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"}));function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe=function(e){var t=e.closeModal,r=e.getOrder,c=e.getSearchQuery,a=Object(s.useDispatch)("tpc/block-editor"),i=a.setFetching,o=a.updateCurrentTab,l={templates:Object(n.__)("Page Templates")};3===parseInt(tiTpc.tier)&&(l.library=Object(n.__)("My Library"));var u=Object(s.useSelect)((function(e){return e("tpc/block-editor").isFetching()})),p=Object(s.useSelect)((function(e){return e("tpc/block-editor").isPreview()})),b=Object(s.useSelect)((function(e){return e("tpc/block-editor").getCurrentTab()})),f=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.localStorage.setItem("tpcCacheBuster",V()),i(!0),t=r(),e.next=5,$(ue({search:c()},t));case 5:return e.next=7,W(ue({search:c()},t));case 7:i(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)("div",{className:"modal-header"},Object(m.createElement)("div",{className:"left"},Object(m.createElement)(T.Icon,{icon:h})),Object(m.createElement)("div",{className:"center"},Object.keys(l).map((function(e){return Object(m.createElement)(T.Button,{key:e,onClick:function(){return o(e)},className:d()("tabs",{"is-active":e===b})},l[e])}))),Object(m.createElement)("div",{className:"right"},"library"===b&&!p&&Object(m.createElement)(T.ButtonGroup,null,Object(m.createElement)(T.Button,{label:Object(n.__)("Re-sync Library"),icon:oe,disabled:u,className:d()("is-sync",{"is-loading":u}),onClick:f})),Object(m.createElement)(T.Button,{label:Object(n.__)("Close Modal"),icon:se,onClick:t})))},be=r(18),me=function(e){var t=e.isFetching,r=e.importBlocks,c=Object(ce.useViewportMatch)("large",">="),i=Object(ce.useViewportMatch)("large","<="),o=Object(ce.useViewportMatch)("small",">="),l=Object(ce.useViewportMatch)("small","<="),u=1400;c||i||!o||l?!(c||i||o||l)&&(u=600):u=960;var p=Object(s.useDispatch)("tpc/block-editor"),b=p.setFetching,f=p.togglePreview,d=Object(s.useSelect)((function(e){return e("tpc/block-editor").getPreview()})).item;Object(m.useEffect)((function(){h()}),[]);var O=Object(m.useState)(""),g=P()(O,2),j=g[0],y=g[1],h=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.next=3,v();case 3:b(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.next=3,K(d.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&y(t.content),b(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)("div",{className:"tpc-modal-content"},Object(m.createElement)("div",{className:"preview-header"},Object(m.createElement)("div",{className:"left"},d.template_name||Object(n.__)("Template")),Object(m.createElement)("div",{className:"right"},Object(m.createElement)(T.Button,{isSecondary:!0,onClick:f},Object(n.__)("Close Preview")),Object(m.createElement)(T.Button,{isPrimary:!0,isBusy:t,disabled:t,onClick:function(){f(),r(j,d.meta||[])}},Object(n.__)("Import")))),t?Object(m.createElement)(T.Placeholder,null,Object(m.createElement)(T.Spinner,null)):Object(m.createElement)("div",{className:"preview-content"},Object(m.createElement)(be.BlockPreview,{blocks:Object(a.parse)(j),viewportWidth:u})))},fe=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),de=Object(m.createElement)(ae.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"})),Oe=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),ge=r(19);function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he={date:Object(n.__)("Date"),template_name:Object(n.__)("Name"),modified:Object(n.__)("Last Modified")},ve=function(e){var t=e.layout,r=e.sortingOrder,c=e.setLayout,a=e.isSearch,i=e.searchQuery,o=e.onSearch,s=e.setSearchQuery,l=e.setSortingOrder,u=e.changeOrder;return Object(m.createElement)("div",{className:"filters"},Object(m.createElement)("div",{className:"display-sorting"},Object(m.createElement)("div",{className:"sorting-label"},Object(n.__)("Sort by")),Object(m.createElement)("div",{className:"sorting-filter"},Object.keys(he).map((function(e){return Object(m.createElement)(T.Button,{key:e,className:d()({"is-selected":e===r.orderby,"is-asc":"ASC"===r.order}),onClick:function(){var t={order:"DESC",orderby:e};e===r.orderby&&"DESC"===r.order&&(t.order="ASC"),l(ye({},t)),u(ye({},t))}},he[e])})))),Object(m.createElement)("div",{className:"view-filters"},Object(m.createElement)("div",{className:"search-filters"},Object(m.createElement)("input",{placeholder:Object(n.__)("Search for a template…"),className:"filter-search",value:i,onChange:function(e){return s(e.target.value)},onKeyDown:function(e){e.keyCode===ge.ENTER&&o()}}),a?Object(m.createElement)(T.Button,{label:Object(n.__)("Clear search query"),icon:se,onClick:function(){s(""),o("")}}):Object(m.createElement)(T.Button,{label:Object(n.__)("Search"),icon:fe,onClick:function(){return o()}})),Object(m.createElement)(T.Button,{label:Object(n.__)("List View"),icon:de,onClick:function(){return c("list")},isPressed:"list"===t}),Object(m.createElement)(T.Button,{label:Object(n.__)("Grid View"),icon:Oe,onClick:function(){return c("grid")},isPressed:"grid"===t})))},we=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),_e=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),Ee=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(m.createElement)(ae.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"})),ke=Object(m.createElement)(ae.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ae.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Pe=function(e){var t=e.sortingOrder,r=e.layout,c=e.item,a=e.importBlocks,i=e.deletable,o=Object(s.useDispatch)("tpc/block-editor"),l=o.togglePreview,u=o.setPreviewData,p=Object(m.useState)(!1),b=P()(p,2),f=b[0],O=b[1],g=Object(m.useState)(!1),j=P()(g,2),y=j[0],h=j[1],v=Object(m.useState)(c.template_name),_=P()(v,2),k=_[0],x=_[1],S=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O("importing"),e.next=3,K(c.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&a(t.content,c.meta||[]),O(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O("updating"),e.next=3,Z({template_id:c.template_id,template_name:k||c.template_name},t);case 3:return e.next=5,W(t);case 5:O(!1),h(!y);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm(Object(n.__)("Are you sure you want to delete this template?"))){e.next=2;break}return e.abrupt("return",!1);case 2:return O("deleting"),e.next=5,Y(c.template_id,t);case 5:O(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l(),u({type:"library",item:c});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();if("grid"===r){var D={backgroundImage:"url(".concat(c.template_thumbnail,")")};return Object(m.createElement)("div",{key:c.template_id,className:"table-grid"},Object(m.createElement)("div",{style:D,className:d()("grid-preview",{"is-loading":y||!1!==f})},Object(m.createElement)("div",{className:"preview-actions"},Object(m.createElement)(T.Button,{isSecondary:!0,disabled:!1!==f,onClick:B},Object(n.__)("Preview")),Object(m.createElement)(T.Button,{isPrimary:!0,isBusy:"importing"===f,disabled:!1!==f,onClick:S},Object(n.__)("Import")),i&&Object(m.createElement)("div",{className:"preview-controls"},!c.link&&Object(m.createElement)(T.Button,{label:Object(n.__)("Edit"),icon:"updating"===f?oe:we,disabled:y||!1!==f,className:d()({"is-loading":"updating"===f}),onClick:function(){return h(!y)}},y&&Object(m.createElement)(T.Popover,{onFocusOutside:function(){return h(!y)},className:"controls-popover"},Object(m.createElement)("div",{className:"popover-content"},Object(m.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),value:k,onChange:x}),Object(m.createElement)(T.Button,{label:Object(n.__)("Update"),icon:"updating"===f?oe:_e,disabled:!1!==f,className:d()({"is-loading":"updating"===f}),onClick:C})))),Object(m.createElement)(T.Button,{label:Object(n.__)("Delete"),icon:"deleting"===f?oe:Ee,disabled:!1!==f,className:d()({"is-loading":"deleting"===f}),onClick:N})))),Object(m.createElement)("div",{className:"card-footer"},Object(m.createElement)("p",null,c.template_name)))}var I=d()("actions",{"no-controls":!i});return Object(m.createElement)("div",{key:c.template_id,className:"table-row"},Object(m.createElement)("div",{className:"row-title"},Object(m.createElement)(T.Icon,{icon:ke}),y?Object(m.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),hideLabelFromVision:!0,value:k,onChange:x}):c.template_name),i&&Object(m.createElement)("div",{className:"row-controls"},c.link?Object(m.createElement)(T.Tooltip,{text:Object(n.__)("This template is synced to a page.")},Object(m.createElement)(T.Button,{label:Object(n.__)("Edit"),icon:we,disabled:!0},Object(n.__)("Edit"))):Object(m.createElement)(T.Button,{label:y?Object(n.__)("Update"):Object(n.__)("Edit"),icon:y?"updating"===f?oe:_e:we,disabled:!1!==f,className:d()({"is-loading":"updating"===f}),onClick:y?C:function(){return h(!y)}},y?Object(n.__)("Update"):Object(n.__)("Edit")),Object(m.createElement)(T.Button,{label:Object(n.__)("Delete"),icon:"deleting"===f?oe:Ee,disabled:!1!==f,className:d()({"is-loading":"deleting"===f}),onClick:N},"deleting"===f?Object(n.__)("Deleting")+"...":Object(n.__)("Delete"))),Object(m.createElement)("div",{className:I},Object(m.createElement)(T.Button,{isSecondary:!0,disabled:!1!==f,onClick:B},Object(n.__)("Preview")),Object(m.createElement)(T.Button,{isPrimary:!0,isBusy:"importing"===f,disabled:!1!==f,onClick:S},Object(n.__)("Import"))))},xe=function(e){var t=e.total,r=e.current,n=e.onChange;if(t<2)return null;for(var c=[],a=function(e){var t=e===r;c.push(Object(m.createElement)(T.Button,{key:"page-".concat(e),isPrimary:t,disabled:t,onClick:function(){return n(e)}},e+1))},i=0;i<t;i++)a(i);return Object(m.createElement)(T.ButtonGroup,{className:"pagination"},c)};function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ce=Object(s.withSelect)((function(e,t){var r=t.isGeneral?e("tpc/block-editor").getTemplates():e("tpc/block-editor").getLibrary(),n=r.items;return{items:void 0===n?[]:n,currentPage:r.currentPage,totalPages:r.totalPages}}))((function(e){var t=e.importBlocks,r=e.isGeneral,c=void 0!==r&&r,a=e.isFetching,i=e.items,o=e.currentPage,l=e.totalPages,u=e.getOrder,p=e.setQuery,b=e.getSearchQuery,f=e.setSorting,O=Object(s.useDispatch)("tpc/block-editor").setFetching,g=Object(m.useState)("grid"),j=P()(g,2),y=j[0],h=j[1],v=Object(m.useState)({templates:!1,library:!1}),_=P()(v,2),k=_[0],x=_[1],S=function(e){return x(Te(Te({},k),{},c?{templates:e}:{library:e}))},C=function(){return c?k.templates:k.library},N=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(!0),t=u(),!c){e.next=7;break}return e.next=5,$(Te({search:b()},t));case 5:e.next=9;break;case 7:return e.next=9,W(Te({search:b()},t));case 9:O(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(m.useEffect)((function(){i&&i.length>0||N()}),[c]);var B=function(){var e=E()(w.a.mark((function e(t){var r;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(!0),r=u(),!c){e.next=7;break}return e.next=5,$(Te({search:b(),page:t},r));case 5:e.next=9;break;case 7:return e.next=9,W(Te({search:b(),page:t},r));case 9:O(!1);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=E()(w.a.mark((function e(){var t,r,n=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:b(),O(!0),S(!!t),r=u(),!c){e.next=9;break}return e.next=7,$(Te({search:t},r));case 7:e.next=11;break;case 9:return e.next=11,W(Te({search:t},r));case 11:O(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=E()(w.a.mark((function e(t){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(!0),!c){e.next=6;break}return e.next=4,$(Te(Te({},t),{},{search:b()}));case 4:e.next=8;break;case 6:return e.next=8,W(Te(Te({},t),{},{search:b()}));case 8:O(!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();if(a)return Object(m.createElement)(m.Fragment,null,Object(m.createElement)(ve,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:b(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(m.createElement)(T.Placeholder,null,Object(m.createElement)(T.Spinner,null)));if(!Boolean(i.length))return Object(m.createElement)("div",{className:"table-content"},Object(m.createElement)(ve,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:b(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(n.__)("No templates available. Add a new one?"));var A=d()("table-content",{"is-grid":"grid"===y});return Object(m.createElement)(m.Fragment,null,Object(m.createElement)(ve,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:b(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(m.createElement)("div",{className:A},i.map((function(e){return Object(m.createElement)(Pe,{sortingOrder:u(),deletable:!c,key:e.template_id,layout:y,item:e,importBlocks:t})}))),Object(m.createElement)(xe,{onChange:B,current:o,total:l}))})),Ne=Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.isFetching,c=t.getCurrentTab;return{isPreview:r(),isFetching:n(),currentTab:c()}}))((function(e){var t=e.importBlocks,r=e.getOrder,c=e.setQuery,a=e.getSearchQuery,i=e.setSorting,o=e.isPreview,s=e.currentTab,l=e.isFetching;return o&&"library"===s?Object(m.createElement)(me,{isFetching:l,importBlocks:t}):Object(m.createElement)("div",{className:"tpc-modal-content"},Object(m.createElement)(ee,null),["templates","library"].includes(s)&&Object(m.createElement)(Ce,{isFetching:l,isGeneral:"templates"===s,importBlocks:t,getOrder:r,setQuery:c,getSearchQuery:a,setSorting:i}),"patterns"===s&&Object(n.__)("We are still working on this. Please check back later. Thank you!"))})),Be=function(e){var t=e.title,r=e.leftButtons,c=e.rightButtons,a=e.heading,i=e.previewUrl,o=Object(N.stringifyUrl)({url:i,query:{tpcpreview:"yes"}}),s=t||Object(n.__)("Preview");return Object(m.createElement)("div",{className:"ob-preview single-templates"},Object(m.createElement)("div",{className:"preview"},Object(m.createElement)("iframe",{title:s,src:o,frameBorder:"0"}),Object(m.createElement)("div",{className:"loading"},Object(m.createElement)(T.Dashicon,{icon:"update",size:50}))),Object(m.createElement)("div",{className:"bottom-bar"},r&&Object(m.createElement)("div",{className:"navigator"},r),a&&Object(m.createElement)("h2",{className:"heading"},a),c&&Object(m.createElement)("div",{className:"actions"},c)))};function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ae=Object(ce.compose)(Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.getPreview,c=t.getCurrentTab;return{isPreview:r(),currentTab:c(),previewData:n().item}})),Object(s.withDispatch)((function(e){var t=e("core/block-editor"),r=t.removeBlock,n=t.replaceBlocks,c=e("tpc/block-editor").togglePreview;return{removeBlock:r,replaceBlocks:n,closePreview:function(){return c(!1)}}})))((function(e){var t=e.clientId,r=e.isPreview,c=e.previewData,i=e.currentTab,o=e.removeBlock,l=e.replaceBlocks,u=e.closePreview,p=Object(s.useSelect)((function(e){return{type:e("core/editor").getEditedPostAttribute("type")}})).type,b=Object(s.useDispatch)("core/notices").createErrorNotice,f=Object(s.useDispatch)("core/editor").editPost,d=Object(s.useDispatch)("tpc/block-editor"),O=d.updateLibrary,g=d.updateTemplates,j=Object(m.useState)(!1),y=P()(j,2),h=y[0],v=y[1],_=Object(m.useState)(!1),k=P()(_,2),x=k[0],S=k[1],C=Object(m.useState)({templates:"",library:""}),N=P()(C,2),B=N[0],D=N[1],I=Object(m.useState)({templates:{order:"DESC",orderby:"date"},library:{order:"DESC",orderby:"date"}}),A=P()(I,2),F=A[0],L=A[1],V="templates"===i,U=function(){return V?B.templates:B.library},M=function(){return V?F.templates:F.library},R=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];O([]),g([]),0<r.length&&["post","page"].includes(p)&&f({meta:Ie({},JSON.parse(r))}),l(t,Object(a.parse)(e))},z=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,K(c.template_id).then((function(e){if(e.__file&&e.content&&"wp_export"===e.__file)return u(),S(!1),R(e.content,c.meta||[]),!1;b(Object(n.__)("Something went wrong while importing. Please try again."),{type:"snackbar"}),S(!1),o(t)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){v(!1),S(!1),o(t)};return Object(m.useEffect)((function(){setTimeout((function(){v(!0)}),100)}),[]),h?Object(m.createElement)(m.Fragment,null,Object(m.createElement)(T.Modal,{onRequestClose:H,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!r||"templates"!==i,isDismissible:!1,overlayClassName:"tpc-template-cloud-modal"},Object(m.createElement)(pe,{closeModal:H,getOrder:M,getSearchQuery:U}),Object(m.createElement)(Ne,{importBlocks:R,getOrder:M,setQuery:function(e){return D(Ie(Ie({},B),{},V?{templates:e}:{library:e}))},getSearchQuery:U,setSorting:function(e){return L(Ie(Ie({},F),{},V?{templates:e}:{library:e}))}}),Object(m.createElement)((function(){if(!r||"templates"!==i)return null;var e=c.link,t=c.template_name;return Object(m.createElement)(T.Modal,{isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,className:"tpc-preview-wrap-modal"},Object(m.createElement)(Be,{previewUrl:e,heading:t,leftButtons:Object(m.createElement)(m.Fragment,null,Object(m.createElement)(T.Button,{disabled:x,icon:ie,onClick:u})),rightButtons:Object(m.createElement)(T.Button,{disabled:x,isPrimary:!0,onClick:z},x?Object(n.__)("Importing")+"...":Object(n.__)("Import"))}),";")}),null))):null}));Object(a.registerBlockType)("ti-tpc/templates-cloud",{title:Object(n.__)("Templates Cloud"),description:Object(n.__)("A cloud based templates library which enables you to create ready-made website in no time."),icon:y,category:"design",keywords:["templates cloud","patterns","template library"],supports:{html:!1},edit:Ae,save:function(){return null}}),3===parseInt(tiTpc.tier)&&Object(c.registerPlugin)("ti-tpc",{render:function(){var e=Object(m.useState)(!1),t=P()(e,2),r=t[0],c=t[1],i=Object(m.useState)(!1),o=P()(i,2),l=o[0],u=o[1],p=Object(m.useState)(""),b=P()(p,2),f=b[0],O=b[1],g=window.tiTpc.canPredefine,j=Object(s.useDispatch)("core/notices"),h=j.createErrorNotice,v=j.createSuccessNotice,_=Object(s.useDispatch)("core/editor").editPost,k=Object(s.useSelect)((function(e){var t=e("core/block-editor"),r=t.getSelectedBlockCount,n=t.getSelectedBlock,c=t.getMultiSelectedBlocks,i=1===r()?n():c();return Object(a.serialize)(i)}),[]),x=Object(s.useSelect)((function(e){var t=(0,e("core/block-editor").getBlocks)();return Object(a.serialize)(t)}),[]),B=Object(s.useSelect)((function(e){return(0,e("core/editor").getEditedPostAttribute)("meta")}),[]);Object(m.useEffect)((function(){var e=window.tiTpc.metaKeys;window.tiTpc.params.meta=Object.fromEntries(Object.entries(B||{}).filter((function(t){var r=P()(t,2),n=r[0];return r[1],e.includes(n)})))}),[B]);var D=Object(s.useSelect)((function(e){return{meta:e("core/editor").getEditedPostAttribute("meta")||{},postId:e("core/editor").getEditedPostAttribute("id"),type:e("core/editor").getEditedPostAttribute("type"),link:e("core/editor").getEditedPostAttribute("link"),postTitle:e("core/editor").getEditedPostAttribute("title")||Object(n.__)("Template")}})),I=D.meta,A=D.postTitle,F=D.postId,L=D.type,U=D.link,M=D.meta,R=M._ti_tpc_template_sync,z=M._ti_tpc_template_id,H=M._ti_tpc_screenshot_url,G=M._ti_tpc_site_slug,Q=M._ti_tpc_published,q=Object(s.useSelect)((function(e,t){var r=t.forceIsSaving,n=e("core/editor"),c=n.isSavingPost,a=n.isPublishingPost,i=n.isAutosavingPost,o=r||c(),s=i();return(a()||o)&&!s})),$=Object(m.useState)(R),W=P()($,2),Z=W[0],K=W[1],Y=Object(m.useState)(z),te=P()(Y,2),ce=te[0],ae=te[1],ie=Object(m.useState)(G),oe=P()(ie,2),se=oe[0],le=oe[1],ue=Object(m.useState)(Q),pe=P()(ue,2),be=pe[0],me=pe[1],fe=Object(m.useState)(H),de=P()(fe,2),Oe=de[0],ge=de[1];Object(m.useEffect)((function(){_({meta:re(re({},I),{},{_ti_tpc_template_sync:Z,_ti_tpc_template_id:ce,_ti_tpc_screenshot_url:Oe,_ti_tpc_site_slug:se,_ti_tpc_published:be})})}),[Z,ce,Oe,se,be]),Object(m.useEffect)((function(){q&&Z&&ye()}),[q,Z]);var je=function(){var e=E()(w.a.mark((function e(){var t,r,a,i;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),t={__file:"wp_export",version:2,content:k},r=Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:re(re({},ne(tiTpc.params,"meta")),{},{template_name:f,template_type:"gutenberg"})}),e.prev=3,e.next=6,S()({url:r,method:"POST",data:t,parse:!1});case 6:if(!(a=e.sent).ok){e.next=12;break}return e.next=10,a.json();case 10:(i=e.sent).message?h(i.message,{type:"snackbar"}):(window.localStorage.setItem("tpcCacheBuster",V()),v(Object(n.__)("Template saved."),{type:"snackbar"}));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 17:u(!1),c(!1),O("");case 20:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=E()(w.a.mark((function e(){var t,r,c,a,i;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),t={__file:"wp_export",version:2,content:x},c=!1,!ce){e.next=7;break}return e.next=6,J(ce);case 6:c=e.sent;case 7:if(!1===c||"gutenberg"===c.template_type){e.next=9;break}return e.abrupt("return");case 9:return r=c?Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates/"+ce,query:re(re({},ne(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta),template_name:A,link:U})}):Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:re(re({},ne(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta),template_name:A,template_type:"gutenberg",template_site_slug:G||"",template_thumbnail:H||"",link:U})}),e.prev=10,e.next=13,S()({url:r,method:"POST",data:t,parse:!1});case 13:if(!(a=e.sent).ok){e.next=19;break}return e.next=17,a.json();case 17:(i=e.sent).message?h(i.message,{type:"snackbar"}):(window.localStorage.setItem("tpcCacheBuster",V()),v(Object(n.__)("Template saved."),{type:"snackbar"}),i.template_id?(ae(i.template_id),he(i.template_id)):he());case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(10),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 24:u(!1);case 25:case"end":return e.stop()}}),e,null,[[10,21]])})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ce,t=null;return"post"===L?t=new wp.api.models.Post({id:F}):"page"===L&&(t=new wp.api.models.Page({id:F})),t.set("meta",{_ti_tpc_template_id:e,_ti_tpc_template_sync:Z,_ti_tpc_screenshot_url:Oe,_ti_tpc_site_slug:se,_ti_tpc_published:!be}),t.save()};return["post","page"].includes(L)?Object(m.createElement)(m.Fragment,null,Object(m.createElement)(C.PluginBlockSettingsMenuItem,{label:Object(n.__)("Save to Neve Cloud"),icon:"none",onClick:function(){return c(!0)}}),Object(m.createElement)(C.PluginSidebarMoreMenuItem,{icon:Object(m.createElement)(T.Icon,{icon:y}),target:"ti-tpc"},Object(n.__)("Templates Cloud")),Object(m.createElement)(C.PluginSidebar,{name:"ti-tpc",title:Object(n.__)("Templates Cloud"),className:"ti-tpc-components-panel"},Object(m.createElement)(T.PanelBody,null,Object(n.__)("Save this page as a template in your Templates Cloud library."),Object(m.createElement)(T.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:ye},Object(n.__)("Save Page to Neve Cloud")),Object(m.createElement)(T.ToggleControl,{label:Object(n.__)("Automatically sync to the cloud"),checked:Z,onChange:function(){return K(!Z)}})),g&&Object(m.createElement)(T.PanelBody,null,Object(m.createElement)("h4",null,Object(n.__)("Publish Settings")),Object(m.createElement)(T.TextControl,{label:Object(n.__)("Screenshot URL"),value:Oe,type:"url",onChange:ge}),Object(m.createElement)(T.TextControl,{label:Object(n.__)("Site Slug"),value:se,help:Object(n.__)("Use `general` to publish this as a global template. Otherwise use the starter site slug to make it available as a single page for the starter site."),type:"url",onChange:le}),Object(m.createElement)((function(){if(!g)return null;var e=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u("publishing"),e.next=3,X(z,G,H,!Q,U).then((function(e){e.success&&(me(!be),he(),v(be?Object(n.__)("Template Unpublished."):Object(n.__)("Template Published."),{type:"snackbar"}))}));case 3:u(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)(T.Button,{isSecondary:!0,onClick:e,disabled:!1!==l,className:d()({"is-loading":"publishing"===l})},be&&("publishing"===l?Object(n.__)("Unpublishing"):Object(n.__)("Unpublish")),!be&&("publishing"===l?Object(n.__)("Publishing"):Object(n.__)("Publish")))}),null),Object(m.createElement)(ee,null))),r&&Object(m.createElement)(T.Modal,{title:Object(n.__)("Save Template"),onRequestClose:function(){return c(!1)}},Object(m.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),value:f,onChange:O}),Object(m.createElement)(T.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:je},Object(n.__)("Save")))):null},icon:y})}]);
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=30)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t){function r(e,t,r,n,c,a,i){try{var o=e[a](i),s=o.value}catch(e){return void r(e)}o.done?t(s):Promise.resolve(s).then(n,c)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(c,a){var i=e.apply(t,n);function o(e){r(i,c,a,o,s,"next",e)}function s(e){r(i,c,a,o,s,"throw",e)}o(void 0)}))}}},function(e,t,r){var n=r(22),c=r(23),a=r(24),i=r(26);e.exports=function(e,t){return n(e)||c(e,t)||a(e,t)||i()}},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=c.apply(null,n);i&&e.push(i)}else if("object"===a)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){"use strict";const n=r(27),c=r(28),a=r(29);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function s(e,t){return t.decode?c(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const c="string"==typeof r&&r.includes(e.arrayFormatSeparator),a="string"==typeof r&&!c&&s(r,e).includes(e.arrayFormatSeparator);r=a?s(r,e):r;const i=c||a?r.split(e.arrayFormatSeparator).map(t=>s(t,e)):null===r?r:s(r,e);n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const c of e.split("&")){let[e,i]=a(t.decode?c.replace(/\+/g," "):c,"=");i=void 0===i?null:["comma","separator"].includes(t.arrayFormat)?i:s(i,t),r(s(e,t),i,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=u,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const c=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[",c,"]"].join("")]:[...r,[o(t,e),"[",o(c,e),"]=",o(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[]"].join("")]:[...r,[o(t,e),"[]=",o(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[o(t,e),"=",o(n,e)].join("")]:[[r,o(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,o(t,e)]:[...r,[o(t,e),"=",o(n,e)].join("")]}}(t),c={};for(const t of Object.keys(e))r(t)||(c[t]=e[t]);const a=Object.keys(c);return!1!==t.sort&&a.sort(t.sort),a.map(r=>{const c=e[r];return void 0===c?"":null===c?o(r,t):Array.isArray(c)?c.reduce(n(r),[]).join("&"):o(r,t)+"="+o(c,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=a(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(u(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:s(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(e.url).split("?")[0]||"",c=t.extract(e.url),a=t.parse(c,{sort:!1}),i=Object.assign(a,e.query);let s=t.stringify(i,r);s&&(s="?"+s);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+o(e.fragmentIdentifier,r)),`${n}${s}${u}`}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.editPost},,,function(e,t){e.exports=window.wp.plugins},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.keycodes},function(e,t,r){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,c=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){c=!0,a=e}finally{try{n||null==o.return||o.return()}finally{if(c)throw a}}return r}}},function(e,t,r){var n=r(25);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=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(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),c=new RegExp("(%[a-f0-9]{2})+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function i(e){try{return decodeURIComponent(e)}catch(c){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=a(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=c.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=i(r[0]);n!==r[0]&&(t[r[0]]=n)}r=c.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var s=a[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";r.r(t);var n=r(1),c=r(17),a=r(12),i=(r(21),r(10)),o=r.n(i),s=r(4);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p={isFetching:!0,isPreview:!1,tab:3===parseInt(window.tiTpc.tier)?"library":"templates",templates:[],patterns:[],library:{items:[],currentPage:0,totalPages:0},preview:{type:"templates",item:{}}};Object(s.registerStore)("tpc/block-editor",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;return"SET_FETCHING"===t.type?u(u({},e),{},{isFetching:t.isFetching}):"TOGGLE_PREVIEW"===t.type?u(u({},e),{},{isPreview:!e.isPreview}):"UPDATE_CURRENT_TAB"===t.type?u(u({},e),{},{tab:t.tab,isPreview:!1}):"UPDATE_TEMPLATES"===t.type?u(u({},e),{},{templates:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"UPDATE_PATTERNS"===t.type?u(u({},e),{},{patterns:t.items}):"UPDATE_LIBRARY"===t.type?u(u({},e),{},{library:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"SET_PREVIEW_DATA"===t.type?u(u({},e),{},{preview:t.preview}):e},selectors:{isFetching:function(e){return e.isFetching},isPreview:function(e){return e.isPreview},getCurrentTab:function(e){return e.tab},getTemplates:function(e){return e.templates},getPatterns:function(e){return e.patterns},getLibrary:function(e){return e.library},getPreview:function(e){return e.preview}},actions:{setFetching:function(e){return{type:"SET_FETCHING",isFetching:e}},togglePreview:function(e){return{type:"TOGGLE_PREVIEW",isPreview:e}},updateCurrentTab:function(e){return{type:"UPDATE_CURRENT_TAB",tab:e}},updateTemplates:function(e,t,r){return{type:"UPDATE_TEMPLATES",items:e,currentPage:t,totalPages:r}},updatePatterns:function(e){return{type:"UPDATE_PATTERNS",items:e}},updateLibrary:function(e,t,r){return{type:"UPDATE_LIBRARY",items:e,currentPage:t,totalPages:r}},setPreviewData:function(e){return{type:"SET_PREVIEW_DATA",preview:e}}}});var m,b=r(0),f=r(8),d=r.n(f),g=wp.primitives,O=g.Path,j=g.SVG,y=function(e){var t=e.className;return Object(b.createElement)(j,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d()(["tpc-icon",t])},Object(b.createElement)(O,{d:"M22.8063 24H1.19365C0.534714 24 0 23.4653 0 22.8063V1.19365C0 0.534714 0.534714 0 1.19365 0H22.8063C23.4653 0 24 0.534714 24 1.19365V22.8063C24 23.4653 23.4653 24 22.8063 24Z",fill:"#14171C"}),Object(b.createElement)(O,{d:"M19.8466 20.8187V7.39687V4.43164H16.884H3.45947L6.422 7.39687H16.884V17.8562L19.8466 20.8187Z",fill:"white"}),Object(b.createElement)(O,{d:"M10.138 14.1429L10.1407 17.0838L12.7764 19.7195L12.7656 11.5152L4.55859 11.5044L7.19435 14.1375L10.138 14.1429Z",fill:"white"}))},h=function(){return Object(b.createElement)(j,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tpc-template-cloud-icon"},Object(b.createElement)(O,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(b.createElement)(O,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(b.createElement)(O,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},v=r(3),w=r.n(v),_=r(6),E=r.n(_),k=r(7),P=r.n(k),x=r(11),S=r.n(x),T=r(2),C=r(14),N=r(9),B=new Uint8Array(16);function D(){if(!m&&!(m="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return m(B)}for(var I=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,A=function(e){return"string"==typeof e&&I.test(e)},F=[],L=0;L<256;++L)F.push((L+256).toString(16).substr(1));var V=function(e,t,r){var n=(e=e||{}).random||(e.rng||D)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var c=0;c<16;++c)t[r+c]=n[c];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase();if(!A(r))throw TypeError("Stringified UUID is invalid");return r}(n)};function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=lodash.omit,z=Object(s.dispatch)("tpc/block-editor"),H=z.updateLibrary,G=z.updateTemplates,Q=Object(s.dispatch)("core/notices").createNotice,q=function(e){Q("warning",e,{context:"themeisle-blocks/notices/templates-cloud",isDismissible:!0})},$=function(){var e=E()(w.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),{},{per_page:12,page:0,premade:!0,template_site_slug:"general"},t),n=Object(N.stringifyUrl)({url:tiTpc.endpoint+"page-templates",query:r}),e.prev=3,e.next=6,S()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",q(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,G(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&q(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=E()(w.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=M({per_page:12,page:0},t),n=Object(N.stringifyUrl)({url:tiTpc.endpoint+"templates",query:M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),r)}),e.prev=3,e.next=6,S()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",q(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,H(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&q(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t.template_id),query:M(M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)},t)}),e.prev=1,e.next=4,S()({url:r,method:"POST",parse:!1});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",q(c.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,$();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&q(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta"))}),e.prev=1,e.next=4,S()({url:r,method:"GET",parse:!1});case 4:if(!(n=e.sent).ok){e.next=12;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",c);case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=E()(w.a.mark((function e(t){var r,n,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/import"),query:M({cache:localStorage.getItem("tpcCacheBuster")},R(tiTpc.params,"meta"))}),n={},e.prev=2,e.next=5,S()({url:r,method:"GET",parse:!1});case 5:if(!(c=e.sent).ok){e.next=12;break}return e.next=9,c.json();case 9:if(!(n=e.sent).message){e.next=12;break}return e.abrupt("return",q(n.message));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0.message&&q(e.t0.message);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=E()(w.a.mark((function e(t,r){var n,c,a;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t),query:M({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},R(tiTpc.params,"meta"))}),e.prev=1,e.next=4,S()({url:n,method:"POST"});case 4:if(!(c=e.sent).ok){e.next=11;break}return e.next=8,c.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",q(a.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,W(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&q(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t,r){return e.apply(this,arguments)}}(),X=function(){var e=E()(w.a.mark((function e(t,r,n,c,a){var i,o,s;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(N.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/publish"),query:M({cache:localStorage.getItem("tpcCacheBuster"),method:"POST",template_site_slug:r,template_thumbnail:n,premade:c?"yes":"no",link:a},R(tiTpc.params,"meta"))}),e.prev=1,e.next=4,S()({url:i,method:"POST",headers:{Authorization:"Bearer ".concat(tiTpc.bearer||""," ")}});case 4:if(!(o=e.sent).ok){e.next=14;break}return e.next=8,o.json();case 8:if(!(s=e.sent).message){e.next=12;break}return q(s.message),e.abrupt("return",{success:!1});case 12:e.next=17;break;case 14:if(!o.message){e.next=17;break}return q(o.message),e.abrupt("return",{success:!1});case 17:return localStorage.setItem("tpcCacheBuster",V()),e.abrupt("return",{success:!0});case 21:if(e.prev=21,e.t0=e.catch(1),!e.t0.message){e.next=26;break}return q(e.t0.message),e.abrupt("return",{success:!1});case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t,r,n,c,a){return e.apply(this,arguments)}}(),ee=function(){var e=Object(s.useSelect)((function(e){return e("core/notices").getNotices("themeisle-blocks/notices/templates-cloud")})),t=Object(s.useDispatch)("core/notices").removeNotice;return Object(b.createElement)("div",{className:"notices"},e.map((function(e){return Object(b.createElement)(T.Notice,{key:e.id,status:e.status,isDismissible:e.isDismissible,onRemove:function(){return t(e.id,"themeisle-blocks/notices/templates-cloud")},actions:e.actions},e.content)})))};function te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?te(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ne=lodash.omit,ce=r(18),ae=r.n(ce),ie=r(13),oe=r(5),se=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{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"})),le=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(b.createElement)(oe.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"})),ue=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"}));function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be=function(e){var t=e.closeModal,r=e.getOrder,c=e.getSearchQuery,a=Object(s.useDispatch)("tpc/block-editor"),i=a.setFetching,o=a.updateCurrentTab,l={templates:Object(n.__)("Page Templates")};3===parseInt(tiTpc.tier)&&(l.library=Object(n.__)("My Library"));var u=Object(s.useSelect)((function(e){return e("tpc/block-editor").isFetching()})),p=Object(s.useSelect)((function(e){return e("tpc/block-editor").isPreview()})),m=Object(s.useSelect)((function(e){return e("tpc/block-editor").getCurrentTab()})),f=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.localStorage.setItem("tpcCacheBuster",V()),i(!0),t=r(),e.next=5,$(me({search:c()},t));case 5:return e.next=7,W(me({search:c()},t));case 7:i(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(b.createElement)("div",{className:"modal-header"},Object(b.createElement)("div",{className:"left"},Object(b.createElement)(T.Icon,{icon:h})),Object(b.createElement)("div",{className:"center"},Object.keys(l).map((function(e){return Object(b.createElement)(T.Button,{key:e,onClick:function(){return o(e)},className:d()("tabs",{"is-active":e===m})},l[e])}))),Object(b.createElement)("div",{className:"right"},"library"===m&&!p&&Object(b.createElement)(T.ButtonGroup,null,Object(b.createElement)(T.Button,{label:Object(n.__)("Re-sync Library"),icon:le,disabled:u,className:d()("is-sync",{"is-loading":u}),onClick:f})),Object(b.createElement)(T.Button,{label:Object(n.__)("Close Modal"),icon:ue,onClick:t})))},fe=r(19),de=function(e){var t=e.isFetching,r=e.importBlocks,c=Object(ie.useViewportMatch)("large",">="),i=Object(ie.useViewportMatch)("large","<="),o=Object(ie.useViewportMatch)("small",">="),l=Object(ie.useViewportMatch)("small","<="),u=1400;c||i||!o||l?!(c||i||o||l)&&(u=600):u=960;var p=Object(s.useDispatch)("tpc/block-editor"),m=p.setFetching,f=p.togglePreview,d=Object(s.useSelect)((function(e){return e("tpc/block-editor").getPreview()})).item;Object(b.useEffect)((function(){h()}),[]);var g=Object(b.useState)(""),O=P()(g,2),j=O[0],y=O[1],h=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),e.next=3,v();case 3:m(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),e.next=3,K(d.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&y(t.content),m(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(b.createElement)("div",{className:"tpc-modal-content"},Object(b.createElement)("div",{className:"preview-header"},Object(b.createElement)("div",{className:"left"},d.template_name||Object(n.__)("Template")),Object(b.createElement)("div",{className:"right"},Object(b.createElement)(T.Button,{isSecondary:!0,onClick:f},Object(n.__)("Close Preview")),Object(b.createElement)(T.Button,{isPrimary:!0,isBusy:t,disabled:t,onClick:function(){f(),r(j,d.meta||[])}},Object(n.__)("Import")))),t?Object(b.createElement)(T.Placeholder,null,Object(b.createElement)(T.Spinner,null)):Object(b.createElement)("div",{className:"preview-content"},Object(b.createElement)(fe.BlockPreview,{blocks:Object(a.parse)(j),viewportWidth:u})))},ge=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),Oe=Object(b.createElement)(oe.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"})),je=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),ye=r(20);function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var we={date:Object(n.__)("Date"),template_name:Object(n.__)("Name"),modified:Object(n.__)("Last Modified")},_e=function(e){var t=e.layout,r=e.sortingOrder,c=e.setLayout,a=e.isSearch,i=e.searchQuery,o=e.onSearch,s=e.setSearchQuery,l=e.setSortingOrder,u=e.changeOrder;return Object(b.createElement)("div",{className:"filters"},Object(b.createElement)("div",{className:"display-sorting"},Object(b.createElement)("div",{className:"sorting-label"},Object(n.__)("Sort by")),Object(b.createElement)("div",{className:"sorting-filter"},Object.keys(we).map((function(e){return Object(b.createElement)(T.Button,{key:e,className:d()({"is-selected":e===r.orderby,"is-asc":"ASC"===r.order}),onClick:function(){var t={order:"DESC",orderby:e};e===r.orderby&&"DESC"===r.order&&(t.order="ASC"),l(ve({},t)),u(ve({},t))}},we[e])})))),Object(b.createElement)("div",{className:"view-filters"},Object(b.createElement)("div",{className:"search-filters"},Object(b.createElement)("input",{placeholder:Object(n.__)("Search for a template…"),className:"filter-search",value:i,onChange:function(e){return s(e.target.value)},onKeyDown:function(e){e.keyCode===ye.ENTER&&o()}}),a?Object(b.createElement)(T.Button,{label:Object(n.__)("Clear search query"),icon:ue,onClick:function(){s(""),o("")}}):Object(b.createElement)(T.Button,{label:Object(n.__)("Search"),icon:ge,onClick:function(){return o()}})),Object(b.createElement)(T.Button,{label:Object(n.__)("List View"),icon:Oe,onClick:function(){return c("list")},isPressed:"list"===t}),Object(b.createElement)(T.Button,{label:Object(n.__)("Grid View"),icon:je,onClick:function(){return c("grid")},isPressed:"grid"===t})))},Ee=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),ke=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),Pe=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(b.createElement)(oe.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"})),xe=Object(b.createElement)(oe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(b.createElement)(oe.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Se=function(e){var t=e.sortingOrder,r=e.layout,c=e.item,a=e.importBlocks,i=e.deletable,o=Object(s.useDispatch)("tpc/block-editor"),l=o.togglePreview,u=o.setPreviewData,p=Object(b.useState)(!1),m=P()(p,2),f=m[0],g=m[1],O=Object(b.useState)(!1),j=P()(O,2),y=j[0],h=j[1],v=Object(b.useState)(c.template_name),_=P()(v,2),k=_[0],x=_[1],S=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g("importing"),e.next=3,K(c.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&a(t.content,c.meta||[]),g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g("updating"),e.next=3,Z({template_id:c.template_id,template_name:k||c.template_name},t);case 3:return e.next=5,W(t);case 5:g(!1),h(!y);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm(Object(n.__)("Are you sure you want to delete this template?"))){e.next=2;break}return e.abrupt("return",!1);case 2:return g("deleting"),e.next=5,Y(c.template_id,t);case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l(),u({type:"library",item:c});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();if("grid"===r){var D={backgroundImage:"url(".concat(c.template_thumbnail,")")};return Object(b.createElement)("div",{key:c.template_id,className:"table-grid"},Object(b.createElement)("div",{style:D,className:d()("grid-preview",{"is-loading":y||!1!==f})},Object(b.createElement)("div",{className:"preview-actions"},Object(b.createElement)(T.Button,{isSecondary:!0,disabled:!1!==f,onClick:B},Object(n.__)("Preview")),Object(b.createElement)(T.Button,{isPrimary:!0,isBusy:"importing"===f,disabled:!1!==f,onClick:S},Object(n.__)("Import")),i&&Object(b.createElement)("div",{className:"preview-controls"},!c.link&&Object(b.createElement)(T.Button,{label:Object(n.__)("Edit"),icon:"updating"===f?le:Ee,disabled:y||!1!==f,className:d()({"is-loading":"updating"===f}),onClick:function(){return h(!y)}},y&&Object(b.createElement)(T.Popover,{onFocusOutside:function(){return h(!y)},className:"controls-popover"},Object(b.createElement)("div",{className:"popover-content"},Object(b.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),value:k,onChange:x}),Object(b.createElement)(T.Button,{label:Object(n.__)("Update"),icon:"updating"===f?le:ke,disabled:!1!==f,className:d()({"is-loading":"updating"===f}),onClick:C})))),Object(b.createElement)(T.Button,{label:Object(n.__)("Delete"),icon:"deleting"===f?le:Pe,disabled:!1!==f,className:d()({"is-loading":"deleting"===f}),onClick:N})))),Object(b.createElement)("div",{className:"card-footer"},Object(b.createElement)("p",null,c.template_name)))}var I=d()("actions",{"no-controls":!i});return Object(b.createElement)("div",{key:c.template_id,className:"table-row"},Object(b.createElement)("div",{className:"row-title"},Object(b.createElement)(T.Icon,{icon:xe}),y?Object(b.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),hideLabelFromVision:!0,value:k,onChange:x}):c.template_name),i&&Object(b.createElement)("div",{className:"row-controls"},c.link?Object(b.createElement)(T.Tooltip,{text:Object(n.__)("This template is synced to a page.")},Object(b.createElement)(T.Button,{label:Object(n.__)("Edit"),icon:Ee,disabled:!0},Object(n.__)("Edit"))):Object(b.createElement)(T.Button,{label:y?Object(n.__)("Update"):Object(n.__)("Edit"),icon:y?"updating"===f?le:ke:Ee,disabled:!1!==f,className:d()({"is-loading":"updating"===f}),onClick:y?C:function(){return h(!y)}},y?Object(n.__)("Update"):Object(n.__)("Edit")),Object(b.createElement)(T.Button,{label:Object(n.__)("Delete"),icon:"deleting"===f?le:Pe,disabled:!1!==f,className:d()({"is-loading":"deleting"===f}),onClick:N},"deleting"===f?Object(n.__)("Deleting")+"...":Object(n.__)("Delete"))),Object(b.createElement)("div",{className:I},Object(b.createElement)(T.Button,{isSecondary:!0,disabled:!1!==f,onClick:B},Object(n.__)("Preview")),Object(b.createElement)(T.Button,{isPrimary:!0,isBusy:"importing"===f,disabled:!1!==f,onClick:S},Object(n.__)("Import"))))},Te=function(e){var t=e.total,r=e.current,n=e.onChange;if(t<2)return null;for(var c=[],a=function(e){var t=e===r;c.push(Object(b.createElement)(T.Button,{key:"page-".concat(e),isPrimary:t,disabled:t,onClick:function(){return n(e)}},e+1))},i=0;i<t;i++)a(i);return Object(b.createElement)(T.ButtonGroup,{className:"pagination"},c)};function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Be=Object(s.withSelect)((function(e,t){var r=t.isGeneral?e("tpc/block-editor").getTemplates():e("tpc/block-editor").getLibrary(),n=r.items;return{items:void 0===n?[]:n,currentPage:r.currentPage,totalPages:r.totalPages}}))((function(e){var t=e.importBlocks,r=e.isGeneral,c=void 0!==r&&r,a=e.isFetching,i=e.items,o=e.currentPage,l=e.totalPages,u=e.getOrder,p=e.setQuery,m=e.getSearchQuery,f=e.setSorting,g=Object(s.useDispatch)("tpc/block-editor").setFetching,O=Object(b.useState)("grid"),j=P()(O,2),y=j[0],h=j[1],v=Object(b.useState)({templates:!1,library:!1}),_=P()(v,2),k=_[0],x=_[1],S=function(e){return x(Ne(Ne({},k),{},c?{templates:e}:{library:e}))},C=function(){return c?k.templates:k.library},N=function(){var e=E()(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g(!0),t=u(),!c){e.next=7;break}return e.next=5,$(Ne({search:m()},t));case 5:e.next=9;break;case 7:return e.next=9,W(Ne({search:m()},t));case 9:g(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(b.useEffect)((function(){i&&i.length>0||N()}),[c]);var B=function(){var e=E()(w.a.mark((function e(t){var r;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g(!0),r=u(),!c){e.next=7;break}return e.next=5,$(Ne({search:m(),page:t},r));case 5:e.next=9;break;case 7:return e.next=9,W(Ne({search:m(),page:t},r));case 9:g(!1);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=E()(w.a.mark((function e(){var t,r,n=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:m(),g(!0),S(!!t),r=u(),!c){e.next=9;break}return e.next=7,$(Ne({search:t},r));case 7:e.next=11;break;case 9:return e.next=11,W(Ne({search:t},r));case 11:g(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=E()(w.a.mark((function e(t){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g(!0),!c){e.next=6;break}return e.next=4,$(Ne(Ne({},t),{},{search:m()}));case 4:e.next=8;break;case 6:return e.next=8,W(Ne(Ne({},t),{},{search:m()}));case 8:g(!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();if(a)return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_e,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:m(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(b.createElement)(T.Placeholder,null,Object(b.createElement)(T.Spinner,null)));if(!Boolean(i.length))return Object(b.createElement)("div",{className:"table-content"},Object(b.createElement)(_e,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:m(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(n.__)("No templates available. Add a new one?"));var A=d()("table-content",{"is-grid":"grid"===y});return Object(b.createElement)(b.Fragment,null,Object(b.createElement)(_e,{layout:y,sortingOrder:u(),setLayout:h,isSearch:C(),searchQuery:m(),onSearch:D,setSearchQuery:p,setSortingOrder:f,changeOrder:I}),Object(b.createElement)("div",{className:A},i.map((function(e){return Object(b.createElement)(Se,{sortingOrder:u(),deletable:!c,key:e.template_id,layout:y,item:e,importBlocks:t})}))),Object(b.createElement)(Te,{onChange:B,current:o,total:l}))})),De=Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.isFetching,c=t.getCurrentTab;return{isPreview:r(),isFetching:n(),currentTab:c()}}))((function(e){var t=e.importBlocks,r=e.getOrder,c=e.setQuery,a=e.getSearchQuery,i=e.setSorting,o=e.isPreview,s=e.currentTab,l=e.isFetching;return o&&"library"===s?Object(b.createElement)(de,{isFetching:l,importBlocks:t}):Object(b.createElement)("div",{className:"tpc-modal-content"},Object(b.createElement)(ee,null),["templates","library"].includes(s)&&Object(b.createElement)(Be,{isFetching:l,isGeneral:"templates"===s,importBlocks:t,getOrder:r,setQuery:c,getSearchQuery:a,setSorting:i}),"patterns"===s&&Object(n.__)("We are still working on this. Please check back later. Thank you!"))})),Ie=function(e){var t=e.title,r=e.leftButtons,c=e.rightButtons,a=e.heading,i=e.previewUrl,o=Object(N.stringifyUrl)({url:i,query:{tpcpreview:"yes"}}),s=t||Object(n.__)("Preview");return Object(b.createElement)("div",{className:"ob-preview single-templates"},Object(b.createElement)("div",{className:"preview"},Object(b.createElement)("iframe",{title:s,src:o,frameBorder:"0"}),Object(b.createElement)("div",{className:"loading"},Object(b.createElement)(T.Dashicon,{icon:"update",size:50}))),Object(b.createElement)("div",{className:"bottom-bar"},r&&Object(b.createElement)("div",{className:"navigator"},r),a&&Object(b.createElement)("h2",{className:"heading"},a),c&&Object(b.createElement)("div",{className:"actions"},c)))};function Ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Le=lodash.omit,Ve=Object(ie.compose)(Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.getPreview,c=t.getCurrentTab;return{isPreview:r(),currentTab:c(),previewData:n().item}})),Object(s.withDispatch)((function(e){var t=e("core/block-editor"),r=t.removeBlock,n=t.replaceBlocks,c=e("tpc/block-editor").togglePreview;return{removeBlock:r,replaceBlocks:n,closePreview:function(){return c(!1)}}})))((function(e){var t=e.clientId,r=e.isPreview,c=e.previewData,i=e.currentTab,o=e.removeBlock,l=e.replaceBlocks,u=e.closePreview,p=Object(s.useSelect)((function(e){return{type:e("core/editor").getEditedPostAttribute("type")}})).type,m=Object(s.useDispatch)("core/notices").createErrorNotice,f=Object(s.useDispatch)("core/editor").editPost,d=Object(s.useDispatch)("tpc/block-editor"),g=d.updateLibrary,O=d.updateTemplates,j=Object(b.useState)(!1),y=P()(j,2),h=y[0],v=y[1],_=Object(b.useState)(!1),k=P()(_,2),x=k[0],S=k[1],C=Object(b.useState)({templates:"",library:""}),N=P()(C,2),B=N[0],D=N[1],I=Object(b.useState)({templates:{order:"DESC",orderby:"date"},library:{order:"DESC",orderby:"date"}}),A=P()(I,2),F=A[0],L=A[1],V="templates"===i,U=function(){return V?B.templates:B.library},M=function(){return V?F.templates:F.library},R=function(e){try{var t=JSON.parse(e);if(t&&"object"===ae()(t))return t}catch(e){}return!1},z=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(g([]),O([]),0<Object.keys(R(r)||{}).length&&["post","page"].includes(p)){var n=JSON.parse(r),c=Fe({},Le(Fe({},n),"_wp_page_template"));f({meta:c}),"page"===p&&n._wp_page_template&&f({template:n._wp_page_template})}l(t,Object(a.parse)(e))},H=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,K(c.template_id).then((function(e){if(e.__file&&e.content&&"wp_export"===e.__file)return u(),S(!1),z(e.content,c.meta||[]),!1;m(Object(n.__)("Something went wrong while importing. Please try again."),{type:"snackbar"}),S(!1),o(t)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=function(){v(!1),S(!1),o(t)};return Object(b.useEffect)((function(){setTimeout((function(){v(!0)}),100)}),[]),h?Object(b.createElement)(b.Fragment,null,Object(b.createElement)(T.Modal,{onRequestClose:G,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!r||"templates"!==i,isDismissible:!1,overlayClassName:"tpc-template-cloud-modal"},Object(b.createElement)(be,{closeModal:G,getOrder:M,getSearchQuery:U}),Object(b.createElement)(De,{importBlocks:z,getOrder:M,setQuery:function(e){return D(Fe(Fe({},B),{},V?{templates:e}:{library:e}))},getSearchQuery:U,setSorting:function(e){return L(Fe(Fe({},F),{},V?{templates:e}:{library:e}))}}),Object(b.createElement)((function(){if(!r||"templates"!==i)return null;var e=c.link,t=c.template_name;return Object(b.createElement)(T.Modal,{isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,className:"tpc-preview-wrap-modal"},Object(b.createElement)(Ie,{previewUrl:e,heading:t,leftButtons:Object(b.createElement)(b.Fragment,null,Object(b.createElement)(T.Button,{disabled:x,icon:se,onClick:u})),rightButtons:Object(b.createElement)(T.Button,{disabled:x,isPrimary:!0,onClick:H},x?Object(n.__)("Importing")+"...":Object(n.__)("Import"))}),";")}),null))):null}));Object(a.registerBlockType)("ti-tpc/templates-cloud",{title:Object(n.__)("Templates Cloud"),description:Object(n.__)("A cloud based templates library which enables you to create ready-made website in no time."),icon:y,category:"design",keywords:["templates cloud","patterns","template library"],supports:{html:!1},edit:Ve,save:function(){return null}}),3===parseInt(tiTpc.tier)&&Object(c.registerPlugin)("ti-tpc",{render:function(){var e=Object(b.useState)(!1),t=P()(e,2),r=t[0],c=t[1],i=Object(b.useState)(!1),o=P()(i,2),l=o[0],u=o[1],p=Object(b.useState)(""),m=P()(p,2),f=m[0],g=m[1],O=window.tiTpc.canPredefine,j=Object(s.useDispatch)("core/notices"),h=j.createErrorNotice,v=j.createSuccessNotice,_=Object(s.useDispatch)("core/editor").editPost,k=Object(s.useSelect)((function(e){var t=e("core/block-editor"),r=t.getSelectedBlockCount,n=t.getSelectedBlock,c=t.getMultiSelectedBlocks,i=1===r()?n():c();return Object(a.serialize)(i)}),[]),x=Object(s.useSelect)((function(e){var t=(0,e("core/block-editor").getBlocks)();return Object(a.serialize)(t)}),[]),B=Object(s.useSelect)((function(e){return(0,e("core/editor").getEditedPostAttribute)("meta")}),[]),D=Object(s.useSelect)((function(e){return(0,e("core/editor").getEditedPostAttribute)("template")}),[]);Object(b.useEffect)((function(){var e=window.tiTpc.metaKeys;window.tiTpc.params.meta=Object.fromEntries(Object.entries(B||{}).filter((function(t){var r=P()(t,1)[0];return e.includes(r)}))),D?window.tiTpc.params.meta._wp_page_template=D:""===D&&window.tiTpc.params.meta._wp_page_template&&delete window.tiTpc.params.meta._wp_page_template}),[B,D]);var I=Object(s.useSelect)((function(e){return{meta:e("core/editor").getEditedPostAttribute("meta")||{},postId:e("core/editor").getEditedPostAttribute("id"),type:e("core/editor").getEditedPostAttribute("type"),link:e("core/editor").getEditedPostAttribute("link"),postTitle:e("core/editor").getEditedPostAttribute("title")||Object(n.__)("Template")}})),A=I.meta,F=I.postTitle,L=I.postId,U=I.type,M=I.link,R=I.meta,z=R._ti_tpc_template_sync,H=R._ti_tpc_template_id,G=R._ti_tpc_screenshot_url,Q=R._ti_tpc_site_slug,q=R._ti_tpc_published,$=Object(s.useSelect)((function(e,t){var r=t.forceIsSaving,n=e("core/editor"),c=n.isSavingPost,a=n.isPublishingPost,i=n.isAutosavingPost,o=r||c(),s=i();return(a()||o)&&!s})),W=Object(b.useState)(z),Z=P()(W,2),K=Z[0],Y=Z[1],te=Object(b.useState)(H),ce=P()(te,2),ae=ce[0],ie=ce[1],oe=Object(b.useState)(Q),se=P()(oe,2),le=se[0],ue=se[1],pe=Object(b.useState)(q),me=P()(pe,2),be=me[0],fe=me[1],de=Object(b.useState)(G),ge=P()(de,2),Oe=ge[0],je=ge[1];Object(b.useEffect)((function(){_({meta:re(re({},A),{},{_ti_tpc_template_sync:K,_ti_tpc_template_id:ae,_ti_tpc_screenshot_url:Oe,_ti_tpc_site_slug:le,_ti_tpc_published:be})})}),[K,ae,Oe,le,be]),Object(b.useEffect)((function(){$&&K&&he()}),[$,K]);var ye=function(){var e=E()(w.a.mark((function e(){var t,r,a,i;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),t={__file:"wp_export",version:2,content:k},r=Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:re(re({},ne(tiTpc.params,"meta")),{},{template_name:f,template_type:"gutenberg"})}),e.prev=3,e.next=6,S()({url:r,method:"POST",data:t,parse:!1});case 6:if(!(a=e.sent).ok){e.next=12;break}return e.next=10,a.json();case 10:(i=e.sent).message?h(i.message,{type:"snackbar"}):(window.localStorage.setItem("tpcCacheBuster",V()),v(Object(n.__)("Template saved."),{type:"snackbar"}));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 17:u(!1),c(!1),g("");case 20:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=E()(w.a.mark((function e(){var t,r,c,a,i;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),t={__file:"wp_export",version:2,content:x},c=!1,!ae){e.next=7;break}return e.next=6,J(ae);case 6:c=e.sent;case 7:if(!1===c||"gutenberg"===c.template_type){e.next=9;break}return e.abrupt("return");case 9:return r=c?Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates/"+ae,query:re(re({},ne(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta),template_name:F,link:M})}):Object(N.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:re(re({},ne(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta),template_name:F,template_type:"gutenberg",template_site_slug:Q||"",template_thumbnail:G||"",link:M})}),e.prev=10,e.next=13,S()({url:r,method:"POST",data:t,parse:!1});case 13:if(!(a=e.sent).ok){e.next=19;break}return e.next=17,a.json();case 17:(i=e.sent).message?h(i.message,{type:"snackbar"}):(window.localStorage.setItem("tpcCacheBuster",V()),v(Object(n.__)("Template saved."),{type:"snackbar"}),i.template_id?(ie(i.template_id),ve(i.template_id)):ve());case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(10),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 24:u(!1);case 25:case"end":return e.stop()}}),e,null,[[10,21]])})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ae,t=null;return"post"===U?t=new wp.api.models.Post({id:L}):"page"===U&&(t=new wp.api.models.Page({id:L})),t.set("meta",{_ti_tpc_template_id:e,_ti_tpc_template_sync:K,_ti_tpc_screenshot_url:Oe,_ti_tpc_site_slug:le,_ti_tpc_published:!be}),t.save()};return["post","page"].includes(U)?Object(b.createElement)(b.Fragment,null,Object(b.createElement)(C.PluginBlockSettingsMenuItem,{label:Object(n.__)("Save to Neve Cloud"),icon:"none",onClick:function(){return c(!0)}}),Object(b.createElement)(C.PluginSidebarMoreMenuItem,{icon:Object(b.createElement)(T.Icon,{icon:y}),target:"ti-tpc"},Object(n.__)("Templates Cloud")),Object(b.createElement)(C.PluginSidebar,{name:"ti-tpc",title:Object(n.__)("Templates Cloud"),className:"ti-tpc-components-panel"},Object(b.createElement)(T.PanelBody,null,Object(n.__)("Save this page as a template in your Templates Cloud library."),Object(b.createElement)(T.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:he},Object(n.__)("Save Page to Neve Cloud")),Object(b.createElement)(T.ToggleControl,{label:Object(n.__)("Automatically sync to the cloud"),checked:K,onChange:function(){return Y(!K)}})),O&&Object(b.createElement)(T.PanelBody,null,Object(b.createElement)("h4",null,Object(n.__)("Publish Settings")),Object(b.createElement)(T.TextControl,{label:Object(n.__)("Screenshot URL"),value:Oe,type:"url",onChange:je}),Object(b.createElement)(T.TextControl,{label:Object(n.__)("Site Slug"),value:le,help:Object(n.__)("Use `general` to publish this as a global template. Otherwise use the starter site slug to make it available as a single page for the starter site."),type:"url",onChange:ue}),Object(b.createElement)((function(){if(!O)return null;var e=function(){var e=E()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u("publishing"),e.next=3,X(H,Q,G,!q,M).then((function(e){e.success&&(fe(!be),ve(),v(be?Object(n.__)("Template Unpublished."):Object(n.__)("Template Published."),{type:"snackbar"}))}));case 3:u(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(b.createElement)(T.Button,{isSecondary:!0,onClick:e,disabled:!1!==l,className:d()({"is-loading":"publishing"===l})},be&&("publishing"===l?Object(n.__)("Unpublishing"):Object(n.__)("Unpublish")),!be&&("publishing"===l?Object(n.__)("Publishing"):Object(n.__)("Publish")))}),null),Object(b.createElement)(ee,null))),r&&Object(b.createElement)(T.Modal,{title:Object(n.__)("Save Template"),onRequestClose:function(){return c(!1)}},Object(b.createElement)(T.TextControl,{label:Object(n.__)("Template Name"),value:f,onChange:g}),Object(b.createElement)(T.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:ye},Object(n.__)("Save")))):null},icon:y})}]);
editor/src/data/templates-cloud/index.js CHANGED
@@ -1,3 +1,4 @@
 
1
  /* global localStorage, tiTpc */
2
  import { stringifyUrl } from 'query-string';
3
  import { v4 as uuidv4 } from 'uuid';
@@ -282,7 +283,6 @@ export const publishTemplate = async (
282
  premade: publishStatus ? 'yes' : 'no',
283
  link,
284
  ...omit( tiTpc.params, 'meta' ),
285
- meta: JSON.stringify( tiTpc.params.meta )
286
  },
287
  } );
288
 
1
+ /* eslint-disable no-undef */
2
  /* global localStorage, tiTpc */
3
  import { stringifyUrl } from 'query-string';
4
  import { v4 as uuidv4 } from 'uuid';
283
  premade: publishStatus ? 'yes' : 'no',
284
  link,
285
  ...omit( tiTpc.params, 'meta' ),
 
286
  },
287
  } );
288
 
editor/src/edit.js CHANGED
@@ -1,5 +1,11 @@
 
1
  /* eslint-disable camelcase */
2
- import { withDispatch, withSelect, useDispatch, useSelect } from '@wordpress/data';
 
 
 
 
 
3
  import { useState, useEffect } from '@wordpress/element';
4
  import { Modal, Button } from '@wordpress/components';
5
  import { compose } from '@wordpress/compose';
@@ -12,6 +18,8 @@ import Content from './components/content';
12
  import PreviewFrame from '../../assets/src/Components/CloudLibrary/PreviewFrame';
13
  import { importTemplate } from './data/templates-cloud';
14
 
 
 
15
  const Edit = ( {
16
  clientId,
17
  isPreview,
@@ -21,9 +29,7 @@ const Edit = ( {
21
  replaceBlocks,
22
  closePreview,
23
  } ) => {
24
- const {
25
- type,
26
- } = useSelect( ( select ) => ( {
27
  type: select( 'core/editor' ).getEditedPostAttribute( 'type' ),
28
  } ) );
29
 
@@ -100,14 +106,42 @@ const Edit = ( {
100
  return sortingOrder.library;
101
  };
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  const importBlocks = ( content, metaFields = [] ) => {
104
  updateLibrary( [] );
105
  updateTemplates( [] );
106
 
107
- if ( 0 < metaFields.length && [ 'post', 'page' ].includes( type ) ) {
108
- editPost( {
109
- meta: { ...JSON.parse( metaFields ) },
110
- } );
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
 
113
  replaceBlocks( clientId, parse( content ) );
1
+ /* eslint-disable no-undef */
2
  /* eslint-disable camelcase */
3
+ import {
4
+ withDispatch,
5
+ withSelect,
6
+ useDispatch,
7
+ useSelect,
8
+ } from '@wordpress/data';
9
  import { useState, useEffect } from '@wordpress/element';
10
  import { Modal, Button } from '@wordpress/components';
11
  import { compose } from '@wordpress/compose';
18
  import PreviewFrame from '../../assets/src/Components/CloudLibrary/PreviewFrame';
19
  import { importTemplate } from './data/templates-cloud';
20
 
21
+ const { omit } = lodash;
22
+
23
  const Edit = ( {
24
  clientId,
25
  isPreview,
29
  replaceBlocks,
30
  closePreview,
31
  } ) => {
32
+ const { type } = useSelect( ( select ) => ( {
 
 
33
  type: select( 'core/editor' ).getEditedPostAttribute( 'type' ),
34
  } ) );
35
 
106
  return sortingOrder.library;
107
  };
108
 
109
+ const tryParseJSON = ( jsonString ) => {
110
+ try {
111
+ const o = JSON.parse( jsonString );
112
+
113
+ // Handle non-exception-throwing cases:
114
+ // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking,
115
+ // but... JSON.parse(null) returns null, and typeof null === "object",
116
+ // so we must check for that, too. Thankfully, null is falsey, so this suffices:
117
+ // Source: https://stackoverflow.com/a/20392392
118
+ if ( o && typeof o === 'object' ) {
119
+ return o;
120
+ }
121
+ } catch ( e ) {}
122
+
123
+ return false;
124
+ };
125
+
126
  const importBlocks = ( content, metaFields = [] ) => {
127
  updateLibrary( [] );
128
  updateTemplates( [] );
129
 
130
+ if (
131
+ 0 < Object.keys( tryParseJSON( metaFields ) || {} ).length &&
132
+ [ 'post', 'page' ].includes( type )
133
+ ) {
134
+ const fields = JSON.parse( metaFields );
135
+ const meta = {
136
+ ...omit( { ...fields }, '_wp_page_template' ),
137
+ };
138
+ editPost( { meta } );
139
+
140
+ if ( 'page' === type && fields._wp_page_template ) {
141
+ editPost( {
142
+ template: fields._wp_page_template,
143
+ } );
144
+ }
145
  }
146
 
147
  replaceBlocks( clientId, parse( content ) );
editor/src/extension.js CHANGED
@@ -1,3 +1,4 @@
 
1
  /* eslint-disable camelcase */
2
  import { __ } from '@wordpress/i18n';
3
  import apiFetch from '@wordpress/api-fetch';
@@ -66,10 +67,28 @@ const Exporter = () => {
66
  return getEditedPostAttribute( 'meta' );
67
  }, [] );
68
 
 
 
 
 
 
69
  useEffect( () => {
70
  const metaKeys = window.tiTpc.metaKeys;
71
- window.tiTpc.params.meta = Object.fromEntries( Object.entries( getMetaFields || {} ).filter(( [key, value] ) => metaKeys.includes( key )) );
72
- }, [ getMetaFields ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  const {
75
  meta,
1
+ /* eslint-disable no-undef */
2
  /* eslint-disable camelcase */
3
  import { __ } from '@wordpress/i18n';
4
  import apiFetch from '@wordpress/api-fetch';
67
  return getEditedPostAttribute( 'meta' );
68
  }, [] );
69
 
70
+ const pageTemplate = useSelect( ( select ) => {
71
+ const { getEditedPostAttribute } = select( 'core/editor' );
72
+ return getEditedPostAttribute( 'template' );
73
+ }, [] );
74
+
75
  useEffect( () => {
76
  const metaKeys = window.tiTpc.metaKeys;
77
+ window.tiTpc.params.meta = Object.fromEntries(
78
+ Object.entries( getMetaFields || {} ).filter( ( [ key ] ) =>
79
+ metaKeys.includes( key )
80
+ )
81
+ );
82
+
83
+ if ( pageTemplate ) {
84
+ window.tiTpc.params.meta._wp_page_template = pageTemplate;
85
+ } else if (
86
+ '' === pageTemplate &&
87
+ window.tiTpc.params.meta._wp_page_template
88
+ ) {
89
+ delete window.tiTpc.params.meta._wp_page_template;
90
+ }
91
+ }, [ getMetaFields, pageTemplate ] );
92
 
93
  const {
94
  meta,
elementor/build/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill', 'wp-primitives'), 'version' => '6eb35ac9420a3150e7242a1550f19a2b');
1
+ <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill', 'wp-primitives'), 'version' => 'd3c730dad6ad805a41cf255b7c7781b9');
elementor/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=29)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.components},function(e,t){function r(e,t,r,n,a,c,i){try{var o=e[c](i),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(a,c){var i=e.apply(t,n);function o(e){r(i,a,c,o,l,"next",e)}function l(e){r(i,a,c,o,l,"throw",e)}o(void 0)}))}}},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t,r){var n=r(19),a=r(20),c=r(14),i=r(21);e.exports=function(e,t){return n(e)||a(e,t)||c(e,t)||i()}},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var i=a.apply(null,n);i&&e.push(i)}else if("object"===c)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){"use strict";const n=r(25),a=r(26),c=r(27);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function l(e,t){return t.decode?a(e):e}function s(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=s(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const a="string"==typeof r&&r.includes(e.arrayFormatSeparator),c="string"==typeof r&&!a&&l(r,e).includes(e.arrayFormatSeparator);r=c?l(r,e):r;const i=a||c?r.split(e.arrayFormatSeparator).map(t=>l(t,e)):null===r?r:l(r,e);n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const a of e.split("&")){let[e,i]=c(t.decode?a.replace(/\+/g," "):a,"=");i=void 0===i?null:["comma","separator"].includes(t.arrayFormat)?i:l(i,t),r(l(e,t),i,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=u,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[",a,"]"].join("")]:[...r,[o(t,e),"[",o(a,e),"]=",o(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[]"].join("")]:[...r,[o(t,e),"[]=",o(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[o(t,e),"=",o(n,e)].join("")]:[[r,o(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,o(t,e)]:[...r,[o(t,e),"=",o(n,e)].join("")]}}(t),a={};for(const t of Object.keys(e))r(t)||(a[t]=e[t]);const c=Object.keys(a);return!1!==t.sort&&c.sort(t.sort),c.map(r=>{const a=e[r];return void 0===a?"":null===a?o(r,t):Array.isArray(a)?a.reduce(n(r),[]).join("&"):o(r,t)+"="+o(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=c(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(u(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:l(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=s(e.url).split("?")[0]||"",a=t.extract(e.url),c=t.parse(a,{sort:!1}),i=Object.assign(c,e.query);let l=t.stringify(i,r);l&&(l="?"+l);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+o(e.fragmentIdentifier,r)),`${n}${l}${u}`}},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.compose},function(e,t,r){var n=r(22),a=r(23),c=r(14),i=r(24);e.exports=function(e){return n(e)||a(e)||c(e)||i()}},function(e,t,r){var n=r(15);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=window.wp.keycodes},,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,c=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,c=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw c}}return r}}},function(e,t){e.exports=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(e,t,r){var n=r(15);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=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(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function c(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],c(r),c(n))}function i(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=c(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=a.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=i(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),o=0;o<c.length;o++){var l=c[o];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n,a=r(6),c=r.n(a),i=r(1),o=r.n(i),l=r(3),s=r.n(l),u=r(0),p=r(7),m=r.n(p),d=r(2),b=r(13),f=r.n(b),g=r(8),w=r.n(g),y=r(9),h=new Uint8Array(16);function v(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(h)}for(var O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,j=function(e){return"string"==typeof e&&O.test(e)},E=[],x=0;x<256;++x)E.push((x+256).toString(16).substr(1));var T=function(e,t,r){var n=(e=e||{}).random||(e.rng||v)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+"-"+E[e[t+4]]+E[e[t+5]]+"-"+E[e[t+6]]+E[e[t+7]]+"-"+E[e[t+8]]+E[e[t+9]]+"-"+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase();if(!j(r))throw TypeError("Stringified UUID is invalid");return r}(n)},k=r(10),_=r.n(k),P=r(4);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=lodash.omit,D=function(e){return elementor.notifications.showToast({message:e})},M=function(){var e=s()(o.a.mark((function e(){var t,r,n,a,c,i,l,s,u,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),{},{per_page:20,page:0,premade:!0,template_site_slug:"general"},C(t,"isScroll")),n=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"page-templates",query:r}),e.prev=3,e.next=6,_()({url:n,method:"GET",parse:!1});case 6:if(!(a=e.sent).ok){e.next=18;break}return e.next=10,a.json();case 10:if(!(c=e.sent).message){e.next=13;break}return e.abrupt("return",D(c.message));case 13:i=c,t.isScroll&&(l=Object(P.select)("tpc/elementor").getTemplates(),i=[].concat(f()(l.items),f()(c))),s=a.headers.get("x-wp-totalpages"),u=r.page,Object(P.dispatch)("tpc/elementor").updateTemplates(i,u,s);case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(3),e.t0.message&&D(e.t0.message);case 23:case"end":return e.stop()}}),e,null,[[3,20]])})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=s()(o.a.mark((function e(){var t,r,n,a,c,i,l,s,u,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>0&&void 0!==p[0]?p[0]:{},3===parseInt(window.tiTpc.tier)){e.next=3;break}return e.abrupt("return");case 3:return r=N({per_page:20,page:0},C(t,"isScroll")),n=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),r)}),e.prev=5,e.next=8,_()({url:n,method:"GET",parse:!1});case 8:if(!(a=e.sent).ok){e.next=20;break}return e.next=12,a.json();case 12:if(!(c=e.sent).message){e.next=15;break}return e.abrupt("return",D(c.message));case 15:i=c,t.isScroll&&(l=Object(P.select)("tpc/elementor").getLibrary(),i=[].concat(f()(l.items),f()(c))),s=a.headers.get("x-wp-totalpages"),u=r.page,Object(P.dispatch)("tpc/elementor").updateLibrary(i,u,s);case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(5),e.t0.message&&D(e.t0.message);case 25:case"end":return e.stop()}}),e,null,[[5,22]])})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=s()(o.a.mark((function e(t){var r,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,_()({url:r,method:"GET",parse:!1});case 4:if(!(n=e.sent).ok){e.next=12;break}return e.next=8,n.json();case 8:if(!e.sent.message){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t){return e.apply(this,arguments)}}(),B=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t,"/import"),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),n={},e.prev=2,e.next=5,_()({url:r,method:"GET",parse:!1});case 5:if(!(a=e.sent).ok){e.next=12;break}return e.next=9,a.json();case 9:if(!(n=e.sent).message){e.next=12;break}return e.abrupt("return",D(n.message));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0.message&&D(e.t0.message);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),F=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t,"/clone"),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,_()({url:r,method:"POST"});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",D(a.message));case 11:return localStorage.setItem("tpcCacheBuster",T()),e.next=14,I();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=s()(o.a.mark((function e(t){var r,n,a,c,i;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t.template_id),query:N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)},C(t,"content"))}),e.prev=1,n={url:r,method:"POST",parse:!1},t.content&&(a={title:elementor.config.initial_document.settings.settings.post_title||"",version:"0.4",type:"page",content:t.content},n.data=a),e.next=6,_()(N({},n));case 6:if(!(c=e.sent).ok){e.next=13;break}return e.next=10,c.json();case 10:if(!(i=e.sent).message){e.next=13;break}return e.abrupt("return",D(i.message));case 13:return localStorage.setItem("tpcCacheBuster",T()),e.next=16,I();case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[1,18]])})));return function(t){return e.apply(this,arguments)}}(),U=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:N({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,_()({url:r,method:"POST"});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",D(a.message));case 11:return localStorage.setItem("tpcCacheBuster",T()),e.next=14,I();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=s()(o.a.mark((function e(t){var r,n,a,c,i,l,s,u,p,m,d;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.title,n=t.type,a=t.content,c=t.link,i=void 0===c?"":c,l=t.callback,s=void 0===l?function(){}:l,u={version:"0.4",title:r,type:n,content:a},p=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:N(N({},C(tiTpc.params,"meta")),{},{meta:"page"===n?JSON.stringify(tiTpc.params.meta):"",template_name:r||window.tiTpc.exporter.textPlaceholder,template_type:"elementor",link:i})}),e.prev=3,e.next=6,_()({url:p,method:"POST",data:u,parse:!1});case 6:if(!(m=e.sent).ok){e.next=12;break}return e.next=10,m.json();case 10:(d=e.sent).message?D(d.message):(s(d),window.localStorage.setItem("tpcCacheBuster",T()),D(window.tiTpc.exporter.templateSaved));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),e.t0.message&&D(e.t0.message);case 17:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(t){return e.apply(this,arguments)}}(),V=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t.template_id,"/publish"),query:N(N({cache:localStorage.getItem("tpcCacheBuster"),method:"POST"},C(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)},C(t,"template_id"))}),e.prev=1,e.next=4,_()({url:r,method:"POST",headers:{Authorization:"Bearer ".concat(window.tiTpc.bearer||""," ")}});case 4:if(!(n=e.sent).ok){e.next=14;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=12;break}return D(a.message),e.abrupt("return",{success:!1});case 12:e.next=17;break;case 14:if(!n.message){e.next=17;break}return D(n.message),e.abrupt("return",{success:!1});case 17:return localStorage.setItem("tpcCacheBuster",T()),e.abrupt("return",{success:!0});case 21:if(e.prev=21,e.t0=e.catch(1),!e.t0.message){e.next=26;break}return D(e.t0.message),e.abrupt("return",{success:!1});case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t){return e.apply(this,arguments)}}();3===parseInt(window.tiTpc.tier)&&(elementor.on("document:loaded",(function(){s()(o.a.mark((function e(){var t,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(["wp-post","wp-page"].includes(elementor.config.document.type)){e.next=2;break}return e.abrupt("return",null);case 2:if(t=elementor.config.document.id,"page"!==window.tiTpc.postType){e.next=9;break}return e.next=6,new wp.api.models.Page({id:t});case 6:window.tiTpc.postModel=e.sent,e.next=12;break;case 9:return e.next=11,new wp.api.models.Post({id:t});case 11:window.tiTpc.postModel=e.sent;case 12:return e.next=14,window.tiTpc.postModel.fetch();case 14:(r=document.querySelector("button#elementor-panel-saver-button-publish")).addEventListener("click",s()(o.a.mark((function e(){var t,n,a,c,i;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.tiTpc.postModel.fetch();case 2:return t=window.tiTpc.postModel.getMetas(),n=t._ti_tpc_template_sync,a=t._ti_tpc_template_id,e.next=5,L(a);case 5:if(c=e.sent,r.className.includes("elementor-disabled")||!n||!a||!c){e.next=10;break}return i=elementor.elements.toJSON({remove:["default","editSettings","defaultEditSettings"]}),e.next=10,A({template_id:a,template_name:elementor.config.initial_document.settings.settings.post_title||"",content:i,meta:JSON.stringify(tiTpc.params.meta)});case 10:case"end":return e.stop()}}),e)}))));case 16:case"end":return e.stop()}}),e)})))()})),document.addEventListener("DOMContentLoaded",(function(){var e=function(e){var t=e.content,r=Object(u.useState)(""),n=c()(r,2),a=n[0],i=n[1],l=Object(u.useState)(!1),p=c()(l,2),b=p[0],f=p[1],g=function(){Object(u.unmountComponentAtNode)(document.getElementById("ti-tpc-modal"))},w=function(){var e=s()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,R({title:a,type:"section",content:[t]});case 3:f(!1),g();case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)(d.Modal,{title:window.tiTpc.exporter.modalLabel,onRequestClose:g,overlayClassName:m()({"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)(d.TextControl,{label:window.tiTpc.exporter.textLabel,placeholder:window.tiTpc.exporter.textPlaceholder,value:a,onChange:i}),Object(u.createElement)(d.Button,{isPrimary:!0,isBusy:b,disabled:b,onClick:w},window.tiTpc.exporter.buttonLabel))};elementor.hooks.addFilter("elements/section/contextMenuGroups",(function(t,r){var n={name:"ti_tpc_export",title:window.tiTpc.exporter.exportLabel,callback:function(){return function(t){var r=t.model.toJSON({remove:["default","editSettings","defaultEditSettings"]}),n=document.createElement("div");n.id="ti-tpc-modal",document.body.appendChild(n),Object(u.render)(Object(u.createElement)(e,{content:r}),document.getElementById("ti-tpc-modal"))}(r)}},a=t.find((function(e){return"save"===e.name}));if(a)a.actions.push(n);else{var c={name:"ti_tpc_export",actions:[n]};t.splice(3,0,c),t.join()}return t}))})));var G=r(12),H=r(5);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $=function(e){var t=e.title;return Object(u.createElement)(H.SVG,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tpc-template-cloud-icon",title:t},Object(u.createElement)(H.Path,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(u.createElement)(H.Path,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(u.createElement)(H.Path,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},Y=Object(G.compose)(Object(P.withSelect)((function(e){var t=e("tpc/elementor"),r=t.isFetching,n=t.isPreview,a=t.getCurrentTab,c=t.getPreview;return{isFetching:r(),isPreview:n(),currentTab:a(),preview:c()}})),Object(P.withDispatch)((function(e){var t=e("tpc/elementor");return{setFetching:t.setFetching,togglePreview:t.togglePreview,updateCurrentTab:t.updateCurrentTab}})))((function(e){var t=e.getSearchQuery,r=e.getOrder,n=e.onImport,a=e.isFetching,c=e.isPreview,i=e.currentTab,l=e.preview,p=e.setFetching,b=e.togglePreview,f=e.updateCurrentTab,g=function(){var e=s()(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.localStorage.setItem("tpcCacheBuster",T()),p(!0),n=r(),e.next=5,M(q({search:t()},n));case 5:return e.next=7,I(q({search:t()},n));case 7:p(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)("div",{className:m()("dialog-header dialog-lightbox-header",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header"},Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__logo-area"},c?Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-header-preview-back",onClick:b},Object(u.createElement)("i",{className:"eicon-","aria-hidden":"true"}),Object(u.createElement)("span",null,window.tiTpc.library.actions.back)):Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__logo"},Object(u.createElement)($,{title:window.tiTpc.library.templatesCloud}))),!c&&Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__menu-area"},Object(u.createElement)(d.Button,{className:m()("ti-tpc-template-library-menu-item",{"is-active":"templates"===i}),onClick:function(){return f("templates")}},window.tiTpc.library.tabs.templates),3===parseInt(window.tiTpc.tier)&&Object(u.createElement)(d.Button,{className:m()("ti-tpc-template-library-menu-item",{"is-active":"library"===i}),onClick:function(){return f("library")}},window.tiTpc.library.tabs.library)),Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__items-area"},Object(u.createElement)("div",{className:"ti-tpc-template-library-header-tools"},c?Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__item ti-tpc-template-library-header-preview-insert-wrapper"},Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-insert elementor-button",onClick:function(){return n({id:l.template_id,title:l.template_name,meta:l.meta||[]})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-button-title"},window.tiTpc.library.actions.insert))):Object(u.createElement)("div",{className:"ti-tpc-template-library-header-actions"},"library"===i&&Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item",onClick:g},Object(u.createElement)("i",{className:m()("eicon-sync",{"eicon-animation-spin":a}),"aria-hidden":"true",title:window.tiTpc.library.actions.sync}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.actions.sync)),["wp-post","wp-page"].includes(elementor.config.document.type)&&3===parseInt(window.tiTpc.tier)&&Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item",onClick:function(){return f("export")}},Object(u.createElement)("i",{className:"eicon-save-o","aria-hidden":"true",title:window.tiTpc.library.save}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.save)))),Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item ti-tpc-templates-modal__header__close",onClick:window.tiTpcModal.hide},Object(u.createElement)("i",{className:"eicon-close","aria-hidden":"true",title:window.tiTpc.library.actions.close}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.actions.close)))))})),J=Object(u.createElement)(H.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(H.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})),Z=r(16),Q=r(11);function W(e){return[null,void 0].includes(e)}function K(e){var t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom,left:t.left,right:t.right}}function X(e,t,r){if(e){var n=K(e),a=n.left,c=n.right,i=n.top,o=n.bottom;if(a>r)return!1;if(c<0)return!1;if(i>t)return!1;if(o<0)return!1}return!0}var ee=function(e){var t,r,n,a=e.loading,c=e.hasNextPage,i=e.onLoadMore,o=e.threshold,l=void 0===o?150:o,s=e.checkInterval,u=void 0===s?200:s,p=e.scrollContainer,m=void 0===p?"window":p,d=Object(Q.useRef)(null),b=function(){var e="object"==typeof window,t=Object(Q.useCallback)((function(){return{width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0}}),[e]),r=Object(Q.useState)(t()),n=r[0],a=r[1];return Object(Q.useEffect)((function(){function r(){a(t())}if(e)return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}}),[t,e]),n}(),f=b.height,g=b.width,w=Object(Q.useState)(!0),y=w[0],h=w[1];return Object(Q.useEffect)((function(){a||h(!0)}),[a]),t=function(){!function(){if(y&&!a&&c&&d.current){if("parent"===m){if(!(n=null===(r=d.current)||void 0===r?void 0:r.parentNode)||W(f)||W(g)||!X(n,f,g))return}else if(!(t=d.current)||W(f)||W(g)||!X(t,f,g))return;var e=function(){var e=d.current;if(!e||W(f))return null;var t=e.getBoundingClientRect().bottom,r=t-f;if("parent"===m){var n=e.parentNode;if(!n)return null;r=t-K(n).bottom}return r}();if(W(e))return;e<l&&(h(!1),i())}var t,r,n}()},r=c?u:0,n=Object(Q.useRef)(null),Object(Q.useEffect)((function(){n.current=t}),[t]),Object(Q.useEffect)((function(){if(r){var e=setInterval((function(){var e;null===(e=n.current)||void 0===e||e.call(n)}),r);return function(){clearInterval(e)}}}),[r]),d},te=Object(u.createElement)(H.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(H.Path,{d:"M7.5 12C7.5 11.1716 6.82843 10.5 6 10.5C5.17157 10.5 4.5 11.1716 4.5 12C4.5 12.8284 5.17157 13.5 6 13.5C6.82843 13.5 7.5 12.8284 7.5 12Z"}),Object(u.createElement)(H.Path,{d:"M13.5 12C13.5 11.1716 12.8284 10.5 12 10.5C11.1716 10.5 10.5 11.1716 10.5 12C10.5 12.8284 11.1716 13.5 12 13.5C12.8284 13.5 13.5 12.8284 13.5 12Z"}),Object(u.createElement)(H.Path,{d:"M19.5 12C19.5 11.1716 18.8284 10.5 18 10.5C17.1716 10.5 16.5 11.1716 16.5 12C16.5 12.8284 17.1716 13.5 18 13.5C18.8284 13.5 19.5 12.8284 19.5 12Z"})),re=Object(u.createElement)(H.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(H.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),ne=Object(u.createElement)(H.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(H.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"})),ae=Object(u.createElement)(H.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(u.createElement)(H.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"}));function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ie=Object(P.withDispatch)((function(e){var t=e("tpc/elementor");return{togglePreview:t.togglePreview,setPreviewData:t.setPreviewData}}))((function(e){var t=e.table,r=void 0!==t&&t,n=e.item,a=e.id,i=e.title,o=e.meta,l=e.thumbnail,s=e.onImport,p=e.onUpdateTemplate,m=e.onDelete,b=e.onDuplicate,f=e.togglePreview,g=e.setPreviewData,y=Object(u.useState)(!1),h=c()(y,2),v=h[0],O=h[1],j=Object(u.useState)(i),E=c()(j,2),x=E[0],T=E[1];return r?Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-item"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},v?Object(u.createElement)(u.Fragment,null,Object(u.createElement)("input",{type:"text",value:x,onChange:function(e){return T(e.target.value)}}),Object(u.createElement)(d.Button,{className:"elementor-button",onClick:function(){return p(a,x)}},Object(u.createElement)("i",{className:"eicon-check","aria-hidden":"true",title:window.tiTpc.library.actions.save}),Object(u.createElement)("span",{className:"elementor-button-title elementor-hidden"},window.tiTpc.library.actions.save)),Object(u.createElement)(d.Button,{className:"elementor-button",onClick:function(){return O(!1)}},Object(u.createElement)("i",{className:"eicon-editor-close","aria-hidden":"true",title:window.tiTpc.library.actions.cancel}),Object(u.createElement)("span",{className:"elementor-button-title elementor-hidden"},window.tiTpc.library.actions.cancel))):i),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},moment(n.date).format("MMMM D, YYYY")),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},moment(n.modified).format("MMMM D, YYYY")),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,{className:"elementor-button elementor-button-success",onClick:function(){return s({id:a,title:i,meta:o})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-button-title"},window.tiTpc.library.actions.insert)),Object(u.createElement)(d.DropdownMenu,{icon:te,label:window.tiTpc.library.filters.sortLabels.actions,popoverProps:{position:"bottom right",noArrow:!1},controls:[{title:window.tiTpc.library.actions.edit,icon:re,isDisabled:!!n.link,onClick:function(){return O(!0)}},{title:window.tiTpc.library.actions.duplicate,icon:ne,onClick:function(){return b(a)}},{title:window.tiTpc.library.actions.delete,icon:ae,onClick:function(){return m(a)}}]}))):Object(u.createElement)("div",{className:"ti-tpc-template-library-template"},Object(u.createElement)("div",{className:"ti-tpc-template-library-template-body"},Object(u.createElement)("div",{className:"ti-tpc-template-library-template-screenshot",style:{backgroundImage:"url( ".concat(l,")")}}),Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-preview",onClick:function(){f(),g(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n))}},Object(u.createElement)("i",{className:"eicon-zoom-in-bold","aria-hidden":"true"}))),Object(u.createElement)("div",{className:"ti-tpc-template-library-template-footer"},Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-action elementor-button",onClick:function(){return s({id:a,title:i,meta:o})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",null,window.tiTpc.library.actions.insert)),Object(u.createElement)("div",{className:"ti-tpc-template-library-template-name"},i)))}));function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var se={template_name:window.tiTpc.library.filters.sortLabels.name,date:window.tiTpc.library.filters.sortLabels.date,modified:window.tiTpc.library.filters.sortLabels.modified},ue=Object(P.withSelect)((function(e,t){var r=t.isGeneral?e("tpc/elementor").getTemplates():e("tpc/elementor").getLibrary(),n=r.items;return{items:void 0===n?[]:n,currentPage:r.currentPage,totalPages:r.totalPages}}))((function(e){var t=e.getSearchQuery,r=e.getOrder,n=e.setSorting,a=e.onImport,i=e.onUpdateTemplate,l=e.onDelete,p=e.onDuplicate,b=e.isGeneral,f=e.items,g=e.currentPage,w=e.totalPages,y=Object(u.useState)(!1),h=c()(y,2),v=h[0],O=h[1],j=ee({loading:v,hasNextPage:g!==w,onLoadMore:function(){var e=s()(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g!==w){e.next=2;break}return e.abrupt("return");case 2:if(O(!0),n=r(),!b){e.next=9;break}return e.next=7,M(le({search:t(),page:g+1,isScroll:!0},n));case 7:e.next=11;break;case 9:return e.next=11,I(le({search:t(),page:g+1,isScroll:!0},n));case 11:O(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),threshold:1});return Object(u.createElement)("div",{className:m()("ti-tpc-template-library-templates-container",{"is-table":!b}),ref:j},b?f.map((function(e){return Object(u.createElement)(ie,{key:e.template_id,item:e,id:e.template_id,title:e.template_name,thumbnail:e.template_thumbnail,onImport:a})})):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-header"},Object.keys(se).map((function(e){return Object(u.createElement)("div",{key:e,className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,{className:m()({"is-selected":e===r().orderby,"is-asc":"ASC"===r().order}),onClick:function(){var t={order:"DESC",orderby:e};e===r().orderby&&"DESC"===r().order&&(t.order="ASC"),n(le({},t))}},se[e]))})),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,null,window.tiTpc.library.filters.sortLabels.actions))),f.map((function(e){return Object(u.createElement)(ie,{table:!0,key:e.template_id,item:e,id:e.template_id,title:e.template_name,meta:e.meta||[],onImport:a,onUpdateTemplate:i,onDelete:l,onDuplicate:function(e){return p(e)}})}))),0===f.length&&(b?Object(u.createElement)("p",null,"No templates found. Check again later!"):Object(u.createElement)("p",null,"No templates available. Try adding few templates.")),v&&Object(u.createElement)(d.Placeholder,null,Object(u.createElement)(d.Spinner,null)))})),pe=Object(P.withDispatch)((function(e){return{updateCurrentTab:e("tpc/elementor").updateCurrentTab}}))((function(e){var t=e.updateCurrentTab;Object(u.useEffect)((function(){var e=window.tiTpc.postModel.getMetas(),t=e._ti_tpc_template_sync,r=e._ti_tpc_template_id,n=e._ti_tpc_screenshot_url,a=e._ti_tpc_site_slug,c=e._ti_tpc_published;g(Boolean(t)),v(r),x(n),P(a),D(Boolean(c))}),[]);var r=elementor.config.initial_document.settings.settings.post_title||"",n=Object(u.useState)(!1),a=c()(n,2),i=a[0],l=a[1],p=Object(u.useState)(!1),b=c()(p,2),f=b[0],g=b[1],w=Object(u.useState)(""),y=c()(w,2),h=y[0],v=y[1],O=Object(u.useState)(""),j=c()(O,2),E=j[0],x=j[1],T=Object(u.useState)(""),k=c()(T,2),_=k[0],P=k[1],S=Object(u.useState)(""),N=c()(S,2),C=N[0],D=N[1],M=function(){var e=s()(o.a.mark((function e(){var n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l(!0),n=elementor.elements.toJSON({remove:["default","editSettings","defaultEditSettings"]}),a=!1,!h){e.next=7;break}return e.next=6,L(h);case 6:a=e.sent;case 7:if(!a){e.next=12;break}return e.next=10,A({template_id:h,template_name:r,content:n,link:elementor.config.initial_document.urls.permalink,meta:JSON.stringify(tiTpc.params.meta)});case 10:e.next=14;break;case 12:return e.next=14,R({title:r,type:"page",content:n,link:elementor.config.initial_document.urls.permalink,callback:function(e){v(e.template_id),window.tiTpc.postModel.set("meta",{_ti_tpc_template_id:e.template_id,_ti_tpc_template_sync:f}),window.tiTpc.postModel.save()}});case 14:l(!1),t("library");case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=s()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.next=3,V({template_id:h,template_site_slug:_,template_thumbnail:E,premade:C?"no":"yes",link:elementor.config.initial_document.urls.permalink}).then((function(e){e.success&&(elementor.notifications.showToast({message:C?window.tiTpc.exporter.templateUnpublished:window.tiTpc.exporter.templatePublished}),D(!C),window.tiTpc.postModel.set("meta",{_ti_tpc_template_id:h,_ti_tpc_template_sync:f,_ti_tpc_screenshot_url:E,_ti_tpc_site_slug:_,_ti_tpc_published:!C}),window.tiTpc.postModel.save())}));case 3:l(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)("div",{className:"dialog-message dialog-lightbox-message"},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-export"},Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-icon"},Object(u.createElement)("i",{className:"eicon-library-save","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.export.save)),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-title"},window.tiTpc.library.export.title),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",value:elementor.config.initial_document.settings.settings.post_title,disabled:!0}),Object(u.createElement)(d.Button,{className:m()("elementor-button elementor-button-success",{"elementor-button-state":i}),onClick:M},Object(u.createElement)("span",{className:"elementor-state-icon"},Object(u.createElement)("i",{className:"eicon-loading eicon-animation-spin","aria-hidden":"true"})),window.tiTpc.library.export.save)),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)(d.ToggleControl,{label:window.tiTpc.exporter.toggleLabel,checked:f,onChange:function(){return g(!f)}})),window.tiTpc.canPredefine&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-screenshot",className:"ti-tpc-template-library-blank-field-input-label"},window.tiTpc.library.export.labelScreenshot),Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",id:"ti-tpc-template-screenshot",value:E,onChange:function(e){return x(e.target.value)}})),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-slug",className:"ti-tpc-template-library-blank-field-input-label"},window.tiTpc.library.export.labelSlug),Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",id:"ti-tpc-template-slug",value:_,onChange:function(e){return P(e.target.value)}})),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)(d.Button,{className:m()("elementor-button elementor-button-success",{"elementor-button-state":i}),onClick:I},Object(u.createElement)("span",{className:"elementor-state-icon"},Object(u.createElement)("i",{className:"eicon-loading eicon-animation-spin","aria-hidden":"true"})),C?window.tiTpc.library.export.unpublish:window.tiTpc.library.export.publish))))))}));function me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?me(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be={date:window.tiTpc.library.filters.sortLabels.date,template_name:window.tiTpc.library.filters.sortLabels.name,modified:window.tiTpc.library.filters.sortLabels.modified},fe=Object(G.compose)(Object(P.withSelect)((function(e){var t=e("tpc/elementor"),r=t.isFetching,n=t.isPreview,a=t.getCurrentTab,c=t.getPreview;return{isFetching:r(),isPreview:n(),currentTab:a(),preview:c()}})),Object(P.withDispatch)((function(e){return{setFetching:e("tpc/elementor").setFetching}})))((function(e){var t=e.setQuery,r=e.getSearchQuery,n=e.setSorting,a=e.getOrder,c=e.isSearch,i=e.setSearch,l=e.onImport,p=e.isFetching,b=e.isPreview,f=e.currentTab,g=e.preview,w=e.setFetching,y=function(){var e=s()(o.a.mark((function e(){var t,n,c=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:r(),w(!0),i(!!t),n=a(),"templates"!==f){e.next=9;break}return e.next=7,M(de({search:t},n));case 7:e.next=11;break;case 9:return e.next=11,I(de({search:t},n));case 11:w(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(u.useEffect)((function(){y()}),[f,a()]);var h="templates"===f,v=function(){var e=s()(o.a.mark((function e(t,r){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,A({template_id:t,template_name:r});case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),O=function(){var e=s()(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,U(t);case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=s()(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,F(t);case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return b?Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-preview"},Object(u.createElement)("iframe",{title:g.template_name,src:g.link||""}),Object(u.createElement)("div",{className:"is-loading"},Object(u.createElement)(d.Icon,{icon:J}))))):p?Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content is-loading"},Object(u.createElement)(d.Spinner,null))):"export"===f?Object(u.createElement)(pe,null):Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters"},h&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters-label"},window.tiTpc.library.filters.sortLabel),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters-filter"},Object.keys(be).map((function(e){return Object(u.createElement)(d.Button,{key:e,className:m()({"is-selected":e===a().orderby,"is-asc":"ASC"===a().order}),onClick:function(){var t={order:"DESC",orderby:e};e===a().orderby&&"DESC"===a().order&&(t.order="ASC"),n(de({},t))}},be[e])}))))),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-search"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-library-filter-search",className:"elementor-screen-only"},window.tiTpc.library.filters.searchLabel),Object(u.createElement)("input",{id:"ti-tpc-template-library-filter-search",placeholder:window.tiTpc.library.filters.search,value:r(),onChange:function(e){return t(e.target.value)},onKeyDown:function(e){e.keyCode===Z.ENTER&&y()}}),c?Object(u.createElement)(d.Button,{onClick:function(){t(""),y("")}},Object(u.createElement)("i",{className:"eicon-close"})):Object(u.createElement)(d.Button,{onClick:function(){return y()}},Object(u.createElement)("i",{className:"eicon-search"})))),["templates","library"].includes(f)&&Object(u.createElement)(ue,{getSearchQuery:function(){return r()},getOrder:a,setSorting:n,onImport:l,onUpdateTemplate:v,onDelete:O,onDuplicate:j,isFetching:p,isGeneral:h}))))}));function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ye=Object(G.compose)(Object(P.withSelect)((function(e){return{currentTab:(0,e("tpc/elementor").getCurrentTab)()}})),Object(P.withDispatch)((function(e){return{setFetching:e("tpc/elementor").setFetching}})))((function(e){var t=e.currentTab,r=e.setFetching,n=Object(u.useState)({templates:"",library:""}),a=c()(n,2),i=a[0],l=a[1],p=Object(u.useState)({templates:{order:"DESC",orderby:"date"},library:{order:"DESC",orderby:"date"}}),m=c()(p,2),d=m[0],b=m[1],f=Object(u.useState)({templates:!1,library:!1}),g=c()(f,2),w=g[0],y=g[1],h="templates"===t,v=function(){return h?i.templates:i.library},O=function(){return h?d.templates:d.library},j=function e(t){if(t.id=elementorCommon.helpers.getUniqueId(),0<t.elements.length)for(var r=0;r<t.elements.length;r++)t.elements[r]=e(t.elements[r]);return t},E=function(){var e=s()(o.a.mark((function e(t){var n,a,c,i,l,s,u,p,m;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.id,a=t.title,c=t.meta,i=void 0===c?[]:c,r(!0),e.next=4,B(n);case 4:if(l=e.sent){e.next=7;break}return e.abrupt("return",r(!1));case 7:for(s=$e.internal("document/history/start-log",{type:"add",title:"".concat(window.tiTpc.library.historyMessage," ").concat(a)}),u=Number(window.tiTpc.placeholder),p=l.content,m=0;m<p.length;m++)p[m]=j(p[m]),$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:p[m],options:u>=0?{at:u++}:{}});0<i.length&&(window.tiTpc.postModel.set("meta",we({},JSON.parse(i))),window.tiTpc.postModel.save()),$e.internal("document/history/end-log",{id:s}),window.tiTpcModal.hide(),r(!1);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(Y,{getSearchQuery:v,getOrder:O,onImport:E}),Object(u.createElement)(fe,{setQuery:function(e){return l(we(we({},i),{},h?{templates:e}:{library:e}))},getSearchQuery:v,setSorting:function(e){return b(we(we({},d),{},h?{templates:e}:{library:e}))},getOrder:O,isSearch:h?w.templates:w.library,setSearch:function(e){return y(we(we({},w),{},h?{templates:e}:{library:e}))},onImport:E}))}));void 0!==elementorCommon&&(window.tiTpcModal=elementorCommon.dialogsManager.createWidget("lightbox",{id:"ti-tpc-templates-modal",className:"ti-tpc-templates-modal",hide:{auto:!1,onClick:!1,onOutsideClick:!1,onOutsideContextMenu:!1,onBackgroundClick:!0},position:{my:"center",at:"center"},onShow:function(){var e=window.tiTpcModal.getElements("content");document.getElementById("ti-tpc-templates-modal-content")||e.append('<div id="ti-tpc-templates-modal-content" class="wrap"></div>')}}),window.tiTpcModal.getElements("header").remove(),window.tiTpcModal.getElements("message").remove(),window.tiTpcModal.getElements("widgetContent").append(window.tiTpcModal.addElement("content")));var he=document.getElementById("tmpl-elementor-add-section");if(he){var ve=he.textContent;he.textContent=ve.replace('<div class="elementor-add-section-drag-title">Drag widget here</div>','<div class="elementor-add-section-area-button elementor-templates-cloud-button" title="'.concat(window.tiTpc.library.libraryButton,'"><svg width="100" height="100" viewBox="10 10 80 80" fill="none" xmlns="http://www.w3.org/2000/svg" class="tpc-template-cloud-icon" role="img" aria-hidden="true" focusable="false"><path d="M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z" fill="#0366D6"></path><path d="M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z" fill="white"></path><path d="M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z" fill="white" style=""></path></svg></div> <div class="elementor-add-section-drag-title">Drag widget here</div>'))}function Oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}elementor.on("preview:loaded",(function(){elementor.$previewContents[0].body.addEventListener("click",(function(e){(-1<Array.from(e.target.classList).indexOf("elementor-templates-cloud-button")||-1<Array.from(e.target.classList).indexOf("tpc-template-cloud-icon")||-1<Array.from(e.target.parentNode.classList).indexOf("tpc-template-cloud-icon"))&&function(e){window.tiTpcModal.show();var t=elementor.$previewContents[0].body.querySelector(".elementor-section-wrap"),r=e.closest(".elementor-add-section");window.tiTpc.placeholder=Array.from(t.childNodes).indexOf(r),Object(u.render)(Object(u.createElement)(ye,null),document.getElementById("ti-tpc-templates-modal-content")),window.tiTpcModal.refreshPosition()}(e.target)}))}));var Ee={isFetching:!0,isPreview:!1,tab:3===parseInt(window.tiTpc.tier)?"library":"templates",templates:[],library:{items:[],currentPage:0,totalPages:0},preview:{}};Object(P.registerStore)("tpc/elementor",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ee,t=arguments.length>1?arguments[1]:void 0;return"SET_FETCHING"===t.type?je(je({},e),{},{isFetching:t.isFetching}):"TOGGLE_PREVIEW"===t.type?je(je({},e),{},{isPreview:!e.isPreview}):"UPDATE_CURRENT_TAB"===t.type?je(je({},e),{},{tab:t.tab}):"UPDATE_TEMPLATES"===t.type?je(je({},e),{},{templates:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"UPDATE_LIBRARY"===t.type?je(je({},e),{},{library:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"SET_PREVIEW_DATA"===t.type?je(je({},e),{},{preview:t.preview}):e},selectors:{isFetching:function(e){return e.isFetching},isPreview:function(e){return e.isPreview},getCurrentTab:function(e){return e.tab},getTemplates:function(e){return e.templates},getLibrary:function(e){return e.library},getPreview:function(e){return e.preview}},actions:{setFetching:function(e){return{type:"SET_FETCHING",isFetching:e}},togglePreview:function(e){return{type:"TOGGLE_PREVIEW",isPreview:e}},updateCurrentTab:function(e){return{type:"UPDATE_CURRENT_TAB",tab:e}},updateTemplates:function(e,t,r){return{type:"UPDATE_TEMPLATES",items:e,currentPage:t,totalPages:r}},updateLibrary:function(e,t,r){return{type:"UPDATE_LIBRARY",items:e,currentPage:t,totalPages:r}},setPreviewData:function(e){return{type:"SET_PREVIEW_DATA",preview:e}}}}),r(28)}]);
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=30)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.regeneratorRuntime},function(e,t){e.exports=window.wp.components},function(e,t){function r(e,t,r,n,a,c,i){try{var o=e[c](i),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,a)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(a,c){var i=e.apply(t,n);function o(e){r(i,a,c,o,l,"next",e)}function l(e){r(i,a,c,o,l,"throw",e)}o(void 0)}))}}},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.primitives},function(e,t,r){var n=r(20),a=r(21),c=r(14),i=r(22);e.exports=function(e,t){return n(e)||a(e,t)||c(e,t)||i()}},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)&&n.length){var i=a.apply(null,n);i&&e.push(i)}else if("object"===c)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){"use strict";const n=r(26),a=r(27),c=r(28);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function l(e,t){return t.decode?a(e):e}function s(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=s(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const a="string"==typeof r&&r.includes(e.arrayFormatSeparator),c="string"==typeof r&&!a&&l(r,e).includes(e.arrayFormatSeparator);r=c?l(r,e):r;const i=a||c?r.split(e.arrayFormatSeparator).map(t=>l(t,e)):null===r?r:l(r,e);n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const a of e.split("&")){let[e,i]=c(t.decode?a.replace(/\+/g," "):a,"=");i=void 0===i?null:["comma","separator"].includes(t.arrayFormat)?i:l(i,t),r(l(e,t),i,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=u,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const a=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[",a,"]"].join("")]:[...r,[o(t,e),"[",o(a,e),"]=",o(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[]"].join("")]:[...r,[o(t,e),"[]=",o(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[o(t,e),"=",o(n,e)].join("")]:[[r,o(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,o(t,e)]:[...r,[o(t,e),"=",o(n,e)].join("")]}}(t),a={};for(const t of Object.keys(e))r(t)||(a[t]=e[t]);const c=Object.keys(a);return!1!==t.sort&&c.sort(t.sort),c.map(r=>{const a=e[r];return void 0===a?"":null===a?o(r,t):Array.isArray(a)?a.reduce(n(r),[]).join("&"):o(r,t)+"="+o(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=c(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(u(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:l(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=s(e.url).split("?")[0]||"",a=t.extract(e.url),c=t.parse(a,{sort:!1}),i=Object.assign(c,e.query);let l=t.stringify(i,r);l&&(l="?"+l);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+o(e.fragmentIdentifier,r)),`${n}${l}${u}`}},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.compose},function(e,t,r){var n=r(23),a=r(24),c=r(14),i=r(25);e.exports=function(e){return n(e)||a(e)||c(e)||i()}},function(e,t,r){var n=r(15);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t){e.exports=window.wp.keycodes},,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,c=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,c=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw c}}return r}}},function(e,t){e.exports=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(e,t,r){var n=r(15);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=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(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function c(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],c(r),c(n))}function i(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=c(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=a.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=i(r[0]);n!==r[0]&&(t[r[0]]=n)}r=a.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),o=0;o<c.length;o++){var l=c[o];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){},function(e,t,r){"use strict";r.r(t);var n,a=r(6),c=r.n(a),i=r(1),o=r.n(i),l=r(3),s=r.n(l),u=r(0),p=r(7),m=r.n(p),d=r(2),b=r(13),f=r.n(b),g=r(8),w=r.n(g),y=r(9),h=new Uint8Array(16);function v(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(h)}for(var O=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,j=function(e){return"string"==typeof e&&O.test(e)},E=[],x=0;x<256;++x)E.push((x+256).toString(16).substr(1));var _=function(e,t,r){var n=(e=e||{}).random||(e.rng||v)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+"-"+E[e[t+4]]+E[e[t+5]]+"-"+E[e[t+6]]+E[e[t+7]]+"-"+E[e[t+8]]+E[e[t+9]]+"-"+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase();if(!j(r))throw TypeError("Stringified UUID is invalid");return r}(n)},T=r(10),k=r.n(T),P=r(4);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var C=lodash.omit,D=function(e){return elementor.notifications.showToast({message:e})},M=function(){var e=s()(o.a.mark((function e(){var t,r,n,a,c,i,l,s,u,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),{},{per_page:20,page:0,premade:!0,template_site_slug:"general"},C(t,"isScroll")),n=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"page-templates",query:r}),e.prev=3,e.next=6,k()({url:n,method:"GET",parse:!1});case 6:if(!(a=e.sent).ok){e.next=18;break}return e.next=10,a.json();case 10:if(!(c=e.sent).message){e.next=13;break}return e.abrupt("return",D(c.message));case 13:i=c,t.isScroll&&(l=Object(P.select)("tpc/elementor").getTemplates(),i=[].concat(f()(l.items),f()(c))),s=a.headers.get("x-wp-totalpages"),u=r.page,Object(P.dispatch)("tpc/elementor").updateTemplates(i,u,s);case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(3),e.t0.message&&D(e.t0.message);case 23:case"end":return e.stop()}}),e,null,[[3,20]])})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=s()(o.a.mark((function e(){var t,r,n,a,c,i,l,s,u,p=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>0&&void 0!==p[0]?p[0]:{},3===parseInt(window.tiTpc.tier)){e.next=3;break}return e.abrupt("return");case 3:return r=N({per_page:20,page:0},C(t,"isScroll")),n=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),r)}),e.prev=5,e.next=8,k()({url:n,method:"GET",parse:!1});case 8:if(!(a=e.sent).ok){e.next=20;break}return e.next=12,a.json();case 12:if(!(c=e.sent).message){e.next=15;break}return e.abrupt("return",D(c.message));case 15:i=c,t.isScroll&&(l=Object(P.select)("tpc/elementor").getLibrary(),i=[].concat(f()(l.items),f()(c))),s=a.headers.get("x-wp-totalpages"),u=r.page,Object(P.dispatch)("tpc/elementor").updateLibrary(i,u,s);case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(5),e.t0.message&&D(e.t0.message);case 25:case"end":return e.stop()}}),e,null,[[5,22]])})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=s()(o.a.mark((function e(t){var r,n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,k()({url:r,method:"GET",parse:!1});case 4:if(!(n=e.sent).ok){e.next=12;break}return e.next=8,n.json();case 8:if(!e.sent.message){e.next=11;break}return e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t){return e.apply(this,arguments)}}(),B=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t,"/import"),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),n={},e.prev=2,e.next=5,k()({url:r,method:"GET",parse:!1});case 5:if(!(a=e.sent).ok){e.next=12;break}return e.next=9,a.json();case 9:if(!(n=e.sent).message){e.next=12;break}return e.abrupt("return",D(n.message));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0.message&&D(e.t0.message);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),F=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t,"/clone"),query:N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,k()({url:r,method:"POST"});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",D(a.message));case 11:return localStorage.setItem("tpcCacheBuster",_()),e.next=14,I();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=s()(o.a.mark((function e(t){var r,n,a,c,i;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t.template_id),query:N(N({cache:localStorage.getItem("tpcCacheBuster")},C(tiTpc.params,"meta")),{},{meta:JSON.stringify(tiTpc.params.meta)},C(t,"content"))}),e.prev=1,n={url:r,method:"POST",parse:!1},t.content&&(a={title:elementor.config.initial_document.settings.settings.post_title||"",version:"0.4",type:"page",content:t.content},n.data=a),e.next=6,k()(N({},n));case 6:if(!(c=e.sent).ok){e.next=13;break}return e.next=10,c.json();case 10:if(!(i=e.sent).message){e.next=13;break}return e.abrupt("return",D(i.message));case 13:return localStorage.setItem("tpcCacheBuster",_()),e.next=16,I();case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[1,18]])})));return function(t){return e.apply(this,arguments)}}(),U=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t),query:N({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},C(tiTpc.params,"meta"))}),e.prev=1,e.next=4,k()({url:r,method:"POST"});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=11;break}return e.abrupt("return",D(a.message));case 11:return localStorage.setItem("tpcCacheBuster",_()),e.next=14,I();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&D(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),R=function(){var e=s()(o.a.mark((function e(t){var r,n,a,c,i,l,s,u,p,m,d,b,f;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.title,n=t.type,a=t.content,c=t.link,i=void 0===c?"":c,l=t.callback,s=void 0===l?function(){}:l,u={version:"0.4",title:r,type:n,content:a},p=window.tiTpc.params.meta,(m=elementor.documents.getCurrent().container.settings.get("template"))&&(p._wp_page_template=m),d=Object(y.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:N(N({},C(tiTpc.params,"meta")),{},{meta:"page"===n?JSON.stringify(p):"",template_name:r||window.tiTpc.exporter.textPlaceholder,template_type:"elementor",link:i})}),e.prev=6,e.next=9,k()({url:d,method:"POST",data:u,parse:!1});case 9:if(!(b=e.sent).ok){e.next=15;break}return e.next=13,b.json();case 13:(f=e.sent).message?D(f.message):(s(f),window.localStorage.setItem("tpcCacheBuster",_()),D(window.tiTpc.exporter.templateSaved));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(6),e.t0.message&&D(e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[6,17]])})));return function(t){return e.apply(this,arguments)}}(),V=function(){var e=s()(o.a.mark((function e(t){var r,n,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(y.stringifyUrl)({url:"".concat(window.tiTpc.endpoint,"templates/").concat(t.template_id,"/publish"),query:N(N({cache:localStorage.getItem("tpcCacheBuster"),method:"POST"},C(tiTpc.params,"meta")),C(t,"template_id"))}),e.prev=1,e.next=4,k()({url:r,method:"POST",headers:{Authorization:"Bearer ".concat(window.tiTpc.bearer||""," ")}});case 4:if(!(n=e.sent).ok){e.next=14;break}return e.next=8,n.json();case 8:if(!(a=e.sent).message){e.next=12;break}return D(a.message),e.abrupt("return",{success:!1});case 12:e.next=17;break;case 14:if(!n.message){e.next=17;break}return D(n.message),e.abrupt("return",{success:!1});case 17:return localStorage.setItem("tpcCacheBuster",_()),e.abrupt("return",{success:!0});case 21:if(e.prev=21,e.t0=e.catch(1),!e.t0.message){e.next=26;break}return D(e.t0.message),e.abrupt("return",{success:!1});case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t){return e.apply(this,arguments)}}();3===parseInt(window.tiTpc.tier)&&(elementor.on("document:loaded",(function(){s()(o.a.mark((function e(){var t,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(["wp-post","wp-page"].includes(elementor.config.document.type)){e.next=2;break}return e.abrupt("return",null);case 2:if(t=elementor.config.document.id,"page"!==window.tiTpc.postType){e.next=9;break}return e.next=6,new wp.api.models.Page({id:t});case 6:window.tiTpc.postModel=e.sent,e.next=12;break;case 9:return e.next=11,new wp.api.models.Post({id:t});case 11:window.tiTpc.postModel=e.sent;case 12:return e.next=14,window.tiTpc.postModel.fetch();case 14:(r=document.querySelector("button#elementor-panel-saver-button-publish")).addEventListener("click",s()(o.a.mark((function e(){var t,n,a,c,i,l,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.tiTpc.postModel.fetch();case 2:return t=window.tiTpc.postModel.getMetas(),n=t._ti_tpc_template_sync,a=t._ti_tpc_template_id,e.next=5,L(a);case 5:if(c=e.sent,r.className.includes("elementor-disabled")||!n||!a||!c){e.next=13;break}return i=elementor.elements.toJSON({remove:["default","editSettings","defaultEditSettings"]}),l=window.tiTpc.params.meta,(s=elementor.documents.getCurrent().container.settings.get("template"))&&(l._wp_page_template=s),e.next=13,A({template_id:a,template_name:elementor.config.initial_document.settings.settings.post_title||"",content:i,meta:JSON.stringify(l)});case 13:case"end":return e.stop()}}),e)}))));case 16:case"end":return e.stop()}}),e)})))()})),document.addEventListener("DOMContentLoaded",(function(){var e=function(e){var t=e.content,r=Object(u.useState)(""),n=c()(r,2),a=n[0],i=n[1],l=Object(u.useState)(!1),p=c()(l,2),b=p[0],f=p[1],g=function(){Object(u.unmountComponentAtNode)(document.getElementById("ti-tpc-modal"))},w=function(){var e=s()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,R({title:a,type:"section",content:[t]});case 3:f(!1),g();case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)(d.Modal,{title:window.tiTpc.exporter.modalLabel,onRequestClose:g,overlayClassName:m()({"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)(d.TextControl,{label:window.tiTpc.exporter.textLabel,placeholder:window.tiTpc.exporter.textPlaceholder,value:a,onChange:i}),Object(u.createElement)(d.Button,{isPrimary:!0,isBusy:b,disabled:b,onClick:w},window.tiTpc.exporter.buttonLabel))};elementor.hooks.addFilter("elements/section/contextMenuGroups",(function(t,r){var n={name:"ti_tpc_export",title:window.tiTpc.exporter.exportLabel,callback:function(){return function(t){var r=t.model.toJSON({remove:["default","editSettings","defaultEditSettings"]}),n=document.createElement("div");n.id="ti-tpc-modal",document.body.appendChild(n),Object(u.render)(Object(u.createElement)(e,{content:r}),document.getElementById("ti-tpc-modal"))}(r)}},a=t.find((function(e){return"save"===e.name}));if(a)a.actions.push(n);else{var c={name:"ti_tpc_export",actions:[n]};t.splice(3,0,c),t.join()}return t}))})));var G=r(16),H=r.n(G),z=r(12),q=r(5);function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=function(e){var t=e.title;return Object(u.createElement)(q.SVG,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tpc-template-cloud-icon",title:t},Object(u.createElement)(q.Path,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(u.createElement)(q.Path,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(u.createElement)(q.Path,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},Z=Object(z.compose)(Object(P.withSelect)((function(e){var t=e("tpc/elementor"),r=t.isFetching,n=t.isPreview,a=t.getCurrentTab,c=t.getPreview;return{isFetching:r(),isPreview:n(),currentTab:a(),preview:c()}})),Object(P.withDispatch)((function(e){var t=e("tpc/elementor");return{setFetching:t.setFetching,togglePreview:t.togglePreview,updateCurrentTab:t.updateCurrentTab}})))((function(e){var t=e.getSearchQuery,r=e.getOrder,n=e.onImport,a=e.isFetching,c=e.isPreview,i=e.currentTab,l=e.preview,p=e.setFetching,b=e.togglePreview,f=e.updateCurrentTab,g=function(){var e=s()(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.localStorage.setItem("tpcCacheBuster",_()),p(!0),n=r(),e.next=5,M(Y({search:t()},n));case 5:return e.next=7,I(Y({search:t()},n));case 7:p(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)("div",{className:m()("dialog-header dialog-lightbox-header",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header"},Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__logo-area"},c?Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-header-preview-back",onClick:b},Object(u.createElement)("i",{className:"eicon-","aria-hidden":"true"}),Object(u.createElement)("span",null,window.tiTpc.library.actions.back)):Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__logo"},Object(u.createElement)(J,{title:window.tiTpc.library.templatesCloud}))),!c&&Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__menu-area"},Object(u.createElement)(d.Button,{className:m()("ti-tpc-template-library-menu-item",{"is-active":"templates"===i}),onClick:function(){return f("templates")}},window.tiTpc.library.tabs.templates),3===parseInt(window.tiTpc.tier)&&Object(u.createElement)(d.Button,{className:m()("ti-tpc-template-library-menu-item",{"is-active":"library"===i}),onClick:function(){return f("library")}},window.tiTpc.library.tabs.library)),Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__items-area"},Object(u.createElement)("div",{className:"ti-tpc-template-library-header-tools"},c?Object(u.createElement)("div",{className:"ti-tpc-templates-modal__header__item ti-tpc-template-library-header-preview-insert-wrapper"},Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-insert elementor-button",onClick:function(){return n({id:l.template_id,title:l.template_name,meta:l.meta||[]})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-button-title"},window.tiTpc.library.actions.insert))):Object(u.createElement)("div",{className:"ti-tpc-template-library-header-actions"},"library"===i&&Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item",onClick:g},Object(u.createElement)("i",{className:m()("eicon-sync",{"eicon-animation-spin":a}),"aria-hidden":"true",title:window.tiTpc.library.actions.sync}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.actions.sync)),["wp-post","wp-page"].includes(elementor.config.document.type)&&3===parseInt(window.tiTpc.tier)&&Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item",onClick:function(){return f("export")}},Object(u.createElement)("i",{className:"eicon-save-o","aria-hidden":"true",title:window.tiTpc.library.save}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.save)))),Object(u.createElement)(d.Button,{className:"ti-tpc-templates-modal__header__item ti-tpc-templates-modal__header__close",onClick:window.tiTpcModal.hide},Object(u.createElement)("i",{className:"eicon-close","aria-hidden":"true",title:window.tiTpc.library.actions.close}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.actions.close)))))})),Q=Object(u.createElement)(q.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(q.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})),W=r(17),K=r(11);function X(e){return[null,void 0].includes(e)}function ee(e){var t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom,left:t.left,right:t.right}}function te(e,t,r){if(e){var n=ee(e),a=n.left,c=n.right,i=n.top,o=n.bottom;if(a>r)return!1;if(c<0)return!1;if(i>t)return!1;if(o<0)return!1}return!0}var re=function(e){var t,r,n,a=e.loading,c=e.hasNextPage,i=e.onLoadMore,o=e.threshold,l=void 0===o?150:o,s=e.checkInterval,u=void 0===s?200:s,p=e.scrollContainer,m=void 0===p?"window":p,d=Object(K.useRef)(null),b=function(){var e="object"==typeof window,t=Object(K.useCallback)((function(){return{width:e?window.innerWidth:void 0,height:e?window.innerHeight:void 0}}),[e]),r=Object(K.useState)(t()),n=r[0],a=r[1];return Object(K.useEffect)((function(){function r(){a(t())}if(e)return window.addEventListener("resize",r),function(){window.removeEventListener("resize",r)}}),[t,e]),n}(),f=b.height,g=b.width,w=Object(K.useState)(!0),y=w[0],h=w[1];return Object(K.useEffect)((function(){a||h(!0)}),[a]),t=function(){!function(){if(y&&!a&&c&&d.current){if("parent"===m){if(!(n=null===(r=d.current)||void 0===r?void 0:r.parentNode)||X(f)||X(g)||!te(n,f,g))return}else if(!(t=d.current)||X(f)||X(g)||!te(t,f,g))return;var e=function(){var e=d.current;if(!e||X(f))return null;var t=e.getBoundingClientRect().bottom,r=t-f;if("parent"===m){var n=e.parentNode;if(!n)return null;r=t-ee(n).bottom}return r}();if(X(e))return;e<l&&(h(!1),i())}var t,r,n}()},r=c?u:0,n=Object(K.useRef)(null),Object(K.useEffect)((function(){n.current=t}),[t]),Object(K.useEffect)((function(){if(r){var e=setInterval((function(){var e;null===(e=n.current)||void 0===e||e.call(n)}),r);return function(){clearInterval(e)}}}),[r]),d},ne=Object(u.createElement)(q.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(u.createElement)(q.Path,{d:"M7.5 12C7.5 11.1716 6.82843 10.5 6 10.5C5.17157 10.5 4.5 11.1716 4.5 12C4.5 12.8284 5.17157 13.5 6 13.5C6.82843 13.5 7.5 12.8284 7.5 12Z"}),Object(u.createElement)(q.Path,{d:"M13.5 12C13.5 11.1716 12.8284 10.5 12 10.5C11.1716 10.5 10.5 11.1716 10.5 12C10.5 12.8284 11.1716 13.5 12 13.5C12.8284 13.5 13.5 12.8284 13.5 12Z"}),Object(u.createElement)(q.Path,{d:"M19.5 12C19.5 11.1716 18.8284 10.5 18 10.5C17.1716 10.5 16.5 11.1716 16.5 12C16.5 12.8284 17.1716 13.5 18 13.5C18.8284 13.5 19.5 12.8284 19.5 12Z"})),ae=Object(u.createElement)(q.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(q.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),ce=Object(u.createElement)(q.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(u.createElement)(q.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"})),ie=Object(u.createElement)(q.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(u.createElement)(q.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"}));function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var le=Object(P.withDispatch)((function(e){var t=e("tpc/elementor");return{togglePreview:t.togglePreview,setPreviewData:t.setPreviewData}}))((function(e){var t=e.table,r=void 0!==t&&t,n=e.item,a=e.id,i=e.title,o=e.meta,l=e.thumbnail,s=e.onImport,p=e.onUpdateTemplate,m=e.onDelete,b=e.onDuplicate,f=e.togglePreview,g=e.setPreviewData,y=Object(u.useState)(!1),h=c()(y,2),v=h[0],O=h[1],j=Object(u.useState)(i),E=c()(j,2),x=E[0],_=E[1];return r?Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-item"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},v?Object(u.createElement)(u.Fragment,null,Object(u.createElement)("input",{type:"text",value:x,onChange:function(e){return _(e.target.value)}}),Object(u.createElement)(d.Button,{className:"elementor-button",onClick:function(){return p(a,x)}},Object(u.createElement)("i",{className:"eicon-check","aria-hidden":"true",title:window.tiTpc.library.actions.save}),Object(u.createElement)("span",{className:"elementor-button-title elementor-hidden"},window.tiTpc.library.actions.save)),Object(u.createElement)(d.Button,{className:"elementor-button",onClick:function(){return O(!1)}},Object(u.createElement)("i",{className:"eicon-editor-close","aria-hidden":"true",title:window.tiTpc.library.actions.cancel}),Object(u.createElement)("span",{className:"elementor-button-title elementor-hidden"},window.tiTpc.library.actions.cancel))):i),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},moment(n.date).format("MMMM D, YYYY")),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},moment(n.modified).format("MMMM D, YYYY")),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,{className:"elementor-button elementor-button-success",onClick:function(){return s({id:a,title:i,meta:o})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-button-title"},window.tiTpc.library.actions.insert)),Object(u.createElement)(d.DropdownMenu,{icon:ne,label:window.tiTpc.library.filters.sortLabels.actions,popoverProps:{position:"bottom right",noArrow:!1},controls:[{title:window.tiTpc.library.actions.edit,icon:ae,isDisabled:!!n.link,onClick:function(){return O(!0)}},{title:window.tiTpc.library.actions.duplicate,icon:ce,onClick:function(){return b(a)}},{title:window.tiTpc.library.actions.delete,icon:ie,onClick:function(){return m(a)}}]}))):Object(u.createElement)("div",{className:"ti-tpc-template-library-template"},Object(u.createElement)("div",{className:"ti-tpc-template-library-template-body"},Object(u.createElement)("div",{className:"ti-tpc-template-library-template-screenshot",style:{backgroundImage:"url( ".concat(l,")")}}),Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-preview",onClick:function(){f(),g(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n))}},Object(u.createElement)("i",{className:"eicon-zoom-in-bold","aria-hidden":"true"}))),Object(u.createElement)("div",{className:"ti-tpc-template-library-template-footer"},Object(u.createElement)(d.Button,{className:"ti-tpc-template-library-template-action elementor-button",onClick:function(){return s({id:a,title:i,meta:o})}},Object(u.createElement)("i",{className:"eicon-file-download","aria-hidden":"true"}),Object(u.createElement)("span",null,window.tiTpc.library.actions.insert)),Object(u.createElement)("div",{className:"ti-tpc-template-library-template-name"},i)))}));function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe={template_name:window.tiTpc.library.filters.sortLabels.name,date:window.tiTpc.library.filters.sortLabels.date,modified:window.tiTpc.library.filters.sortLabels.modified},me=Object(P.withSelect)((function(e,t){var r=t.isGeneral?e("tpc/elementor").getTemplates():e("tpc/elementor").getLibrary(),n=r.items;return{items:void 0===n?[]:n,currentPage:r.currentPage,totalPages:r.totalPages}}))((function(e){var t=e.getSearchQuery,r=e.getOrder,n=e.setSorting,a=e.onImport,i=e.onUpdateTemplate,l=e.onDelete,p=e.onDuplicate,b=e.isGeneral,f=e.items,g=e.currentPage,w=e.totalPages,y=Object(u.useState)(!1),h=c()(y,2),v=h[0],O=h[1],j=re({loading:v,hasNextPage:g!==w,onLoadMore:function(){var e=s()(o.a.mark((function e(){var n;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g!==w){e.next=2;break}return e.abrupt("return");case 2:if(O(!0),n=r(),!b){e.next=9;break}return e.next=7,M(ue({search:t(),page:g+1,isScroll:!0},n));case 7:e.next=11;break;case 9:return e.next=11,I(ue({search:t(),page:g+1,isScroll:!0},n));case 11:O(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),threshold:1});return Object(u.createElement)("div",{className:m()("ti-tpc-template-library-templates-container",{"is-table":!b}),ref:j},b?f.map((function(e){return Object(u.createElement)(le,{key:e.template_id,item:e,id:e.template_id,title:e.template_name,thumbnail:e.template_thumbnail,onImport:a})})):Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-header"},Object.keys(pe).map((function(e){return Object(u.createElement)("div",{key:e,className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,{className:m()({"is-selected":e===r().orderby,"is-asc":"ASC"===r().order}),onClick:function(){var t={order:"DESC",orderby:e};e===r().orderby&&"DESC"===r().order&&(t.order="ASC"),n(ue({},t))}},pe[e]))})),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-table-column"},Object(u.createElement)(d.Button,null,window.tiTpc.library.filters.sortLabels.actions))),f.map((function(e){return Object(u.createElement)(le,{table:!0,key:e.template_id,item:e,id:e.template_id,title:e.template_name,meta:e.meta||"",onImport:a,onUpdateTemplate:i,onDelete:l,onDuplicate:function(e){return p(e)}})}))),0===f.length&&(b?Object(u.createElement)("p",null,"No templates found. Check again later!"):Object(u.createElement)("p",null,"No templates available. Try adding few templates.")),v&&Object(u.createElement)(d.Placeholder,null,Object(u.createElement)(d.Spinner,null)))})),de=Object(P.withDispatch)((function(e){return{updateCurrentTab:e("tpc/elementor").updateCurrentTab}}))((function(e){var t=e.updateCurrentTab;Object(u.useEffect)((function(){var e=window.tiTpc.postModel.getMetas(),t=e._ti_tpc_template_sync,r=e._ti_tpc_template_id,n=e._ti_tpc_screenshot_url,a=e._ti_tpc_site_slug,c=e._ti_tpc_published;g(Boolean(t)),v(r),x(n),P(a),D(Boolean(c))}),[]);var r=elementor.config.initial_document.settings.settings.post_title||"",n=Object(u.useState)(!1),a=c()(n,2),i=a[0],l=a[1],p=Object(u.useState)(!1),b=c()(p,2),f=b[0],g=b[1],w=Object(u.useState)(""),y=c()(w,2),h=y[0],v=y[1],O=Object(u.useState)(""),j=c()(O,2),E=j[0],x=j[1],_=Object(u.useState)(""),T=c()(_,2),k=T[0],P=T[1],S=Object(u.useState)(""),N=c()(S,2),C=N[0],D=N[1],M=function(){var e=s()(o.a.mark((function e(){var n,a,c,i;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l(!0),n=elementor.elements.toJSON({remove:["default","editSettings","defaultEditSettings"]}),a=!1,!h){e.next=7;break}return e.next=6,L(h);case 6:a=e.sent;case 7:if(c=window.tiTpc.params.meta,(i=elementor.documents.getCurrent().container.settings.get("template"))&&(c._wp_page_template=i),!a){e.next=15;break}return e.next=13,A({template_id:h,template_name:r,content:n,link:elementor.config.initial_document.urls.permalink,meta:JSON.stringify(c)});case 13:e.next=17;break;case 15:return e.next=17,R({title:r,type:"page",content:n,link:elementor.config.initial_document.urls.permalink,callback:function(e){v(e.template_id),window.tiTpc.postModel.set("meta",{_ti_tpc_template_id:e.template_id,_ti_tpc_template_sync:f}),window.tiTpc.postModel.save()}});case 17:l(!1),t("library");case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=s()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.next=3,V({template_id:h,template_site_slug:k,template_thumbnail:E,premade:C?"no":"yes",link:elementor.config.initial_document.urls.permalink}).then((function(e){e.success&&(elementor.notifications.showToast({message:C?window.tiTpc.exporter.templateUnpublished:window.tiTpc.exporter.templatePublished}),D(!C),window.tiTpc.postModel.set("meta",{_ti_tpc_template_id:h,_ti_tpc_template_sync:f,_ti_tpc_screenshot_url:E,_ti_tpc_site_slug:k,_ti_tpc_published:!C}),window.tiTpc.postModel.save())}));case 3:l(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(u.createElement)("div",{className:"dialog-message dialog-lightbox-message"},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-export"},Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-icon"},Object(u.createElement)("i",{className:"eicon-library-save","aria-hidden":"true"}),Object(u.createElement)("span",{className:"elementor-screen-only"},window.tiTpc.library.export.save)),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-title"},window.tiTpc.library.export.title),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",value:elementor.config.initial_document.settings.settings.post_title,disabled:!0}),Object(u.createElement)(d.Button,{className:m()("elementor-button elementor-button-success",{"elementor-button-state":i}),onClick:M},Object(u.createElement)("span",{className:"elementor-state-icon"},Object(u.createElement)("i",{className:"eicon-loading eicon-animation-spin","aria-hidden":"true"})),window.tiTpc.library.export.save)),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)(d.ToggleControl,{label:window.tiTpc.exporter.toggleLabel,checked:f,onChange:function(){return g(!f)}})),window.tiTpc.canPredefine&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-screenshot",className:"ti-tpc-template-library-blank-field-input-label"},window.tiTpc.library.export.labelScreenshot),Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",id:"ti-tpc-template-screenshot",value:E,onChange:function(e){return x(e.target.value)}})),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-slug",className:"ti-tpc-template-library-blank-field-input-label"},window.tiTpc.library.export.labelSlug),Object(u.createElement)("input",{className:"ti-tpc-template-library-blank-field-input",id:"ti-tpc-template-slug",value:k,onChange:function(e){return P(e.target.value)}})),Object(u.createElement)("div",{className:"ti-tpc-template-library-blank-field"},Object(u.createElement)(d.Button,{className:m()("elementor-button elementor-button-success",{"elementor-button-state":i}),onClick:I},Object(u.createElement)("span",{className:"elementor-state-icon"},Object(u.createElement)("i",{className:"eicon-loading eicon-animation-spin","aria-hidden":"true"})),C?window.tiTpc.library.export.unpublish:window.tiTpc.library.export.publish))))))}));function be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ge={date:window.tiTpc.library.filters.sortLabels.date,template_name:window.tiTpc.library.filters.sortLabels.name,modified:window.tiTpc.library.filters.sortLabels.modified},we=Object(z.compose)(Object(P.withSelect)((function(e){var t=e("tpc/elementor"),r=t.isFetching,n=t.isPreview,a=t.getCurrentTab,c=t.getPreview;return{isFetching:r(),isPreview:n(),currentTab:a(),preview:c()}})),Object(P.withDispatch)((function(e){return{setFetching:e("tpc/elementor").setFetching}})))((function(e){var t=e.setQuery,r=e.getSearchQuery,n=e.setSorting,a=e.getOrder,c=e.isSearch,i=e.setSearch,l=e.onImport,p=e.isFetching,b=e.isPreview,f=e.currentTab,g=e.preview,w=e.setFetching,y=function(){var e=s()(o.a.mark((function e(){var t,n,c=arguments;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:r(),w(!0),i(!!t),n=a(),"templates"!==f){e.next=9;break}return e.next=7,M(fe({search:t},n));case 7:e.next=11;break;case 9:return e.next=11,I(fe({search:t},n));case 11:w(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(u.useEffect)((function(){y()}),[f,a()]);var h="templates"===f,v=function(){var e=s()(o.a.mark((function e(t,r){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,A({template_id:t,template_name:r});case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),O=function(){var e=s()(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,U(t);case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=s()(o.a.mark((function e(t){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,F(t);case 3:w(!1);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return b?Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-preview"},Object(u.createElement)("iframe",{title:g.template_name,src:g.link||""}),Object(u.createElement)("div",{className:"is-loading"},Object(u.createElement)(d.Icon,{icon:Q}))))):p?Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content is-loading"},Object(u.createElement)(d.Spinner,null))):"export"===f?Object(u.createElement)(de,null):Object(u.createElement)("div",{className:m()("dialog-message dialog-lightbox-message",{"is-dark":"dark"===elementor.settings.editorPreferences.model.get("ui_theme")})},Object(u.createElement)("div",{className:"dialog-content dialog-lightbox-content"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header"},Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters"},h&&Object(u.createElement)(u.Fragment,null,Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters-label"},window.tiTpc.library.filters.sortLabel),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-filters-filter"},Object.keys(ge).map((function(e){return Object(u.createElement)(d.Button,{key:e,className:m()({"is-selected":e===a().orderby,"is-asc":"ASC"===a().order}),onClick:function(){var t={order:"DESC",orderby:e};e===a().orderby&&"DESC"===a().order&&(t.order="ASC"),n(fe({},t))}},ge[e])}))))),Object(u.createElement)("div",{className:"ti-tpc-template-library-templates-header-search"},Object(u.createElement)("label",{htmlFor:"ti-tpc-template-library-filter-search",className:"elementor-screen-only"},window.tiTpc.library.filters.searchLabel),Object(u.createElement)("input",{id:"ti-tpc-template-library-filter-search",placeholder:window.tiTpc.library.filters.search,value:r(),onChange:function(e){return t(e.target.value)},onKeyDown:function(e){e.keyCode===W.ENTER&&y()}}),c?Object(u.createElement)(d.Button,{onClick:function(){t(""),y("")}},Object(u.createElement)("i",{className:"eicon-close"})):Object(u.createElement)(d.Button,{onClick:function(){return y()}},Object(u.createElement)("i",{className:"eicon-search"})))),["templates","library"].includes(f)&&Object(u.createElement)(me,{getSearchQuery:function(){return r()},getOrder:a,setSorting:n,onImport:l,onUpdateTemplate:v,onDelete:O,onDuplicate:j,isFetching:p,isGeneral:h}))))}));function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ve=lodash.omit,Oe=Object(z.compose)(Object(P.withSelect)((function(e){return{currentTab:(0,e("tpc/elementor").getCurrentTab)()}})),Object(P.withDispatch)((function(e){return{setFetching:e("tpc/elementor").setFetching}})))((function(e){var t=e.currentTab,r=e.setFetching,n=Object(u.useState)({templates:"",library:""}),a=c()(n,2),i=a[0],l=a[1],p=Object(u.useState)({templates:{order:"DESC",orderby:"date"},library:{order:"DESC",orderby:"date"}}),m=c()(p,2),d=m[0],b=m[1],f=Object(u.useState)({templates:!1,library:!1}),g=c()(f,2),w=g[0],y=g[1],h="templates"===t,v=function(){return h?i.templates:i.library},O=function(){return h?d.templates:d.library},j=function e(t){if(t.id=elementorCommon.helpers.getUniqueId(),0<t.elements.length)for(var r=0;r<t.elements.length;r++)t.elements[r]=e(t.elements[r]);return t},E=function(e){try{var t=JSON.parse(e);if(t&&"object"===H()(t))return t}catch(e){}return!1},x=function(){var e=s()(o.a.mark((function e(t){var n,a,c,i,l,s,u,p,m;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.id,a=t.title,c=t.meta,i=void 0===c?void 0:c,r(!0),e.next=4,B(n);case 4:if(l=e.sent){e.next=7;break}return e.abrupt("return",r(!1));case 7:for(s=$e.internal("document/history/start-log",{type:"add",title:"".concat(window.tiTpc.library.historyMessage," ").concat(a)}),u=Number(window.tiTpc.placeholder),p=l.content,m=0;m<p.length;m++)p[m]=j(p[m]),$e.run("document/elements/create",{container:elementor.getPreviewContainer(),model:p[m],options:u>=0?{at:u++}:{}});void 0!==i&&0<Object.keys(E(i)||{}).length&&(i=he({},JSON.parse(i)),window.tiTpc.postModel.set("meta",he({},ve(i,"_wp_page_template"))),window.tiTpc.postModel.save(),i._wp_page_template&&elementor.documents.getCurrent().container.settings.set({template:i._wp_page_template})),$e.internal("document/history/end-log",{id:s}),window.tiTpcModal.hide(),r(!1);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(Z,{getSearchQuery:v,getOrder:O,onImport:x}),Object(u.createElement)(we,{setQuery:function(e){return l(he(he({},i),{},h?{templates:e}:{library:e}))},getSearchQuery:v,setSorting:function(e){return b(he(he({},d),{},h?{templates:e}:{library:e}))},getOrder:O,isSearch:h?w.templates:w.library,setSearch:function(e){return y(he(he({},w),{},h?{templates:e}:{library:e}))},onImport:x}))}));void 0!==elementorCommon&&(window.tiTpcModal=elementorCommon.dialogsManager.createWidget("lightbox",{id:"ti-tpc-templates-modal",className:"ti-tpc-templates-modal",hide:{auto:!1,onClick:!1,onOutsideClick:!1,onOutsideContextMenu:!1,onBackgroundClick:!0},position:{my:"center",at:"center"},onShow:function(){var e=window.tiTpcModal.getElements("content");document.getElementById("ti-tpc-templates-modal-content")||e.append('<div id="ti-tpc-templates-modal-content" class="wrap"></div>')}}),window.tiTpcModal.getElements("header").remove(),window.tiTpcModal.getElements("message").remove(),window.tiTpcModal.getElements("widgetContent").append(window.tiTpcModal.addElement("content")));var je=document.getElementById("tmpl-elementor-add-section");if(je){var Ee=je.textContent;je.textContent=Ee.replace('<div class="elementor-add-section-drag-title">Drag widget here</div>','<div class="elementor-add-section-area-button elementor-templates-cloud-button" title="'.concat(window.tiTpc.library.libraryButton,'"><svg width="100" height="100" viewBox="10 10 80 80" fill="none" xmlns="http://www.w3.org/2000/svg" class="tpc-template-cloud-icon" role="img" aria-hidden="true" focusable="false"><path d="M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z" fill="#0366D6"></path><path d="M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z" fill="white"></path><path d="M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z" fill="white" style=""></path></svg></div> <div class="elementor-add-section-drag-title">Drag widget here</div>'))}function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}elementor.on("preview:loaded",(function(){elementor.$previewContents[0].body.addEventListener("click",(function(e){(-1<Array.from(e.target.classList).indexOf("elementor-templates-cloud-button")||-1<Array.from(e.target.classList).indexOf("tpc-template-cloud-icon")||-1<Array.from(e.target.parentNode.classList).indexOf("tpc-template-cloud-icon"))&&function(e){window.tiTpcModal.show();var t=elementor.$previewContents[0].body.querySelector(".elementor-section-wrap"),r=e.closest(".elementor-add-section");window.tiTpc.placeholder=Array.from(t.childNodes).indexOf(r),Object(u.render)(Object(u.createElement)(Oe,null),document.getElementById("ti-tpc-templates-modal-content")),window.tiTpcModal.refreshPosition()}(e.target)}))}));var Te={isFetching:!0,isPreview:!1,tab:3===parseInt(window.tiTpc.tier)?"library":"templates",templates:[],library:{items:[],currentPage:0,totalPages:0},preview:{}};Object(P.registerStore)("tpc/elementor",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Te,t=arguments.length>1?arguments[1]:void 0;return"SET_FETCHING"===t.type?_e(_e({},e),{},{isFetching:t.isFetching}):"TOGGLE_PREVIEW"===t.type?_e(_e({},e),{},{isPreview:!e.isPreview}):"UPDATE_CURRENT_TAB"===t.type?_e(_e({},e),{},{tab:t.tab}):"UPDATE_TEMPLATES"===t.type?_e(_e({},e),{},{templates:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"UPDATE_LIBRARY"===t.type?_e(_e({},e),{},{library:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"SET_PREVIEW_DATA"===t.type?_e(_e({},e),{},{preview:t.preview}):e},selectors:{isFetching:function(e){return e.isFetching},isPreview:function(e){return e.isPreview},getCurrentTab:function(e){return e.tab},getTemplates:function(e){return e.templates},getLibrary:function(e){return e.library},getPreview:function(e){return e.preview}},actions:{setFetching:function(e){return{type:"SET_FETCHING",isFetching:e}},togglePreview:function(e){return{type:"TOGGLE_PREVIEW",isPreview:e}},updateCurrentTab:function(e){return{type:"UPDATE_CURRENT_TAB",tab:e}},updateTemplates:function(e,t,r){return{type:"UPDATE_TEMPLATES",items:e,currentPage:t,totalPages:r}},updateLibrary:function(e,t,r){return{type:"UPDATE_LIBRARY",items:e,currentPage:t,totalPages:r}},setPreviewData:function(e){return{type:"SET_PREVIEW_DATA",preview:e}}}}),r(29)}]);
elementor/src/components/export.js CHANGED
@@ -52,13 +52,23 @@ const Export = ( { updateCurrentTab } ) => {
52
  doesExist = await getTemplate( templateID );
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
55
  if ( doesExist ) {
56
  await updateTemplate( {
57
  template_id: templateID,
58
  template_name: title,
59
  content,
60
  link: elementor.config.initial_document.urls.permalink,
61
- meta: JSON.stringify( tiTpc.params.meta ),
62
  } );
63
  } else {
64
  await exportTemplate( {
52
  doesExist = await getTemplate( templateID );
53
  }
54
 
55
+ const meta = window.tiTpc.params.meta;
56
+
57
+ const currentTemplate = elementor.documents
58
+ .getCurrent()
59
+ .container.settings.get( 'template' );
60
+
61
+ if ( currentTemplate ) {
62
+ meta._wp_page_template = currentTemplate;
63
+ }
64
+
65
  if ( doesExist ) {
66
  await updateTemplate( {
67
  template_id: templateID,
68
  template_name: title,
69
  content,
70
  link: elementor.config.initial_document.urls.permalink,
71
+ meta: JSON.stringify( meta ),
72
  } );
73
  } else {
74
  await exportTemplate( {
elementor/src/components/templates-content.js CHANGED
@@ -136,7 +136,7 @@ const TemplatesContent = ( {
136
  item={ item }
137
  id={ item.template_id }
138
  title={ item.template_name }
139
- meta={ item.meta || [] }
140
  onImport={ onImport }
141
  onUpdateTemplate={ onUpdateTemplate }
142
  onDelete={ onDelete }
136
  item={ item }
137
  id={ item.template_id }
138
  title={ item.template_name }
139
+ meta={ item.meta || '' }
140
  onImport={ onImport }
141
  onUpdateTemplate={ onUpdateTemplate }
142
  onDelete={ onDelete }
elementor/src/data/templates-cloud/index.js CHANGED
@@ -310,11 +310,21 @@ export const exportTemplate = async ( {
310
  content,
311
  };
312
 
 
 
 
 
 
 
 
 
 
 
313
  const url = stringifyUrl( {
314
  url: window.tiTpc.endpoint + 'templates',
315
  query: {
316
  ...omit( tiTpc.params, 'meta' ),
317
- meta: 'page' === type ? JSON.stringify( tiTpc.params.meta ) : '',
318
  template_name: title || window.tiTpc.exporter.textPlaceholder,
319
  template_type: 'elementor',
320
  link,
@@ -355,7 +365,6 @@ export const publishTemplate = async ( params ) => {
355
  cache: localStorage.getItem( 'tpcCacheBuster' ),
356
  method: 'POST',
357
  ...omit( tiTpc.params, 'meta' ),
358
- meta: JSON.stringify( tiTpc.params.meta ),
359
  ...omit( params, 'template_id' ),
360
  },
361
  } );
310
  content,
311
  };
312
 
313
+ const meta = window.tiTpc.params.meta;
314
+
315
+ const currentTemplate = elementor.documents
316
+ .getCurrent()
317
+ .container.settings.get( 'template' );
318
+
319
+ if ( currentTemplate ) {
320
+ meta._wp_page_template = currentTemplate;
321
+ }
322
+
323
  const url = stringifyUrl( {
324
  url: window.tiTpc.endpoint + 'templates',
325
  query: {
326
  ...omit( tiTpc.params, 'meta' ),
327
+ meta: 'page' === type ? JSON.stringify( meta ) : '',
328
  template_name: title || window.tiTpc.exporter.textPlaceholder,
329
  template_type: 'elementor',
330
  link,
365
  cache: localStorage.getItem( 'tpcCacheBuster' ),
366
  method: 'POST',
367
  ...omit( tiTpc.params, 'meta' ),
 
368
  ...omit( params, 'template_id' ),
369
  },
370
  } );
elementor/src/export.js CHANGED
@@ -61,13 +61,23 @@ if ( parseInt( window.tiTpc.tier ) === 3 ) {
61
  ],
62
  } );
63
 
 
 
 
 
 
 
 
 
 
 
64
  await updateTemplate( {
65
  template_id: _ti_tpc_template_id,
66
  template_name:
67
  elementor.config.initial_document.settings.settings
68
  .post_title || '',
69
  content,
70
- meta: JSON.stringify( tiTpc.params.meta ),
71
  } );
72
  }
73
  } );
61
  ],
62
  } );
63
 
64
+ const meta = window.tiTpc.params.meta;
65
+
66
+ const currentTemplate = elementor.documents
67
+ .getCurrent()
68
+ .container.settings.get( 'template' );
69
+
70
+ if ( currentTemplate ) {
71
+ meta._wp_page_template = currentTemplate;
72
+ }
73
+
74
  await updateTemplate( {
75
  template_id: _ti_tpc_template_id,
76
  template_name:
77
  elementor.config.initial_document.settings.settings
78
  .post_title || '',
79
  content,
80
+ meta: JSON.stringify( meta ),
81
  } );
82
  }
83
  } );
elementor/src/template-library.js CHANGED
@@ -1,3 +1,4 @@
 
1
  /* global elementor, $e, elementorCommon */
2
  import { withDispatch, withSelect } from '@wordpress/data';
3
  import { compose } from '@wordpress/compose';
@@ -7,6 +8,8 @@ import Header from './components/header.js';
7
  import Content from './components/content.js';
8
  import { importTemplate } from './data/templates-cloud/index.js';
9
 
 
 
10
  const TemplateLibrary = ( { currentTab, setFetching } ) => {
11
  const [ searchQuery, setSearchQuery ] = useState( {
12
  templates: '',
@@ -109,7 +112,24 @@ const TemplateLibrary = ( { currentTab, setFetching } ) => {
109
  return element;
110
  };
111
 
112
- const onImport = async ( { id, title, meta = [] } ) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  setFetching( true );
114
  const data = await importTemplate( id );
115
 
@@ -135,9 +155,22 @@ const TemplateLibrary = ( { currentTab, setFetching } ) => {
135
  } );
136
  }
137
 
138
- if ( 0 < meta.length ) {
139
- window.tiTpc.postModel.set( 'meta', { ... JSON.parse( meta ) } );
 
 
 
 
 
 
 
140
  window.tiTpc.postModel.save();
 
 
 
 
 
 
141
  }
142
 
143
  $e.internal( 'document/history/end-log', {
1
+ /* eslint-disable no-undef */
2
  /* global elementor, $e, elementorCommon */
3
  import { withDispatch, withSelect } from '@wordpress/data';
4
  import { compose } from '@wordpress/compose';
8
  import Content from './components/content.js';
9
  import { importTemplate } from './data/templates-cloud/index.js';
10
 
11
+ const { omit } = lodash;
12
+
13
  const TemplateLibrary = ( { currentTab, setFetching } ) => {
14
  const [ searchQuery, setSearchQuery ] = useState( {
15
  templates: '',
112
  return element;
113
  };
114
 
115
+ const tryParseJSON = ( jsonString ) => {
116
+ try {
117
+ const o = JSON.parse( jsonString );
118
+
119
+ // Handle non-exception-throwing cases:
120
+ // Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking,
121
+ // but... JSON.parse(null) returns null, and typeof null === "object",
122
+ // so we must check for that, too. Thankfully, null is falsey, so this suffices:
123
+ // Source: https://stackoverflow.com/a/20392392
124
+ if ( o && typeof o === 'object' ) {
125
+ return o;
126
+ }
127
+ } catch ( e ) {}
128
+
129
+ return false;
130
+ };
131
+
132
+ const onImport = async ( { id, title, meta = undefined } ) => {
133
  setFetching( true );
134
  const data = await importTemplate( id );
135
 
155
  } );
156
  }
157
 
158
+ if (
159
+ undefined !== meta &&
160
+ 0 < Object.keys( tryParseJSON( meta ) || {} ).length
161
+ ) {
162
+ meta = { ...JSON.parse( meta ) };
163
+
164
+ window.tiTpc.postModel.set( 'meta', {
165
+ ...omit( meta, '_wp_page_template' ),
166
+ } );
167
  window.tiTpc.postModel.save();
168
+
169
+ if ( meta._wp_page_template ) {
170
+ elementor.documents.getCurrent().container.settings.set( {
171
+ template: meta._wp_page_template,
172
+ } );
173
+ }
174
  }
175
 
176
  $e.internal( 'document/history/end-log', {
includes/Main.php CHANGED
@@ -18,7 +18,7 @@ class Main {
18
  *
19
  * @var string Version string.
20
  */
21
- const VERSION = '1.1.13';
22
  /**
23
  * Sites Library API URL.
24
  *
18
  *
19
  * @var string Version string.
20
  */
21
+ const VERSION = '1.1.14';
22
  /**
23
  * Sites Library API URL.
24
  *
includes/Rest_Server.php CHANGED
@@ -310,6 +310,19 @@ class Rest_Server {
310
  2
311
  );
312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  if ( 'beaver' === $template['template_type'] ) {
314
  if ( class_exists( 'FLBuilderModel' ) ) {
315
  $response = TI_Beaver::get_template_content( $template['template_id'] );
@@ -320,7 +333,7 @@ class Rest_Server {
320
  'post_title' => wp_strip_all_tags( $template['template_name'] ),
321
  'post_status' => 'publish',
322
  'post_type' => 'page',
323
- 'page_template' => 'page-templates/template-pagebuilder-full-width.php',
324
  'meta_input' => isset( $template['meta'] ) ? json_decode( $template['meta'], true ) : array(),
325
  )
326
  );
@@ -345,7 +358,7 @@ class Rest_Server {
345
  'post_title' => wp_strip_all_tags( $template['template_name'] ),
346
  'post_status' => 'publish',
347
  'post_type' => 'page',
348
- 'page_template' => 'page-templates/template-pagebuilder-full-width.php',
349
  'meta_input' => array_merge(
350
  array(
351
  '_elementor_data' => $template['content'],
@@ -364,7 +377,7 @@ class Rest_Server {
364
  'post_content' => wp_kses_post( $template['content'] ),
365
  'post_status' => 'publish',
366
  'post_type' => 'page',
367
- 'page_template' => 'page-templates/template-pagebuilder-full-width.php',
368
  'meta_input' => isset( $template['meta'] ) ? json_decode( $template['meta'], true ) : array(),
369
  )
370
  );
310
  2
311
  );
312
 
313
+ $page_template = '';
314
+
315
+ if ( 'gutenberg' !== $template['template_type'] ) {
316
+ $page_template = 'page-templates/template-pagebuilder-full-width.php';
317
+ }
318
+
319
+ if ( isset( $template['meta'] ) ) {
320
+ $meta = json_decode( $template['meta'], true );
321
+ if ( isset( $meta['_wp_page_template'] ) ) {
322
+ $page_template = $meta['_wp_page_template'];
323
+ }
324
+ }
325
+
326
  if ( 'beaver' === $template['template_type'] ) {
327
  if ( class_exists( 'FLBuilderModel' ) ) {
328
  $response = TI_Beaver::get_template_content( $template['template_id'] );
333
  'post_title' => wp_strip_all_tags( $template['template_name'] ),
334
  'post_status' => 'publish',
335
  'post_type' => 'page',
336
+ 'page_template' => $page_template,
337
  'meta_input' => isset( $template['meta'] ) ? json_decode( $template['meta'], true ) : array(),
338
  )
339
  );
358
  'post_title' => wp_strip_all_tags( $template['template_name'] ),
359
  'post_status' => 'publish',
360
  'post_type' => 'page',
361
+ 'page_template' => $page_template,
362
  'meta_input' => array_merge(
363
  array(
364
  '_elementor_data' => $template['content'],
377
  'post_content' => wp_kses_post( $template['content'] ),
378
  'post_status' => 'publish',
379
  'post_type' => 'page',
380
+ 'page_template' => $page_template,
381
  'meta_input' => isset( $template['meta'] ) ? json_decode( $template['meta'], true ) : array(),
382
  )
383
  );
includes/TI_Beaver.php CHANGED
@@ -268,8 +268,13 @@ class TI_Beaver extends FLBuilderModule {
268
  */
269
  static public function get_template_meta() {
270
  $post_id = FLBuilderModel::get_post_id();
 
271
 
272
- return Main::get_meta_fields( $post_id, $type = 'beaver' );
 
 
 
 
273
  }
274
 
275
  /**
@@ -288,7 +293,6 @@ class TI_Beaver extends FLBuilderModule {
288
  'premade' => $premade,
289
  'link' => get_permalink( $post_id ),
290
  'cache' => uniqid(),
291
- 'meta' => json_encode( self::get_template_meta() ),
292
  ),
293
  TPC_TEMPLATES_CLOUD_ENDPOINT . 'templates/' . esc_attr( $template_id ) . '/publish'
294
  );
268
  */
269
  static public function get_template_meta() {
270
  $post_id = FLBuilderModel::get_post_id();
271
+ $fields = Main::get_meta_fields( $post_id, $type = 'beaver' );
272
 
273
+ if ( get_page_template_slug( $post_id ) ) {
274
+ $fields['_wp_page_template'] = get_page_template_slug( $post_id );
275
+ }
276
+
277
+ return $fields;
278
  }
279
 
280
  /**
293
  'premade' => $premade,
294
  'link' => get_permalink( $post_id ),
295
  'cache' => uniqid(),
 
296
  ),
297
  TPC_TEMPLATES_CLOUD_ENDPOINT . 'templates/' . esc_attr( $template_id ) . '/publish'
298
  );
languages/templates-patterns-collection.pot CHANGED
@@ -1,5 +1,5 @@
1
  # Copyright (C) 2021 ThemeIsle
2
- # This file is distributed under the GPLv3.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Templates Patterns Collection 1.1.10\n"
@@ -9,9 +9,9 @@ msgstr ""
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-05-24T14:06:55+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: templates-patterns-collection\n"
16
 
17
  #. Plugin Name of the plugin
@@ -30,606 +30,439 @@ msgstr ""
30
  msgid "https://themeisle.com"
31
  msgstr ""
32
 
33
- #: dist/templates-patterns-collection/includes/Admin.php:72
34
- #: dist/templates-patterns-collection/includes/Admin.php:73
35
  #: includes/Admin.php:70
36
  #: includes/Admin.php:71
37
  msgid "Starter Sites"
38
  msgstr ""
39
 
40
- #: dist/templates-patterns-collection/includes/Admin.php:82
41
- #: dist/templates-patterns-collection/includes/Elementor.php:75
42
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:398
43
  #: includes/Admin.php:80
44
  #: includes/Elementor.php:75
45
- #: includes/TI_Beaver.php:398
46
  msgid "My Library"
47
  msgstr ""
48
 
49
  #. translators: %s - Theme name
50
- #: dist/templates-patterns-collection/includes/Admin.php:155
51
  #: includes/Admin.php:153
52
  msgid "Choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
53
  msgstr ""
54
 
55
- #: dist/templates-patterns-collection/includes/Admin.php:247
56
  #: includes/Admin.php:244
57
  msgid "Great news! Now you can export your own custom designs to the cloud and then reuse them on other sites."
58
  msgstr ""
59
 
60
- #: dist/templates-patterns-collection/includes/Admin.php:248
61
  #: includes/Admin.php:245
62
  msgid "Open %s"
63
  msgstr ""
64
 
65
- #: dist/templates-patterns-collection/includes/Admin.php:345
66
  #: includes/Admin.php:342
67
  msgid "Hi! We've noticed you were using a child theme of Zelle before. To make your transition easier, we can help you keep the same homepage settings you had before but in original Zelle's style, by converting it into an Elementor template."
68
  msgstr ""
69
 
70
- #: dist/templates-patterns-collection/includes/Admin.php:375
71
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:408
72
  #: includes/Admin.php:372
73
- #: includes/TI_Beaver.php:408
74
- #: assets/build/app.js:4665
75
  #: assets/src/Components/StarterSiteCard.js:60
76
- #: dist/templates-patterns-collection/assets/build/app.js:10
77
- #: dist/templates-patterns-collection/assets/src/Components/StarterSiteCard.js:60
78
  msgid "Preview"
79
  msgstr ""
80
 
81
- #: dist/templates-patterns-collection/includes/Admin.php:376
82
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:409
83
  #: includes/Admin.php:373
84
- #: includes/TI_Beaver.php:409
85
- #: assets/build/app.js:4402
86
- #: assets/build/app.js:4669
87
  #: assets/src/Components/PreviewFrame.js:102
88
  #: assets/src/Components/StarterSiteCard.js:68
89
- #: dist/templates-patterns-collection/assets/build/app.js:10
90
- #: dist/templates-patterns-collection/assets/src/Components/PreviewFrame.js:102
91
- #: dist/templates-patterns-collection/assets/src/Components/StarterSiteCard.js:68
92
  msgid "Import"
93
  msgstr ""
94
 
95
- #: dist/templates-patterns-collection/includes/Admin.php:377
96
  #: includes/Admin.php:374
97
  msgid "Get the PRO version!"
98
  msgstr ""
99
 
100
- #: dist/templates-patterns-collection/includes/Admin.php:378
101
  #: includes/Admin.php:375
102
  msgid "Importing"
103
  msgstr ""
104
 
105
- #: dist/templates-patterns-collection/includes/Admin.php:379
106
- #: dist/templates-patterns-collection/includes/Elementor.php:81
107
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:387
108
  #: includes/Admin.php:376
109
  #: includes/Elementor.php:81
110
- #: includes/TI_Beaver.php:387
111
- #: assets/build/app.js:3971
112
  #: assets/src/Components/Migration.js:165
113
- #: dist/templates-patterns-collection/assets/build/app.js:2
114
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:165
115
  msgid "Cancel"
116
  msgstr ""
117
 
118
- #: dist/templates-patterns-collection/includes/Admin.php:380
119
  #: includes/Admin.php:377
120
  msgid "Loading"
121
  msgstr ""
122
 
123
- #: dist/templates-patterns-collection/includes/Admin.php:381
124
  #: includes/Admin.php:378
125
- #: assets/build/app.js:3284
126
- #: assets/build/app.js:3985
127
  #: assets/src/Components/ImportModal.js:603
128
  #: assets/src/Components/Migration.js:198
129
- #: dist/templates-patterns-collection/assets/build/app.js:2
130
- #: dist/templates-patterns-collection/assets/build/app.js:10
131
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:652
132
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:198
133
  msgid "View Website"
134
  msgstr ""
135
 
136
- #: dist/templates-patterns-collection/includes/Admin.php:382
137
  #: includes/Admin.php:379
138
- #: assets/build/app.js:3288
139
  #: assets/src/Components/ImportModal.js:613
140
- #: dist/templates-patterns-collection/assets/build/app.js:10
141
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:662
142
  msgid "Add your own content"
143
  msgstr ""
144
 
145
- #: dist/templates-patterns-collection/includes/Admin.php:383
146
  #: includes/Admin.php:380
147
- #: assets/build/app.js:3281
148
  #: assets/src/Components/ImportModal.js:594
149
- #: dist/templates-patterns-collection/assets/build/app.js:10
150
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:643
151
  msgid "Back to Sites Library"
152
  msgstr ""
153
 
154
- #: dist/templates-patterns-collection/includes/Admin.php:384
155
  #: includes/Admin.php:381
156
  msgid "Note"
157
  msgstr ""
158
 
159
- #: dist/templates-patterns-collection/includes/Admin.php:385
160
  #: includes/Admin.php:382
161
  msgid "Advanced Options"
162
  msgstr ""
163
 
164
- #: dist/templates-patterns-collection/includes/Admin.php:386
165
  #: includes/Admin.php:383
166
- #: assets/build/app.js:3023
167
  #: assets/src/Components/ImportModal.js:272
168
- #: dist/templates-patterns-collection/assets/build/app.js:10
169
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:286
170
  msgid "Plugins"
171
  msgstr ""
172
 
173
- #: dist/templates-patterns-collection/includes/Admin.php:387
174
  #: includes/Admin.php:384
175
  msgid "General"
176
  msgstr ""
177
 
178
- #: dist/templates-patterns-collection/includes/Admin.php:388
179
  #: includes/Admin.php:385
180
  msgid "Keep current layout"
181
  msgstr ""
182
 
183
- #: dist/templates-patterns-collection/includes/Admin.php:389
184
- #: dist/templates-patterns-collection/includes/Elementor.php:96
185
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:421
186
  #: includes/Admin.php:386
187
  #: includes/Elementor.php:96
188
- #: includes/TI_Beaver.php:421
189
  msgid "Search"
190
  msgstr ""
191
 
192
- #: dist/templates-patterns-collection/includes/Admin.php:390
193
  #: includes/Admin.php:387
194
- #: assets/build/app.js:2966
195
  #: assets/src/Components/ImportModal.js:200
196
- #: dist/templates-patterns-collection/assets/build/app.js:10
197
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:203
198
  msgid "Content"
199
  msgstr ""
200
 
201
- #: dist/templates-patterns-collection/includes/Admin.php:391
202
  #: includes/Admin.php:388
203
- #: assets/build/app.js:2970
204
  #: assets/src/Components/ImportModal.js:204
205
- #: dist/templates-patterns-collection/assets/build/app.js:10
206
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:207
207
  msgid "Customizer"
208
  msgstr ""
209
 
210
- #: dist/templates-patterns-collection/includes/Admin.php:392
211
  #: includes/Admin.php:389
212
- #: assets/build/app.js:2974
213
  #: assets/src/Components/ImportModal.js:208
214
- #: dist/templates-patterns-collection/assets/build/app.js:10
215
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:211
216
  msgid "Widgets"
217
  msgstr ""
218
 
219
- #: dist/templates-patterns-collection/includes/Admin.php:393
220
  #: includes/Admin.php:390
221
  msgid "We recommend you backup your website content before attempting a full site import."
222
  msgstr ""
223
 
224
- #: dist/templates-patterns-collection/includes/Admin.php:394
225
  #: includes/Admin.php:391
226
  msgid "Due to copyright issues, some of the demo images will not be imported and will be replaced by placeholder images."
227
  msgstr ""
228
 
229
- #: dist/templates-patterns-collection/includes/Admin.php:395
230
  #: includes/Admin.php:392
231
  msgid "Some of the demo images will not be imported and will be replaced by placeholder images."
232
  msgstr ""
233
 
234
- #: dist/templates-patterns-collection/includes/Admin.php:396
235
  #: includes/Admin.php:393
236
  msgid "Here is our own collection of related images you can use for your site."
237
  msgstr ""
238
 
239
- #: dist/templates-patterns-collection/includes/Admin.php:397
240
  #: includes/Admin.php:394
241
- #: assets/build/app.js:3261
242
  #: assets/src/Components/ImportModal.js:542
243
- #: dist/templates-patterns-collection/assets/build/app.js:8
244
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:591
245
  msgid "Content was successfully imported. Enjoy your new site!"
246
  msgstr ""
247
 
248
- #: dist/templates-patterns-collection/includes/Admin.php:398
249
  #: includes/Admin.php:395
250
  msgid "Available in the PRO version"
251
  msgstr ""
252
 
253
- #: dist/templates-patterns-collection/includes/Admin.php:399
254
  #: includes/Admin.php:396
255
  msgid "Copy error code"
256
  msgstr ""
257
 
258
- #: dist/templates-patterns-collection/includes/Admin.php:400
259
  #: includes/Admin.php:397
260
  msgid "Download error log"
261
  msgstr ""
262
 
263
- #: dist/templates-patterns-collection/includes/Admin.php:401
264
  #: includes/Admin.php:398
265
  msgid "To import this demo you have to install the following plugins:"
266
  msgstr ""
267
 
268
  #. translators: 1 - 'here'.
269
- #: dist/templates-patterns-collection/includes/Admin.php:404
270
  #: includes/Admin.php:401
271
  msgid "It seems that Rest API is not working properly on your website. Read about how you can fix it %1$s."
272
  msgstr ""
273
 
274
- #: dist/templates-patterns-collection/includes/Admin.php:405
275
  #: includes/Admin.php:402
276
  msgid "here"
277
  msgstr ""
278
 
279
  #. translators: 1 - 'get in touch'.
280
- #: dist/templates-patterns-collection/includes/Admin.php:409
281
  #: includes/Admin.php:406
282
  msgid "Hi! It seems there is a configuration issue with your server that's causing the import to fail. Please %1$s with us with the error code below, so we can help you fix this."
283
  msgstr ""
284
 
285
- #: dist/templates-patterns-collection/includes/Admin.php:410
286
- #: dist/templates-patterns-collection/includes/Admin.php:420
287
  #: includes/Admin.php:407
288
  #: includes/Admin.php:417
289
  msgid "get in touch"
290
  msgstr ""
291
 
292
  #. translators: 1 - 'troubleshooting guide'.
293
- #: dist/templates-patterns-collection/includes/Admin.php:414
294
  #: includes/Admin.php:411
295
  msgid "Hi! It seems there is a configuration issue with your server that's causing the import to fail. Take a look at our %1$s to see if any of the proposed solutions work."
296
  msgstr ""
297
 
298
- #: dist/templates-patterns-collection/includes/Admin.php:415
299
  #: includes/Admin.php:412
300
  msgid "troubleshooting guide"
301
  msgstr ""
302
 
303
  #. translators: 1 - 'get in touch'.
304
- #: dist/templates-patterns-collection/includes/Admin.php:419
305
  #: includes/Admin.php:416
306
  msgid "If none of the solutions in the guide work, please %1$s with us with the error code below, so we can help you fix this."
307
  msgstr ""
308
 
309
  #. translators: %s - 'WP_Filesystem'.
310
- #: dist/templates-patterns-collection/includes/Admin.php:424
311
  #: includes/Admin.php:421
312
  msgid "It seems that %s is not available. You can contact your site administrator or hosting provider to help you enable it."
313
  msgstr ""
314
 
315
- #: dist/templates-patterns-collection/includes/Elementor.php:59
316
- #: dist/templates-patterns-collection/includes/Elementor.php:79
317
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:402
318
  #: includes/Elementor.php:59
319
  #: includes/Elementor.php:79
320
- #: includes/TI_Beaver.php:402
321
  msgid "Save to %s"
322
  msgstr ""
323
 
324
- #: dist/templates-patterns-collection/includes/Elementor.php:60
325
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:382
326
  #: includes/Elementor.php:60
327
- #: includes/TI_Beaver.php:382
328
  msgid "Save Templates"
329
  msgstr ""
330
 
331
- #: dist/templates-patterns-collection/includes/Elementor.php:61
332
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:383
333
  #: includes/Elementor.php:61
334
- #: includes/TI_Beaver.php:383
335
  msgid "Template Name"
336
  msgstr ""
337
 
338
- #: dist/templates-patterns-collection/includes/Elementor.php:62
339
- #: dist/templates-patterns-collection/includes/Elementor.php:107
340
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:384
341
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:478
342
  #: includes/Elementor.php:62
343
  #: includes/Elementor.php:107
344
- #: includes/TI_Beaver.php:384
345
- #: includes/TI_Beaver.php:478
346
  msgid "Template"
347
  msgstr ""
348
 
349
- #: dist/templates-patterns-collection/includes/Elementor.php:63
350
- #: dist/templates-patterns-collection/includes/Elementor.php:100
351
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:385
352
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:426
353
  #: includes/Elementor.php:63
354
  #: includes/Elementor.php:100
355
- #: includes/TI_Beaver.php:385
356
- #: includes/TI_Beaver.php:426
357
  msgid "Save"
358
  msgstr ""
359
 
360
- #: dist/templates-patterns-collection/includes/Elementor.php:64
361
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:386
362
  #: includes/Elementor.php:64
363
- #: includes/TI_Beaver.php:386
364
  msgid "Automatically sync to the cloud"
365
  msgstr ""
366
 
367
- #: dist/templates-patterns-collection/includes/Elementor.php:65
368
  #: includes/Elementor.php:65
369
  msgid "Template Saved."
370
  msgstr ""
371
 
372
- #: dist/templates-patterns-collection/includes/Elementor.php:66
373
  #: includes/Elementor.php:66
374
  msgid "Template Published."
375
  msgstr ""
376
 
377
- #: dist/templates-patterns-collection/includes/Elementor.php:67
378
  #: includes/Elementor.php:67
379
  msgid "Template Unpublished."
380
  msgstr ""
381
 
382
- #: dist/templates-patterns-collection/includes/Elementor.php:70
383
  #: includes/Elementor.php:70
384
  msgid "Import from %s"
385
  msgstr ""
386
 
387
- #: dist/templates-patterns-collection/includes/Elementor.php:72
388
  #: includes/Elementor.php:72
389
  msgid "Add Template from %s:"
390
  msgstr ""
391
 
392
- #: dist/templates-patterns-collection/includes/Elementor.php:74
393
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:397
394
  #: includes/Elementor.php:74
395
- #: includes/TI_Beaver.php:397
396
  msgid "Page Templates"
397
  msgstr ""
398
 
399
- #: dist/templates-patterns-collection/includes/Elementor.php:78
400
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:401
401
  #: includes/Elementor.php:78
402
- #: includes/TI_Beaver.php:401
403
  msgid "Sync Library"
404
  msgstr ""
405
 
406
- #: dist/templates-patterns-collection/includes/Elementor.php:80
407
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:404
408
  #: includes/Elementor.php:80
409
- #: includes/TI_Beaver.php:404
410
- #: assets/build/app.js:447
411
- #: assets/build/app.js:3683
412
- #: assets/build/app.js:3971
413
- #: assets/build/app.js:4221
414
- #: assets/build/app.js:4380
415
  #: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:206
416
  #: assets/src/Components/InstallModal.js:163
417
  #: assets/src/Components/Migration.js:161
418
  #: assets/src/Components/OnboardingContent.js:153
419
  #: assets/src/Components/PreviewFrame.js:54
420
- #: dist/templates-patterns-collection/assets/build/app.js:2
421
- #: dist/templates-patterns-collection/assets/build/app.js:10
422
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:206
423
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:163
424
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:161
425
- #: dist/templates-patterns-collection/assets/src/Components/OnboardingContent.js:153
426
- #: dist/templates-patterns-collection/assets/src/Components/PreviewFrame.js:54
427
  msgid "Close"
428
  msgstr ""
429
 
430
- #: dist/templates-patterns-collection/includes/Elementor.php:82
431
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:405
432
  #: includes/Elementor.php:82
433
- #: includes/TI_Beaver.php:405
434
- #: assets/build/app.js:859
435
  #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:183
436
- #: dist/templates-patterns-collection/assets/build/app.js:2
437
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:183
438
  msgid "Edit"
439
  msgstr ""
440
 
441
- #: dist/templates-patterns-collection/includes/Elementor.php:83
442
  #: includes/Elementor.php:83
443
  msgid "Duplicate"
444
  msgstr ""
445
 
446
- #: dist/templates-patterns-collection/includes/Elementor.php:84
447
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:406
448
  #: includes/Elementor.php:84
449
- #: includes/TI_Beaver.php:406
450
  msgid "Delete"
451
  msgstr ""
452
 
453
- #: dist/templates-patterns-collection/includes/Elementor.php:85
454
  #: includes/Elementor.php:85
455
  msgid "Insert"
456
  msgstr ""
457
 
458
- #: dist/templates-patterns-collection/includes/Elementor.php:86
459
  #: includes/Elementor.php:86
460
  msgid "Back to Library"
461
  msgstr ""
462
 
463
- #: dist/templates-patterns-collection/includes/Elementor.php:89
464
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:412
465
  #: includes/Elementor.php:89
466
- #: includes/TI_Beaver.php:412
467
  msgid "Sort by"
468
  msgstr ""
469
 
470
- #: dist/templates-patterns-collection/includes/Elementor.php:91
471
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:414
472
  #: includes/Elementor.php:91
473
- #: includes/TI_Beaver.php:414
474
  msgid "Name"
475
  msgstr ""
476
 
477
- #: dist/templates-patterns-collection/includes/Elementor.php:92
478
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:415
479
  #: includes/Elementor.php:92
480
- #: includes/TI_Beaver.php:415
481
  msgid "Date"
482
  msgstr ""
483
 
484
- #: dist/templates-patterns-collection/includes/Elementor.php:93
485
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:416
486
  #: includes/Elementor.php:93
487
- #: includes/TI_Beaver.php:416
488
  msgid "Last Modified"
489
  msgstr ""
490
 
491
- #: dist/templates-patterns-collection/includes/Elementor.php:94
492
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:417
493
  #: includes/Elementor.php:94
494
- #: includes/TI_Beaver.php:417
495
  msgid "Actions"
496
  msgstr ""
497
 
498
- #: dist/templates-patterns-collection/includes/Elementor.php:97
499
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:422
500
  #: includes/Elementor.php:97
501
- #: includes/TI_Beaver.php:422
502
  msgid "Search Templates"
503
  msgstr ""
504
 
505
- #: dist/templates-patterns-collection/includes/Elementor.php:101
506
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:427
507
  #: includes/Elementor.php:101
508
- #: includes/TI_Beaver.php:427
509
  msgid "Save your page to %s"
510
  msgstr ""
511
 
512
- #: dist/templates-patterns-collection/includes/Elementor.php:102
513
  #: includes/Elementor.php:102
514
  msgid "Enter Template Name"
515
  msgstr ""
516
 
517
- #: dist/templates-patterns-collection/includes/Elementor.php:103
518
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:428
519
  #: includes/Elementor.php:103
520
- #: includes/TI_Beaver.php:428
521
  msgid "Screenshot URL"
522
  msgstr ""
523
 
524
- #: dist/templates-patterns-collection/includes/Elementor.php:104
525
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:429
526
  #: includes/Elementor.php:104
527
- #: includes/TI_Beaver.php:429
528
  msgid "Site Slug"
529
  msgstr ""
530
 
531
- #: dist/templates-patterns-collection/includes/Elementor.php:105
532
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:430
533
  #: includes/Elementor.php:105
534
- #: includes/TI_Beaver.php:430
535
  msgid "Publish"
536
  msgstr ""
537
 
538
- #: dist/templates-patterns-collection/includes/Elementor.php:106
539
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:431
540
  #: includes/Elementor.php:106
541
- #: includes/TI_Beaver.php:431
542
  msgid "Unpublish"
543
  msgstr ""
544
 
545
- #: dist/templates-patterns-collection/includes/Sites_Listing.php:46
546
- #: dist/templates-patterns-collection/includes/Sites_Listing.php:56
547
  #: includes/Sites_Listing.php:46
548
  #: includes/Sites_Listing.php:56
549
  msgid "Want to keep using Zelle's homepage?"
550
  msgstr ""
551
 
552
- #: dist/templates-patterns-collection/includes/Sites_Listing.php:47
553
- #: dist/templates-patterns-collection/includes/Sites_Listing.php:57
554
  #: includes/Sites_Listing.php:47
555
  #: includes/Sites_Listing.php:57
556
  msgid "Hi! We've noticed you were using Zelle before. To make your transition easier, we can help you keep the same beautiful homepage you had before, by converting it into an Elementor template. This option will also import your homepage content."
557
  msgstr ""
558
 
559
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:35
560
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:37
561
  #: includes/TI_Beaver.php:35
562
  #: includes/TI_Beaver.php:37
563
  msgid "Templates Cloud"
564
  msgstr ""
565
 
566
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:36
567
  #: includes/TI_Beaver.php:36
568
  msgid "Templates Cloud by Neve."
569
  msgstr ""
570
 
571
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:388
572
- #: includes/TI_Beaver.php:388
573
  msgid "Import Failed"
574
  msgstr ""
575
 
576
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:389
577
- #: includes/TI_Beaver.php:389
578
  msgid "Export Failed"
579
  msgstr ""
580
 
581
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:393
582
- #: includes/TI_Beaver.php:393
583
  msgid "No templates available. Add a new one?"
584
  msgstr ""
585
 
586
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:394
587
- #: includes/TI_Beaver.php:394
588
  msgid "Are you sure you want to delete this template?"
589
  msgstr ""
590
 
591
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:395
592
- #: includes/TI_Beaver.php:395
593
  msgid "This template is synced to a page."
594
  msgstr ""
595
 
596
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:403
597
- #: includes/TI_Beaver.php:403
598
  msgid "Update"
599
  msgstr ""
600
 
601
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:407
602
- #: includes/TI_Beaver.php:407
603
  msgid "Deleting"
604
  msgstr ""
605
 
606
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:418
607
- #: includes/TI_Beaver.php:418
608
  msgid "List View"
609
  msgstr ""
610
 
611
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:419
612
- #: includes/TI_Beaver.php:419
613
  msgid "Grid View"
614
  msgstr ""
615
 
616
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:423
617
- #: includes/TI_Beaver.php:423
618
  msgid "Clear search query"
619
  msgstr ""
620
 
621
- #: dist/templates-patterns-collection/includes/TI_Beaver.php:449
622
- #: includes/TI_Beaver.php:449
623
  msgid "Save to Neve Cloud"
624
  msgstr ""
625
 
626
- #: dist/templates-patterns-collection/templates-patterns-collection.php:42
627
  #: templates-patterns-collection.php:42
628
  msgid "You need to have %1$s installed and activated to use %2$s."
629
  msgstr ""
630
 
631
  #. translators: %s Neve theme name.
632
- #: dist/templates-patterns-collection/templates-patterns-collection.php:50
633
  #: templates-patterns-collection.php:50
634
  msgid "Install and Activate %s"
635
  msgstr ""
@@ -642,408 +475,280 @@ msgstr ""
642
  msgid "With Neve, you can choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
643
  msgstr ""
644
 
645
- #: assets/build/app.js:425
646
- #: assets/build/app.js:4691
647
- #: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:155
648
- #: assets/src/Components/StarterSiteCard.js:103
649
- #: dist/templates-patterns-collection/assets/build/app.js:10
650
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:155
651
- #: dist/templates-patterns-collection/assets/src/Components/StarterSiteCard.js:103
652
- msgid "Premium"
653
  msgstr ""
654
 
655
- #: assets/build/app.js:840
656
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:142
657
- #: dist/templates-patterns-collection/assets/build/app.js:2
658
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:142
659
- msgid "Import done!"
660
  msgstr ""
661
 
662
- #: assets/build/app.js:842
663
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:149
664
- #: dist/templates-patterns-collection/assets/build/app.js:2
665
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:149
666
- msgid "Template was successfully imported!"
667
  msgstr ""
668
 
669
- #: assets/build/app.js:842
670
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:153
671
- #: dist/templates-patterns-collection/assets/build/app.js:2
672
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:153
673
- msgid "Templates were successfully imported!"
674
  msgstr ""
675
 
676
- #: assets/build/app.js:856
677
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:174
678
- #: dist/templates-patterns-collection/assets/build/app.js:2
679
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:174
680
- msgid "Visit"
681
  msgstr ""
682
 
683
- #: assets/build/app.js:874
684
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:210
685
- #: dist/templates-patterns-collection/assets/build/app.js:2
686
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:210
687
- msgid "An error occurred!"
688
  msgstr ""
689
 
690
- #. translators: %s the name of the template
691
- #: assets/build/app.js:894
692
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:246
693
- #: dist/templates-patterns-collection/assets/build/app.js:8
694
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:246
695
- msgid "The %s template will be imported as a page into your site. This import will install & activate the page builder plugin if not already installed."
696
  msgstr ""
697
 
698
- #. translators: %s the name of the template
699
- #: assets/build/app.js:894
700
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:252
701
- #: dist/templates-patterns-collection/assets/build/app.js:8
702
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:252
703
- msgid "All the templates that are included in this starter site, will be imported as pages. This import will install & activate the page builder plugin if not already installed."
704
  msgstr ""
705
 
706
- #. translators: name of starter site
707
- #: assets/build/app.js:913
708
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:277
709
- #: dist/templates-patterns-collection/assets/build/app.js:4
710
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:277
711
- msgid "Import the %s template"
712
  msgstr ""
713
 
714
- #. translators: name of template
715
- #: assets/build/app.js:915
716
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:282
717
- #: dist/templates-patterns-collection/assets/build/app.js:6
718
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:282
719
- msgid "Import all templates from %s"
720
  msgstr ""
721
 
722
- #: assets/build/app.js:924
723
- #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:302
724
- #: dist/templates-patterns-collection/assets/build/app.js:8
725
- #: dist/templates-patterns-collection/assets/src/Components/CloudLibrary/ImportTemplatesModal.js:302
726
- msgid "I want to import the entire site"
727
  msgstr ""
728
 
729
- #: assets/build/app.js:2350
730
- #: assets/build/app.js:2379
731
- #: assets/build/app.js:2460
732
- #: assets/src/Components/EditorSelector.js:30
733
- #: assets/src/Components/EditorSelector.js:70
734
- #: assets/src/Components/EditorTabs.js:42
735
- #: dist/templates-patterns-collection/assets/build/app.js:10
736
- #: dist/templates-patterns-collection/assets/src/Components/EditorSelector.js:30
737
- #: dist/templates-patterns-collection/assets/src/Components/EditorSelector.js:70
738
- #: dist/templates-patterns-collection/assets/src/Components/EditorTabs.js:42
739
- msgid "Builder Logo"
740
  msgstr ""
741
 
742
- #: assets/build/app.js:2854
743
- #: assets/build/app.js:2879
744
- #: assets/src/Components/ImportModal.js:61
745
- #: assets/src/Components/ImportModal.js:97
746
- #: dist/templates-patterns-collection/assets/build/app.js:8
747
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:64
748
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:100
749
- msgid "Something went wrong while loading the site data. Please refresh the page and try again."
750
  msgstr ""
751
 
752
- #. translators: name of starter site
753
- #: assets/build/app.js:2958
754
- #: assets/src/Components/ImportModal.js:180
755
- #: dist/templates-patterns-collection/assets/build/app.js:10
756
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:183
757
- msgid "Import %s as a complete site"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  msgstr ""
759
 
760
  #. translators: name of starter site
761
- #: assets/build/app.js:2960
762
- #: assets/src/Components/ImportModal.js:188
763
- #: dist/templates-patterns-collection/assets/build/app.js:10
764
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:191
765
- msgid "Import the entire site including customizer options, pages, content and plugins."
766
  msgstr ""
767
 
768
- #: assets/build/app.js:2987
769
- #: assets/src/Components/ImportModal.js:222
770
- #: dist/templates-patterns-collection/assets/build/app.js:10
771
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:236
772
- msgid "Import settings"
773
  msgstr ""
774
 
775
- #: assets/build/app.js:3179
776
- #: assets/src/Components/ImportModal.js:427
777
- #: dist/templates-patterns-collection/assets/build/app.js:8
778
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:472
779
- msgid "Something went wrong while installing the necessary plugins."
780
  msgstr ""
781
 
782
- #: assets/build/app.js:3180
783
- #: assets/src/Components/ImportModal.js:431
784
- #: dist/templates-patterns-collection/assets/build/app.js:8
785
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:476
786
- msgid "Something went wrong while importing the website content."
787
  msgstr ""
788
 
789
- #: assets/build/app.js:3181
790
- #: assets/src/Components/ImportModal.js:435
791
- #: dist/templates-patterns-collection/assets/build/app.js:8
792
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:480
793
- msgid "Something went wrong while updating the customizer settings."
794
  msgstr ""
795
 
796
- #: assets/build/app.js:3182
797
- #: assets/src/Components/ImportModal.js:439
798
- #: dist/templates-patterns-collection/assets/build/app.js:8
799
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:484
800
- msgid "Something went wrong while importing the widgets."
801
  msgstr ""
802
 
803
- #: assets/build/app.js:3267
804
- #: assets/src/Components/ImportModal.js:562
805
- #: dist/templates-patterns-collection/assets/build/app.js:10
806
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:611
807
- msgid "I want to import just the templates"
808
  msgstr ""
809
 
810
- #: assets/build/app.js:3275
811
- #: assets/src/Components/ImportModal.js:580
812
- #: dist/templates-patterns-collection/assets/build/app.js:10
813
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:629
814
- msgid "Import entire site"
815
  msgstr ""
816
 
817
- #: assets/build/app.js:3358
818
- #: assets/src/Components/ImportModalError.js:26
819
- #: dist/templates-patterns-collection/assets/build/app.js:2
820
- #: dist/templates-patterns-collection/assets/src/Components/ImportModalError.js:26
821
- msgid "Error code"
822
  msgstr ""
823
 
824
- #: assets/build/app.js:3358
825
- #: assets/src/Components/ImportModalError.js:31
826
- #: dist/templates-patterns-collection/assets/build/app.js:2
827
- #: dist/templates-patterns-collection/assets/src/Components/ImportModalError.js:31
828
- msgid "Error log"
829
  msgstr ""
830
 
831
- #: assets/build/app.js:3448
832
  #: assets/src/Components/ImportStepper.js:8
833
- #: dist/templates-patterns-collection/assets/build/app.js:8
834
- #: dist/templates-patterns-collection/assets/src/Components/ImportStepper.js:13
835
  msgid "Installing Plugins"
836
  msgstr ""
837
 
838
- #: assets/build/app.js:3453
839
  #: assets/src/Components/ImportStepper.js:13
840
- #: dist/templates-patterns-collection/assets/build/app.js:8
841
- #: dist/templates-patterns-collection/assets/src/Components/ImportStepper.js:18
842
  msgid "Importing Content"
843
  msgstr ""
844
 
845
- #: assets/build/app.js:3458
846
  #: assets/src/Components/ImportStepper.js:18
847
- #: dist/templates-patterns-collection/assets/build/app.js:8
848
- #: dist/templates-patterns-collection/assets/src/Components/ImportStepper.js:23
849
  msgid "Importing Customizer Settings"
850
  msgstr ""
851
 
852
- #: assets/build/app.js:3463
853
  #: assets/src/Components/ImportStepper.js:26
854
- #: dist/templates-patterns-collection/assets/build/app.js:8
855
- #: dist/templates-patterns-collection/assets/src/Components/ImportStepper.js:31
856
  msgid "Importing Widgets"
857
  msgstr ""
858
 
859
- #. translators: %s: Error message.
860
- #: assets/build/app.js:3587
861
- #: assets/src/Components/InstallModal.js:31
862
- #: dist/templates-patterns-collection/assets/build/app.js:2
863
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:31
864
- msgid "An error has ocurred: %s"
865
- msgstr ""
866
-
867
- #: assets/build/app.js:3604
868
- #: assets/src/Components/InstallModal.js:52
869
- #: dist/templates-patterns-collection/assets/build/app.js:2
870
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:52
871
- msgid "Could not install theme."
872
- msgstr ""
873
-
874
- #. translators: %s: Error message.
875
- #: assets/build/app.js:3614
876
- #: assets/src/Components/InstallModal.js:67
877
- #: dist/templates-patterns-collection/assets/build/app.js:2
878
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:67
879
- msgid "Could not activate theme."
880
- msgstr ""
881
-
882
- #: assets/build/app.js:3634
883
- #: assets/src/Components/InstallModal.js:89
884
- #: dist/templates-patterns-collection/assets/build/app.js:2
885
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:89
886
- msgid "Install and Activate Neve"
887
  msgstr ""
888
 
889
- #: assets/build/app.js:3648
890
- #: assets/src/Components/InstallModal.js:102
891
- #: dist/templates-patterns-collection/assets/build/app.js:2
892
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:102
893
- msgid "Logo"
894
  msgstr ""
895
 
896
- #: assets/build/app.js:3659
897
- #: assets/src/Components/InstallModal.js:116
898
- #: dist/templates-patterns-collection/assets/build/app.js:2
899
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:116
900
- msgid "In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve"
901
  msgstr ""
902
 
903
- #: assets/build/app.js:3676
904
- #: assets/src/Components/InstallModal.js:147
905
- #: dist/templates-patterns-collection/assets/build/app.js:2
906
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:147
907
- msgid "Install and Activate"
908
  msgstr ""
909
 
910
- #: assets/build/app.js:3676
911
- #: assets/src/Components/InstallModal.js:151
912
- #: dist/templates-patterns-collection/assets/build/app.js:2
913
- #: dist/templates-patterns-collection/assets/src/Components/InstallModal.js:151
914
- msgid "Activate"
915
  msgstr ""
916
 
917
- #: assets/build/app.js:3942
918
- #: assets/build/app.js:4014
919
- #: assets/src/Components/Migration.js:82
920
- #: assets/src/Components/Migration.js:240
921
- #: dist/templates-patterns-collection/assets/build/app.js:2
922
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:82
923
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:240
924
- msgid "Migrate"
925
  msgstr ""
926
 
927
- #: assets/build/app.js:3964
928
- #: assets/src/Components/Migration.js:141
929
- #: dist/templates-patterns-collection/assets/build/app.js:2
930
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:141
931
- msgid "Migrating"
932
  msgstr ""
933
 
934
- #: assets/build/app.js:3976
935
- #: assets/src/Components/Migration.js:177
936
- #: dist/templates-patterns-collection/assets/build/app.js:2
937
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:177
938
- msgid "Start Migration"
939
  msgstr ""
940
 
941
- #: assets/build/app.js:3982
942
- #: assets/src/Components/Migration.js:189
943
- #: dist/templates-patterns-collection/assets/build/app.js:2
944
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:189
945
- msgid "Edit Content"
946
  msgstr ""
947
 
948
- #: assets/build/app.js:4025
949
- #: assets/src/Components/Migration.js:260
950
- #: dist/templates-patterns-collection/assets/build/app.js:2
951
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:260
952
- msgid "Dismissed"
953
  msgstr ""
954
 
955
- #: assets/build/app.js:4029
956
- #: assets/src/Components/Migration.js:269
957
- #: dist/templates-patterns-collection/assets/build/app.js:2
958
- #: dist/templates-patterns-collection/assets/src/Components/Migration.js:269
959
- msgid "Dismiss"
960
  msgstr ""
961
 
962
- #: assets/build/app.js:4230
963
- #: assets/src/Components/OnboardingContent.js:171
964
- #: dist/templates-patterns-collection/assets/build/app.js:10
965
- #: dist/templates-patterns-collection/assets/src/Components/OnboardingContent.js:171
966
- msgid "No results found"
967
  msgstr ""
968
 
969
- #: assets/build/app.js:4385
970
  #: assets/src/Components/PreviewFrame.js:62
971
- #: dist/templates-patterns-collection/assets/build/app.js:10
972
- #: dist/templates-patterns-collection/assets/src/Components/PreviewFrame.js:62
973
  msgid "Previous"
974
  msgstr ""
975
 
976
- #: assets/build/app.js:4390
977
  #: assets/src/Components/PreviewFrame.js:74
978
- #: dist/templates-patterns-collection/assets/build/app.js:10
979
- #: dist/templates-patterns-collection/assets/src/Components/PreviewFrame.js:74
980
  msgid "Next"
981
  msgstr ""
982
 
983
- #: assets/build/app.js:4398
984
  #: assets/src/Components/PreviewFrame.js:91
985
- #: dist/templates-patterns-collection/assets/build/app.js:10
986
- #: dist/templates-patterns-collection/assets/src/Components/PreviewFrame.js:91
987
  msgid "Upgrade and Import"
988
  msgstr ""
989
 
990
- #: assets/build/app.js:4542
991
  #: assets/src/Components/Search.js:102
992
- #: dist/templates-patterns-collection/assets/build/app.js:10
993
- #: dist/templates-patterns-collection/assets/src/Components/Search.js:102
994
  msgid "Search for a starter site"
995
  msgstr ""
996
 
997
- #: assets/build/app.js:4677
998
- #: assets/src/Components/StarterSiteCard.js:81
999
- #: dist/templates-patterns-collection/assets/build/app.js:10
1000
- #: dist/templates-patterns-collection/assets/src/Components/StarterSiteCard.js:81
1001
- msgid "View Pages"
1002
- msgstr ""
1003
-
1004
- #: assets/build/app.js:5323
1005
- #: assets/src/utils/common.js:27
1006
- #: dist/templates-patterns-collection/assets/build/app.js:8
1007
- #: dist/templates-patterns-collection/assets/src/utils/common.js:27
1008
- msgid "Business"
1009
- msgstr ""
1010
-
1011
- #: assets/build/app.js:5323
1012
- #: assets/src/utils/common.js:28
1013
- #: dist/templates-patterns-collection/assets/build/app.js:8
1014
- #: dist/templates-patterns-collection/assets/src/utils/common.js:28
1015
- msgid "Ecommerce"
1016
- msgstr ""
1017
-
1018
- #: assets/build/app.js:5323
1019
- #: assets/src/utils/common.js:29
1020
- #: dist/templates-patterns-collection/assets/build/app.js:8
1021
- #: dist/templates-patterns-collection/assets/src/utils/common.js:29
1022
- msgid "Fashion"
1023
- msgstr ""
1024
-
1025
- #: assets/build/app.js:5323
1026
- #: assets/src/utils/common.js:30
1027
- #: dist/templates-patterns-collection/assets/build/app.js:8
1028
- #: dist/templates-patterns-collection/assets/src/utils/common.js:30
1029
- msgid "Blogging"
1030
- msgstr ""
1031
-
1032
- #: assets/build/app.js:5323
1033
- #: assets/src/utils/common.js:31
1034
- #: dist/templates-patterns-collection/assets/build/app.js:8
1035
- #: dist/templates-patterns-collection/assets/src/utils/common.js:31
1036
- msgid "Photography"
1037
- msgstr ""
1038
-
1039
- #: dist/templates-patterns-collection/assets/build/app.js:8
1040
- #: dist/templates-patterns-collection/assets/build/app.js:10
1041
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:220
1042
- #: dist/templates-patterns-collection/assets/src/Components/ImportStepper.js:8
1043
- msgid "Cleanup previous Import"
1044
  msgstr ""
1045
 
1046
- #: dist/templates-patterns-collection/assets/build/app.js:8
1047
- #: dist/templates-patterns-collection/assets/src/Components/ImportModal.js:468
1048
- msgid "Something went wrong while cleaning the previous import."
1049
  msgstr ""
1
  # Copyright (C) 2021 ThemeIsle
2
+ # This file is distributed under the same license as the Templates Patterns Collection plugin.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Templates Patterns Collection 1.1.10\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-07-05T02:54:47+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: templates-patterns-collection\n"
16
 
17
  #. Plugin Name of the plugin
30
  msgid "https://themeisle.com"
31
  msgstr ""
32
 
 
 
33
  #: includes/Admin.php:70
34
  #: includes/Admin.php:71
35
  msgid "Starter Sites"
36
  msgstr ""
37
 
 
 
 
38
  #: includes/Admin.php:80
39
  #: includes/Elementor.php:75
40
+ #: includes/TI_Beaver.php:402
41
  msgid "My Library"
42
  msgstr ""
43
 
44
  #. translators: %s - Theme name
 
45
  #: includes/Admin.php:153
46
  msgid "Choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
47
  msgstr ""
48
 
 
49
  #: includes/Admin.php:244
50
  msgid "Great news! Now you can export your own custom designs to the cloud and then reuse them on other sites."
51
  msgstr ""
52
 
 
53
  #: includes/Admin.php:245
54
  msgid "Open %s"
55
  msgstr ""
56
 
 
57
  #: includes/Admin.php:342
58
  msgid "Hi! We've noticed you were using a child theme of Zelle before. To make your transition easier, we can help you keep the same homepage settings you had before but in original Zelle's style, by converting it into an Elementor template."
59
  msgstr ""
60
 
 
 
61
  #: includes/Admin.php:372
62
+ #: includes/TI_Beaver.php:412
63
+ #: assets/build/app.js:10
64
  #: assets/src/Components/StarterSiteCard.js:60
 
 
65
  msgid "Preview"
66
  msgstr ""
67
 
 
 
68
  #: includes/Admin.php:373
69
+ #: includes/TI_Beaver.php:413
70
+ #: assets/build/app.js:10
 
71
  #: assets/src/Components/PreviewFrame.js:102
72
  #: assets/src/Components/StarterSiteCard.js:68
 
 
 
73
  msgid "Import"
74
  msgstr ""
75
 
 
76
  #: includes/Admin.php:374
77
  msgid "Get the PRO version!"
78
  msgstr ""
79
 
 
80
  #: includes/Admin.php:375
81
  msgid "Importing"
82
  msgstr ""
83
 
 
 
 
84
  #: includes/Admin.php:376
85
  #: includes/Elementor.php:81
86
+ #: includes/TI_Beaver.php:391
87
+ #: assets/build/app.js:2
88
  #: assets/src/Components/Migration.js:165
 
 
89
  msgid "Cancel"
90
  msgstr ""
91
 
 
92
  #: includes/Admin.php:377
93
  msgid "Loading"
94
  msgstr ""
95
 
 
96
  #: includes/Admin.php:378
97
+ #: assets/build/app.js:2
98
+ #: assets/build/app.js:10
99
  #: assets/src/Components/ImportModal.js:603
100
  #: assets/src/Components/Migration.js:198
 
 
 
 
101
  msgid "View Website"
102
  msgstr ""
103
 
 
104
  #: includes/Admin.php:379
105
+ #: assets/build/app.js:10
106
  #: assets/src/Components/ImportModal.js:613
 
 
107
  msgid "Add your own content"
108
  msgstr ""
109
 
 
110
  #: includes/Admin.php:380
111
+ #: assets/build/app.js:10
112
  #: assets/src/Components/ImportModal.js:594
 
 
113
  msgid "Back to Sites Library"
114
  msgstr ""
115
 
 
116
  #: includes/Admin.php:381
117
  msgid "Note"
118
  msgstr ""
119
 
 
120
  #: includes/Admin.php:382
121
  msgid "Advanced Options"
122
  msgstr ""
123
 
 
124
  #: includes/Admin.php:383
125
+ #: assets/build/app.js:10
126
  #: assets/src/Components/ImportModal.js:272
 
 
127
  msgid "Plugins"
128
  msgstr ""
129
 
 
130
  #: includes/Admin.php:384
131
  msgid "General"
132
  msgstr ""
133
 
 
134
  #: includes/Admin.php:385
135
  msgid "Keep current layout"
136
  msgstr ""
137
 
 
 
 
138
  #: includes/Admin.php:386
139
  #: includes/Elementor.php:96
140
+ #: includes/TI_Beaver.php:425
141
  msgid "Search"
142
  msgstr ""
143
 
 
144
  #: includes/Admin.php:387
145
+ #: assets/build/app.js:10
146
  #: assets/src/Components/ImportModal.js:200
 
 
147
  msgid "Content"
148
  msgstr ""
149
 
 
150
  #: includes/Admin.php:388
151
+ #: assets/build/app.js:10
152
  #: assets/src/Components/ImportModal.js:204
 
 
153
  msgid "Customizer"
154
  msgstr ""
155
 
 
156
  #: includes/Admin.php:389
157
+ #: assets/build/app.js:10
158
  #: assets/src/Components/ImportModal.js:208
 
 
159
  msgid "Widgets"
160
  msgstr ""
161
 
 
162
  #: includes/Admin.php:390
163
  msgid "We recommend you backup your website content before attempting a full site import."
164
  msgstr ""
165
 
 
166
  #: includes/Admin.php:391
167
  msgid "Due to copyright issues, some of the demo images will not be imported and will be replaced by placeholder images."
168
  msgstr ""
169
 
 
170
  #: includes/Admin.php:392
171
  msgid "Some of the demo images will not be imported and will be replaced by placeholder images."
172
  msgstr ""
173
 
 
174
  #: includes/Admin.php:393
175
  msgid "Here is our own collection of related images you can use for your site."
176
  msgstr ""
177
 
 
178
  #: includes/Admin.php:394
179
+ #: assets/build/app.js:8
180
  #: assets/src/Components/ImportModal.js:542
 
 
181
  msgid "Content was successfully imported. Enjoy your new site!"
182
  msgstr ""
183
 
 
184
  #: includes/Admin.php:395
185
  msgid "Available in the PRO version"
186
  msgstr ""
187
 
 
188
  #: includes/Admin.php:396
189
  msgid "Copy error code"
190
  msgstr ""
191
 
 
192
  #: includes/Admin.php:397
193
  msgid "Download error log"
194
  msgstr ""
195
 
 
196
  #: includes/Admin.php:398
197
  msgid "To import this demo you have to install the following plugins:"
198
  msgstr ""
199
 
200
  #. translators: 1 - 'here'.
 
201
  #: includes/Admin.php:401
202
  msgid "It seems that Rest API is not working properly on your website. Read about how you can fix it %1$s."
203
  msgstr ""
204
 
 
205
  #: includes/Admin.php:402
206
  msgid "here"
207
  msgstr ""
208
 
209
  #. translators: 1 - 'get in touch'.
 
210
  #: includes/Admin.php:406
211
  msgid "Hi! It seems there is a configuration issue with your server that's causing the import to fail. Please %1$s with us with the error code below, so we can help you fix this."
212
  msgstr ""
213
 
 
 
214
  #: includes/Admin.php:407
215
  #: includes/Admin.php:417
216
  msgid "get in touch"
217
  msgstr ""
218
 
219
  #. translators: 1 - 'troubleshooting guide'.
 
220
  #: includes/Admin.php:411
221
  msgid "Hi! It seems there is a configuration issue with your server that's causing the import to fail. Take a look at our %1$s to see if any of the proposed solutions work."
222
  msgstr ""
223
 
 
224
  #: includes/Admin.php:412
225
  msgid "troubleshooting guide"
226
  msgstr ""
227
 
228
  #. translators: 1 - 'get in touch'.
 
229
  #: includes/Admin.php:416
230
  msgid "If none of the solutions in the guide work, please %1$s with us with the error code below, so we can help you fix this."
231
  msgstr ""
232
 
233
  #. translators: %s - 'WP_Filesystem'.
 
234
  #: includes/Admin.php:421
235
  msgid "It seems that %s is not available. You can contact your site administrator or hosting provider to help you enable it."
236
  msgstr ""
237
 
 
 
 
238
  #: includes/Elementor.php:59
239
  #: includes/Elementor.php:79
240
+ #: includes/TI_Beaver.php:406
241
  msgid "Save to %s"
242
  msgstr ""
243
 
 
 
244
  #: includes/Elementor.php:60
245
+ #: includes/TI_Beaver.php:386
246
  msgid "Save Templates"
247
  msgstr ""
248
 
 
 
249
  #: includes/Elementor.php:61
250
+ #: includes/TI_Beaver.php:387
251
  msgid "Template Name"
252
  msgstr ""
253
 
 
 
 
 
254
  #: includes/Elementor.php:62
255
  #: includes/Elementor.php:107
256
+ #: includes/TI_Beaver.php:388
257
+ #: includes/TI_Beaver.php:482
258
  msgid "Template"
259
  msgstr ""
260
 
 
 
 
 
261
  #: includes/Elementor.php:63
262
  #: includes/Elementor.php:100
263
+ #: includes/TI_Beaver.php:389
264
+ #: includes/TI_Beaver.php:430
265
  msgid "Save"
266
  msgstr ""
267
 
 
 
268
  #: includes/Elementor.php:64
269
+ #: includes/TI_Beaver.php:390
270
  msgid "Automatically sync to the cloud"
271
  msgstr ""
272
 
 
273
  #: includes/Elementor.php:65
274
  msgid "Template Saved."
275
  msgstr ""
276
 
 
277
  #: includes/Elementor.php:66
278
  msgid "Template Published."
279
  msgstr ""
280
 
 
281
  #: includes/Elementor.php:67
282
  msgid "Template Unpublished."
283
  msgstr ""
284
 
 
285
  #: includes/Elementor.php:70
286
  msgid "Import from %s"
287
  msgstr ""
288
 
 
289
  #: includes/Elementor.php:72
290
  msgid "Add Template from %s:"
291
  msgstr ""
292
 
 
 
293
  #: includes/Elementor.php:74
294
+ #: includes/TI_Beaver.php:401
295
  msgid "Page Templates"
296
  msgstr ""
297
 
 
 
298
  #: includes/Elementor.php:78
299
+ #: includes/TI_Beaver.php:405
300
  msgid "Sync Library"
301
  msgstr ""
302
 
 
 
303
  #: includes/Elementor.php:80
304
+ #: includes/TI_Beaver.php:408
305
+ #: assets/build/app.js:2
306
+ #: assets/build/app.js:10
 
 
 
307
  #: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:206
308
  #: assets/src/Components/InstallModal.js:163
309
  #: assets/src/Components/Migration.js:161
310
  #: assets/src/Components/OnboardingContent.js:153
311
  #: assets/src/Components/PreviewFrame.js:54
 
 
 
 
 
 
 
312
  msgid "Close"
313
  msgstr ""
314
 
 
 
315
  #: includes/Elementor.php:82
316
+ #: includes/TI_Beaver.php:409
317
+ #: assets/build/app.js:2
318
  #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:183
 
 
319
  msgid "Edit"
320
  msgstr ""
321
 
 
322
  #: includes/Elementor.php:83
323
  msgid "Duplicate"
324
  msgstr ""
325
 
 
 
326
  #: includes/Elementor.php:84
327
+ #: includes/TI_Beaver.php:410
328
  msgid "Delete"
329
  msgstr ""
330
 
 
331
  #: includes/Elementor.php:85
332
  msgid "Insert"
333
  msgstr ""
334
 
 
335
  #: includes/Elementor.php:86
336
  msgid "Back to Library"
337
  msgstr ""
338
 
 
 
339
  #: includes/Elementor.php:89
340
+ #: includes/TI_Beaver.php:416
341
  msgid "Sort by"
342
  msgstr ""
343
 
 
 
344
  #: includes/Elementor.php:91
345
+ #: includes/TI_Beaver.php:418
346
  msgid "Name"
347
  msgstr ""
348
 
 
 
349
  #: includes/Elementor.php:92
350
+ #: includes/TI_Beaver.php:419
351
  msgid "Date"
352
  msgstr ""
353
 
 
 
354
  #: includes/Elementor.php:93
355
+ #: includes/TI_Beaver.php:420
356
  msgid "Last Modified"
357
  msgstr ""
358
 
 
 
359
  #: includes/Elementor.php:94
360
+ #: includes/TI_Beaver.php:421
361
  msgid "Actions"
362
  msgstr ""
363
 
 
 
364
  #: includes/Elementor.php:97
365
+ #: includes/TI_Beaver.php:426
366
  msgid "Search Templates"
367
  msgstr ""
368
 
 
 
369
  #: includes/Elementor.php:101
370
+ #: includes/TI_Beaver.php:431
371
  msgid "Save your page to %s"
372
  msgstr ""
373
 
 
374
  #: includes/Elementor.php:102
375
  msgid "Enter Template Name"
376
  msgstr ""
377
 
 
 
378
  #: includes/Elementor.php:103
379
+ #: includes/TI_Beaver.php:432
380
  msgid "Screenshot URL"
381
  msgstr ""
382
 
 
 
383
  #: includes/Elementor.php:104
384
+ #: includes/TI_Beaver.php:433
385
  msgid "Site Slug"
386
  msgstr ""
387
 
 
 
388
  #: includes/Elementor.php:105
389
+ #: includes/TI_Beaver.php:434
390
  msgid "Publish"
391
  msgstr ""
392
 
 
 
393
  #: includes/Elementor.php:106
394
+ #: includes/TI_Beaver.php:435
395
  msgid "Unpublish"
396
  msgstr ""
397
 
 
 
398
  #: includes/Sites_Listing.php:46
399
  #: includes/Sites_Listing.php:56
400
  msgid "Want to keep using Zelle's homepage?"
401
  msgstr ""
402
 
 
 
403
  #: includes/Sites_Listing.php:47
404
  #: includes/Sites_Listing.php:57
405
  msgid "Hi! We've noticed you were using Zelle before. To make your transition easier, we can help you keep the same beautiful homepage you had before, by converting it into an Elementor template. This option will also import your homepage content."
406
  msgstr ""
407
 
 
 
408
  #: includes/TI_Beaver.php:35
409
  #: includes/TI_Beaver.php:37
410
  msgid "Templates Cloud"
411
  msgstr ""
412
 
 
413
  #: includes/TI_Beaver.php:36
414
  msgid "Templates Cloud by Neve."
415
  msgstr ""
416
 
417
+ #: includes/TI_Beaver.php:392
 
418
  msgid "Import Failed"
419
  msgstr ""
420
 
421
+ #: includes/TI_Beaver.php:393
 
422
  msgid "Export Failed"
423
  msgstr ""
424
 
425
+ #: includes/TI_Beaver.php:397
 
426
  msgid "No templates available. Add a new one?"
427
  msgstr ""
428
 
429
+ #: includes/TI_Beaver.php:398
 
430
  msgid "Are you sure you want to delete this template?"
431
  msgstr ""
432
 
433
+ #: includes/TI_Beaver.php:399
 
434
  msgid "This template is synced to a page."
435
  msgstr ""
436
 
437
+ #: includes/TI_Beaver.php:407
 
438
  msgid "Update"
439
  msgstr ""
440
 
441
+ #: includes/TI_Beaver.php:411
 
442
  msgid "Deleting"
443
  msgstr ""
444
 
445
+ #: includes/TI_Beaver.php:422
 
446
  msgid "List View"
447
  msgstr ""
448
 
449
+ #: includes/TI_Beaver.php:423
 
450
  msgid "Grid View"
451
  msgstr ""
452
 
453
+ #: includes/TI_Beaver.php:427
 
454
  msgid "Clear search query"
455
  msgstr ""
456
 
457
+ #: includes/TI_Beaver.php:453
 
458
  msgid "Save to Neve Cloud"
459
  msgstr ""
460
 
 
461
  #: templates-patterns-collection.php:42
462
  msgid "You need to have %1$s installed and activated to use %2$s."
463
  msgstr ""
464
 
465
  #. translators: %s Neve theme name.
 
466
  #: templates-patterns-collection.php:50
467
  msgid "Install and Activate %s"
468
  msgstr ""
475
  msgid "With Neve, you can choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
476
  msgstr ""
477
 
478
+ #. translators: %s: Error message.
479
+ #: assets/build/app.js:2
480
+ #: assets/src/Components/InstallModal.js:31
481
+ msgid "An error has ocurred: %s"
 
 
 
 
482
  msgstr ""
483
 
484
+ #. translators: %s: Error message.
485
+ #: assets/build/app.js:2
486
+ #: assets/src/Components/InstallModal.js:67
487
+ msgid "Could not activate theme."
 
488
  msgstr ""
489
 
490
+ #: assets/build/app.js:2
491
+ #: assets/src/Components/InstallModal.js:89
492
+ msgid "Install and Activate Neve"
 
 
493
  msgstr ""
494
 
495
+ #: assets/build/app.js:2
496
+ #: assets/src/Components/InstallModal.js:102
497
+ msgid "Logo"
 
 
498
  msgstr ""
499
 
500
+ #: assets/build/app.js:2
501
+ #: assets/src/Components/InstallModal.js:116
502
+ msgid "In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve"
 
 
503
  msgstr ""
504
 
505
+ #: assets/build/app.js:2
506
+ #: assets/src/Components/InstallModal.js:52
507
+ msgid "Could not install theme."
 
 
508
  msgstr ""
509
 
510
+ #: assets/build/app.js:2
511
+ #: assets/src/Components/InstallModal.js:147
512
+ msgid "Install and Activate"
 
 
 
513
  msgstr ""
514
 
515
+ #: assets/build/app.js:2
516
+ #: assets/src/Components/InstallModal.js:151
517
+ msgid "Activate"
 
 
 
518
  msgstr ""
519
 
520
+ #: assets/build/app.js:2
521
+ #: assets/src/Components/ImportModalError.js:26
522
+ msgid "Error code"
 
 
 
523
  msgstr ""
524
 
525
+ #: assets/build/app.js:2
526
+ #: assets/src/Components/ImportModalError.js:31
527
+ msgid "Error log"
 
 
 
528
  msgstr ""
529
 
530
+ #: assets/build/app.js:2
531
+ #: assets/src/Components/Migration.js:82
532
+ #: assets/src/Components/Migration.js:240
533
+ msgid "Migrate"
 
534
  msgstr ""
535
 
536
+ #: assets/build/app.js:2
537
+ #: assets/src/Components/Migration.js:141
538
+ msgid "Migrating"
 
 
 
 
 
 
 
 
539
  msgstr ""
540
 
541
+ #: assets/build/app.js:2
542
+ #: assets/src/Components/Migration.js:189
543
+ msgid "Edit Content"
 
 
 
 
 
544
  msgstr ""
545
 
546
+ #: assets/build/app.js:2
547
+ #: assets/src/Components/Migration.js:177
548
+ msgid "Start Migration"
549
+ msgstr ""
550
+
551
+ #: assets/build/app.js:2
552
+ #: assets/src/Components/Migration.js:260
553
+ msgid "Dismissed"
554
+ msgstr ""
555
+
556
+ #: assets/build/app.js:2
557
+ #: assets/src/Components/Migration.js:269
558
+ msgid "Dismiss"
559
+ msgstr ""
560
+
561
+ #: assets/build/app.js:2
562
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:210
563
+ msgid "An error occurred!"
564
+ msgstr ""
565
+
566
+ #: assets/build/app.js:2
567
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:142
568
+ msgid "Import done!"
569
+ msgstr ""
570
+
571
+ #: assets/build/app.js:2
572
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:149
573
+ msgid "Template was successfully imported!"
574
+ msgstr ""
575
+
576
+ #: assets/build/app.js:2
577
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:153
578
+ msgid "Templates were successfully imported!"
579
+ msgstr ""
580
+
581
+ #: assets/build/app.js:2
582
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:174
583
+ msgid "Visit"
584
  msgstr ""
585
 
586
  #. translators: name of starter site
587
+ #: assets/build/app.js:4
588
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:277
589
+ msgid "Import the %s template"
 
 
590
  msgstr ""
591
 
592
+ #. translators: name of template
593
+ #: assets/build/app.js:6
594
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:282
595
+ msgid "Import all templates from %s"
 
596
  msgstr ""
597
 
598
+ #. translators: %s the name of the template
599
+ #: assets/build/app.js:8
600
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:246
601
+ msgid "The %s template will be imported as a page into your site. This import will install & activate the page builder plugin if not already installed."
 
602
  msgstr ""
603
 
604
+ #. translators: %s the name of the template
605
+ #: assets/build/app.js:8
606
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:252
607
+ msgid "All the templates that are included in this starter site, will be imported as pages. This import will install & activate the page builder plugin if not already installed."
 
608
  msgstr ""
609
 
610
+ #: assets/build/app.js:8
611
+ #: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:302
612
+ msgid "I want to import the entire site"
 
 
613
  msgstr ""
614
 
615
+ #: assets/build/app.js:8
616
+ #: assets/src/utils/common.js:27
617
+ msgid "Business"
 
 
618
  msgstr ""
619
 
620
+ #: assets/build/app.js:8
621
+ #: assets/src/utils/common.js:28
622
+ msgid "Ecommerce"
 
 
623
  msgstr ""
624
 
625
+ #: assets/build/app.js:8
626
+ #: assets/src/utils/common.js:29
627
+ msgid "Fashion"
 
 
628
  msgstr ""
629
 
630
+ #: assets/build/app.js:8
631
+ #: assets/src/utils/common.js:30
632
+ msgid "Blogging"
 
 
633
  msgstr ""
634
 
635
+ #: assets/build/app.js:8
636
+ #: assets/src/utils/common.js:31
637
+ msgid "Photography"
 
 
638
  msgstr ""
639
 
640
+ #: assets/build/app.js:8
641
  #: assets/src/Components/ImportStepper.js:8
 
 
642
  msgid "Installing Plugins"
643
  msgstr ""
644
 
645
+ #: assets/build/app.js:8
646
  #: assets/src/Components/ImportStepper.js:13
 
 
647
  msgid "Importing Content"
648
  msgstr ""
649
 
650
+ #: assets/build/app.js:8
651
  #: assets/src/Components/ImportStepper.js:18
 
 
652
  msgid "Importing Customizer Settings"
653
  msgstr ""
654
 
655
+ #: assets/build/app.js:8
656
  #: assets/src/Components/ImportStepper.js:26
 
 
657
  msgid "Importing Widgets"
658
  msgstr ""
659
 
660
+ #: assets/build/app.js:8
661
+ #: assets/src/Components/ImportModal.js:427
662
+ msgid "Something went wrong while installing the necessary plugins."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663
  msgstr ""
664
 
665
+ #: assets/build/app.js:8
666
+ #: assets/src/Components/ImportModal.js:431
667
+ msgid "Something went wrong while importing the website content."
 
 
668
  msgstr ""
669
 
670
+ #: assets/build/app.js:8
671
+ #: assets/src/Components/ImportModal.js:435
672
+ msgid "Something went wrong while updating the customizer settings."
 
 
673
  msgstr ""
674
 
675
+ #: assets/build/app.js:8
676
+ #: assets/src/Components/ImportModal.js:439
677
+ msgid "Something went wrong while importing the widgets."
 
 
678
  msgstr ""
679
 
680
+ #: assets/build/app.js:8
681
+ #: assets/src/Components/ImportModal.js:61
682
+ #: assets/src/Components/ImportModal.js:97
683
+ msgid "Something went wrong while loading the site data. Please refresh the page and try again."
 
684
  msgstr ""
685
 
686
+ #. translators: name of starter site
687
+ #: assets/build/app.js:10
688
+ #: assets/src/Components/ImportModal.js:180
689
+ msgid "Import %s as a complete site"
 
 
 
 
690
  msgstr ""
691
 
692
+ #. translators: name of starter site
693
+ #: assets/build/app.js:10
694
+ #: assets/src/Components/ImportModal.js:188
695
+ msgid "Import the entire site including customizer options, pages, content and plugins."
 
696
  msgstr ""
697
 
698
+ #: assets/build/app.js:10
699
+ #: assets/src/Components/ImportModal.js:222
700
+ msgid "Import settings"
 
 
701
  msgstr ""
702
 
703
+ #: assets/build/app.js:10
704
+ #: assets/src/Components/ImportModal.js:562
705
+ msgid "I want to import just the templates"
 
 
706
  msgstr ""
707
 
708
+ #: assets/build/app.js:10
709
+ #: assets/src/Components/ImportModal.js:580
710
+ msgid "Import entire site"
 
 
711
  msgstr ""
712
 
713
+ #: assets/build/app.js:10
714
+ #: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:155
715
+ #: assets/src/Components/StarterSiteCard.js:103
716
+ msgid "Premium"
 
717
  msgstr ""
718
 
719
+ #: assets/build/app.js:10
720
+ #: assets/src/Components/StarterSiteCard.js:81
721
+ msgid "View Pages"
 
 
722
  msgstr ""
723
 
724
+ #: assets/build/app.js:10
725
  #: assets/src/Components/PreviewFrame.js:62
 
 
726
  msgid "Previous"
727
  msgstr ""
728
 
729
+ #: assets/build/app.js:10
730
  #: assets/src/Components/PreviewFrame.js:74
 
 
731
  msgid "Next"
732
  msgstr ""
733
 
734
+ #: assets/build/app.js:10
735
  #: assets/src/Components/PreviewFrame.js:91
 
 
736
  msgid "Upgrade and Import"
737
  msgstr ""
738
 
739
+ #: assets/build/app.js:10
740
  #: assets/src/Components/Search.js:102
 
 
741
  msgid "Search for a starter site"
742
  msgstr ""
743
 
744
+ #: assets/build/app.js:10
745
+ #: assets/src/Components/EditorSelector.js:30
746
+ #: assets/src/Components/EditorSelector.js:70
747
+ #: assets/src/Components/EditorTabs.js:42
748
+ msgid "Builder Logo"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  msgstr ""
750
 
751
+ #: assets/build/app.js:10
752
+ #: assets/src/Components/OnboardingContent.js:171
753
+ msgid "No results found"
754
  msgstr ""
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: themeisle
3
  Tags: neve, templates, patterns, blocks, starter, sites, demo, content, import
4
  Requires at least: 4.7
5
- Tested up to: 5.7
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPLv3
@@ -39,6 +39,13 @@ Yes, you can. You can either chose to import one template or the entire starter
39
 
40
  == Changelog ==
41
 
 
 
 
 
 
 
 
42
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
43
 
44
  * Fix compatibility with WooCommerce specific pages on import
2
  Contributors: themeisle
3
  Tags: neve, templates, patterns, blocks, starter, sites, demo, content, import
4
  Requires at least: 4.7
5
+ Tested up to: 5.8
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPLv3
39
 
40
  == Changelog ==
41
 
42
+ ##### [Version 1.1.14](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.13...v1.1.14) (2021-07-05)
43
+
44
+ - Allow Page Templates Support
45
+
46
+
47
+
48
+
49
  ##### [Version 1.1.13](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.1.12...v1.1.13) (2021-05-31)
50
 
51
  * Fix compatibility with WooCommerce specific pages on import
templates-patterns-collection.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Templates Patterns Collection
4
  * Description: This plugin is an add-on to Neve WordPress theme which offers access to Templates and Block Patterns library service to be used with the theme.
5
- * Version: 1.1.13
6
  * Author: ThemeIsle
7
  * Author URI: https://themeisle.com
8
  * License: GPLv3
2
  /**
3
  * Plugin Name: Templates Patterns Collection
4
  * Description: This plugin is an add-on to Neve WordPress theme which offers access to Templates and Block Patterns library service to be used with the theme.
5
+ * Version: 1.1.14
6
  * Author: ThemeIsle
7
  * Author URI: https://themeisle.com
8
  * License: GPLv3
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit0712dee88c27d6ba39180e169073e0b6::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -338,7 +338,7 @@ class ClassLoader
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
- * @return bool|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
@@ -347,6 +347,8 @@ class ClassLoader
347
 
348
  return true;
349
  }
 
 
350
  }
351
 
352
  /**
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
+ * @return true|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
347
 
348
  return true;
349
  }
350
+
351
+ return null;
352
  }
353
 
354
  /**
vendor/composer/InstalledVersions.php CHANGED
@@ -1,308 +1,337 @@
1
  <?php
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
  class InstalledVersions
26
  {
27
- private static $installed = array (
28
- 'root' =>
29
- array (
30
- 'pretty_version' => '1.1.13',
31
- 'version' => '1.1.13.0',
32
- 'aliases' =>
33
- array (
34
- ),
35
- 'reference' => NULL,
36
- 'name' => 'codeinwp/templates-patterns-collection',
37
- ),
38
- 'versions' =>
39
- array (
40
- 'codeinwp/templates-patterns-collection' =>
41
- array (
42
- 'pretty_version' => '1.1.13',
43
- 'version' => '1.1.13.0',
44
- 'aliases' =>
45
- array (
46
- ),
47
- 'reference' => NULL,
48
- ),
49
- 'codeinwp/themeisle-sdk' =>
50
- array (
51
- 'pretty_version' => '3.2.20',
52
- 'version' => '3.2.20.0',
53
- 'aliases' =>
54
- array (
55
- ),
56
- 'reference' => 'aeef3f159c1b35451d87672b6984ccde36c0d21d',
57
- ),
58
- ),
59
- );
60
- private static $canGetVendors;
61
- private static $installedByVendor = array();
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
- public static function getInstalledPackages()
70
- {
71
- $packages = array();
72
- foreach (self::getInstalled() as $installed) {
73
- $packages[] = array_keys($installed['versions']);
74
- }
75
-
76
- if (1 === \count($packages)) {
77
- return $packages[0];
78
- }
79
-
80
- return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
81
- }
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
- public static function isInstalled($packageName)
92
- {
93
- foreach (self::getInstalled() as $installed) {
94
- if (isset($installed['versions'][$packageName])) {
95
- return true;
96
- }
97
- }
98
-
99
- return false;
100
- }
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
- public static function satisfies(VersionParser $parser, $packageName, $constraint)
116
- {
117
- $constraint = $parser->parseConstraints($constraint);
118
- $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
119
-
120
- return $provided->matches($constraint);
121
- }
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
- public static function getVersionRanges($packageName)
133
- {
134
- foreach (self::getInstalled() as $installed) {
135
- if (!isset($installed['versions'][$packageName])) {
136
- continue;
137
- }
138
-
139
- $ranges = array();
140
- if (isset($installed['versions'][$packageName]['pretty_version'])) {
141
- $ranges[] = $installed['versions'][$packageName]['pretty_version'];
142
- }
143
- if (array_key_exists('aliases', $installed['versions'][$packageName])) {
144
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
145
- }
146
- if (array_key_exists('replaced', $installed['versions'][$packageName])) {
147
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
148
- }
149
- if (array_key_exists('provided', $installed['versions'][$packageName])) {
150
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
151
- }
152
-
153
- return implode(' || ', $ranges);
154
- }
155
-
156
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
157
- }
158
-
159
-
160
-
161
-
162
-
163
- public static function getVersion($packageName)
164
- {
165
- foreach (self::getInstalled() as $installed) {
166
- if (!isset($installed['versions'][$packageName])) {
167
- continue;
168
- }
169
-
170
- if (!isset($installed['versions'][$packageName]['version'])) {
171
- return null;
172
- }
173
-
174
- return $installed['versions'][$packageName]['version'];
175
- }
176
-
177
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
178
- }
179
-
180
-
181
-
182
-
183
-
184
- public static function getPrettyVersion($packageName)
185
- {
186
- foreach (self::getInstalled() as $installed) {
187
- if (!isset($installed['versions'][$packageName])) {
188
- continue;
189
- }
190
-
191
- if (!isset($installed['versions'][$packageName]['pretty_version'])) {
192
- return null;
193
- }
194
-
195
- return $installed['versions'][$packageName]['pretty_version'];
196
- }
197
-
198
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
199
- }
200
-
201
-
202
-
203
-
204
-
205
- public static function getReference($packageName)
206
- {
207
- foreach (self::getInstalled() as $installed) {
208
- if (!isset($installed['versions'][$packageName])) {
209
- continue;
210
- }
211
-
212
- if (!isset($installed['versions'][$packageName]['reference'])) {
213
- return null;
214
- }
215
-
216
- return $installed['versions'][$packageName]['reference'];
217
- }
218
-
219
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
220
- }
221
-
222
-
223
-
224
-
225
-
226
- public static function getRootPackage()
227
- {
228
- $installed = self::getInstalled();
229
-
230
- return $installed[0]['root'];
231
- }
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
- public static function getRawData()
241
- {
242
- @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
243
-
244
- return self::$installed;
245
- }
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
- public static function getAllRawData()
254
- {
255
- return self::getInstalled();
256
- }
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
- public static function reload($data)
277
- {
278
- self::$installed = $data;
279
- self::$installedByVendor = array();
280
- }
281
-
282
-
283
-
284
-
285
-
286
- private static function getInstalled()
287
- {
288
- if (null === self::$canGetVendors) {
289
- self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
290
- }
291
-
292
- $installed = array();
293
-
294
- if (self::$canGetVendors) {
295
- foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
296
- if (isset(self::$installedByVendor[$vendorDir])) {
297
- $installed[] = self::$installedByVendor[$vendorDir];
298
- } elseif (is_file($vendorDir.'/composer/installed.php')) {
299
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
300
- }
301
- }
302
- }
303
-
304
- $installed[] = self::$installed;
305
-
306
- return $installed;
307
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  }
1
  <?php
2
 
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
24
+ */
25
  class InstalledVersions
26
  {
27
+ private static $installed;
28
+ private static $canGetVendors;
29
+ private static $installedByVendor = array();
30
+
31
+ /**
32
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
33
+ *
34
+ * @return string[]
35
+ * @psalm-return list<string>
36
+ */
37
+ public static function getInstalledPackages()
38
+ {
39
+ $packages = array();
40
+ foreach (self::getInstalled() as $installed) {
41
+ $packages[] = array_keys($installed['versions']);
42
+ }
43
+
44
+ if (1 === \count($packages)) {
45
+ return $packages[0];
46
+ }
47
+
48
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
49
+ }
50
+
51
+ /**
52
+ * Returns a list of all package names with a specific type e.g. 'library'
53
+ *
54
+ * @param string $type
55
+ * @return string[]
56
+ * @psalm-return list<string>
57
+ */
58
+ public static function getInstalledPackagesByType($type)
59
+ {
60
+ $packagesByType = array();
61
+
62
+ foreach (self::getInstalled() as $installed) {
63
+ foreach ($installed['versions'] as $name => $package) {
64
+ if (isset($package['type']) && $package['type'] === $type) {
65
+ $packagesByType[] = $name;
66
+ }
67
+ }
68
+ }
69
+
70
+ return $packagesByType;
71
+ }
72
+
73
+ /**
74
+ * Checks whether the given package is installed
75
+ *
76
+ * This also returns true if the package name is provided or replaced by another package
77
+ *
78
+ * @param string $packageName
79
+ * @param bool $includeDevRequirements
80
+ * @return bool
81
+ */
82
+ public static function isInstalled($packageName, $includeDevRequirements = true)
83
+ {
84
+ foreach (self::getInstalled() as $installed) {
85
+ if (isset($installed['versions'][$packageName])) {
86
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
87
+ }
88
+ }
89
+
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Checks whether the given package satisfies a version constraint
95
+ *
96
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
97
+ *
98
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
99
+ *
100
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
101
+ * @param string $packageName
102
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
103
+ * @return bool
104
+ */
105
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
106
+ {
107
+ $constraint = $parser->parseConstraints($constraint);
108
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
109
+
110
+ return $provided->matches($constraint);
111
+ }
112
+
113
+ /**
114
+ * Returns a version constraint representing all the range(s) which are installed for a given package
115
+ *
116
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
117
+ * whether a given version of a package is installed, and not just whether it exists
118
+ *
119
+ * @param string $packageName
120
+ * @return string Version constraint usable with composer/semver
121
+ */
122
+ public static function getVersionRanges($packageName)
123
+ {
124
+ foreach (self::getInstalled() as $installed) {
125
+ if (!isset($installed['versions'][$packageName])) {
126
+ continue;
127
+ }
128
+
129
+ $ranges = array();
130
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
131
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
132
+ }
133
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
134
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
135
+ }
136
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
137
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
138
+ }
139
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
140
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
141
+ }
142
+
143
+ return implode(' || ', $ranges);
144
+ }
145
+
146
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
147
+ }
148
+
149
+ /**
150
+ * @param string $packageName
151
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
152
+ */
153
+ public static function getVersion($packageName)
154
+ {
155
+ foreach (self::getInstalled() as $installed) {
156
+ if (!isset($installed['versions'][$packageName])) {
157
+ continue;
158
+ }
159
+
160
+ if (!isset($installed['versions'][$packageName]['version'])) {
161
+ return null;
162
+ }
163
+
164
+ return $installed['versions'][$packageName]['version'];
165
+ }
166
+
167
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
168
+ }
169
+
170
+ /**
171
+ * @param string $packageName
172
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
173
+ */
174
+ public static function getPrettyVersion($packageName)
175
+ {
176
+ foreach (self::getInstalled() as $installed) {
177
+ if (!isset($installed['versions'][$packageName])) {
178
+ continue;
179
+ }
180
+
181
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
182
+ return null;
183
+ }
184
+
185
+ return $installed['versions'][$packageName]['pretty_version'];
186
+ }
187
+
188
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
189
+ }
190
+
191
+ /**
192
+ * @param string $packageName
193
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
194
+ */
195
+ public static function getReference($packageName)
196
+ {
197
+ foreach (self::getInstalled() as $installed) {
198
+ if (!isset($installed['versions'][$packageName])) {
199
+ continue;
200
+ }
201
+
202
+ if (!isset($installed['versions'][$packageName]['reference'])) {
203
+ return null;
204
+ }
205
+
206
+ return $installed['versions'][$packageName]['reference'];
207
+ }
208
+
209
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
210
+ }
211
+
212
+ /**
213
+ * @param string $packageName
214
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
215
+ */
216
+ public static function getInstallPath($packageName)
217
+ {
218
+ foreach (self::getInstalled() as $installed) {
219
+ if (!isset($installed['versions'][$packageName])) {
220
+ continue;
221
+ }
222
+
223
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
224
+ }
225
+
226
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
227
+ }
228
+
229
+ /**
230
+ * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
+ */
233
+ public static function getRootPackage()
234
+ {
235
+ $installed = self::getInstalled();
236
+
237
+ return $installed[0]['root'];
238
+ }
239
+
240
+ /**
241
+ * Returns the raw installed.php data for custom implementations
242
+ *
243
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
+ * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
+ */
247
+ public static function getRawData()
248
+ {
249
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
250
+
251
+ if (null === self::$installed) {
252
+ // only require the installed.php file if this file is loaded from its dumped location,
253
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
254
+ if (substr(__DIR__, -8, 1) !== 'C') {
255
+ self::$installed = include __DIR__ . '/installed.php';
256
+ } else {
257
+ self::$installed = array();
258
+ }
259
+ }
260
+
261
+ return self::$installed;
262
+ }
263
+
264
+ /**
265
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
+ *
267
+ * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
+ */
270
+ public static function getAllRawData()
271
+ {
272
+ return self::getInstalled();
273
+ }
274
+
275
+ /**
276
+ * Lets you reload the static array from another file
277
+ *
278
+ * This is only useful for complex integrations in which a project needs to use
279
+ * this class but then also needs to execute another project's autoloader in process,
280
+ * and wants to ensure both projects have access to their version of installed.php.
281
+ *
282
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
283
+ * the data it needs from this class, then call reload() with
284
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
285
+ * the project in which it runs can then also use this class safely, without
286
+ * interference between PHPUnit's dependencies and the project's dependencies.
287
+ *
288
+ * @param array[] $data A vendor/composer/installed.php data set
289
+ * @return void
290
+ *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
+ */
293
+ public static function reload($data)
294
+ {
295
+ self::$installed = $data;
296
+ self::$installedByVendor = array();
297
+ }
298
+
299
+ /**
300
+ * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
+ */
303
+ private static function getInstalled()
304
+ {
305
+ if (null === self::$canGetVendors) {
306
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
307
+ }
308
+
309
+ $installed = array();
310
+
311
+ if (self::$canGetVendors) {
312
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
313
+ if (isset(self::$installedByVendor[$vendorDir])) {
314
+ $installed[] = self::$installedByVendor[$vendorDir];
315
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
316
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
317
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
318
+ self::$installed = $installed[count($installed) - 1];
319
+ }
320
+ }
321
+ }
322
+ }
323
+
324
+ if (null === self::$installed) {
325
+ // only require the installed.php file if this file is loaded from its dumped location,
326
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
327
+ if (substr(__DIR__, -8, 1) !== 'C') {
328
+ self::$installed = require __DIR__ . '/installed.php';
329
+ } else {
330
+ self::$installed = array();
331
+ }
332
+ }
333
+ $installed[] = self::$installed;
334
+
335
+ return $installed;
336
+ }
337
  }
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit697e611d92d65b14d837c7ac2651523a::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit697e611d92d65b14d837c7ac2651523a
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit697e611d92d65b14d837c7ac2651523a::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire697e611d92d65b14d837c7ac2651523a($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire697e611d92d65b14d837c7ac2651523a($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit0712dee88c27d6ba39180e169073e0b6
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit0712dee88c27d6ba39180e169073e0b6', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit0712dee88c27d6ba39180e169073e0b6', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit0712dee88c27d6ba39180e169073e0b6::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInit0712dee88c27d6ba39180e169073e0b6::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire0712dee88c27d6ba39180e169073e0b6($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire0712dee88c27d6ba39180e169073e0b6($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit697e611d92d65b14d837c7ac2651523a
8
  {
9
  public static $files = array (
10
  '50f1a0479b2a5847c529d784c54cebe2' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
@@ -56,9 +56,9 @@ class ComposerStaticInit697e611d92d65b14d837c7ac2651523a
56
  public static function getInitializer(ClassLoader $loader)
57
  {
58
  return \Closure::bind(function () use ($loader) {
59
- $loader->prefixLengthsPsr4 = ComposerStaticInit697e611d92d65b14d837c7ac2651523a::$prefixLengthsPsr4;
60
- $loader->prefixDirsPsr4 = ComposerStaticInit697e611d92d65b14d837c7ac2651523a::$prefixDirsPsr4;
61
- $loader->classMap = ComposerStaticInit697e611d92d65b14d837c7ac2651523a::$classMap;
62
 
63
  }, null, ClassLoader::class);
64
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit0712dee88c27d6ba39180e169073e0b6
8
  {
9
  public static $files = array (
10
  '50f1a0479b2a5847c529d784c54cebe2' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
56
  public static function getInitializer(ClassLoader $loader)
57
  {
58
  return \Closure::bind(function () use ($loader) {
59
+ $loader->prefixLengthsPsr4 = ComposerStaticInit0712dee88c27d6ba39180e169073e0b6::$prefixLengthsPsr4;
60
+ $loader->prefixDirsPsr4 = ComposerStaticInit0712dee88c27d6ba39180e169073e0b6::$prefixDirsPsr4;
61
+ $loader->classMap = ComposerStaticInit0712dee88c27d6ba39180e169073e0b6::$classMap;
62
 
63
  }, null, ClassLoader::class);
64
  }
vendor/composer/installed.php CHANGED
@@ -1,33 +1,32 @@
1
- <?php return array (
2
- 'root' =>
3
- array (
4
- 'pretty_version' => '1.1.13',
5
- 'version' => '1.1.13.0',
6
- 'aliases' =>
7
- array (
 
 
 
8
  ),
9
- 'reference' => NULL,
10
- 'name' => 'codeinwp/templates-patterns-collection',
11
- ),
12
- 'versions' =>
13
- array (
14
- 'codeinwp/templates-patterns-collection' =>
15
- array (
16
- 'pretty_version' => '1.1.13',
17
- 'version' => '1.1.13.0',
18
- 'aliases' =>
19
- array (
20
- ),
21
- 'reference' => NULL,
 
 
 
 
 
 
22
  ),
23
- 'codeinwp/themeisle-sdk' =>
24
- array (
25
- 'pretty_version' => '3.2.20',
26
- 'version' => '3.2.20.0',
27
- 'aliases' =>
28
- array (
29
- ),
30
- 'reference' => 'aeef3f159c1b35451d87672b6984ccde36c0d21d',
31
- ),
32
- ),
33
  );
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'pretty_version' => '1.1.14',
4
+ 'version' => '1.1.14.0',
5
+ 'type' => 'library',
6
+ 'install_path' => __DIR__ . '/../../',
7
+ 'aliases' => array(),
8
+ 'reference' => NULL,
9
+ 'name' => 'codeinwp/templates-patterns-collection',
10
+ 'dev' => false,
11
  ),
12
+ 'versions' => array(
13
+ 'codeinwp/templates-patterns-collection' => array(
14
+ 'pretty_version' => '1.1.14',
15
+ 'version' => '1.1.14.0',
16
+ 'type' => 'library',
17
+ 'install_path' => __DIR__ . '/../../',
18
+ 'aliases' => array(),
19
+ 'reference' => NULL,
20
+ 'dev_requirement' => false,
21
+ ),
22
+ 'codeinwp/themeisle-sdk' => array(
23
+ 'pretty_version' => '3.2.20',
24
+ 'version' => '3.2.20.0',
25
+ 'type' => 'library',
26
+ 'install_path' => __DIR__ . '/../codeinwp/themeisle-sdk',
27
+ 'aliases' => array(),
28
+ 'reference' => 'aeef3f159c1b35451d87672b6984ccde36c0d21d',
29
+ 'dev_requirement' => false,
30
+ ),
31
  ),
 
 
 
 
 
 
 
 
 
 
32
  );