"use strict";(self.webpackChunkrichie_education=self.webpackChunkrichie_education||[]).push([[52042],{52042:function(e,n,t){t.r(n),t(26364),t(86632),t(10853),t(61928),t(54883),t(45007),t(68995);var o=t(89526),r=t(39354),a=t(87485);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}n.default=function(e){var n=e.url,t=e.onSuccess,c=e.onError,i=function(e){"string"==typeof e.data?"closePayPlugFrame"===e.data&&c(r.k.ERROR_ABORTING):"object"===u(e.data)?"paidByPayPlug"===e.data.event&&(window.Payplug._closeIframe(),t()):(0,a.p)("[PayplugLightbox] - Unknown message type posted.")},s=(0,o.useCallback)((function(){window.Payplug.showPayment(n),window.addEventListener("message",i)}),[n]);return(0,o.useEffect)((function(){if(window.Payplug)s();else{var e=document.createElement("script");e.src="https://api.payplug.com/js/1/form.latest.js",e.async=!0,document.body.appendChild(e),e.onload=s,e.onerror=function(){return c(r.k.ERROR_DEFAULT)}}return function(){window.removeEventListener("message",i)}}),[]),null}}}]);
//# sourceMappingURL=52042.d9f8ff7759d4bccc6bd1.index.js.map