← Back
Editing: subscription-product-onboarding-modal.js
(()=>{var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var s in o)e.o(o,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:o[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var o=globalThis.document;if(!t&&o&&(o.currentScript&&"SCRIPT"===o.currentScript.tagName.toUpperCase()&&(t=o.currentScript.src),!t)){var s=o.getElementsByTagName("script");if(s.length)for(var c=s.length-1;c>-1&&(!t||!/^http(s?):/.test(t));)t=s[c--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";window.React;const t=window.wp.components,o=window.wp.element,s=window.wp.plugins,c=window.wp.url,n=window.wp.i18n,r=window.wp.domReady;var i=e.n(r);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)})},p=window.ReactJSXRuntime,{connectUrl:d,pluginScope:l}=window.wcpaySubscriptionProductOnboardingModal,u=()=>{const[e,s]=(0,o.useState)(!1);return(0,p.jsx)(t.Button,{disabled:e,href:d,isBusy:e,variant:"primary",onClick:()=>{a("wcpay_subscriptions_account_not_connected_product_modal_finish_setup"),s(!0)},__next40pxDefaultSize:!0,children:(0,n.__)("Finish setup","woocommerce-payments")})},w=({onRequestClose:e=()=>{}})=>((0,o.useEffect)(()=>{a("wcpay_subscriptions_account_not_connected_product_modal_view")},[]),(0,p.jsxs)(t.Modal,{className:"wcpay-subscription-product-modal",onRequestClose:()=>{a("wcpay_subscriptions_account_not_connected_product_modal_dismiss"),e()},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,o.createInterpolateElement)((0,n.__)('By clicking "Finish setup", you agree to the <a>Terms of Service</a>',"woocommerce-payments"),{a:(0,p.jsx)(t.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)(t.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,s.registerPlugin)("wcpay-subscription-product-onboarding-modal",{icon:null,render:()=>{const[e,t]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{window?.history&&window.history.replaceState(null,null,(0,c.removeQueryArgs)(window.location.href,"wcpay-subscription-saved-as-draft"))},[]),e?(0,p.jsx)(w,{onRequestClose:()=>{t(!1)}}):null},scope:l})})()})();
Save File
Cancel