/*! For license information please see subscription-product-onboarding-modal.js.LICENSE.txt */
(()=>{var e={1020(e,t,o){"use strict";var r=o(1609),s=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,o){var r,a={},p=null,d=null;for(r in void 0!==o&&(p=""+o),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,r)&&!i.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:s,type:e,key:p,ref:d,props:a,_owner:c.current}}t.jsx=a,t.jsxs=a},4848(e,t,o){"use strict";e.exports=o(1020)},1609(e){"use strict";e.exports=window.React}},t={};function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),o.p=window.wcpayAssets.url,(()=>{"use strict";o(1609);const e=window.wp.components,t=window.wp.element,r=window.wp.plugins,s=window.wp.url,n=window.wp.i18n,c=window.wp.domReady;var i=o.n(c);const a=(e,t={})=>{if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:wcpaySettings.trackingInfo?.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}i()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})};var p=o(4848);const{connectUrl:d,pluginScope:l}=window.wcpaySubscriptionProductOnboardingModal,u=()=>{const[o,r]=(0,t.useState)(!1);return(0,p.jsx)(e.Button,{disabled:o,href:d,isBusy:o,variant:"primary",onClick:()=>{a("wcpay_subscriptions_account_not_connected_product_modal_finish_setup"),r(!0)},__next40pxDefaultSize:!0,children:(0,n.__)("Finish setup","woocommerce-payments")})},w=({onRequestClose:o=()=>{}})=>((0,t.useEffect)(()=>{a("wcpay_subscriptions_account_not_connected_product_modal_view")},[]),(0,p.jsxs)(e.Modal,{className:"wcpay-subscription-product-modal",onRequestClose:()=>{a("wcpay_subscriptions_account_not_connected_product_modal_dismiss"),o()},shouldCloseOnClickOutside:!1,children:[(0,p.jsx)("p",{className:"wcpay-subscription-product-modal__title",children:(0,n.__)("One more step to accept recurring payments","woocommerce-payments")}),(0,p.jsx)("p",{children:(0,n.sprintf)((0,n.__)("Verify your business details with %s to accept recurring payments for this subscription product.","woocommerce-payments"),"WooPayments")}),(0,p.jsx)("p",{className:"wcpay-subscription-product-modal__tos",children:(0,t.createInterpolateElement)((0,n.__)('By clicking "Finish setup", you agree to the <a>Terms of Service</a>',"woocommerce-payments"),{a:(0,p.jsx)(e.ExternalLink,{href:"https://wordpress.com/tos/"})})}),(0,p.jsxs)("div",{className:"wcpay-subscription-product-modal__footer",children:[(0,p.jsxs)("div",{className:"wcpay-subscription-product-modal__saved-indicator",children:[(0,p.jsx)(e.Icon,{icon:"saved"}),(0,p.jsx)("p",{children:(0,n.__)("We’ve saved your product as a draft.","woocommerce-payments")})]}),(0,p.jsx)(u,{})]})]}));(0,r.registerPlugin)("wcpay-subscription-product-onboarding-modal",{icon:null,render:()=>{const[e,o]=(0,t.useState)(!0);return(0,t.useEffect)(()=>{window?.history&&window.history.replaceState(null,null,(0,s.removeQueryArgs)(window.location.href,"wcpay-subscription-saved-as-draft"))},[]),e?(0,p.jsx)(w,{onRequestClose:()=>{o(!1)}}):null},scope:l})})()})();