subscription-product-onboarding-toast.js
1.23 KB
!function(){var o={};o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(o){if("object"==typeof window)return window}}(),function(){var t;o.g.importScripts&&(t=o.g.location+"");var r=o.g.document;if(!t&&r&&(r.currentScript&&(t=r.currentScript.src),!t)){var n=r.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t}(),o.p=window.wcpayAssets.url,function(){"use strict";var o=window.wp.data,t=window.wp.element,r=window.wp.plugins,n=window.wp.url,e=window.wp.i18n;const{pluginScope:i}=window.wcpaySubscriptionProductOnboardingToast;(0,r.registerPlugin)("wcpay-subscription-product-onboarding-toast",{icon:null,render:()=>{const{createInfoNotice:r}=(0,o.useDispatch)("core/notices");return(0,t.useEffect)((()=>{var o;null!==(o=window)&&void 0!==o&&o.history&&window.history.replaceState(null,null,(0,n.removeQueryArgs)(window.location.href,"wcpay-subscriptions-onboarded")),r((0,e.__)("Thank you for setting up WooCommerce Payments! We’ve published your first subscription product.","woocommerce-payments"))}),[r]),null},scope:i})}()}();