File: /home/ondernemer/public_html/wp-content/themes/dt-the7/inc/admin/assets/js/demo-content.min.js
!function(t){"use strict";t((function(){var e,n=null,o=null,i=t(".the7-import-feedback"),r=t(".websites-item"),s={feedback:null,beforePluginsInstallation:function(){},onActionStart:function(t){this.feedback=x(t,i)},onActionDone:function(e){this.feedback.replaceWith(t('<p class="the7-updated">'+e+"</p>"))},onActionFail:function(e){this.feedback.replaceWith(t('<p class="the7-error">'+e+"</p>"))}},a={import_attachments:function(t,e,n){return t.then((function(){let t=I(e);if(d||(d=t),n.importActions){const e=n.importActions.getRetries();e&&(t=d+" Retry... "+e)}return A(e,n,x(t,i))}))},install_plugins:function(e,n,o){var i=s,r=o.plugins_to_install,a=o.plugins_to_activate,d=dtDummy.plugins_page_url,p=dtDummy.strings.plugins_installation_error;if(!a&&!r)return o.importActions&&o.importActions.done(n.dummy),e;return i.beforePluginsInstallation(t.merge([],r,a)),r.forEach((function(n){e=e.then((function(){var e=n;return void 0!==dtDummy.plugins[n]&&(e=dtDummy.plugins[n]),i.onActionStart(dtDummy.strings.installing_plugin+" "+e),t.post(d,{action:"tgmpa-bulk-install",just_install:!0,tgmpa_install_protected_plugins:o.tgmpa_install_protected_plugins||"",noheader:!0,plugin:n}).then((function(e){var n=t.Deferred();return t(e).find(".update-php div.error p").length>0?n.reject(e):n.resolve(e),n.promise()})).done((function(e){var n=t(e).find(".update-php div.updated p");n.find(".js-update-details-toggle").remove(),i.onActionDone(n.text())})).fail((function(e){var o=t(e).find(".update-php div.error p");i.onActionFail(o.length?o.text():p,n)}))}))})),e=(e=e.then((function(){return i.onActionStart(dtDummy.strings.activating_plugin),t.merge(a,r),t.post(d,{action:"tgmpa-bulk-activate",noheader:!0,context:"demo_install",plugin:a}).done((function(t){i.onActionDone(dtDummy.strings.plugins_activated)})).fail((function(){i.onActionFail(p)}))}))).then((function(){return i.onActionStart(dtDummy.strings.rid_of_redirects),t.get(d,{noheader:!0}).done((function(){o.importActions&&o.importActions.done(n.dummy),i.onActionDone(dtDummy.strings.rid_of_redirects)})).fail((function(){i.onActionFail(p)}))}))},import_by_url:function(e,n,o){return D(e,t.extend({},n,{provided_url:o.provided_url}),o)},import_one_post:function(e,n,o){return D(e,t.extend({},n,{post_to_import:o.post_to_import}),o)},remove_content:function(t,e,n){return w(t,{action:"the7_remove_demo_content",_wpnonce:dtDummy.remove_demo_nonce,demo:n.demo_id,dummy:"remove_content"}).always(P)},keep_content:function(t,e,n){return w(t,{action:"the7_keep_demo_content",_wpnonce:dtDummy.nonces.keep_demo_content,demo:n.demo_id,dummy:"keep_content"}).always(P)},download_package:function(e,n,o){return w(e,t.extend({},n,{demo_page_url:o.provided_url||""}),o)},download_fse_fonts:function(e,n,o){return e.then((function(){const e=t.Deferred();if(void 0===window.the7DownloadFseFonts)return e.resolve().promise();const o=I(n),r=x(o,i);return wp.apiRequest({path:"/the7/v1/fse-fonts",method:"GET"}).then((function(e){return e&&Array.isArray(e)&&0!==e.length?window.the7DownloadFseFonts(e):(r.replaceWith(t('<p class="the7-updated">'+o+"</p>")),t.Deferred().resolve().promise())})).always((function(){r.replaceWith(t('<p class="the7-updated">'+o+"</p>")),e.resolve()})),e.promise()}))}};let d="";const p=function(t){this.actions=t,this.retryAttempts=0};p.prototype.get=function(){return this.actions},p.prototype.done=function(t){this.actions=this.actions.filter((function(e){return e!==t})),this.dropRetryAttempts()},p.prototype.getRetries=function(){return this.retryAttempts},p.prototype.attemptRetry=function(){return this.retryAttempts+=1,this.canRetry()&&this.isActionRetriable()?this:null},p.prototype.isActionRetriable=function(){return this.actions&&["import_attachments"].includes(this.actions[0])},p.prototype.canRetry=function(){return this.retryAttempts<=3},p.prototype.dropRetryAttempts=function(){this.retryAttempts=0};new(function(){function e(e,n){this.insertAfterObj=t(n),this.noticeID=e,this.noticeTplObj=t('<div id="'+e+'" class="the7-dashboard-notice the7-notice notice is-dismissible"></div>'),t("body").on("click","#"+e+" .notice-dismiss",(function(){t("#"+e).remove()}))}return e.prototype.addError=function(e,n){if(!e)return t();t("html, body").animate({scrollTop:0},400);return this.noticeTplObj.clone().html(e+'<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>').addClass(n).insertAfter(this.insertAfterObj)},e.prototype.removeErrors=function(){t("#"+this.noticeID).remove()},e.prototype.prepareMsg=function(t){return"<p><strong>"+t+"</strong></p>"},e.prototype.addMsg=function(t,e){return this.addError(this.prepareMsg(t),e)},e}())("the7-demo-content-error",".wrap > .wp-header-end");var c={bootstrap:function(){var e=this;t(".nav-tab-wrapper").show(),this.showOptionsTab(t(".nav-tab-wrapper a.nav-tab-active").attr("id")),t(".tabs-holder").removeClass("hidden"),t(".nav-tab-wrapper a").on("click.the7.tabs",(function(t){e.onTabClick(t,this)})),t(window).on("popstate.the7.tabs",this.onPopstate.bind(this))},convertTab2Group:function(t){return t.replace("-tab","-group")},showOptionsTab:function(e){if(e){var n=this.convertTab2Group(e);t(".group").hide().filter("#"+n).fadeIn(),t(".nav-tab-wrapper a").removeClass("nav-tab-active").filter("#"+e).addClass("nav-tab-active").trigger("blur")}},onTabClick:function(e,n){e.preventDefault();var o=t(n);if(o.hasClass("blocked"))return!1;var i=o.attr("id");return this.showOptionsTab(i),history.pushState({activeGroupId:"#"+this.convertTab2Group(i)},"",o.attr("href")),!1},onPopstate:function(e){var n={};if(location.search.substr(1).split("&").forEach((function(t){n[t.split("=")[0]]=t.split("=")[1]})),n.tab)var o=n.tab;else o=t(".nav-tab-wrapper a").first().attr("id");this.showOptionsTab(o)},blockTabs:function(){t(".nav-tab-wrapper a").removeClass("blocked").addClass("blocked")},unblockTabs:function(){t(".nav-tab-wrapper a").removeClass("blocked")}};if(c.bootstrap(),"undefined"!=typeof the7ImportData){var u=!1,m=function(){u||(u=!0,the7ImportData.importActions=new p(the7ImportData.actions),"full_import"===the7ImportData.import_type&&(the7ImportData.onDone=P),k(the7ImportData.importActions,{action:"the7_import_demo_content",content_part_id:the7ImportData.demo_id,user_map:the7ImportData.users,imported_authors:["admin"],_wpnonce:dtDummy.nonces.import_nonce,import_type:the7ImportData.import_type||"full_import"},the7ImportData))};const e=t("#elementor-pro-notice");e.length?(e.find("#buy-elementor").on("click",(function(e){e.preventDefault(),window.open(t(this).attr("href"),"_blank","noopener,noreferrer"),window.location.href=dtDummy.dashboard_page_url})),e.find(".button-primary").on("click",(function(t){t.preventDefault(),m(),e.hide()}))):m()}t(".dt-dummy-control-buttons .dt-dummy-button-import-one-page").on("click",(function(i){var r,s,a=t(this),d=a.closest(".dt-dummy-content"),p=d.data("the7Demo"),u=[t(".dt-dummy-content-user",d).first().val()],m=t.when();i.preventDefault(),p.errors.clear(),p.buttons.onePageImport.setBusy(dtDummy.strings.loading),r=t("#full-site-group"),s=r.find("button").not(":disabled"),r.data("the7ButtonsToEnable",s),s.prop("disabled","disabled"),c.blockTabs(),function(t,n){var i=t.attr("data-dummy-id")||"0";void 0===e||i===o&&!n||(e.slideDown(),e.parent().find(".dt-dummy-one-page-importing-interface").remove());o=i}(d,!1),["download_package","get_posts"].forEach((function(t){m=w(m,{action:"the7_import_demo_content",_wpnonce:dtDummy.nonces.import_nonce,dummy:t,user_map:u,content_part_id:p.id})})),m.done((function(o){void 0!==o.data&&void 0!==o.data.response&&"getPostsList"===o.data.response&&(n=o.data.data,(e=a.closest(".dt-dummy-controls-block-import-one-page")).slideUp(400,(function(){var o=t('<div class="dt-dummy-one-page-importing-interface"></div>');e.after(o),function(t){t.empty(),t.hide();var e='<div class="dt-dummy-controls-block" style="padding-bottom: 1em;"><table class="dt-dummy-field dt-dummy-one-post-data"><tr><td>'+dtDummy.strings.one_post_importing_choose_post_type+': </td><td><select name="the7_import_post_type" id="post-type" class="dt-dummy-content-post-type"></select></td></tr><tr><td>'+dtDummy.strings.one_post_importing_choose_post+': </td><td><select name="the7_import_post_id" id="posts" class="dt-dummy-content-posts"></select> <a class="the7-tip dt-dummy-one-post-url" href="#" target="_blank">'+dtDummy.strings.one_post_importing_url_msg+"</a></td></tr></table></div>",n='<div class="dt-dummy-controls-block dt-dummy-control-buttons"><div class="dt-dummy-button-wrap"><button type="submit" class="button button-primary dt-dummy-button-import-one-page-submit">'+dtDummy.strings.one_post_importing_import+"</button></div></div>";void 0!==t&&(t.append(e),t.append(n))}(o),function(e){var o=e.find("select.dt-dummy-content-post-type");o.html(""),t.each(n,(function(t,e){o.append('<option id="'+t+'" value="'+t+'">'+t+"</option>")})),T(e)}(o),o.slideDown(),C(o.find("select.dt-dummy-content-post-type").val(),o),o.find("select.dt-dummy-content-post-type").on("change",(function(t){C(this.value,o)})),o.find("select.dt-dummy-content-posts").on("change",(function(t){T(o)}))})))})),m.fail((function(t){void 0!==t.data&&void 0!==t.data.error_msg&&t.data.error_msg?p.errors.addText(t.data.error_msg):p.errors.addPHPStatus()})),m.always((function(){!function(){var e=t("#full-site-group"),n=e.data("the7ButtonsToEnable");if(e.removeData("the7ButtonsToEnable"),!n||!n.length)return;n.removeAttr("disabled"),c.unblockTabs()}(),p.buttons.onePageImport.setFree()}))}));const l=t(".websites-filter"),f=t(".filter-links a"),h=t(".filter-count > .count"),_=t(".websites-browser .websites-item");f.on("click",(function(e){e.preventDefault();const n=t(this),o=n.data("filter");f.removeClass("current"),n.addClass("current"),"*"===o?_.show():_.each((function(){const e=t(this);JSON.parse(e.attr("data-tags")).includes(o)?e.show():e.hide()})),h.text(_.filter((function(){return t(this).is(":visible")})).length)})),t("#wp-filter-search-input").on("input",(function(e){var n=t(this).val().toLowerCase(),o=n.split(" ");1!==n.length&&_.each((function(){var e=t(this),i=e.data("the7Demo"),r=!1,s=i.title.toLowerCase()+" "+i.tags.join(" ").toLowerCase();(o.every((function(t){return s.includes(t)}))||i.url.toLowerCase().includes(function(t){let e=j(t).replace("https://","");return e=e.split("/").slice(0,2).filter((function(t){return""!==t})).join("/"),e+"/"}(n)))&&(r=!0),r?e.show():e.hide()}))}));const v=t("#the7-dashboard");function b(t){this.button=t}function y(t){this.container=t}function g(t){this.id=t.attr("data-dummy-id"),this.title=t.find(".websites-heading").first().text(),this.url=j(t.find(".websites-preview").first().attr("href")),this.tags=JSON.parse(t.attr("data-tags")),this.container=t,this.settings=t.find(".dt-dummy-field input"),this.errors=new y(t.find(".the7-demo-notifications")),this.buttons={import:new b(t.find(".dt-dummy-button-import")),onePageImport:new b(t.find(".dt-dummy-button-import-one-page")),remove:new b(t.find(".dt-remove-content-button")),keep:new b(t.find(".dt-keep-content-button"))},this.addEvents()}function w(e,n,o,r){return e.then((function(){var e=I(n);return void 0===r&&(r=x(e,i)),t.post(ajaxurl,n).then(O).done((function(i){o&&o.importActions&&o.importActions.done(n.dummy),r.replaceWith(t('<p class="the7-updated">'+e+"</p>"))})).fail((function(){r.replaceWith(t('<p class="the7-error">'+e+"</p>"))}))}))}function D(e,n,o){return e.then((function(){var e=I(n),r=x(e,i);return t.post(ajaxurl,n).then(O).done((function(i){let s=i.data.step2Links,a=t.extend({},n,{imported_post_id:i.data.imported_post_id});r.replaceWith(t('<p class="the7-updated">'+e+"</p>")),o.importActions=new p(i.data.postImportActions),o.onDone=function(){t("#the7-demo-visit-site-link").replaceWith(s),P()},k(o.importActions,a,o)})).fail((function(){r.replaceWith(t('<p class="the7-error">'+e+"</p>"))}))}))}function k(e,n,o){if(!e||!e.get())return;let r=t.when();return e.get().forEach((function(e){let i=t.extend({},n,{dummy:e});r=a.hasOwnProperty(e)?a[e](r,i,o):w(r,i,o)})),r.fail((function(r){if(e.attemptRetry())k(e,n,o);else{var s=new y(i);void 0!==r.data&&void 0!==r.data.error_msg&&r.data.error_msg?s.addText(r.data.error_msg):s.addPHPStatus(),t(".the7-go-back-link").html(dtDummy.strings.go_back_with_error),P()}})),o.onDone&&r.done(o.onDone),r}function A(e,n,o){return t.post(ajaxurl,e).then(O).then((function(i){return d=I({dummy:"import_attachments"})+" ("+i.data.imported+"/"+i.data.total+")",d===o.text().trim()?O(null):0!=i.data.left?(n.importActions&&n.importActions.dropRetryAttempts(),A(e,n,(r=o,s=x(d),r.replaceWith(s),s))):(n.importActions&&n.importActions.done(e.dummy),void o.replaceWith(t('<p class="the7-updated">'+I(e)+"</p>")));var r,s})).fail((function(){n.importActions&&n.importActions.canRetry()?o.remove():o.replaceWith(t('<p class="the7-error">'+I(e)+"</p>"))}))}function x(e,n){var o=t('<p><span class="spinner is-active" style="float: none; margin: 0 4px 0 0; vertical-align: bottom;"></span> '+e+"</p>");return void 0!==n&&n.append(o),o}function C(e,o){var i=o.find("select.dt-dummy-content-posts");i.empty(),t.each(n[e],(function(t,e){i.append('<option id="'+t+'" value="'+t+'">'+e.post_title+"</option>")})),T(o)}function T(t){var e=t.find("select.dt-dummy-content-posts").val(),o=t.find("select.dt-dummy-content-post-type").val(),i=t.find(".dt-dummy-one-post-url");null!=e&&null!=o?(i.attr("href",n[o][e].url),i.show()):i.hide()}function I(t){var e=t.dummy;return void 0!==dtDummy.strings[t.dummy]&&(e=dtDummy.strings[t.dummy]),e}function j(t){return"https://"+t.replace(/[\?#].*/,"").replace(/\/?$/,"/").replace("https://","")}function P(){t(".the7-go-back-link").removeClass("hide-if-js")}function O(e){var n=t.Deferred();return e.success?n.resolve(e):n.reject(e),n.promise()}l.find(".drawer-toggle").on("click",(function(t){t.preventDefault(),v.toggleClass("show-filters")})),t(".dt-remove-content-button").on("click",(function(t){window.confirm(dtDummy.strings.remove_content_confirm)||t.preventDefault()})),t(".dt-keep-content-button").on("click",(function(t){window.confirm(dtDummy.strings.keep_content_confirm)||t.preventDefault()})),b.prototype.disable=function(){this.button.prop("disabled",!0)},b.prototype.enable=function(){this.button.prop("disabled",!1)},b.prototype.setBusy=function(t){this.setFree(),this.button.addClass("button--importing").prop("disabled",!0),void 0!==t&&(this.button.data("the7ButtonOriginCaption",this.button.text()),this.button.text(t)),this.button.siblings(".spinner").first().addClass("is-active")},b.prototype.setFree=function(t){var e=this.button.data("the7ButtonOriginCaption");this.button.siblings(".spinner").first().removeClass("is-active"),this.button.removeClass("button--importing").prop("disabled",!1),e&&this.button.text(e)},y.prototype.addText=function(t){this.add("<p>"+t+"</p>")},y.prototype.add=function(e){var n=t('<div class="dt-dummy-inline-msg hide-if-js inline error">'+e+"</div>");this.container.append(n),n.slideDown()},y.prototype.clear=function(){this.container.slideUp().html("")},y.prototype.addPHPStatus=function(){var e=this;t.post(ajaxurl,{action:"the7_demo_content_php_status",_wpnonce:dtDummy.nonces.status_nonce,demo_id:the7ImportData.demo_id,import_data:the7ImportData}).then(O).done((function(t){t.data?e.add(t.data):e.addText(dtDummy.strings.msg_import_fail)})).fail((function(){e.addText(dtDummy.strings.msg_import_fail)}))},g.prototype.addEvents=function(){},g.prototype.getActions=function(){var e=[];return this.settings.filter(":checked").not(":disabled").each((function(){e.push(t(this).attr("name"))})),e.indexOf("import_theme_options")>=0&&(e=e.filter((function(t){return"import_theme_options"!==t}))).push("import_theme_options"),e},g.prototype.maybeChangeImportButtonState=function(){this.getActions().filter((function(t){return"install_plugins"!==t})).length?this.buttons.import.enable():this.buttons.import.disable()},r.each((function(){var e=t(this);e.data("the7Demo",new g(e))}));const R=(t,e)=>(t||"").replace(/%s/g,e),E=t(".websites-actions");t(".websites-actions a.button").on("click",(function(e){if(e.preventDefault(),t(this).is("[disabled]"))return;const n=t(this),o=n.closest(".websites-item"),i=o.data("the7Demo"),r={remove:R(dtDummy.strings.remove_confirm,i.title),keep:R(dtDummy.strings.keep_confirm,i.title)},s=n.data("action");n.text();let a={demo:i.id};if(r[s]&&!confirm(r[s]))return;if("remove"===s)a.action="the7_remove_demo_content",a._wpnonce=dtDummy.nonces.remove_demo_nonce;else{if("keep"!==s)return;a.action="the7_keep_demo_content",a._wpnonce=dtDummy.nonces.keep_demo_content}const d=o.find(".notice"),p=d.find("p").text();n.data("progress-text")&&(d.removeClass("notice-success"),d.addClass("notice-warning"),d.find("p").text(n.data("progress-text"))),E.hide(),o.addClass("the7-disabled"),t.post(ajaxurl,a).then(O).done((function(t){window.location.reload()})).always((function(){d.addClass("notice-success"),d.removeClass("notice-warning"),d.find("p").text(p),o.removeClass("the7-disabled"),E.show()}))}))}))}(jQuery);