File: /home/shrsglobal/www/wp-content/plugins/woocommerce/assets/client/admin/chunks/launch-store.js
"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[3678],{37148:(e,t,o)=>{o.d(t,{a:()=>r});var n=o(4921),s=o(86087),a=o(23772);const r=({children:e,className:t})=>(0,s.createElement)("div",{className:(0,n.A)("woocommerce-onboarding-loader",t)},e);r.Layout=({children:e,className:t})=>(0,s.createElement)("div",{className:(0,n.A)("woocommerce-onboarding-loader-wrapper",t)},(0,s.createElement)("div",{className:(0,n.A)("woocommerce-onboarding-loader-container",t)},e)),r.Illustration=({children:e})=>(0,s.createElement)(s.Fragment,null,e),r.Title=({children:e,className:t})=>(0,s.createElement)("h1",{className:(0,n.A)("woocommerce-onboarding-loader__title",t)},e),r.ProgressBar=({progress:e,className:t})=>(0,s.createElement)(a.A,{className:(0,n.A)("progress-bar",t),percent:null!=e?e:0,color:"var(--wp-admin-theme-color)",bgcolor:"#E0E0E0"}),r.Subtext=({children:e,className:t})=>(0,s.createElement)("p",{className:(0,n.A)("woocommerce-onboarding-loader__paragraph",t)},e),r.Sequence=({interval:e,shouldLoop:t=!0,children:o,onChange:n=()=>{}})=>{const[a,r]=(0,s.useState)(0),i=s.Children.count(o);(0,s.useEffect)((()=>{const o=setInterval((()=>{r((e=>{const s=e+1;if(t){const e=s%i;return n(e),e}return s<i?(n(s),s):(clearInterval(o),e)}))}),e);return()=>clearInterval(o)}),[e,o,t,i]);const c=s.Children.toArray(o)[a];return(0,s.createElement)(s.Fragment,null,c)}},14695:(e,t,o)=>{o.d(t,{L:()=>j});var n=o(51609),s=o(86087),a=o(56427),r=o(18015),i=o(12486),c=o(27193),l=o(6457),m=o(94084),d=o(90423),u=o(31183),_=o(76147),p=o(22056),h=o(96043),y=o(70145),g=o(61727),w=o(97021),v=o(27707),b=o(30487),S=o(97723),x=o(80019),C=o(66012),k=o(17479),f=o(93342),P=o(10630);const E=[{name:"visa",component:(0,s.createElement)(r.A,{key:"visa"})},{name:"mastercard",component:(0,s.createElement)(i.A,{key:"mastercard"})},{name:"amex",component:(0,s.createElement)(c.A,{key:"amex"})},{name:"discover",component:(0,s.createElement)(l.A,{key:"discover"})},{name:"woopay",component:(0,s.createElement)(_.A,{key:"woopay"})},{name:"applepay",component:(0,s.createElement)(m.A,{key:"applepay"})},{name:"googlepay",component:(0,s.createElement)(d.A,{key:"googlepay"})},{name:"afterpay",component:(0,s.createElement)(p.A,{key:"afterpay"})},{name:"affirm",component:(0,s.createElement)(h.A,{key:"affirm"})},{name:"klarna",component:(0,s.createElement)(y.A,{key:"klarna"})},{name:"cartebancaire",component:(0,s.createElement)(g.A,{key:"cartebancaire"})},{name:"unionpay",component:(0,s.createElement)(w.A,{key:"unionpay"})},{name:"diners",component:(0,s.createElement)(v.A,{key:"diners"})},{name:"eftpos",component:(0,s.createElement)(b.A,{key:"eftpos"})},{name:"jcb",component:(0,s.createElement)(u.A,{key:"jcb"})},{name:"bancontact",component:(0,s.createElement)(x.A,{key:"bancontact"})},{name:"becs",component:(0,s.createElement)(k.A,{key:"becs"})},{name:"eps",component:(0,s.createElement)(C.A,{key:"eps"})},{name:"ideal",component:(0,s.createElement)(S.A,{key:"ideal"})},{name:"przelewy24",component:(0,s.createElement)(f.A,{key:"przelewy24"})},{name:"grabpay",component:(0,s.createElement)(P.A,{key:"grabpay"})}],j=({isWooPayEligible:e=!1,maxElements:t=10,tabletWidthBreakpoint:o=768,maxElementsTablet:r=7,mobileWidthBreakpoint:i=480,maxElementsMobile:c=5,totalPaymentMethods:l=21})=>{const[m,d]=(0,n.useState)(t),[u,_]=(0,n.useState)(!1),p=(0,n.useRef)(null),h=e=>{const t=e.target.closest(".woocommerce-woopayments-payment-methods-logos-count");p.current&&t!==p.current||_((e=>!e))},y=e?l:l-1,g=t=>e?t:t+1;(0,n.useEffect)((()=>{const e=()=>{window.innerWidth<=i?d(c):window.innerWidth<=o?d(r):d(t)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t,c,r,o,i]);const w=E.slice(0,g(m)).filter((t=>e||"woopay"!==t.name)),v=E.slice(g(m)).filter((t=>e||"woopay"!==t.name));return(0,s.createElement)("div",{className:"woocommerce-woopayments-payment-methods-logos"},w.map((e=>e.component)),m<y&&(0,s.createElement)("div",{className:"woocommerce-woopayments-payment-methods-logos-count",role:"button",tabIndex:0,ref:p,onClick:h,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(e)}},"+ ",y-m,u&&(0,s.createElement)(a.Popover,{className:"woocommerce-woopayments-payment-methods-logos-popover",placement:"top-start",offset:4,variant:"unstyled",focusOnMount:!0,noArrow:!0,shift:!0,onFocusOutside:()=>{_(!1)}},(0,s.createElement)("div",{className:"woocommerce-woopayments-payment-methods-logos"},v.map((e=>e.component))))))}},29568:(e,t,o)=>{o.d(t,{b:()=>i,J:()=>c});var n=o(84343),s=o.n(n),a=o(27723);const r={PH:{"National Capital Region":(0,a.__)("Metro Manila","woocommerce")},IT:{Rome:(0,a.__)("Roma","woocommerce")}},i=(e,t,o=.7)=>{if(!t)return null;let n=null,a=o;const i=(({country_short:e,region:t="",city:o=""})=>{if(!e)return null;const n=r[e];if(!n)return null;const s=n[t];return s||(n[o]||null)})(t);for(const o of e){if(o.key===t.country_short)return o;if(o.key.split(":")[0]===t.country_short&&o.label.includes("—")){const e=o.label.split("—")[1].trim();if(i===e)return o;if(0===e.localeCompare(t.region||"","en",{sensitivity:"base"})||0===e.localeCompare(t.city||"","en",{sensitivity:"base"}))return o;const r=Math.max(s().compareTwoStrings(e,t.region||""),s().compareTwoStrings(e,t.city||""));r>=a&&(n=o,a=r)}}return n},c=e=>{var t;return null!==(t=e?.split(":")[0])&&void 0!==t?t:void 0}},5751:(e,t,o)=>{o.d(t,{A:()=>s});var n=o(39793);const s=()=>(0,n.jsxs)("svg",{width:"91",height:"24",viewBox:"0 0 91 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"wc-icon wc-icon__woo-logo new-branding",children:[(0,n.jsx)("path",{d:"M79.0537 0C72.2755 0 67.0874 5.10851 67.0874 12C67.0874 18.8915 72.2755 24 79.0537 24C85.832 24 91.0002 18.8915 91.0002 12C91.0002 5.10851 85.7923 0 79.0537 0ZM79.0537 16.6277C76.5094 16.6277 74.7602 14.6644 74.7602 12C74.7602 9.33555 76.4895 7.37228 79.0537 7.37228C81.6179 7.37228 83.3473 9.33555 83.3473 12C83.3473 14.6644 81.5981 16.6277 79.0537 16.6277Z",fill:"#873DFF"}),(0,n.jsx)("path",{d:"M53.7285 0C46.9503 0 41.7622 5.10851 41.7622 12C41.7622 18.8915 46.9701 24 53.7285 24C60.4869 24 65.675 18.8915 65.675 12C65.675 5.10851 60.4671 0 53.7285 0ZM53.7285 16.6277C51.1842 16.6277 49.435 14.6644 49.435 12C49.435 9.33555 51.1643 7.37228 53.7285 7.37228C56.2928 7.37228 58.0221 9.33555 58.0221 12C58.0221 14.6644 56.2928 16.6277 53.7285 16.6277Z",fill:"#873DFF"}),(0,n.jsx)("path",{d:"M11.688 24C14.3715 24 16.5183 22.6577 18.1483 19.5726L21.7461 12.7813V18.5509C21.7461 21.9365 23.9327 24 27.3317 24C29.9556 24 31.8837 22.798 33.792 19.5726L42.1207 5.44908C43.9494 2.36394 42.6574 0 38.6421 0C36.4953 0 35.1039 0.721201 33.8516 3.08514L28.107 13.9232V4.28714C28.107 1.40234 26.7553 0 24.2308 0C22.2629 0 20.6926 0.861435 19.4602 3.26544L14.0535 13.9032V4.38731C14.0535 1.30217 12.8012 0 9.74004 0H3.53822C1.19266 0 0 1.10184 0 3.14524C0 5.18864 1.23241 6.33054 3.53822 6.33054H6.08255V18.5309C6.10243 21.9365 8.3486 24 11.688 24Z",fill:"#873DFF"})]})},81110:(e,t,o)=>{o.d(t,{b:()=>y});var n=o(4921),s=o(47143),a=o(56427),r=o(29491),i=o(3582),c=o(18537),l=o(86087),m=o(23522),d=o(96476),u=o(98846),_=o(39793);const p=function({className:e="wordpress-logo",size:t=72}){return(0,_.jsx)("svg",{className:e,height:t,width:t,viewBox:"0 0 72 72",children:(0,_.jsx)("path",{d:"M36,0C16.1,0,0,16.1,0,36c0,19.9,16.1,36,36,36c19.9,0,36-16.2,36-36C72,16.1,55.8,0,36,0z M3.6,36 c0-4.7,1-9.1,2.8-13.2l15.4,42.3C11.1,59.9,3.6,48.8,3.6,36z M36,68.4c-3.2,0-6.2-0.5-9.1-1.3l9.7-28.2l9.9,27.3 c0.1,0.2,0.1,0.3,0.2,0.4C43.4,67.7,39.8,68.4,36,68.4z M40.5,20.8c1.9-0.1,3.7-0.3,3.7-0.3c1.7-0.2,1.5-2.8-0.2-2.7 c0,0-5.2,0.4-8.6,0.4c-3.2,0-8.5-0.4-8.5-0.4c-1.7-0.1-2,2.6-0.2,2.7c0,0,1.7,0.2,3.4,0.3l5,13.8L28,55.9L16.2,20.8 c2-0.1,3.7-0.3,3.7-0.3c1.7-0.2,1.5-2.8-0.2-2.7c0,0-5.2,0.4-8.6,0.4c-0.6,0-1.3,0-2.1,0C14.7,9.4,24.7,3.6,36,3.6 c8.4,0,16.1,3.2,21.9,8.5c-0.1,0-0.3,0-0.4,0c-3.2,0-5.4,2.8-5.4,5.7c0,2.7,1.5,4.9,3.2,7.6c1.2,2.2,2.7,4.9,2.7,8.9 c0,2.8-0.8,6.3-2.5,10.5l-3.2,10.8L40.5,20.8z M52.3,64l9.9-28.6c1.8-4.6,2.5-8.3,2.5-11.6c0-1.2-0.1-2.3-0.2-3.3 c2.5,4.6,4,9.9,4,15.5C68.4,47.9,61.9,58.4,52.3,64z"})})};(0,o(52619).addFilter)("woocommerce_admin_persisted_queries","woocommerce_admin_customize_your_store",(e=>(e.push("ref"),e)));const h=()=>"entrepreneur-signup"===new URLSearchParams(window.location.search).get("ref"),y=(0,l.forwardRef)((({isTransparent:e,...t},o)=>{const{siteTitle:l}=(0,s.useSelect)((e=>{const{getSite:t}=e(i.store);return{siteTitle:t()?.title}}),[]),y=(0,r.useReducedMotion)();return(0,_.jsx)(a.__unstableMotion.div,{ref:o,...t,className:(0,n.A)("woocommerce-edit-site-site-hub",t.className),initial:!1,transition:{type:"tween",duration:y?0:.3,ease:"easeOut"},children:(0,_.jsx)(a.__experimentalHStack,{justify:"space-between",alignment:"center",className:"woocommerce-edit-site-site-hub__container",children:(0,_.jsxs)(a.__experimentalHStack,{justify:"flex-start",className:"woocommerce-edit-site-site-hub__text-content",spacing:"0",children:[(0,_.jsx)("div",{className:(0,n.A)("woocommerce-edit-site-site-hub__view-mode-toggle-container",{"has-transparent-background":e}),children:(0,_.jsx)(u.Link,{href:(0,d.getNewPath)((0,d.getPersistedQuery)(),"/",{}),type:"wp-admin",children:h()?(0,_.jsx)(p,{size:24,className:"woocommerce-cys-wordpress-header-logo"}):(0,_.jsx)(m.A,{className:"woocommerce-edit-site-layout__view-mode-toggle-icon"})})}),!h()&&(0,_.jsx)(a.__unstableAnimatePresence,{children:(0,_.jsx)(a.__unstableMotion.div,{layout:!1,animate:{opacity:1},exit:{opacity:0},className:(0,n.A)("woocommerce-edit-site-site-hub__site-title",{"is-transparent":e}),transition:{type:"tween",duration:y?0:.2,ease:"easeOut",delay:.1},children:(0,c.decodeEntities)(l)})})]})})})}))},31409:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Ye});var n=o(84437),s=o(51609),a=o.n(s),r=o(47143),i=o(40314),c=o(4921),l=o(24060),m=o(51513),d=o(53187),u=o(97233),_=o(71529),p=o(4316),h=o(96476),y=o(83306),g=o(1455),w=o.n(g),v=o(86087),b=o(27723),S=o(59783),x=o(56427),C=o(45260),k=o(46445),f=o(24148),P=o(47804),E=o(61288),j=o(39793);const A=({title:e,description:t,footer:o,children:n,onMobileClose:s})=>{const r=(0,b.isRTL)()?C.A:k.A;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(x.__experimentalVStack,{className:(0,c.A)("woocommerce-edit-site-sidebar-navigation-screen__main",{"has-footer":!!o}),spacing:0,justify:"flex-start",children:[(0,j.jsxs)(x.__experimentalHStack,{spacing:4,alignment:"flex-start",className:"woocommerce-edit-site-sidebar-navigation-screen__title-icon",children:[(0,j.jsx)(E.A,{onClick:(i=e,a().isValidElement(i)&&"function"==typeof i.props.onClick?e.props.onClick:void 0),icon:r,label:(0,b.__)("Back","woocommerce"),showTooltip:!1}),(0,j.jsx)(x.__experimentalHeading,{className:"woocommerce-edit-site-sidebar-navigation-screen__title",level:1,as:"h1",children:e})]}),s&&(0,j.jsx)("div",{className:"woocommerce-lys-mobile-sidebar-close",children:(0,j.jsx)(x.Button,{className:"mobile-sidebar-close",onClick:s,icon:(0,j.jsx)(f.A,{icon:P.A,size:24}),"aria-label":(0,b.__)("Close sidebar","woocommerce")})}),(0,j.jsxs)("div",{className:"woocommerce-edit-site-sidebar-navigation-screen__content",children:[t&&(0,j.jsx)("p",{className:"woocommerce-edit-site-sidebar-navigation-screen__description",children:t}),n]})]}),o&&(0,j.jsx)("footer",{className:"woocommerce-edit-site-sidebar-navigation-screen__footer",children:o})]});var i};var T=o(72744),N=o(20273),L=o(24652),R=o(44412),W=o(35166),M=o(33484),O=o(5573);const H=(0,j.jsx)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,j.jsx)(O.Path,{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18.5C10.2761 18.5 8.62279 17.8152 7.40381 16.5962C6.18482 15.3772 5.5 13.7239 5.5 12C5.5 10.2761 6.18482 8.62279 7.40381 7.40381C8.62279 6.18482 10.2761 5.5 12 5.5C13.7239 5.5 15.3772 6.18482 16.5962 7.40381C17.8152 8.62279 18.5 10.2761 18.5 12C18.5 13.7239 17.8152 15.3772 16.5962 16.5962C15.3772 17.8152 13.7239 18.5 12 18.5ZM4 12C4 9.87827 4.84285 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12C20 14.1217 19.1571 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20C9.87827 20 7.84344 19.1571 6.34315 17.6569C4.84285 16.1566 4 14.1217 4 12ZM15.53 10.53L14.47 9.47L11 12.94L9.53 11.47L8.47 12.53L11 15.06L15.53 10.53Z",fill:"#00A32A"})}),I=(0,j.jsx)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,j.jsx)(O.Path,{d:"M5 17.7C5.4 18.2 5.8 18.6 6.2 18.9L7.3 17.5C6.9 17.2 6.6 16.9 6.3 16.5L5 17.7ZM5 6.3L6.4 7.4C6.7 7 7 6.7 7.4 6.4L6.3 5C5.8 5.4 5.4 5.8 5 6.3ZM5.1 14.1L3.4 14.6C3.6 15.2 3.8 15.7 4.1 16.2L5.6 15.4C5.4 15 5.2 14.6 5.1 14.1ZM4.8 12V11.3L3 11.1V12.9L4.7 12.7C4.8 12.5 4.8 12.2 4.8 12ZM7.8 19.9C8.3 20.2 8.9 20.4 9.4 20.6L9.9 18.9C9.4 18.8 9 18.6 8.6 18.4L7.8 19.9ZM19 6.3C18.6 5.8 18.2 5.4 17.8 5.1L16.7 6.5C17.1 6.8 17.4 7.1 17.7 7.5L19 6.3ZM18.9 9.9L20.6 9.4C20.4 8.8 20.2 8.3 19.9 7.8L18.4 8.6C18.6 9 18.8 9.4 18.9 9.9ZM5.6 8.6L4.1 7.8C3.8 8.3 3.6 8.8 3.4 9.4L5.1 9.9C5.2 9.4 5.4 9 5.6 8.6ZM7.8 4.1L8.6 5.6C9 5.4 9.4 5.2 9.9 5.1L9.4 3.4C8.8 3.6 8.3 3.8 7.8 4.1ZM16.6 17.6L17.7 19C18.2 18.6 18.6 18.2 18.9 17.8L17.5 16.7C17.3 17 17 17.3 16.6 17.6ZM18.4 15.4L19.9 16.2C20.2 15.7 20.4 15.1 20.6 14.6L18.9 14.1C18.8 14.6 18.6 15 18.4 15.4ZM21 11.1L19.3 11.3V12.7L21 12.9V12V11.1ZM11.1 3L11.3 4.7H12.7L12.9 3H11.1ZM14.1 5.1C14.6 5.2 15 5.4 15.4 5.6L16.2 4.1C15.7 3.8 15.1 3.6 14.6 3.4L14.1 5.1ZM12 19.2H11.3L11.1 21H12.9L12.7 19.3C12.5 19.2 12.2 19.2 12 19.2ZM14.1 18.9L14.6 20.6C15.2 20.4 15.7 20.2 16.2 19.9L15.4 18.4C15 18.6 14.6 18.8 14.1 18.9Z",fill:"#949494"})}),D=T.A,B={tax:N.A,shipping:L.A,"customize-store":R.A,payments:W.A,"woocommerce-payments":W.A,products:M.A,activePaymentStep:I,completedPaymentStep:H};var U=o(81110),F=o(52619),z=o(85816),Y=o(15703),K=o(1069),$=o(22861);const{getWithExpiry:Z,setWithExpiry:G}=(0,z.createStorageUtils)("lys_recently_actioned_tasks",604800),Q=async()=>{var e;const t=(0,F.applyFilters)("woocommerce_launch_your_store_tasklist_whitelist",["products","customize-store","payments","shipping","tax"]),o=await(0,r.resolveSelect)(i.onboardingStore).getTaskListsByIds(["setup"]),n=null!==(e=Z())&&void 0!==e?e:[],s=o[0].tasks.filter((e=>t.includes(e.id)&&(!e.isComplete||n.includes(e.id))));return{...o[0],tasks:s,recentlyActionedTasks:n,fullLysTaskList:o[0].tasks.filter((e=>t.includes(e.id)))}},V=({task:e,classNames:t})=>(0,j.jsx)(S.A,{className:(0,c.A)(e.id,"is-complete",t),icon:D,disabled:!0,children:e.title}),X=({task:e,classNames:t,onClick:o})=>(0,j.jsx)(S.A,{className:(0,c.A)(e.id,t),icon:B[e.id],withChevron:!0,onClick:o,children:e.title}),q=e=>{const{context:{tasklist:t,removeTestOrders:o,testOrderCount:n,launchStoreError:s}}=e,a=(0,j.jsx)(x.Button,{onClick:()=>{e.sendEventToSidebar({type:"POP_BROWSER_STACK"})},children:(0,b.__)("Launch Your Store","woocommerce")}),r=(0,b.__)("Ready to start selling? Before you launch your store, make sure you’ve completed these essential tasks. If you’d like to change your store visibility, go to WooCommerce > Settings > Site visibility.","woocommerce"),i=t&&!t.tasks.every((e=>e.isComplete)),[l,m]=(0,v.useState)(null==o||o),[d,u]=(0,v.useState)(!1),[_,p]=(0,v.useState)(!1),h=()=>{p(!0),e.sendEventToSidebar({type:"LAUNCH_STORE",removeTestOrders:l})};return(0,v.useEffect)((()=>{s?.message&&p(!1)}),[s?.message]),(0,j.jsxs)("div",{className:(0,c.A)("launch-store-sidebar__container",e.className),children:[(0,j.jsx)(x.__unstableMotion.div,{className:"woocommerce-edit-site-layout__header-container",animate:"view",children:(0,j.jsx)(U.b,{variants:{view:{x:0}},isTransparent:!1,className:"woocommerce-edit-site-layout__hub"})}),(0,j.jsxs)(A,{title:a,description:r,onMobileClose:e.onMobileClose,children:[(0,j.jsx)("div",{className:"woocommerce-edit-site-sidebar-navigation-screen-essential-tasks__group-header",children:(0,j.jsx)(x.__experimentalHeading,{level:2,children:(0,b.__)("Essential Tasks","woocommerce")})}),(0,j.jsxs)(x.__experimentalItemGroup,{className:"woocommerce-edit-site-sidebar-navigation-screen-essential-tasks__group",children:[t&&i&&t.tasks.map((t=>t.isComplete?(0,j.jsx)(V,{task:t},t.id):(0,j.jsx)(X,{task:t,onClick:()=>{e.sendEventToSidebar({type:"TASK_CLICKED",task:t})}},t.id))),t&&!i&&(0,j.jsx)(S.A,{className:"all-tasks-complete",icon:D,children:(0,b.__)("Fantastic job! Your store is ready to go — no pending tasks to complete.","woocommerce")})]}),n>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"woocommerce-edit-site-sidebar-navigation-screen-test-data__group-header",children:(0,j.jsx)(x.__experimentalHeading,{level:2,children:(0,b.__)("Test data","woocommerce")})}),(0,j.jsxs)(x.__experimentalItemGroup,{className:"woocommerce-edit-site-sidebar-navigation-screen-remove-test-data__group",children:[(0,j.jsx)(x.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,b.sprintf)((0,b.__)("Remove %d test orders","woocommerce"),n),checked:l,onChange:m}),(0,j.jsx)("p",{children:(0,b.__)("Remove test orders and associated data, including analytics and transactions, once your store goes live. ","woocommerce")})]})]}),(0,j.jsxs)(x.__experimentalItemGroup,{className:"woocommerce-edit-site-sidebar-navigation-screen-launch-store-button__group",children:[s?.message&&!d&&(0,j.jsx)(x.Notice,{className:"launch-store-error-notice",isDismissible:!0,onRemove:()=>u(!0),status:"error",children:(0,v.createInterpolateElement)((0,b.__)("Oops! We encountered a problem while launching your store. <retryButton/>","woocommerce"),{retryButton:(0,j.jsx)(x.Button,{onClick:h,variant:"tertiary",children:(0,b.__)("Please try again","woocommerce")})})}),(0,j.jsx)(x.Button,{variant:"primary",onClick:h,children:_?(0,j.jsx)(x.Spinner,{}):(0,b.__)("Launch your store","woocommerce")})]})]})]})};var J=o(99096);const ee=({rows:e})=>{const t=Array.from({length:e}).map(((e,t)=>(0,j.jsxs)(x.__unstableMotion.div,{className:"step-placeholder__item payment-step payment-step--disabled",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:.1*t,ease:"easeOut"},children:[(0,j.jsx)("div",{className:"step-placeholder__icon step-placeholder__shimmer"}),(0,j.jsx)("div",{className:"step-placeholder__content",children:(0,j.jsx)("div",{className:"step-placeholder__text step-placeholder__shimmer"})})]},t)));return(0,j.jsx)(x.__unstableMotion.div,{className:"step-placeholder",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:t})};var te=o(75854);const oe=(0,v.createContext)({isWooPaymentsActive:!1,isWooPaymentsInstalled:!1,wooPaymentsRecentlyActivated:!1,setWooPaymentsRecentlyActivated:()=>{}}),ne=()=>(0,v.useContext)(oe),se=({children:e,closeModal:t})=>{const{wooPaymentsPluginSlug:o,isSlugResolved:n}=(0,r.useSelect)((e=>{const t=e(i.paymentSettingsStore),o=t.isFetching(),n=t.getPaymentProviders(),s=Array.isArray(n)?n.find((e=>(0,K.j4)(e.id))):void 0,a=!o&&Array.isArray(n),r=s?.plugin?.slug;return{wooPaymentsPluginSlug:null!=r?r:$.bw,isSlugResolved:a}}),[]),s=(0,r.useSelect)((e=>{const t=e(i.pluginsStore).getActivePlugins();return!!Array.isArray(t)&&t.includes(o)}),[o]),a=(0,r.useSelect)((e=>{const t=e(i.pluginsStore).getInstalledPlugins();return!!Array.isArray(t)&&t.includes(o)}),[o]),[c,l]=(0,v.useState)(!1),m={buildStepURL:(e,t={})=>(0,h.getNewPath)({path:e,...t},"/launch-your-store"+e,{page:"wc-admin",path:"/launch-your-store/woopayments/onboarding",sidebar:"hub",content:"payments"}),preserveParams:["sidebar","content"]};return n?(0,j.jsxs)(oe.Provider,{value:{isWooPaymentsActive:s,isWooPaymentsInstalled:a,wooPaymentsRecentlyActivated:c,setWooPaymentsRecentlyActivated:l},children:[s&&(0,j.jsx)(J.X,{closeModal:t,onboardingSteps:te.PK,urlStrategy:m,sessionEntryPoint:"lys",onFinish:t,children:e}),!s&&e]}):(0,j.jsx)(oe.Provider,{value:{isWooPaymentsActive:!1,isWooPaymentsInstalled:!1,wooPaymentsRecentlyActivated:!1,setWooPaymentsRecentlyActivated:()=>{}},children:e})};var ae=o(6865);const re=({onToggle:e})=>(0,j.jsx)(x.Button,{className:"mobile-sidebar-toggle",onClick:e,"aria-label":(0,b.__)("Toggle sidebar","woocommerce"),icon:(0,j.jsx)(f.A,{icon:ae.A,size:24})}),ie=e=>(0,j.jsxs)("div",{className:"mobile-header launch-store-hub-mobile-header",children:[(0,j.jsx)(x.Button,{className:"mobile-header__back-button",onClick:()=>{e.sendEventToSidebar({type:"POP_BROWSER_STACK"})},icon:k.A,iconSize:20,"aria-label":(0,b.__)("Go back","woocommerce")}),(0,j.jsx)("h1",{className:"mobile-header__title",children:(0,b.__)("Launch your store","woocommerce")}),e.onToggle&&(0,j.jsx)(re,{onToggle:e.onToggle})]}),ce=(e,t)=>{let o=(0,h.getHistory)().location;const n=(0,h.getHistory)().listen((({action:n,location:s})=>{if("POP"===n){const n=new URLSearchParams(o.search),a=new URLSearchParams(s.search);n.get(e)!==a.get(e)&&(o=s,t({type:"EXTERNAL_URL_UPDATE"}))}o=s}));return()=>{n()}},le=e=>{const t=(0,h.getQuery)(),o=Object.entries(e).reduce(((e,[o,n])=>(t[o]!==n&&(e[o]=n),e)),{});Object.keys(o).length>0&&(0,h.updateQueryString)(o)};let me=null;const de=async()=>{if(null!==me)return me;const e=await w()({path:"/wc-admin/launch-your-store/survey-completed"});return me=e,me},ue=(0,d.Sx)((async()=>{const[e,t,o]=await Promise.all([de(),(0,r.resolveSelect)(i.onboardingStore).getTaskListsByIds(["setup","extended"]),(0,r.resolveSelect)(i.pluginsStore).getActivePlugins()]);return{surveyCompleted:e,tasklists:t,activePlugins:o}})),_e=(0,d.SP)((({sendBack:e})=>ce("sidebar",e))),pe=async({url:e})=>{try{const t=await fetch(e,{method:"GET",credentials:"omit",cache:"no-store"});if(!t.ok)throw new Error(`Failed to fetch ${e}`);const o=await t.text();return!!(new DOMParser).parseFromString(o,"text/html").querySelector('meta[name="woo-coming-soon-page"]')}catch(t){throw new Error(`Error fetching ${e}: ${t}`)}},he=async()=>{const e=await(0,r.resolveSelect)(i.settingsStore).getSettings("wc_admin"),t=[];return e?.shopUrl&&t.push(pe({url:e.shopUrl})),e?.siteUrl&&t.push(pe({url:e.siteUrl})),(await Promise.all(t)).some((e=>e))},ye=(0,u.mj)({types:{},actions:{showLaunchStoreSuccessPage:(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"SHOW_LAUNCH_STORE_SUCCESS"}),showLaunchStorePendingCache:(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"SHOW_LAUNCH_STORE_PENDING_CACHE"}),showLoadingPage:(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"SHOW_LOADING"}),showSitePreview:(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"EXTERNAL_URL_UPDATE"}),updateQueryParams:(e,t)=>{le(t)},taskClicked:({event:e,self:t})=>{if("TASK_CLICKED"===e.type){const o=function(e){var t;const o=null!==(t=Z())&&void 0!==t?t:[];G([...o,e.task.id]),window.sessionStorage.setItem("lysWaiting","yes");const{setWithExpiry:n}=(0,z.accessTaskReferralStorage)({taskId:e.task.id,referralLifetime:86400});if(n({referrer:"launch-your-store",returnUrl:(0,Y.getAdminLink)("admin.php?page=wc-admin&path=/launch-your-store")}),(0,y.recordEvent)("launch_your_store_hub_task_clicked",{task:e.task.id}),"payments"===e.task.id){var s;const{wooPaymentsIsActive:t,wooPaymentsSettingsCountryIsSupported:o,wooPaymentsIsOnboarded:n,wooPaymentsHasTestAccount:a,wooPaymentsHasOtherProvidersEnabled:r,wooPaymentsHasOtherProvidersNeedSetup:i}=null!==(s=e.task?.additionalData)&&void 0!==s?s:{};if(o&&(!t&&!r||t&&!n||t&&a||t&&i))return(0,K.W7)("woopayments_onboarding_modal_opened",{from:"lys_sidebar_task",source:$.K7}),{type:"SHOW_PAYMENTS"}}e.task.actionUrl?(0,h.navigateTo)({url:e.task.actionUrl}):(0,h.navigateTo)({url:(0,h.getNewPath)({task:e.task.id},"/",{})})}(e);o&&"object"==typeof o&&"type"in o&&"SHOW_PAYMENTS"===o.type&&t.send({type:"SHOW_PAYMENTS"})}},openWcAdminUrl:({event:e})=>{"OPEN_WC_ADMIN_URL"===e.type&&(0,h.navigateTo)({url:e.url})},windowHistoryBack:()=>{window.history.back()},recordStoreLaunchAttempt:(0,_.a)({launchStoreAttemptTimestamp:({context:e})=>{const t=e.tasklist?.fullLysTaskList.length||0,o=e.tasklist?.tasks.filter((e=>!e.isComplete)).map((e=>e.id))||[],n=e.tasklist?.fullLysTaskList.filter((e=>e.isComplete)).map((e=>e.id))||[],s=n.filter((t=>e.tasklist?.recentlyActionedTasks.includes(t)));return(0,y.recordEvent)("launch_your_store_hub_store_launch_attempted",{tasks_total_count:t,tasks_completed:n,tasks_completed_count:n.length,tasks_completed_in_lys:s,tasks_completed_in_lys_count:s.length,incomplete_tasks:o,incomplete_tasks_count:o.length,delete_test_orders:e.removeTestOrders||!1}),performance.now()}}),recordStoreLaunchResults:({context:e},{success:t})=>{((e,t)=>{(0,y.recordEvent)("launch_your_store_hub_store_launch_results",{success:t,duration:(0,l.D8)(performance.now()-e)})})(e.launchStoreAttemptTimestamp||0,t)},recordStoreLaunchCachedContentDetected:()=>{(0,y.recordEvent)("launch_your_store_hub_store_launch_cached_content_detected")},showPaymentsContent:(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"SHOW_PAYMENTS"}),triggerTasklistRefresh:({self:e})=>{e.send({type:"REFRESH_TASKLIST"})},navigateToWcAdmin:()=>{window.location.href="/wp-admin/admin.php?page=wc-admin"}},guards:{hasSidebarLocation:(e,{sidebar:t})=>{const{sidebar:o}=(0,h.getQuery)();return!!o&&o===t},hasPaymentsContent:()=>{const{content:e}=(0,h.getQuery)();return"payments"===e},hasWooPaymentsOnboardingPath:()=>{const e=(0,h.getQuery)();return!!e.path&&e.path.includes("/woopayments/onboarding")},hasWooPayments:({context:e})=>!!e.hasWooPayments,siteIsShowingCachedContent:({context:e})=>!!e.siteIsShowingCachedContent},actors:{sidebarQueryParamListener:_e,getTasklist:(0,d.Sx)(Q),getTestOrderCount:(0,d.Sx)((async()=>(await w()({path:"/wc-admin/launch-your-store/woopayments/test-orders/count",method:"GET"})).count)),getSiteCachedStatus:(0,d.Sx)(he),updateLaunchStoreOptions:(0,d.Sx)((async()=>{const e=await(0,r.dispatch)(i.optionsStore).updateOptions({woocommerce_coming_soon:"no"});if(e.success)return e;throw new Error(JSON.stringify(e))})),deleteTestOrders:(0,d.Sx)((async({input:e})=>e.removeTestOrders?await w()({path:"/wc-admin/launch-your-store/woopayments/test-orders",method:"DELETE"}):null)),fetchCongratsData:ue,getWooPaymentsStatus:(0,d.Sx)((async()=>{if(!1===window?.wcSettings?.admin?.plugins?.activePlugins.includes("woocommerce-payments"))return!1;const e=(await(0,r.resolveSelect)(i.paymentGatewaysStore).getPaymentGateways()).filter((e=>e.enabled));return 1===e.length&&(0,K.j4)(e[0].id)}))}}).createMachine({id:"sidebar",initial:"navigate",context:({input:e})=>({externalUrl:null,testOrderCount:0,mainContentMachineRef:e.mainContentMachineRef}),invoke:{id:"sidebarQueryParamListener",src:"sidebarQueryParamListener"},states:{navigate:{always:[{guard:{type:"hasWooPaymentsOnboardingPath"},target:"payments"},{guard:{type:"hasPaymentsContent"},target:"payments"},{guard:{type:"hasSidebarLocation",params:{sidebar:"hub"}},target:"launchYourStoreHub"},{guard:{type:"hasSidebarLocation",params:{sidebar:"launch-success"}},target:"storeLaunchSuccessful"},{target:"launchYourStoreHub"}]},launchYourStoreHub:{initial:"preLaunchYourStoreHub",states:{preLaunchYourStoreHub:{entry:[(0,p.P)("fetchCongratsData",{id:"prefetch-congrats-data "})],invoke:{src:"getTasklist",onDone:{actions:(0,_.a)({tasklist:({event:e})=>e.output}),target:"checkWooPayments"}}},checkWooPayments:{invoke:{src:"getWooPaymentsStatus",onDone:{actions:(0,_.a)({hasWooPayments:({event:e})=>e.output}),target:"maybeCountTestOrders"},onError:{target:"maybeCountTestOrders"}}},maybeCountTestOrders:{always:[{guard:"hasWooPayments",target:"countTestOrders"},{target:"launchYourStoreHub"}]},countTestOrders:{invoke:{src:"getTestOrderCount",onDone:{actions:(0,_.a)({testOrderCount:({event:e})=>e.output}),target:"launchYourStoreHub"},onError:{target:"launchYourStoreHub"}}},launchYourStoreHub:{id:"launchYourStoreHub",tags:"sidebar-visible",meta:{component:q,mobileHeader:ie},on:{LAUNCH_STORE:{target:"#storeLaunching"},POP_BROWSER_STACK:{actions:["navigateToWcAdmin"]},REFRESH_TASKLIST:{target:"backgroundRefresh"}}},backgroundRefresh:{id:"backgroundRefresh",tags:"sidebar-visible",meta:{component:q,mobileHeader:ie},invoke:[{src:"getTasklist",onDone:{actions:(0,_.a)({tasklist:({event:e})=>e.output}),target:"backgroundCheckWooPayments"},onError:{target:"launchYourStoreHub"}}],on:{LAUNCH_STORE:{target:"#storeLaunching"},POP_BROWSER_STACK:{actions:["navigateToWcAdmin"]}}},backgroundCheckWooPayments:{tags:"sidebar-visible",meta:{component:q,mobileHeader:ie},invoke:{src:"getWooPaymentsStatus",onDone:{actions:(0,_.a)({hasWooPayments:({event:e})=>e.output}),target:"backgroundMaybeCountTestOrders"},onError:{target:"backgroundMaybeCountTestOrders"}},on:{LAUNCH_STORE:{target:"#storeLaunching"},POP_BROWSER_STACK:{actions:["navigateToWcAdmin"]}}},backgroundMaybeCountTestOrders:{tags:"sidebar-visible",meta:{component:q,mobileHeader:ie},always:[{guard:"hasWooPayments",target:"backgroundCountTestOrders"},{target:"launchYourStoreHub"}]},backgroundCountTestOrders:{tags:"sidebar-visible",meta:{component:q,mobileHeader:ie},invoke:{src:"getTestOrderCount",onDone:{actions:(0,_.a)({testOrderCount:({event:e})=>e.output}),target:"launchYourStoreHub"},onError:{target:"launchYourStoreHub"}},on:{LAUNCH_STORE:{target:"#storeLaunching"},POP_BROWSER_STACK:{actions:["navigateToWcAdmin"]}}}}},storeLaunching:{id:"storeLaunching",initial:"launching",states:{launching:{entry:[(0,_.a)({launchStoreError:void 0}),"recordStoreLaunchAttempt"],invoke:[{src:"updateLaunchStoreOptions",onDone:{actions:[{type:"recordStoreLaunchResults",params:{success:!0}}],target:"checkingForCachedContent"},onError:{actions:[(0,_.a)({launchStoreError:({event:e})=>({message:JSON.stringify(e.error)})}),{type:"recordStoreLaunchResults",params:{success:!1}}],target:"#launchYourStoreHub"}},{src:"deleteTestOrders",input:({event:e})=>({removeTestOrders:e.removeTestOrders})}]},checkingForCachedContent:{invoke:[{src:"getSiteCachedStatus",onDone:{target:"#storeLaunchSuccessful",actions:(0,_.a)({siteIsShowingCachedContent:({event:e})=>e.output})},onError:{target:"#storeLaunchSuccessful"}}]}}},storeLaunchSuccessful:{id:"storeLaunchSuccessful",tags:"fullscreen",entry:[{type:"updateQueryParams",params:{sidebar:"launch-success",content:"launch-store-success"}},(0,_.b)((({check:e,enqueue:t})=>{if(e("siteIsShowingCachedContent"))return t({type:"showLaunchStorePendingCache"}),void t({type:"recordStoreLaunchCachedContentDetected"});t({type:"showLaunchStoreSuccessPage"})}))]},payments:{id:"payments",meta:{component:e=>{const{wooPaymentsRecentlyActivated:t,isWooPaymentsActive:o}=ne(),{steps:n,currentStep:a,justCompletedStepId:r,isLoading:i}=(0,J.w)(),[l,m]=(0,s.useState)(void 0);(0,s.useEffect)((()=>{let e=!0;return(async()=>{try{const t=await(async()=>{try{const e=await Q();return Array.isArray(e?.fullLysTaskList)?e.fullLysTaskList.find((e=>"payments"===e.id)):void console.error("Invalid tasklist data: fullLysTaskList is not an array")}catch(e){return void console.error("Error fetching payments task:",e)}})();e&&m(t)}catch(e){console.error("PaymentsSidebar: Failed to fetch payments task:",e)}})(),()=>{e=!1}}),[o,t]);const d=n.findIndex((e=>e.id===a?.id)),u=e=>e.id===r||"completed"===e.status||d===n.length,_=n.sort(((e,t)=>{const o=u(e);return o===u(t)?0:o?-1:1})),p=(0,j.jsx)(x.Button,{onClick:()=>{(0,y.recordEvent)("launch_your_store_payments_back_to_hub_click"),(0,K.W7)("woopayments_onboarding_modal_closed",{from:"lys_sidebar_back_to_hub",source:$.K7}),window.sessionStorage.setItem("lysWaiting","no"),e.sendEventToSidebar({type:"RETURN_FROM_PAYMENTS"})},children:(0,b.sprintf)((0,b.__)("Set up %s","woocommerce"),"WooPayments")}),h=({isStepComplete:e})=>(0,j.jsx)(S.A,{className:(0,c.A)("install-woopayments",{active:e,"payment-step":!0,"payment-step--active":e,"payment-step--disabled":e,"is-complete":e}),icon:e?D:B.activePaymentStep,disabled:!0,showChevron:!1,children:l?.additionalData?.wooPaymentsIsInstalled?(0,b.sprintf)((0,b.__)("Enable %s","woocommerce"),"WooPayments"):(0,b.sprintf)((0,b.__)("Install %s","woocommerce"),"WooPayments")},"install-woopayments");return(0,j.jsxs)("div",{className:(0,c.A)("launch-store-sidebar__container",e.className),children:[(0,j.jsx)(x.__unstableMotion.div,{className:"woocommerce-edit-site-layout__header-container",animate:"view",children:(0,j.jsx)(U.b,{variants:{view:{x:0}},isTransparent:!1,className:"woocommerce-edit-site-layout__hub"})}),(0,j.jsx)(A,{title:p,onMobileClose:e.onMobileClose,children:(0,j.jsxs)(x.__experimentalItemGroup,{className:"woocommerce-edit-site-sidebar-navigation-screen-essential-tasks__group",children:[!o&&(0,j.jsx)(x.__unstableMotion.div,{initial:{opacity:0,y:0},animate:{opacity:1,y:0},transition:{duration:.7,delay:.2},children:(0,j.jsx)(h,{isStepComplete:!1})}),o&&i&&(0,j.jsx)(x.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,j.jsx)(ee,{rows:3})}),o&&!i&&(0,j.jsxs)(x.__unstableMotion.div,{initial:{opacity:0,y:0},animate:{opacity:1,y:0},transition:{duration:.7,delay:.2},children:[(0,j.jsx)(h,{isStepComplete:!0}),_.map((e=>(0,j.jsx)(S.A,{className:(0,c.A)(e.id,{active:a?.id===e.id,"payment-step":!0,"payment-step--active":a?.id===e.id,"payment-step--disabled":a?.id!==e.id,"is-complete":u(e)}),icon:u(e)?D:B.activePaymentStep,disabled:!0,showChevron:!1,children:e.label},e.id)))]})]})})]})},mobileHeader:e=>{const{wooPaymentsRecentlyActivated:t}=ne(),{steps:o,currentStep:n}=(0,J.w)();let s=o.findIndex((e=>e.id===n?.id))+1||1,a=o.length||1;return t&&(s++,a++),(0,j.jsxs)("div",{className:"mobile-header payments-mobile-header",children:[(0,j.jsx)(x.Button,{className:"mobile-header__back-button",onClick:()=>{(0,y.recordEvent)("launch_your_store_payments_back_to_hub_click"),(0,K.W7)("woopayments_onboarding_modal_closed",{from:"lys_mobile_header_back_to_hub",source:$.K7}),window.sessionStorage.setItem("lysWaiting","no"),e.sendEventToSidebar({type:"RETURN_FROM_PAYMENTS"})},icon:k.A,iconSize:20,"aria-label":(0,b.__)("Go back","woocommerce")}),(0,j.jsx)("h1",{className:"mobile-header__title",children:(0,b.sprintf)((0,b.__)("Set up %s","woocommerce"),"WooPayments")}),(0,j.jsx)("div",{className:"mobile-header__steps",children:(0,b.sprintf)((0,b.__)("Step %1$s of %2$s","woocommerce"),s,a)})]})}},entry:["showPaymentsContent",{type:"updateQueryParams",params:{sidebar:"hub",content:"payments"}}],on:{POP_BROWSER_STACK:{actions:[{type:"navigateToWcAdmin"}]},RETURN_FROM_PAYMENTS:{target:"#launchYourStoreHub",actions:[{type:"updateQueryParams",params:{sidebar:"hub",content:"site-preview"}},(0,_.c)((({context:e})=>e.mainContentMachineRef),{type:"RETURN_FROM_PAYMENTS"}),"triggerTasklistRefresh"]}}}},on:{EXTERNAL_URL_UPDATE:{target:".navigate"},TASK_CLICKED:{actions:"taskClicked"},OPEN_WC_ADMIN_URL:{actions:"openWcAdminUrl"},OPEN_WC_ADMIN_URL_IN_CONTENT_AREA:{},SHOW_PAYMENTS:{target:".payments"}}}),ge=({children:e,className:t})=>(0,j.jsx)("div",{className:(0,c.A)("launch-your-store-layout__sidebar",t),children:e});var we=o(98846);const ve=()=>(0,j.jsx)("div",{className:"spinner-container",children:(0,j.jsx)(we.Spinner,{})});var be=o(29491),Se=o(56109);const xe={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},Ce=320,ke=9/19.5,fe={width:"100%",height:"100%"};function Pe(e,t){const o=1-Math.max(0,Math.min(1,(e-Ce)/980));var n;return e/((n=t)+(ke-n)*o)}const Ee=(0,v.createContext)(!1),je=function e({isFullWidth:t,isOversized:o,setIsOversized:n,isReady:s,children:a,defaultSize:r,innerContentStyle:i,isHandleVisibleByDefault:l=!1}){const[m,d]=(0,v.useState)(fe),[u,_]=(0,v.useState)(),[p,h]=(0,v.useState)(!1),[y,g]=(0,v.useState)(!1),[w,S]=(0,v.useState)(1),C={type:"tween",duration:p?0:.5},[k,f]=(0,v.useState)(!1),P=(0,v.useRef)(null),E=(0,be.useInstanceId)(e,"woocommerce-edit-site-resizable-frame-handle-help"),A=r.width/r.height,T={default:{flexGrow:0,height:m.height},fullWidth:{flexGrow:1,height:m.height}},N=p||l?"active":y?"visible":"hidden",L=(0,j.jsx)(x.__unstableMotion.button,{role:"separator","aria-orientation":"vertical",className:(0,c.A)("woocommerce-edit-site-resizable-frame__handle",{"is-resizing":p}),variants:{hidden:{opacity:0,left:0},visible:{opacity:.6,left:-10},active:{opacity:1,left:-10}},animate:N,"aria-label":(0,b.__)("Drag to resize","woocommerce"),"aria-describedby":E,"aria-valuenow":P.current?.resizable?.offsetWidth||void 0,"aria-valuemin":Ce,"aria-valuemax":r.width,onKeyDown:e=>{if(!["ArrowLeft","ArrowRight"].includes(e.key))return;e.preventDefault();const t=20*(e.shiftKey?5:1)*("ArrowLeft"===e.key?1:-1),o=Math.min(Math.max(Ce,P.current.resizable.offsetWidth+t),r.width);d({width:o,height:Pe(o,A)})},initial:"hidden",exit:"hidden",whileFocus:"active",whileHover:"active",children:l&&!k&&(0,j.jsx)(x.Popover,{className:"woocommerce-assembler-hub__resizable-frame__drag-handler",position:"middle right",children:(0,b.__)("Drag to resize","woocommerce")})},"handle");return(0,j.jsx)(x.ResizableBox,{as:x.__unstableMotion.div,ref:P,initial:!1,variants:T,animate:t?"fullWidth":"default",onAnimationComplete:e=>{"fullWidth"===e&&d({width:"100%",height:"100%"})},transition:C,size:m,enable:{top:!1,right:!1,bottom:!1,left:s,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},resizeRatio:w,handleClasses:void 0,handleStyles:{left:xe,right:xe},minWidth:Ce,maxWidth:"100%",maxHeight:"100%",onFocus:()=>g(!0),onBlur:()=>g(!1),onMouseOver:()=>g(!0),onMouseOut:()=>g(!1),handleComponent:{left:(0,j.jsxs)(j.Fragment,{children:[l?(0,j.jsx)("div",{children:L}):(0,j.jsx)(x.Tooltip,{position:"middle right",text:(0,b.__)("Drag to resize","woocommerce"),children:L}),(0,j.jsx)("div",{hidden:!0,id:E,children:(0,b.__)("Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.","woocommerce")})]})},onResizeStart:(e,t,o)=>{_(o.offsetWidth),h(!0)},onResize:(e,t,s,a)=>{const i=a.width/w,c=Math.abs(i),l=a.width<0?c:(r.width-u)/2,m=Math.min(c,l),_=0===c?0:m/c;S(1-_+2*_);const p=u+a.width;n(p>r.width),d({height:o?"100%":Pe(p,A)})},onResizeStop:(e,t,s)=>{h(!1),k||f(!0),o&&(n(!1),d(fe))},className:(0,c.A)("woocommerce-edit-site-resizable-frame__inner",{"is-resizing":p}),children:(0,j.jsx)(x.__unstableMotion.div,{className:"customize-your-store-edit-site-resizable-frame__inner-content",animate:{borderRadius:t?0:8},transition:C,style:i,children:(0,j.jsx)(Ee.Provider,{value:p,children:a})})})};var Ae=o(58016),Te=o(46772);const Ne=({installWooPayments:e,isPluginInstalling:t,isPluginInstalled:o})=>{(0,v.useEffect)((()=>{(0,K.W7)("woopayments_onboarding_modal_step_view",{step:"install_woopayments",from:"lys",source:$.K7})}),[]);const n=(0,r.useSelect)((e=>e(i.paymentSettingsStore).getIsWooPayEligible()),[]),s=(0,r.useSelect)((e=>e(i.paymentSettingsStore).getPaymentProviders().find((e=>(0,K.j4)(e.id)))),[]),a=window.wcSettings?.admin?.woocommerce_payments_nox_profile?.business_country_code||null;let c=(0,b.__)("Install","woocommerce");return o&&!t&&(c=(0,b.__)("Enable","woocommerce")),o&&t&&(c=(0,b.__)("Enabling","woocommerce")),!o&&t&&(c=(0,b.__)("Installing","woocommerce")),(0,j.jsxs)("div",{className:"launch-your-store-payments-content__step--install-woopayments",children:[(0,j.jsx)("div",{className:"launch-your-store-payments-content__step--install-woopayments-logo",children:(0,j.jsx)("img",{src:`${Se.GZ}images/woo-logo.svg`,alt:"",role:"presentation"})}),(0,j.jsx)("h1",{className:"launch-your-store-payments-content__step--install-woopayments-title",children:(0,b.__)("Accept payments with Woo","woocommerce")}),(0,j.jsx)("p",{className:"launch-your-store-payments-content__step--install-woopayments-description",children:(0,b.__)("Set up payments for your store in just a few steps. With WooPayments, you can accept online and in-person payments, track revenue, and handle all payment activity from one place.","woocommerce")}),(0,j.jsx)("div",{className:"launch-your-store-payments-content__step--install-woopayments-logos",children:(0,j.jsx)(z.WooPaymentsMethodsLogos,{maxElements:10,isWooPayEligible:n})}),(0,j.jsx)(x.Button,{className:"launch-your-store-payments-content__step--install-woopayments-button",onClick:()=>{s?.onboarding?._links?.preload?.href&&w()({url:s?.onboarding?._links?.preload?.href,method:"POST",data:{location:a}});const t=(e=>{if("string"!=typeof e)return;const t=e.trim();return 0!==t.length?/^[a-z0-9_-]+$/.test(t)?t:void console.warn(`[WooCommerce Payments] Invalid plugin slug format: "${t}". Using default slug.`):void 0})(s?.plugin?.slug);e(t)},isBusy:t,disabled:t,variant:"primary",children:c})]})};var Le=o(5751);const Re={congratsScreen:({context:e})=>(w()({path:"/wc-admin/launch-your-store/update-survey-status",data:{status:"yes"},method:"POST"}).catch((()=>{})),{...e.congratsScreen,hasCompleteSurvey:!0})},We=({activePlugins:e,allTasklists:t})=>{const o=(0,v.useMemo)((()=>(({activePlugins:e,allTasklists:t})=>{const o=[],n=(e,t)=>{o.length<3&&t&&o.push(e)},s=t.find((({id:e})=>"setup"===e))?.tasks?.reduce(((e,{id:t,isComplete:o})=>(e[t]=o||!1,e)),{}),a=t.find((({id:e})=>"extended"===e))?.tasks?.reduce(((e,{id:t,isComplete:o})=>(e[t]=o||!1,e)),{}),r=a?.marketing||!1,i=s?.payments||!1,c=a?.["get-mobile-app"]||!1,l=e.includes("mailchimp-for-woocommerce"),m={title:(0,b.__)("Promote your products","woocommerce"),description:(0,b.__)("Grow your customer base by promoting your products to millions of engaged shoppers.","woocommerce"),link:`${Se.kY}admin.php?page=wc-admin&task=marketing`,linkText:(0,b.__)("Promote products","woocommerce"),trackEvent:"launch_you_store_congrats_marketing_click"},d={title:(0,b.__)("Provide more ways to pay","woocommerce"),description:(0,b.__)("Give your shoppers more ways to pay by adding additional payment methods to your store.","woocommerce"),link:`${Se.kY}admin.php?page=wc-settings&tab=checkout`,linkText:(0,b.__)("Add payment methods","woocommerce"),trackEvent:"launch_you_store_congrats_payments_click"},u={title:(0,b.__)("Build customer relationships","woocommerce"),description:(0,b.__)("Keep your shoppers up to date with what’s new in your store and set up clever post-purchase automations.","woocommerce"),link:l?`${Se.kY}admin.php?page=mailchimp-woocommerce`:"https://woo.com/products/mailchimp-for-woocommerce/?utm_source=launch_your_store&utm_medium=product",linkText:l?(0,b.__)("Manage Mailchimp","woocommerce"):(0,b.__)("Install Mailchimp","woocommerce"),trackEvent:"launch_you_store_congrats_mailchimp_click"},_={title:(0,b.__)("Power up your store","woocommerce"),description:(0,b.__)("Add extra features and functionality to your store with Woo extensions.","woocommerce"),link:`${Se.kY}admin.php?page=wc-admin&path=%2Fextensions`,linkText:(0,b.__)("Add extensions","woocommerce"),trackEvent:"launch_you_store_congrats_extensions_click"},p={title:(0,b.__)("Manage your store on the go","woocommerce"),description:(0,b.__)("Manage your store anywhere with the free WooCommerce Mobile App.","woocommerce"),link:`${Se.kY}admin.php?page=wc-admin&mobileAppModal=true`,linkText:(0,b.__)("Get the app","woocommerce"),trackEvent:"launch_you_store_congrats_mobile_app_click"},h={title:(0,b.__)("Help is on hand","woocommerce"),description:(0,b.__)("Detailed guides and our support team are always available if you’re feeling stuck or need some guidance.","woocommerce"),link:"https://woo.com/documentation/woocommerce/?utm_source=launch_your_store&utm_medium=product",linkText:(0,b.__)("Explore support resources","woocommerce"),trackEvent:"launch_you_store_congrats_external_documentation_click"};return n(m,!r),n(d,!i),n(_,!0),n(p,!c),n(u,!l),n(h,!0),n(d,!0),n(_,!0),n(h,!0),o})({activePlugins:e,allTasklists:t})),[e,t]);return(0,j.jsx)("div",{className:"woocommerce-launch-store__congrats-main-actions",children:o.map(((e,t)=>(0,j.jsx)("div",{className:"woocommerce-launch-store__congrats-action",children:(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-action__content",children:[(0,j.jsx)("h3",{children:e.title}),(0,j.jsx)("p",{children:e.description}),(0,j.jsx)(x.Button,{variant:"link",href:e.link,target:-1===e.link.indexOf(Se.kY)?"_blank":"_self",onClick:()=>{(0,y.recordEvent)(e.trackEvent)},children:e.linkText})]})},t)))})};var Me=o(66087),Oe=o(48214),He=o(27752),Ie=o(97687);const De=({hasCompleteSurvey:e,onSubmit:t})=>{const[o,n]=(0,v.useState)(null),[s,a]=(0,v.useState)(""),[r,i]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!e),m=(0,Me.isInteger)(o);return(0,j.jsxs)(j.Fragment,{children:[c&&(0,j.jsx)("hr",{className:"separator"}),c&&(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-survey",children:[r?(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-thanks",children:[(0,j.jsxs)("p",{className:"thanks-copy",children:["🙌"," ",(0,b.__)("We appreciate your feedback!","woocommerce")]}),(0,j.jsx)(x.Button,{className:"close-button",label:(0,b.__)("Close","woocommerce"),icon:(0,j.jsx)(x.Icon,{icon:Oe.A,viewBox:"6 4 12 14"}),iconSize:14,onClick:()=>{i(!1),l(!1)}})]}):(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-section_1",children:[(0,j.jsx)("div",{className:"woocommerce-launch-store__congrats-survey__selection",children:(0,j.jsx)(He.CustomerFeedbackSimple,{label:(0,b.__)("How was the experience of launching your store?","woocommerce"),onSelect:n,selectedValue:o})}),m&&(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-survey__comment",children:[(0,j.jsx)("label",{className:"comment-label",htmlFor:"launch-your-store-comment",children:(0,v.createInterpolateElement)((0,b.__)("Why do you feel that way? <smallText>(optional)</smallText>","woocommerce"),{smallText:(0,j.jsx)("span",{className:"small-text"})})}),(0,j.jsx)(x.TextareaControl,{__nextHasNoMarginBottom:!0,id:"launch-your-store-comment","data-testid":"launch-your-store-comment",value:s,onChange:e=>{a(e)}}),(0,j.jsx)("span",{className:"privacy-text",children:(0,v.createInterpolateElement)((0,b.__)("Your feedback will be only be shared with WooCommerce and treated in accordance with our <privacyLink>privacy policy</privacyLink>.","woocommerce"),{privacyLink:(0,j.jsx)(we.Link,{href:"https://automattic.com/privacy/",type:"external",target:"_blank",children:(0,j.jsx)(j.Fragment,{})})})})]})]}),m&&!r&&(0,j.jsx)("div",{className:"woocommerce-launch-store__congrats-section_2",children:(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-buttons",children:[(0,j.jsx)(x.Button,{className:"",variant:"tertiary",onClick:()=>{n(null)},children:(0,b.__)("Cancel","woocommerce")}),(0,j.jsx)(x.Button,{className:"",variant:"primary",onClick:()=>{(0,y.recordEvent)((0,Ie.E)()?"launch_your_store_congrats_survey_click":"launch_your_store_on_core_congrats_survey_click"),t({action:"lys_experience",score:o,comments:s}),i(!0)},children:(0,b.__)("Send","woocommerce")})]})})]})]})},Be=(0,d.SP)((({sendBack:e})=>ce("content",e))),Ue=(0,u.mj)({types:{},actions:{updateQueryParams:(e,t)=>{le(t)},cleanupPaymentsUrl:()=>{const e=new URL(window.location.href);e.searchParams.delete("content"),e.searchParams.get("path")?.includes("woopayments")&&e.searchParams.set("path","/launch-your-store"),window.history.replaceState(null,"",e.toString())},assignSiteCachedStatus:(0,_.a)({siteIsShowingCachedContent:!0}),recordSurveyResults:({event:e})=>{(0,u.DT)(e,"COMPLETE_SURVEY"),(0,y.recordEvent)("launch_your_store_congrats_survey_complete",{action:e.payload.action,score:e.payload.score,comments:e.payload.comments})},recordBackToHomeClick:()=>{(0,y.recordEvent)("launch_your_store_congrats_back_to_home_click")},recordPreviewStoreClick:()=>{(0,y.recordEvent)("launch_your_store_congrats_preview_store_click")},navigateToPreview:()=>{const e=(0,Y.getSetting)("homeUrl","");window.open(e,"_blank")},navigateToHome:()=>{const{invalidateResolutionForStoreSelector:e}=(0,r.dispatch)(i.onboardingStore);e("getTaskLists"),(0,h.navigateTo)({url:"/"})}},guards:{hasContentLocation:(e,{content:t})=>{const{content:o}=(0,h.getQuery)();return!!o&&o===t},hasWooPaymentsOnboardingPath:()=>{const e=(0,h.getQuery)();return!!e.path&&e.path.includes("/woopayments/onboarding")}},actors:{contentQueryParamListener:Be,fetchCongratsData:ue,getSiteCachedStatus:(0,d.Sx)(he)}}).createMachine({id:"mainContent",initial:"navigate",context:{congratsScreen:{hasLoadedCongratsData:!1,hasCompleteSurvey:!1,allTasklists:[],activePlugins:[]},siteIsShowingCachedContent:void 0},invoke:{id:"contentQueryParamListener",src:"contentQueryParamListener"},states:{navigate:{always:[{guard:{type:"hasWooPaymentsOnboardingPath"},target:"payments"},{guard:{type:"hasContentLocation",params:{content:"site-preview"}}},{guard:{type:"hasContentLocation",params:{content:"launch-store-success"}},target:"launchStoreSuccess"},{guard:{type:"hasContentLocation",params:{content:"payments"}},target:"payments"},{target:"#sitePreview"}]},sitePreview:{id:"sitePreview",meta:{component:e=>{const t=(0,Se.Qk)("siteUrl")+"?site-preview=1",[o,n]=(0,v.useState)(!0),s=(0,v.useRef)(null),[a,r]=(0,be.useResizeObserver)(),[i,l]=(0,v.useState)(!1);return(0,v.useEffect)((()=>{const e=s.current?.contentWindow,t=()=>{n(!0)};return e&&e.addEventListener("beforeunload",t),()=>{e&&e.removeEventListener("beforeunload",t)}}),[s,n,o]),(0,j.jsxs)("div",{className:(0,c.A)("launch-store-site-preview-page__container",{"is-loading":o},e.className),children:[a,!!r.width&&(0,j.jsx)(x.__unstableMotion.div,{initial:!1,layout:"position",className:"launch-store-preview-layout__canvas",children:(0,j.jsxs)(je,{isReady:!o,isHandleVisibleByDefault:!1,isFullWidth:!1,defaultSize:{width:r.width-24,height:r.height},isOversized:i,setIsOversized:l,innerContentStyle:{},children:[o&&(0,j.jsx)("div",{className:"launch-store-site-preview-site__loading-overlay",children:(0,j.jsx)(we.Spinner,{})}),(0,j.jsx)("iframe",{ref:s,className:"launch-store-site__preview-site-iframe",src:t,title:(0,b.__)("Preview","woocommerce"),onLoad:()=>n(!1)})]})})]})}}},payments:{id:"payments",meta:{component:({})=>{const{isWooPaymentsActive:e,isWooPaymentsInstalled:t,setWooPaymentsRecentlyActivated:o}=ne(),{refreshStoreData:n}=(0,J.w)(),[a,c]=(0,v.useState)(!1),{installAndActivatePlugins:l}=(0,r.useDispatch)(i.pluginsStore),m=(0,v.useRef)(!0);(0,v.useEffect)((()=>()=>{m.current=!1}),[]);const d=(0,s.useCallback)((e=>{c(!0),(0,K.TH)("recommendations_setup",{extension_selected:$.bw,extension_action:t?"activate":"install",provider_id:$.$8,suggestion_id:$.eD,provider_extension_slug:$.bw,from:"lys",source:$.K7}),l([null!=e?e:$.bw]).then((async e=>{m.current&&((0,Te.R)(e),o(!0),n(),t||(0,K.TH)("provider_installed",{provider_id:$.$8,suggestion_id:$.eD,provider_extension_slug:$.bw,from:"lys",source:$.K7}),c(!1))})).catch((e=>{if(!m.current)return;let o="provider_extension_installation_failed";t&&(o="provider_extension_activation_failed"),(0,K.TH)(o,{provider_id:$.$8,suggestion_id:$.eD,provider_extension_slug:$.bw,from:"lys",source:$.K7,reason:"error"}),(0,Te.R)(e),c(!1)}))}),[t,l,o,n]);return(0,j.jsx)("div",{className:"launch-your-store-payments-content",children:(0,j.jsx)("div",{className:"launch-your-store-payments-content__canvas",children:e?(0,j.jsx)(Ae.A,{includeSidebar:!1}):(0,j.jsx)(Ne,{installWooPayments:d,isPluginInstalled:t,isPluginInstalling:a})})})}},entry:[{type:"updateQueryParams",params:{content:"payments"}}],on:{EXTERNAL_URL_UPDATE:{target:"navigate"}}},launchStoreSuccess:{id:"launchStoreSuccess",initial:"loading",states:{loading:{invoke:[{src:"fetchCongratsData",onDone:{actions:(0,_.a)({congratsScreen:({context:e,event:t})=>({...e.congratsScreen,hasLoadedCongratsData:!0,hasCompleteSurvey:"yes"===t.output.surveyCompleted,allTasklists:t.output.tasklists,activePlugins:t.output.activePlugins})})}},{src:"getSiteCachedStatus",onDone:{actions:(0,_.a)({siteIsShowingCachedContent:({event:e})=>e.output})},onError:{actions:(0,_.a)({siteIsShowingCachedContent:!1})}}],always:{guard:({context:e})=>e.congratsScreen.hasLoadedCongratsData&&void 0!==e.siteIsShowingCachedContent,target:"congrats"},meta:{component:ve}},congrats:{entry:[{type:"updateQueryParams",params:{content:"launch-store-success"}}],meta:{component:({context:{congratsScreen:{activePlugins:e,allTasklists:t,hasCompleteSurvey:o},siteIsShowingCachedContent:n},sendEventToMainContent:s,className:a})=>{const r=(0,b.__)("Copy link","woocommerce"),i=(0,b.__)("Copied!","woocommerce"),m=(0,Y.getSetting)("homeUrl",""),d=new URL(m);let u=d?.hostname;d?.port&&(u+=":"+d.port);const[_,p]=(0,v.useState)(r),h=(0,be.useCopyToClipboard)(m,(()=>{p(i),setTimeout((()=>{p(r)}),2e3)}));return(0,l.xG)(["woocommerce-launch-your-store-success"]),(0,j.jsx)("div",{className:(0,c.A)("launch-store-success-page__container",a),children:(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats",children:[(0,j.jsx)(we.ConfettiAnimation,{delay:1e3,colors:["#DFD1FB","#FB79D9","#FFA60E","#03D479","#AD86E9","#7F54B3","#3C2861"]}),(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-header-container",children:[(0,j.jsx)("span",{className:"woologo",children:(0,j.jsx)(Le.A,{})}),(0,j.jsxs)(x.Button,{onClick:()=>{s({type:"BACK_TO_HOME"})},className:"back-to-home-button",variant:"link",children:[(0,j.jsx)(x.Dashicon,{icon:"arrow-left-alt2"}),(0,j.jsx)("span",{children:(0,b.__)("Back to Home","woocommerce")})]})]}),(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-content",children:[(0,j.jsx)("h1",{className:"woocommerce-launch-store__congrats-heading",children:n?(0,b.__)("Congratulations! Your store will launch soon","woocommerce"):(0,b.__)("Congratulations! Your store is now live","woocommerce")}),(0,j.jsx)("h2",{className:"woocommerce-launch-store__congrats-subheading",children:n?(0,v.createInterpolateElement)((0,b.__)("It’ll be ready to view as soon as your <link></link> have updated. Please wait, or contact your web host to find out how to do this manually.","woocommerce"),{link:(0,j.jsx)("a",{href:"https://woocommerce.com/document/configuring-woocommerce-settings/coming-soon-mode/#server-caches",target:"_blank",rel:"noreferrer",children:(0,b.__)("server caches","woocommerce")})}):(0,b.__)("You’ve successfully launched your store and are ready to start selling! We can’t wait to see your business grow.","woocommerce")}),(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-midsection-container",children:[(0,j.jsxs)("div",{className:"woocommerce-launch-store__congrats-visit-store",children:[(0,j.jsx)("p",{className:"store-name",children:u}),(0,j.jsxs)("div",{className:"buttons-container",children:[(0,j.jsx)(x.Button,{className:"",variant:"secondary",ref:h,onClick:()=>{(0,y.recordEvent)("launch_your_store_congrats_copy_store_link_click")},children:_}),(0,j.jsx)(x.Button,{className:"",variant:"primary",onClick:()=>{s({type:"PREVIEW_STORE"})},children:(0,b.__)("Visit your store","woocommerce")})]})]}),(0,j.jsx)(De,{hasCompleteSurvey:o,onSubmit:e=>{s({type:"COMPLETE_SURVEY",payload:e})}})]}),(0,j.jsx)("h2",{className:"woocommerce-launch-store__congrats-main-actions-title",children:(0,b.__)("What’s next?","woocommerce")}),(0,j.jsx)(We,{activePlugins:e,allTasklists:t})]})]})})}}}},on:{COMPLETE_SURVEY:{actions:[(0,_.a)(Re),"recordSurveyResults"]},PREVIEW_STORE:{actions:["recordPreviewStoreClick","navigateToPreview"]},BACK_TO_HOME:{actions:["recordBackToHomeClick","navigateToHome"]}}},loading:{id:"loading",meta:{component:ve}}},on:{EXTERNAL_URL_UPDATE:{target:".navigate"},SHOW_LAUNCH_STORE_SUCCESS:{target:"#launchStoreSuccess"},SHOW_LAUNCH_STORE_PENDING_CACHE:{actions:["assignSiteCachedStatus"],target:"#launchStoreSuccess"},SHOW_LOADING:{target:"#loading"},SHOW_PAYMENTS:{target:"#payments"},POP_BROWSER_STACK:{actions:(0,_.a)({siteIsShowingCachedContent:void 0}),target:"#sitePreview"},RETURN_FROM_PAYMENTS:{actions:[(0,_.a)({siteIsShowingCachedContent:void 0}),"cleanupPaymentsUrl"],target:"#sitePreview"}}}),Fe=({children:e})=>(0,j.jsx)("div",{className:"launch-your-store-layout__content",children:e});var ze=o(89677);const Ye=()=>{(0,l.xG)(["woocommerce-launch-your-store"]),(0,s.useEffect)((()=>{window.sessionStorage.setItem("lysWaiting","no")}),[]);const{xstateV5Inspector:e}=(0,ze.D)("V5"),{invalidateResolutionForStoreSelector:t}=(0,r.useDispatch)(i.onboardingStore),[o,a]=(0,s.useState)(!1),[d,u,_]=(0,n.zl)(Ue,{inspect:e}),[p,h,y]=(0,n.zl)(ye,{inspect:e,input:{mainContentMachineRef:_}}),g=!p.hasTag("fullscreen");(0,s.useEffect)((()=>{a(!1)}),[p.value]);const[w]=(0,m.$)(y),[v]=function(e){const t=(0,n.d4)(e,(e=>{var t;const o=e.getMeta(),n=Object.values(o).find((e=>e?.mobileHeader));return null!==(t=n?.mobileHeader)&&void 0!==t?t:null})),[o,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{a(t?()=>t:null)}),[t]),[o||null]}(y),[b]=(0,m.$)(_),S=()=>{a(!1)};return(0,j.jsx)("div",{className:"launch-your-store-layout__container",children:(0,j.jsxs)(se,{closeModal:()=>{(0,K.W7)("woopayments_onboarding_modal_closed",{from:"lys_modal_close_button",source:$.K7}),window.sessionStorage.setItem("lysWaiting","no"),t("getTaskLists"),t("getTaskListsByIds"),h({type:"RETURN_FROM_PAYMENTS"})},children:[(0,j.jsx)(ge,{className:(0,c.A)({"is-sidebar-hidden":!g,"is-mobile-open":o}),children:w&&(0,j.jsx)(w,{sendEventToSidebar:h,sendEventToMainContent:u,context:p.context,onMobileClose:S})}),(0,j.jsxs)(Fe,{children:[v&&(0,j.jsx)(v,{sendEventToSidebar:h,sendEventToMainContent:u,context:p.context,onMobileClose:S,onToggle:()=>{a(!o)},isMobileSidebarOpen:o}),b&&(0,j.jsx)(b,{sendEventToSidebar:h,sendEventToMainContent:u,context:d.context},d.value.toString())]})]})})}},28239:(e,t,o)=>{o.d(t,{Mk:()=>_});var n=o(27723),s=o(56427),a=o(86087),r=o(47143),i=o(40314),c=o(1455),l=o.n(c),m=o(1069),d=o(22861),u=o(39793);const _=({isOpen:e,onClose:t,hasAccount:o,isTestMode:c,isEmbeddedResetFlow:_=!1,resetUrl:p})=>{const[h,y]=(0,a.useState)(!1),{invalidateResolutionForStoreSelector:g}=(0,r.useDispatch)(i.paymentSettingsStore),{invalidateResolutionForStoreSelector:w}=(0,r.useDispatch)(i.woopaymentsOnboardingStore),{createNotice:v}=(0,r.useDispatch)("core/notices");let b,S,x;return o?(b=c?(0,n.__)("Reset your test account","woocommerce"):(0,n.__)("Reset your account","woocommerce"),S=c?(0,n.sprintf)((0,n.__)("When you reset your test account, all payment data — including your %s account details, test transactions, and payouts history — will be lost. Your order history will remain. This action cannot be undone, but you can create a new test account at any time.","woocommerce"),"WooPayments"):(0,n.sprintf)((0,n.__)("When you reset your account, all payment data — including your %s account details, test transactions, and payouts history — will be lost. Your order history will remain. This action cannot be undone, but you can create a new test account at any time.","woocommerce"),"WooPayments"),_&&(S=(0,n.sprintf)((0,n.__)("You need to reset your test account to continue onboarding with %1$s. This will create a new test account and reset any existing %2$s account details and test transactions.","woocommerce"),"WooPayments","WooPayments")),x=c?(0,n.__)("Yes, reset test account","woocommerce"):(0,n.__)("Yes, reset account","woocommerce")):(b=(0,n.__)("Reset onboarding","woocommerce"),S=(0,n.sprintf)((0,n.__)("When you reset the %s onboarding your progress and the provided data will be lost. This action cannot be undone, but you can restart the onboarding any time.","woocommerce"),"WooPayments"),x=(0,n.__)("Yes, reset onboarding","woocommerce")),(0,u.jsx)(u.Fragment,{children:e&&(0,u.jsxs)(s.Modal,{title:b,className:"woocommerce-woopayments-modal",isDismissible:!0,onRequestClose:t,children:[(0,u.jsxs)("div",{className:"woocommerce-woopayments-modal__content",children:[(0,u.jsx)("div",{className:"woocommerce-woopayments-modal__content__item",children:(0,u.jsx)("div",{children:(0,u.jsx)("span",{children:S})})}),(0,u.jsx)("div",{className:"woocommerce-woopayments-modal__content__item",children:(0,u.jsx)("h3",{children:(0,n.__)("Are you sure you'd like to continue?","woocommerce")})})]}),(0,u.jsx)("div",{className:"woocommerce-woopayments-modal__actions",children:(0,u.jsx)(s.Button,{className:_?"":"danger",variant:_?"primary":"secondary",isBusy:h,disabled:h,onClick:()=>{(0,m.TH)("provider_reset_onboarding_confirmation_click",{provider_id:d.$8,suggestion_id:d.eD,provider_extension_slug:d.bw}),(()=>{if(y(!0),!p)return(0,m.TH)("provider_reset_onboarding_failed",{provider_id:d.$8,suggestion_id:d.eD,provider_extension_slug:d.bw,reason:"missing_reset_url"}),v("error",(0,n.__)("Failed to reset: missing reset URL. Please refresh and try again.","woocommerce"),{isDismissible:!0}),void y(!1);l()({url:p,method:"POST"}).then((()=>{(0,m.TH)("provider_reset_onboarding_success",{provider_id:d.$8,suggestion_id:d.eD,provider_extension_slug:d.bw}),g("getPaymentProviders"),w("getOnboardingData")})).catch((()=>{(0,m.TH)("provider_reset_onboarding_failed",{provider_id:d.$8,suggestion_id:d.eD,provider_extension_slug:d.bw,reason:"error"}),v("error",o?(0,n.sprintf)((0,n.__)("Failed to reset your %s account.","woocommerce"),"WooPayments"):(0,n.sprintf)((0,n.__)("Failed to reset your %s onboarding.","woocommerce"),"WooPayments"),{isDismissible:!0})})).finally((()=>{y(!1),t()}))})()},children:x})})]})})};o(98846),o(15703),o(56109)},22861:(e,t,o)=>{o.d(t,{$8:()=>s,Fx:()=>i,K7:()=>c,Lw:()=>r,bw:()=>n,eD:()=>a});const n="woocommerce-payments",s="woocommerce_payments",a="woopayments",r="_wc_pes_woopayments",i="settings_payments",c="lys"},75854:(e,t,o)=>{o.d(t,{CX:()=>d,PK:()=>_,kE:()=>u}),o(51609);var n=o(27723),s=o(10432),a=o(98404),r=o(3511),i=o(33623),c=o(59530),l=o(8148),m=o(39793);const d="test_account",u="business_verification",_=((0,n.__)("Choose your payment methods","woocommerce"),r.A,(0,n.sprintf)((0,n.__)("Connect with %s","woocommerce"),"WordPress.com"),s.A,(0,n.__)("Activate payments","woocommerce"),(0,n.__)("Test or live account","woocommerce"),c.A,(0,n.__)("Ready to test payments","woocommerce"),i.A,(0,n.__)("Activate payments","woocommerce"),a.A,(0,n.__)("Submit for verification","woocommerce"),l.A,[{id:"payment_methods",order:1,type:"backend",label:(0,n.__)("Choose your payment methods","woocommerce"),content:(0,m.jsx)(r.A,{})},{id:"wpcom_connection",order:2,type:"backend",label:(0,n.sprintf)((0,n.__)("Connect with %s","woocommerce"),"WordPress.com"),content:(0,m.jsx)(s.A,{}),dependencies:["payment_methods"]},{id:u,order:3,type:"backend",label:(0,n.__)("Activate payments","woocommerce"),dependencies:["wpcom_connection"],content:(0,m.jsx)(a.A,{})}])},1069:(e,t,o)=>{o.d(t,{LI:()=>c,TH:()=>m,TO:()=>l,W7:()=>d,j4:()=>a,js:()=>i}),o(15703);var n=o(83306),s=(o(96476),o(56109),o(22861));const a=e=>[s.Lw,s.$8,s.eD].includes(e),r=e=>t=>t.find((t=>t.id===e))||null,i=e=>{const t=r("apple_pay")(e),o=r("google_pay")(e);return t&&o?e.map((e=>"apple_pay"===e.id?{...e,id:"apple_google",extraTitle:o.title,extraDescription:o.description,extraIcon:o.icon}:"google_pay"===e.id?null:e)).filter((e=>null!==e)):e},c=e=>Object.keys(e).reduce(((t,o)=>("apple_pay"===o||"google_pay"===o?t.apple_google=e[o]:t[o]=e[o],t)),{}),l=(e,t)=>"primary"===e.category||!!e.enabled||null!=t&&t,m=(e,t={})=>{var o;e.startsWith("settings_payments_")||(e=`settings_payments_${e}`),t.business_country||(t.business_country=null!==(o=window.wcSettings?.admin?.woocommerce_payments_nox_profile?.business_country_code)&&void 0!==o?o:"unknown"),(0,n.recordEvent)(e,t)},d=(e,t={})=>{var o;e.startsWith("settings_payments_")||(e=`settings_payments_${e}`),t.business_country||(t.business_country=null!==(o=window.wcSettings?.admin?.woocommerce_payments_nox_profile?.business_country_code)&&void 0!==o?o:"unknown");const s=new URLSearchParams(window.location.search);t.source||(t.source=s.get("source")?.replace(/[^\w-]+/g,"")||"unknown"),(0,n.recordEvent)(e,t)}},97687:(e,t,o)=>{o.d(t,{E:()=>n});const n=()=>void 0!==window.wcCalypsoBridge&&window.wcCalypsoBridge.isWooExpress},42843:(e,t,o)=>{function n(e,t=new Set){if(!t.has(e)){t.add(e);for(const o in e)if(e.hasOwnProperty(o)){if("component"===o)return e;if("object"==typeof e[o]&&null!==e[o]){const s=n(e[o],t);if(void 0!==s)return s}}}}o.d(t,{Q:()=>n})},51513:(e,t,o)=>{o.d(t,{$:()=>r});var n=o(84437),s=o(51609),a=o(42843);function r(e){const t=(0,n.d4)(e,(e=>{var t;return(0,a.Q)(null!==(t=e.getMeta())&&void 0!==t?t:void 0)})),[o,r]=(0,s.useState)(null);return(0,s.useEffect)((()=>{t?.component&&r((()=>t.component))}),[t?.component]),[o||null]}}}]);