import{t as e}from"./chunk.DDzo97j7.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.mcaptchaGlue=r():n.mcaptchaGlue=r()})(self,(()=>{return e={44:function(e){e.exports=(()=>{var e={};return{607:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);function r(){this.constructor=e}n(e,t),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,`__esModule`,{value:!0}),t.ConfigurationError=void 0;var i=function(e){function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.message=`Provide either widget link or site key to display mCaptcha widget`,t}return r(t,e),t}(Error);t.ConfigurationError=i,t.default=function(){function e(e,t){var n=this;if(this.handle=function(e){console.log(`message received from ${e.origin} with data: ${e.data.token}`),new URL(e.origin).host==n.widgetLink.host?n.updateState(e.data.token):console.error(`expected message from ${n.widgetLink.host} but received message from ${e.origin}. Aborting.`)},this.updateState=t,e.widgetLink&&e.siteKey)throw new i;if(e.widgetLink)this.widgetLink=e.widgetLink;else{if(!e.siteKey)throw new i;e.siteKey.instanceUrl?(this.widgetLink=e.siteKey.instanceUrl,this.widgetLink.pathname=`/widget/`,this.widgetLink.search=`?sitekey=${e.siteKey.key}`):this.widgetLink=new URL(`https://demo.mcaptcha.org/widget/?sitekey=${e.siteKey.key}`)}}return e.prototype.listen=function(){window.addEventListener(`message`,this.handle)},e.prototype.destroy=function(){window.removeEventListener(`message`,this.handle)},e}()}}[607](0,e),e})()},607:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.ConfigurationError=t.ID=t.INPUT_NAME=void 0;var i=n(44);Object.defineProperty(t,`ConfigurationError`,{enumerable:!0,get:function(){return i.ConfigurationError}});var a=r(n(44));t.INPUT_NAME=`mcaptcha__token`,t.ID=`mcaptcha__widget-container`,t.default=function(e){var n=this;this.setToken=function(e){return n.inputElement.value=e},this.receiver=new a.default(e,this.setToken),this.receiver.listen();var r=document.getElementById(t.ID);if(r==null)throw Error(`Element ${t.ID}'s parent element is undefined`);this.inputElement=document.createElement(`input`),this.inputElement.id=t.INPUT_NAME,this.inputElement.name=t.INPUT_NAME,this.inputElement.hidden=!0,this.inputElement.required=!0,r.appendChild(this.inputElement);var i=`mcaptcha-widget__iframe`,o=document.createElement(`iframe`);o.title=`mCaptcha`,o.src=this.receiver.widgetLink.toString(),o.ariaRoleDescription=`presentation`,o.name=i,o.id=i,o.scrolling=`no`;try{o.sandbox=`allow-same-origin allow-scripts allow-popups`}catch{try{o.sandbox.add(`allow-same-origin`),o.sandbox.add(`allow-scripts`),o.sandbox.add(`allow-popups`)}catch{o.setAttribute(`sandbox`,`allow-same-origin allow-scripts allow-popups`)}}o.width=`100%`,o.height=`100%`,o.frameBorder=`0`,r.appendChild(o)}}},t={},function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}(607);var e,t}))}));export default t();
//# sourceMappingURL=dist.BFsIwlVp.js.map