/*! For license information please see subscription-product-onboarding-modal.js.LICENSE.txt */
(()=>{var e={1020:(e,t,o)=>{"use strict";var r=o(1609),n=Symbol.for("react.element"),s=(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)s.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:n,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 n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.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,n=window.wp.url,s=window.wp.i18n,c=window.wp.domReady;var i=o.n(c);const a=(e,t={})=>{var o;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:null===(o=wcpaySettings.trackingInfo)||void 0===o?void 0:o.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}i()((()=>{var o,r;(null!==(r=null===(o=null===wc||void 0===wc?void 0:wc.tracks)||void 0===o?void 0:o.recordEvent)&&void 0!==r?r:wcTracks.recordEvent)(e,t)}))};var p=o(4848);const{connectUrl:d,pluginScope:u}=window.wcpaySubscriptionProductOnboardingModal,l=()=>{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,s.__)("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,s.__)("One more step to accept recurring payments","woocommerce-payments")}),(0,p.jsx)("p",{children:(0,s.sprintf)((0,s.__)("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,s.__)('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,s.__)("We’ve saved your product as a draft.","woocommerce-payments")})]}),(0,p.jsx)(l,{})]})]}));(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,n.removeQueryArgs)(window.location.href,"wcpay-subscription-saved-as-draft"))}),[]),e?(0,p.jsx)(w,{onRequestClose:()=>{o(!1)}}):null},scope:u})})()})();