File: /home/axxoncom/domains/adrap.click/private_html/wp-content/plugins/kubio/build/admin-area/index.js
(()=>{"use strict";var e={7418:e=>{var t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var n,s,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))a.call(n,c)&&(r[c]=n[c]);if(t){s=t(n);for(var d=0;d<s.length;d++)i.call(n,s[d])&&(r[s[d]]=n[s[d]])}}return r}},5251:(e,t,a)=>{var i=a(9196),o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,a){var i,n={},c=null,d=null;for(i in void 0!==a&&(c=""+a),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,i)&&!l.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===n[i]&&(n[i]=t[i]);return{$$typeof:o,type:e,key:c,ref:d,props:n,_owner:r.current}}t.Fragment=n,t.jsx=c,t.jsxs=c},5893:(e,t,a)=>{e.exports=a(5251)},9196:e=>{e.exports=window.React}},t={};function a(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{a.r(i),a.d(i,{initDemoImport:()=>A,initSiteWizard:()=>ye});const e=window.lodash;let t={},o={};const n="NOT_INSTALLED",s=e=>t=e,r=()=>{var e;return(null===(e=o)||void 0===e?void 0:e.plugins)||[]},l=a=>{const i=(0,e.find)(t.demos,{slug:a});o=i},c=()=>t.ajax_nonce,d=()=>t.ajax_url,u=e=>{var a;return(null===(a=t.texts)||void 0===a?void 0:a[e])||""},p=e=>t.plugins_states[e]||n,b=window.jQuery,m=window.wp.i18n,h=window.wp.url,g=t=>new Promise(((a,i)=>{const o=t instanceof window.FormData?t:new window.FormData;o.append("nonce",c()),(0,e.each)(t,((e,t)=>o.append(t,e))),b.ajax({method:"POST",url:(0,h.addQueryArgs)(d(),{nonce:c(),action:o.get("action")}),data:o,contentType:!1,processData:!1}).done((e=>{if(!1===e.success){var t,o;const a=(null==e||null===(t=e.data)||void 0===t?void 0:t.error_message)||(null==e||null===(o=e.data)||void 0===o?void 0:o.error);i(a)}else a(e)})).fail((e=>{i(`${e.status} ( ${e.statusText} ) : ${e.responseText}`)}))})),w=async e=>await g({action:"kubio-demo-site-activate-plugin",slug:e}),f=async e=>{const t=p(e);try{switch(t){case"ACTIVE":return!0;case"INSTALLED":await w(e);break;case n:await(async e=>await g({action:"kubio-demo-site-install-plugin",slug:e}))(e),await w(e)}}catch(e){throw e}},k=async(t=null)=>{let a={action:"kubio-demo-site-import-data",slug:o.slug||0,first_call:!0};try{let i={};do{if(t&&a.first_call?((0,e.each)(a,((e,a)=>t.append(a,e))),i=await g(t)):i=await g(a),a=(0,e.omit)(a,"first_call"),i.before_import_action?(I(v.PREPARING,O.PROGRESS),a={...a,before_import_action:i.before_import_action}):(I(v.PREPARING,O.DONE),I(v.CONTENT,O.PROGRESS),a=(0,e.omit)(a,"before_import_action")),"finished"===i.status){I(v.CONTENT,O.DONE);break}}while("requires-new-ajax-call"===i.status)}catch(e){P(e)}};let _=0;const y=(e=!0)=>{const a=b("#kubio-templates-list"),i=b("#kubio-template-installing");if(e){_=window.scrollY,a.hide(),i.css("display","flex").hide().fadeIn(100),i.find("img").attr("src",o.thumb);const e=(0,m.sprintf)(u("importing_template"),o.name);i.find("[data-title]").html(e);const n=r(),s=i.find("[data-plugins]"),l=i.find("[data-plugins-list]");n.length?(s.show(),l.empty(),n.forEach((e=>{const a=(i=e.slug,t.texts.plugins_states[p(i)]);var i;l.append(`<li><span>${e.label}</span><span>${a}</span></li>`)}))):s.hide();const c=!o.is_pro;(e=>{const t=b("#kubio-template-installing"),a=t.find("#import-button"),i=t.find("[data-available-pro-only]"),o=t.find("[data-check-pro-features]");e?(i.addClass("hidden"),o.addClass("hidden"),a.attr("data-start-import",""),a.show()):(a.removeAttr("data-start-import"),a.hide(),i.removeClass("hidden"),o.removeClass("hidden"))})(!(!t.kubio_pro_active&&!c))}else i.css("display","flex").hide(),b("#kubio-templates-list").show(),setTimeout((()=>window.scrollTo(0,_)),5)},x=async()=>{b(".kubio-admin-page-header-start-editing").addClass("hidden");const e=b("#kubio-template-installing"),t=e.find("[data-info]"),a=e.find("[data-progress]"),i=e.find("[data-install-buttons]"),o=e.find("[data-install-success-buttons]"),n=b(".kubio-progress-bar");t.hide(),a.css("display","flex").show(),i.hide(),n.show();try{await(async()=>{try{I(v.PLUGINS,O.PROGRESS);const e=r();for(let t=0;t<e.length;t++){const{slug:a}=e[t];await f(a)}I(v.PLUGINS,O.DONE)}catch(e){P(e)}})(),await k()}catch(e){P()}n.hide(),o.show(),b(".kubio-admin-page-header-start-editing").removeClass("hidden")},j=()=>{b((()=>{!function(){try{const e=new URL(location).searchParams.get("import");if(!e)return;l(e),y(),x()}catch(e){console.error(e)}}(),b(document).on("click","#kubio-templates-list button[data-slug]",(function(){const e=b(this).data("slug");l(e),y()})),b(document).on("click","#kubio-template-installing button[data-cancel-import]",(function(){y(!1)})),b(document).on("click","#kubio-template-installing button[data-start-import]",x),b(document).on("submit","#kubio-import-demo-site",(async e=>{e.preventDefault(),e.stopPropagation();const t=e.target,a=new window.FormData(t);S=!0;const i=b(t).siblings(".kubio-progress-bar");i.show(),b(t).hide();try{await k(a)}catch(e){i.hide();const t=C(e);b("[data-kubio-manual-demo-site-errors]").append(`<div class="kubio-demo-site-manual-import-error">${t}</div>`)}i.hide()}))}))},v={PLUGINS:"plugins",PREPARING:"preparing",CONTENT:"content"},N={plugins:"data-installing-plugins",preparing:"data-preparing-for-import",content:"data-importing-content"},O={INACTIVE:"",PROGRESS:"progress",DONE:"active"},I=(e,t)=>{b(`[data-progress-list] [${N[e]}]`).attr("class",t)};let S=!1;const C=t=>{t=(0,e.castArray)(t);let a="";return t.forEach((e=>a+=`<p>${e}</p>`)),a},E=t=>{if(S)return;const a="[data-importing-errors]";b(a).show(),(t=(0,e.castArray)(t)).forEach((e=>b(`${a} [data-importing-errors-content]`).append(`<p>${e}</p>`)))},P=e=>{throw S||(E(e),E(u("import_stopped")),S=!0),b(".kubio-progress-bar").hide(),b("[data-progress-list] li").attr("class",""),e},A=e=>{s(e),j()},R=b("#upgrade_to_pro_wrapper #kubio-page-builder-activate-license-form");let L=R;const T=b(".notice #kubio-page-builder-activate-license-form");T.length&&(L=T);const D=b("#kubio-page-builder-check-license form");if(D.length&&(L=D),L.length){const je=L.find("input[type=text]"),ve=L.parent(),Ne=ve.find("#kubio-page-builder-activate-license-message"),Oe=ve.find(".description"),Ie=ve.find(".spinner-holder");function Se(e){const t=jQuery(document.createElement("div")).append(e);return t.find("input,button,script,style").remove(),t.find("body").length?t.find("body").html():t.html()}function Ce(){Ne.hide()}function Ee(e){Ae(),Ne.attr("class","message error-message"),Ne.html(Se(e)),Ne.show()}function Pe(e="",t=""){L.hide(),Ne.hide(),Oe.hide(),Ie.show(),""!==e&&("loader"===e?(Ie.removeClass("ok"),Ie.find(".icon .loader").show()):"ok"===e&&Ie.addClass("ok")),""!==t&&Ie.find(".message").text(t)}function Ae(){L.show(),Ne.show(),Oe.show(),Ie.hide()}je.on("keyup change",Ce),L.on("submit",(function(e){var t,a;e.preventDefault(),e.stopPropagation();const i=je.val();i?(Ce(),Pe("loader",(0,m.__)("Loading…","kubio")),L.addClass("disabled"),wp.ajax.send("kubiowp-page-builder-activate",{data:{key:i,_wpnonce:null===(t=top)||void 0===t||null===(a=t.kubioUtilsData)||void 0===a?void 0:a.kubio_ajax_nonce}}).done((function(e){var t,a;R.length?(Pe("loader",(0,m.__)("Installing Kubio PRO…","kubio")),wp.ajax.post("kubiowp-page-builder-maybe-install-pro",{_wpnonce:null===(t=top)||void 0===t||null===(a=t.kubioUtilsData)||void 0===a?void 0:a.kubio_ajax_nonce}).done((function(){Pe("ok",(0,m.__)("Kubio PRO sucessfully installed","kubio")),F(i)})).fail((function(e){e.message?Ee(e.message):Ee((0,m.__)("There was an error installing the Kubio PRO plugin","kubio"))}))):Pe("ok",e||(0,m.__)("Activated successfully","kubio"))})).fail((function(e){Ae(),L.removeClass("disabled"),Ee(e.responseJSON.data)}))):Ee((0,m.__)("License key is empty","kubio"))})),D.length&&window.wp&&window.wp.ajax&&wp.ajax.send("kubiowp-page-builder-check-license",{data:{_wpnonce:top.kubioUtilsData.kubio_ajax_nonce}}).fail((function(e){L.closest(".notice").removeClass("hidden"),Ee(Se(e.responseJSON.data))}))}function F(e){b(".kubio--modal").removeClass("kubio--modal-hidden"),b("input[name=upgrade__reason]").on("click",(function(){b(".kubio--popup__form label").removeClass("kubio--popup__form--checked"),b(this).parents("label").addClass("kubio--popup__form--checked"),0===b("input[name=upgrade__reason]:checked").length?b(".kubio--popup__form").addClass("kubio--popup__form-has-errors"):(b(".kubio--popup__form").removeClass("kubio--popup__form-has-errors"),b(".kubio--modal").addClass("kubio--modal-hidden"),function(e,t){wp.ajax.send("kubiowp-page-builder-upgrade-feedback",{data:{reason:e,license:t,_wpnonce:top.kubioUtilsData.kubio_ajax_nonce}}).done((function(){console.log("Thank you for your feedback")}))}(b("input[name=upgrade__reason]:checked").val(),e))}))}b(".kubio--popup__close button").on("click",(function(e){e.preventDefault(),b(this).parents(".kubio--modal").addClass("kubio--modal-hidden")})),window.kubio=window.kubio||{},window.kubio.showFeedbackForm=F;const $=window.kubio.ai,U=window.kubio.core,G=window.kubio.coreHooks,K=window.kubio.log,M=window.kubio.pro,B=window.kubio.utils,q=window.wp.element;var z=a(9196),W=a.n(z),H=a(7418),Q=a.n(H),Y=function(){return Y=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var o in t=arguments[a])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Y.apply(this,arguments)};const V=function(e){for(var t=e.url,a=e.allowFullScreen,i=e.position,o=e.display,n=e.height,s=e.width,r=e.overflow,l=e.styles,c=e.onLoad,d=e.onMouseOver,u=e.onMouseOut,p=e.scrolling,b=e.id,m=e.frameBorder,h=e.ariaHidden,g=e.sandbox,w=e.allow,f=e.className,k=e.title,_=e.ariaLabel,y=e.ariaLabelledby,x=e.name,j=e.target,v=e.loading,N=e.importance,O=e.referrerpolicy,I=e.allowpaymentrequest,S=e.src,C=Q()({src:S||t,target:j||null,style:{position:i||null,display:o||"block",overflow:r||null},scrolling:p||null,allowpaymentrequest:I||null,importance:N||null,sandbox:g||null,loading:v||null,styles:l||null,name:x||null,className:f||null,referrerpolicy:O||null,title:k||null,allow:w||null,id:b||null,"aria-labelledby":y||null,"aria-hidden":h||null,"aria-label":_||null,width:s||null,height:n||null,onLoad:c||null,onMouseOver:d||null,onMouseOut:u||null}),E=Object.create(null),P=0,A=Object.keys(C);P<A.length;P++){var R=A[P];null!=C[R]&&(E[R]=C[R])}for(var L=0,T=Object.keys(E.style);L<T.length;L++){var D=T[L];null==E.style[D]&&delete E.style[D]}if(a)if("allow"in E){var F=E.allow.replace("fullscreen","");E.allow=("fullscreen "+F.trim()).trim()}else E.allow="fullscreen";return m>=0&&(E.style.hasOwnProperty("border")||(E.style.border=m)),W().createElement("iframe",Y({},E))};var J=a(5893);let Z="",X=()=>(0,B.getBackendData)("kubioAIPricingURL");X=M.upgradeToProURL;const ee=(0,q.memo)((({message:e})=>(0,J.jsxs)("p",{className:"spinner-holder",children:[(0,J.jsx)("span",{className:"loader",dangerouslySetInnerHTML:{__html:Z}}),e]}))),te=({message:e})=>(0,J.jsx)("div",{className:"notice notice-error",children:(0,J.jsx)("p",{children:e})}),ae=({remainingCredits:e,email:t})=>{const[a,i]=(0,q.useState)(1),[o,n]=(0,q.useState)(!0),[s,r]=(0,q.useState)({data:[]});let l=(0,J.jsx)(J.Fragment,{});return(0,G.useEffectAsync)((async()=>{try{n(!0);const e=await(0,$.getAIUsage)(a);r(e)}catch(e){}finally{n(!1)}}),[a]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-info nowrap",children:[(0,J.jsxs)("div",{className:"kubio-admin-col grow",children:[(0,J.jsx)("h3",{children:(0,m.__)("You are connected to Kubio AI","kubio")}),(0,J.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,m.sprintf)(// translators: placeholders are for email and number of credits
// translators: placeholders are for email and number of credits
(0,m.__)("You are currently connected as %1$s, and the current account has %2$s AI credits available","kubio"),`<i class="kubio-ai-email">${t}</i>`,`<i class="kubio-ai-credits">${e}</i>`)}})]}),(0,J.jsxs)("div",{className:"kubio-admin-col kubio-ai-info-actions",children:[(0,J.jsx)("a",{href:X(),target:"_blank",className:"button button-primary button-hero",rel:"noreferrer",children:(0,m.__)("Get more credits","kubio")}),l]})]}),(0,J.jsx)("hr",{}),(0,J.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-usage",children:[(0,J.jsx)("div",{className:"kubio-admin-row kubio-ai-account-info",children:(0,J.jsxs)("div",{className:"kubio-admin-col grow",children:[(0,J.jsx)("h3",{children:(0,m.__)("Kubio AI credits usage","kubio")}),(0,J.jsx)("p",{children:(0,m.__)("The table below displays how Kubio AI credits were spent on this site","kubio")})]})}),(0,J.jsxs)("table",{className:"wp-list-table widefat fixed striped table-view-list pages",children:[(0,J.jsx)("thead",{children:(0,J.jsxs)("tr",{children:[(0,J.jsx)("th",{scope:"col",className:"manage-column r",children:(0,m.__)("Date","kubio")}),(0,J.jsx)("th",{scope:"col",className:"manage-column r",children:(0,m.__)("Message","kubio")})]})}),(0,J.jsxs)("tbody",{children:[o&&(0,J.jsx)("tr",{children:(0,J.jsx)("td",{className:"no-data",colSpan:2,children:(0,J.jsx)(ee,{message:(0,m.__)("Retrieving data…","kubio")})})}),!o&&0===s.data.length&&(0,J.jsx)("tr",{children:(0,J.jsx)("td",{className:"no-data",colSpan:2,children:(0,J.jsx)("p",{children:(0,m.__)("Currently there is no usage history for this site","kubio")})})}),!o&&0!==s.data.length&&s.data.map((e=>(0,J.jsxs)("tr",{children:[(0,J.jsx)("td",{children:e.created_at}),(0,J.jsx)("td",{children:e.content})]},e.created_at)))]})]}),(0,J.jsx)("div",{className:"tablenav bottom",children:(0,J.jsxs)("div",{className:"tablenav-pages",children:[(0,J.jsx)("span",{className:"displaying-num",children:(0,m.sprintf)(// translators: %s number of items
// translators: %s number of items
(0,m._n)("%s item","%s items",s.total,"kubio"),s.total)}),(0,J.jsxs)("span",{className:"pagination-links",children:[(0,J.jsx)("button",{className:"first-page button","aria-hidden":"true",onClick:()=>i(1),disabled:1===a,children:(0,J.jsx)("span",{"aria-hidden":"true",children:"«"})}),(0,J.jsx)("button",{className:"prev-page button","aria-hidden":"true",disabled:1===a,onClick:()=>i((e=>Math.max(1,e-1))),children:(0,J.jsx)("span",{"aria-hidden":"true",children:"‹"})}),(0,J.jsx)("span",{className:"paging-input",children:(0,J.jsx)("span",{className:"tablenav-paging-text",children:(0,m.sprintf)(// translators: %1$s current page, %2$s last page
// translators: %1$s current page, %2$s last page
(0,m.__)("%1$s of %2$s","kubio"),a,s.last_page)})}),(0,J.jsx)("button",{className:"next-page button",disabled:a===s.last_page,onClick:()=>i((e=>Math.min(s.last_page,e+1))),children:(0,J.jsx)("span",{"aria-hidden":"true",children:"›"})}),(0,J.jsx)("button",{className:"last-page button",disabled:a===s.last_page,onClick:()=>i(s.last_page),children:(0,J.jsx)("span",{"aria-hidden":"true",children:"»"})})]})]})})]})]})},ie=()=>{const t=(0,e.first)((0,B.getBackendData)("kubioCloudUrl").split("?")).replace(/\/+$/,"");return(0,q.useEffect)((()=>{const e=t=>{const{action:a=null,value:i=null,error:o=null}=t.data||{};"ai_subscription_key"===a&&(window.removeEventListener("message",e),o&&K.Log.error("AI Connect Iframe",o),i||K.Log.error("AI Connect Iframe, no value"),(async()=>{await(0,$.setAIKey)({aiKey:i}),window.location.reload()})())};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,J.jsxs)("div",{className:"kubio-admin-row kubio-ai-account-info",children:[(0,J.jsxs)("div",{className:"kubio-admin-col",children:[(0,J.jsx)("h2",{children:(0,m.__)("You are not connected to Kubio AI","kubio")}),(0,J.jsx)("p",{children:(0,m.__)("It appears that you haven't fully leveraged the potential of Kubio AI features on your website. By connecting and allowing the AI to assist you, you'll optimize its capabilities and enhance your overall experience. Let the AI do the heavy lifting for you—seamless and efficient.","kubio")})]}),(0,J.jsx)("div",{className:"kubio-admin-col kubio-ai-info-actions kubio-ai-info-actions__login",children:(0,J.jsx)(V,{loading:"eager",importance:"high",className:"kubio-connect-iframe",url:`${t}/ui-route/connect-ai`,title:"Kubio AI Connect",sandbox:"allow-popups allow-modals allow-same-origin allow-scripts allow-forms allow-popups-to-escape-sandbox"})})]})};window.aiInfoInit=function(e){Z=e.loader_iframe,e.connected?async function(){try{const{remaining_credits:e=0,account_email:t=30}=await(0,$.getAIInfo)();(0,U.reactRender)((0,J.jsx)(ae,{remainingCredits:e,email:t}),document.querySelector("#kubio-ai-info-content"))}catch(e){(0,U.reactRender)((0,J.jsx)(te,{message:(0,m.__)("There seems to be an error with the Kubio AI service. Please try again","kubio")}),document.querySelector("#kubio-ai-info-content"))}}():(0,U.reactRender)((0,J.jsx)(ie,{}),document.querySelector("#kubio-ai-info-content"))};const oe=window.kubio.blockPatterns,ne=window.kubio.editor,se=window.kubio.icons,re=window.wp.components,le=window.wp.coreData,ce=window.wp.data,de=window.wp.apiFetch;var ue=a.n(de);const pe=async(e={})=>{await ue()({path:(0,h.addQueryArgs)("kubio/v1/3rd_party_themes/import_fresh_site",e)})},be=window.kubio.controls,me=window.wp.primitives,he=(0,J.jsx)(me.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,J.jsx)(me.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),ge=(0,J.jsx)(me.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,J.jsx)(me.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),we=async()=>{await pe({start_with_frontpage:!0}),window.location=(0,B.getBackendData)("kubioEditorURL")},fe=({onCancel:e})=>{const{nextStep:t}=(0,be.useWizard)();return(0,J.jsx)("div",{className:"kubio-ai-welcome-step kubio-ai-starter-step",children:(0,J.jsxs)("div",{className:"kubio-ai-welcome-step__content",children:[(0,J.jsx)("div",{className:"kubio-ai-welcome-step__close-modal",children:(0,J.jsx)(re.Button,{icon:he,onClick:e})}),(0,J.jsxs)(re.Flex,{children:[(0,J.jsx)(re.FlexBlock,{className:"kubio-ai-welcome-step__content-column",children:(0,J.jsxs)("div",{className:"kubio-ai-welcome-step__content-column__content",children:[(0,J.jsx)(re.Icon,{icon:se.KubioAI,className:"kubio-ai-logo-colored kubio-ai-logo-animated"}),(0,J.jsx)("h2",{children:(0,m.__)("Thanks for choosing Kubio!","kubio")}),(0,J.jsx)("h1",{children:(0,m.__)("Would you like to generate a homepage using AI? It's fast and FREE!","kubio")}),(0,J.jsx)("p",{children:(0,m.__)("Kubio uses an AI page generator to create a homepage that is adapted to your website. Here’s what you’ll get:","kubio")}),(0,J.jsxs)("ul",{children:[(0,J.jsxs)("li",{children:[(0,J.jsx)(re.Icon,{icon:ge}),(0,m.__)("A homepage customized for your website","kubio")]}),(0,J.jsxs)("li",{children:[(0,J.jsx)(re.Icon,{icon:ge}),(0,m.__)("Texts and images based on your website subject","kubio")]}),(0,J.jsxs)("li",{children:[(0,J.jsx)(re.Icon,{icon:ge}),(0,m.__)("Matching color scheme and typography","kubio")]}),(0,J.jsxs)("li",{children:[(0,J.jsx)(re.Icon,{icon:ge}),(0,m.__)("Contact form and social media integration","kubio")]})]}),(0,J.jsxs)(re.Flex,{justify:"flex-start",gap:4,children:[(0,J.jsx)(re.Button,{variant:"primary",onClick:t,className:"kubio-ai-button",children:(0,m.__)("Generate homepage with AI","kubio")}),(0,J.jsx)(re.Button,{variant:"link",onClick:we,children:(0,m.__)("No thanks, install the default homepage","kubio")})]})]})}),(0,J.jsx)(re.Flex,{className:"kubio-ai-welcome-step__bg-column",children:(0,J.jsx)("img",{alt:"welcome",src:(0,B.staticAssetURL)("ai-assets/welcome.png")})})]})]})})},ke=()=>{window.location=(0,B.getBackendData)("admin_url")},_e=()=>{const[e,t]=(0,q.useState)(!1),{saveEditedEntityRecord:a}=(0,ce.useDispatch)(le.store),{dirtyEntityRecords:i}=(0,ce.useSelect)((e=>{const t=e(le.store).__experimentalGetDirtyEntityRecords().filter((e=>!("root"===e.kind&&"site"===e.name))),a=e(le.store).getEntityRecordEdits("root","site"),i=[];for(const e in a)i.push({kind:"root",name:"site",property:e});return{dirtyEntityRecords:[...t,...i]}}),[]);(0,oe.useInitializeCloudPatterns)();const o=(0,q.useCallback)((e=>[{label:(0,m.__)("Welcome","kubio"),name:"start",component:fe,skipNavigation:!0},...e.filter((e=>["general-info","contact-info","final-step"].includes(e.name)))]),[]),n=(0,q.useCallback)((async e=>{const{siteContext:o}=e;t(!0),await pe(),await(0,$.saveAiGeneralSettings)(o);for(const e of i)await a(e.kind,e.name,e.key);window.location=(0,h.addQueryArgs)((0,B.getBackendData)("kubioEditorURL"),{"generate-ai-frontpage":!0})}),[i,a]);return(0,J.jsxs)(J.Fragment,{children:[e&&(0,J.jsx)("div",{className:"kubio-starter-loader",children:(0,J.jsxs)("div",{className:"kubio-starter-loader_content-wrapper",children:[(0,J.jsx)(re.Icon,{icon:se.KubioLoader}),(0,J.jsx)("p",{children:(0,m.__)("Finishing setup…","kubio")})]})}),!e&&(0,J.jsx)($.AIWizard,{isSetup:!1,isFrontPage:!0,stepsFilter:o,startStep:"start",modalTitle:(0,m.__)("Kubio Website starter","kubio"),finishLabel:(0,m.__)("Generate","kubio"),onCancel:ke,onFinish:n})]})},ye=async(e={})=>{(0,ne.registerEditSiteStore)({}),(0,U.reactRender)((0,J.jsx)(q.StrictMode,{children:(0,J.jsx)(_e,{})}),document.querySelector("#kubio-website-starter"))},xe=b("#adminmenu .toplevel_page_kubio");if(xe.length){const Re=window.location.search,Le=new URLSearchParams(Re);if("kubio-get-started"===Le.get("page")){const Te=Le.get("tab");null!==Te&&(xe.find("li.current").removeClass("current"),xe.find("a[href*='tab="+Te+"']").length?xe.find("a[href*='tab="+Te+"']").closest("li").addClass("current"):xe.find("li.wp-first-item").next().addClass("current"))}xe.find("a[href*='tab=pro-upgrade']").length&&xe.find("a[href*='tab=pro-upgrade']").closest("li").addClass("li-pro-upgrade")}setTimeout((()=>{const e=b(".kubio-admin-row.get-started-imported");e.addClass("inline"),b(".get-started-with-kubio").eq(0).prepend(e)}),100)})(),(window.kubio=window.kubio||{}).adminArea=i})();