@evervault/js 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ let t = null;
2
+ async function i() {
3
+ return t || (t = new Promise((n, r) => {
4
+ const e = document.createElement("script");
5
+ if (e.src = "https://js.evervault.com/v2", e.onload = () => n(), e.onerror = () => {
6
+ t = null, r();
7
+ }, !document.head)
8
+ throw new Error(
9
+ "Expected document.head not to be null. Evervault.js requires a <head> element."
10
+ );
11
+ document.head.appendChild(e);
12
+ }), t);
13
+ }
14
+ async function o() {
15
+ if (window.Evervault)
16
+ return window.Evervault;
17
+ try {
18
+ return await i(), window.Evervault;
19
+ } catch {
20
+ throw new Error("Failed to load Evervault.js");
21
+ }
22
+ }
23
+ async function l(n, r, e) {
24
+ const a = await o();
25
+ return new a(n, r, e);
26
+ }
27
+ Promise.resolve().then(() => {
28
+ o();
29
+ });
30
+ export {
31
+ l as loadEvervault
32
+ };
@@ -0,0 +1 @@
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Evervault={}))})(this,function(t){"use strict";let e=null;async function u(){return e||(e=new Promise((o,r)=>{const n=document.createElement("script");if(n.src="https://js.evervault.com/v2",n.onload=()=>o(),n.onerror=()=>{e=null,r()},!document.head)throw new Error("Expected document.head not to be null. Evervault.js requires a <head> element.");document.head.appendChild(n)}),e)}async function i(){if(window.Evervault)return window.Evervault;try{return await u(),window.Evervault}catch{throw new Error("Failed to load Evervault.js")}}async function l(o,r,n){const a=await i();return new a(o,r,n)}Promise.resolve().then(()=>{i()}),t.loadEvervault=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});