!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=333)}({1:function(t,e,n){"use strict";n.d(e,"d",function(){return i}),n.d(e,"b",function(){return u}),n.d(e,"a",function(){return c}),n.d(e,"c",function(){return s});var r=n(49),o=n(31);function i(t,e){void 0===e&&(e={});try{return JSON.parse(t)}catch(t){return e}}function u(t,e){var n=new r.a("onFieldsLoaded",e);n.extra.set("wrapper",t),o.a.emmit(n,e)}function c(t){var e=null;if("content"in t){var n=document.createElement("DIV");n.appendChild(document.importNode(t.content,!0)),e=n.firstElementChild}else e=t.firstElementChild.cloneNode(!0);return e}function s(t,e,n){var r=t.classList;r.remove(e),r.add(n)}},11:function(t,e,n){"use strict";var r=n(1),o=function(){function t(){}return t.request=function(e,n,r){var o=new XMLHttpRequest;o.open("POST",t.url+"?action="+e,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var i=t._serialize(n);return new Promise(function(t,e){o.onload=function(n){200===n.target.status?t(n.target):e(n.target)},"function"==typeof r&&(o.onprogress=r),o.send(i)})},t._serialize=function(t){return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},t.retrieve=function(e,n,o){return t.request(e,n,o).then(function(t){var e=t.responseText,n=Object(r.d)(e.data||e,{});return n.data||n})},t.setUrl=function(e){t.url=e},t.url="",t}();e.a=o},31:function(t,e,n){"use strict";var r=function(){function t(){}return t.trigger=function(e,n){var r=t.bus.get(e);if(!r)return!1;var o,i,u=r.get(n.type);if(!(u instanceof Array))return!1;try{for(var c=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}(u),s=c.next();!s.done;s=c.next())(0,s.value)(n)}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return!0},t.emmit=function(e,n){return t.trigger(e.scope,e),"global"!==e.scope&&t.trigger("global",e),!0},t.addListener=function(e,n,r){void 0===r&&(r="global"),t.getListeners(e,r).push(n)},t.removeListener=function(e,n,r){void 0===r&&(r="global");var o=t.getListeners(e,r),i=o.indexOf(n);i>-1&&o.splice(i,1)},t.getListeners=function(e,n){void 0===n&&(n="global");var r=t.bus.get(n);r||(r=new Map,t.bus.set(n,r));var o=r.get(e);return o||(o=[],r.set(e,o)),o},t.bus=new Map,t}();e.a=r},333:function(t,e,n){"use strict";n.r(e);var r=n(11),o=function(){function t(){var t=this;this.db=null,this.queue=[],new Promise(function(t,e){var n=indexedDB.open("wpw_customizer_db",3);n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;t.oldVersion>=1&&e.deleteObjectStore("wpw_html_store");var n=e.createObjectStore("wpw_html_store",{keyPath:"key"});n.createIndex("html","html",{unique:!1}),n.createIndex("updateAt","updateAt",{unique:!1})},n.onerror=function(t){e(t.target)}}).then(function(e){t.db=e,t.queue.forEach(function(e){"set"===e.type?t.setAsync(e.key,e.callback):t.getAsync(e.key,e.callback)}),t.queue=[]}).catch(function(t){console.error(t)})}return Object.defineProperty(t,"current",{get:function(){return t._inst||(t._inst=new t),t._inst},enumerable:!0,configurable:!0}),t.prototype.getAsync=function(t,e){this.db?this.request(t,e):this.queue.push({type:"get",key:t,callback:e})},t.prototype.request=function(t,e){if(!this.db)return!1;var n=this.db.transaction(["wpw_html_store"],"readwrite").objectStore("wpw_html_store").get(t);n.onsuccess=function(t){"function"==typeof e&&e(t.target.result)},n.onerror=function(t){console.log("err",t)}},t.prototype.setAsync=function(t,e){var n=this;this.db?this.request(t.key,function(r){r=r?Object.assign(r,t):t;var o=n.db.transaction(["wpw_html_store"],"readwrite").objectStore("wpw_html_store");"function"==typeof e&&e(r),r?o.put(r):o.add(r)}):this.queue.push({type:"set",key:t,callback:e})},t._inst=null,t}();console.log("worker is running"),onmessage=function(t){var e=t.data;r.a.setUrl(e.ajaxurl),[{action:"get_fonts_html",key:"wpw_fonts",htmlKey:"fonts"},{action:"get_icons_fa_html",key:"wpw_icons_font-awesome",htmlKey:"icons"},{action:"get_icons_ios_html",key:"wpw_icons_ios",htmlKey:"icons"},{action:"get_icons_small_html",key:"wpw_icons_small",htmlKey:"icons"}].forEach(function(t){var e=t.action,n=t.key,i=t.htmlKey;o.current.getAsync(n,function(t){var u=t||{html:"",updateAt:0},c=u.html,s=u.updateAt;(Date.now()-s>864e5||c.length<1)&&r.a.retrieve(e,{}).then(function(t){t[i]?o.current.setAsync({key:n,html:t[i].replace(/\s+|\t+|\n+|\r+/g," "),updateAt:Date.now()}):console.error(e,t)}).catch(function(t){return console.log(t)})})})}},49:function(t,e,n){"use strict";var r=function(t,e,n){void 0===n&&(n="global"),this.type=t,this.target=e,this.scope=n,this.extra=new Map};e.a=r}});