@sesamy/sesamy-js 1.23.0 → 1.23.1
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.
- package/dist/sesamy-js.cjs +1 -1
- package/dist/sesamy-js.iife.js +1 -1
- package/dist/sesamy-js.mjs +7 -4
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw
|
|
|
14
14
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
|
-
`,document.head.appendChild(i)}async function Rh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function VE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await Rh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function ZE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await Rh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function JE({enabled:e=!1,rules:t}){if(!e)return;const r=await Rr(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await VE(s,a);break;case"replace":await ZE(s,a);break;case"remove":o.remove();break;case"gradient":WE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const Tl="access_token";function YE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(Tl);if(t){Yd(t);const r=new URL(window.location.href);e.delete(Tl),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const Pl="sesamy-refresh",El="force-refetch-entitlements";function XE(){const e=new URLSearchParams(window.location.search),t=e.get(El),r=e.get(Pl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(El),e.delete(Pl),n.search=e.toString(),ke(),window.history.replaceState(null,"",n)}}function qE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function QE(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=qE(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};gP(f)}catch(s){he(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const Ol="sesamy-user";async function eO(){var a;const t=(a=new URLSearchParams(window.location.search).get(Ol))==null?void 0:a.toLowerCase();if(!t)return;const r=await nP();(r==null?void 0:r.email)!==t?(he(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),ke(),as({authorizationParams:{email_hint:t,login_hint:t}})):he(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(Ol),window.history.replaceState(null,"",n)}const kl="sesamy-purchase";function tO(){const e=new URLSearchParams(window.location.search),t=e.get(kl);if(t!==null){const r=new URL(window.location.href);e.delete(kl),r.search=e.toString(),console.log("purchase",t),We(ve.PURCHASE,{itemSrc:t}),ke(),window.history.replaceState(null,"",r)}}const _l="sesamy-login",rO="sesamy_login";async function nO(){const e=new URLSearchParams(window.location.search);if(!(e.get(_l)||e.get(rO)))return;await Rr()||as();const n=new URL(window.location.href);n.searchParams.delete(_l),window.history.replaceState(null,"",n)}const Rl="sesamy-debug";async function aO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Rl))==null?void 0:n.toLowerCase();if(!t)return;PT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Rl),window.history.replaceState(null,"",r)}const iO=typeof window<"u";async function Cl(e){he(`Init with config: ${JSON.stringify(e)}`);try{AE({clientId:e.clientId,environment:e.environment,...e.analytics}),await rP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),FE(e),e.transform&&await JE(e.transform),aO(),YE(),XE(),QE(),await nO(),await eO(),tO(),We(ve.READY,{})}catch(t){he(`Failed to init ${t.message}`)}}async function Ch(e){
|
|
17
|
+
`,document.head.appendChild(i)}async function Rh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function VE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await Rh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function ZE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await Rh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function JE({enabled:e=!1,rules:t}){if(!e)return;const r=await Rr(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await VE(s,a);break;case"replace":await ZE(s,a);break;case"remove":o.remove();break;case"gradient":WE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const Tl="access_token";function YE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(Tl);if(t){Yd(t);const r=new URL(window.location.href);e.delete(Tl),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const Pl="sesamy-refresh",El="force-refetch-entitlements";function XE(){const e=new URLSearchParams(window.location.search),t=e.get(El),r=e.get(Pl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(El),e.delete(Pl),n.search=e.toString(),ke(),window.history.replaceState(null,"",n)}}function qE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function QE(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=qE(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};gP(f)}catch(s){he(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const Ol="sesamy-user";async function eO(){var a;const t=(a=new URLSearchParams(window.location.search).get(Ol))==null?void 0:a.toLowerCase();if(!t)return;const r=await nP();(r==null?void 0:r.email)!==t?(he(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),ke(),as({authorizationParams:{email_hint:t,login_hint:t}})):he(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(Ol),window.history.replaceState(null,"",n)}const kl="sesamy-purchase";function tO(){const e=new URLSearchParams(window.location.search),t=e.get(kl);if(t!==null){const r=new URL(window.location.href);e.delete(kl),r.search=e.toString(),console.log("purchase",t),We(ve.PURCHASE,{itemSrc:t}),ke(),window.history.replaceState(null,"",r)}}const _l="sesamy-login",rO="sesamy_login";async function nO(){const e=new URLSearchParams(window.location.search);if(!(e.get(_l)||e.get(rO)))return;await Rr()||as();const n=new URL(window.location.href);n.searchParams.delete(_l),window.history.replaceState(null,"",n)}const Rl="sesamy-debug";async function aO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Rl))==null?void 0:n.toLowerCase();if(!t)return;PT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Rl),window.history.replaceState(null,"",r)}const iO=typeof window<"u";async function Cl(e){he(`Init with config: ${JSON.stringify(e)}`);try{AE({clientId:e.clientId,environment:e.environment,...e.analytics}),await rP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),FE(e),e.transform&&await JE(e.transform),aO(),YE(),XE(),QE(),await nO(),await eO(),tO(),We(ve.READY,{})}catch(t){he(`Failed to init ${t.message}`)}}async function Ch(e){var n;he("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(typeof window<"u"&&t in window)return he("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=GE({clientId:e.clientId,environment:e.environment,...e.api});return iO&&(e.awaitAllServices?await Cl(e):Cl(e)),r}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Ch(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Ch;
|
package/dist/sesamy-js.iife.js
CHANGED
|
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw
|
|
|
14
14
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
|
-
`,document.head.appendChild(i)}async function mh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function HE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await mh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function GE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await mh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function KE({enabled:e=!1,rules:t}){if(!e)return;const r=await Lr(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await HE(s,a);break;case"replace":await GE(s,a);break;case"remove":o.remove();break;case"gradient":zE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const gh="access_token";function WE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(gh);if(t){ed(t);const r=new URL(window.location.href);e.delete(gh),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const yh="sesamy-refresh",wh="force-refetch-entitlements";function VE(){const e=new URLSearchParams(window.location.search),t=e.get(wh),r=e.get(yh);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(wh),e.delete(yh),n.search=e.toString(),je(),window.history.replaceState(null,"",n)}}function ZE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function JE(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=ZE(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};hP(f)}catch(s){fe(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const bh="sesamy-user";async function YE(){var a;const t=(a=new URLSearchParams(window.location.search).get(bh))==null?void 0:a.toLowerCase();if(!t)return;const r=await QT();(r==null?void 0:r.email)!==t?(fe(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),je(),Go({authorizationParams:{email_hint:t,login_hint:t}})):fe(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(bh),window.history.replaceState(null,"",n)}const Sh="sesamy-purchase";function XE(){const e=new URLSearchParams(window.location.search),t=e.get(Sh);if(t!==null){const r=new URL(window.location.href);e.delete(Sh),r.search=e.toString(),console.log("purchase",t),Ge(he.PURCHASE,{itemSrc:t}),je(),window.history.replaceState(null,"",r)}}const $h="sesamy-login",qE="sesamy_login";async function QE(){const e=new URLSearchParams(window.location.search);if(!(e.get($h)||e.get(qE)))return;await Lr()||Go();const n=new URL(window.location.href);n.searchParams.delete($h),window.history.replaceState(null,"",n)}const Ih="sesamy-debug";async function eO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Ih))==null?void 0:n.toLowerCase();if(!t)return;ST(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Ih),window.history.replaceState(null,"",r)}const tO=typeof window<"u";async function Th(e){fe(`Init with config: ${JSON.stringify(e)}`);try{kE({clientId:e.clientId,environment:e.environment,...e.analytics}),await qT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),NE(e),e.transform&&await KE(e.transform),eO(),WE(),VE(),JE(),await QE(),await YE(),XE(),Ge(he.READY,{})}catch(t){fe(`Failed to init ${t.message}`)}}async function Ph(e){
|
|
17
|
+
`,document.head.appendChild(i)}async function mh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function HE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await mh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function GE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await mh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function KE({enabled:e=!1,rules:t}){if(!e)return;const r=await Lr(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await HE(s,a);break;case"replace":await GE(s,a);break;case"remove":o.remove();break;case"gradient":zE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const gh="access_token";function WE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(gh);if(t){ed(t);const r=new URL(window.location.href);e.delete(gh),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const yh="sesamy-refresh",wh="force-refetch-entitlements";function VE(){const e=new URLSearchParams(window.location.search),t=e.get(wh),r=e.get(yh);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(wh),e.delete(yh),n.search=e.toString(),je(),window.history.replaceState(null,"",n)}}function ZE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function JE(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=ZE(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};hP(f)}catch(s){fe(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const bh="sesamy-user";async function YE(){var a;const t=(a=new URLSearchParams(window.location.search).get(bh))==null?void 0:a.toLowerCase();if(!t)return;const r=await QT();(r==null?void 0:r.email)!==t?(fe(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),je(),Go({authorizationParams:{email_hint:t,login_hint:t}})):fe(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(bh),window.history.replaceState(null,"",n)}const Sh="sesamy-purchase";function XE(){const e=new URLSearchParams(window.location.search),t=e.get(Sh);if(t!==null){const r=new URL(window.location.href);e.delete(Sh),r.search=e.toString(),console.log("purchase",t),Ge(he.PURCHASE,{itemSrc:t}),je(),window.history.replaceState(null,"",r)}}const $h="sesamy-login",qE="sesamy_login";async function QE(){const e=new URLSearchParams(window.location.search);if(!(e.get($h)||e.get(qE)))return;await Lr()||Go();const n=new URL(window.location.href);n.searchParams.delete($h),window.history.replaceState(null,"",n)}const Ih="sesamy-debug";async function eO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Ih))==null?void 0:n.toLowerCase();if(!t)return;ST(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Ih),window.history.replaceState(null,"",r)}const tO=typeof window<"u";async function Th(e){fe(`Init with config: ${JSON.stringify(e)}`);try{kE({clientId:e.clientId,environment:e.environment,...e.analytics}),await qT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),NE(e),e.transform&&await KE(e.transform),eO(),WE(),VE(),JE(),await QE(),await YE(),XE(),Ge(he.READY,{})}catch(t){fe(`Failed to init ${t.message}`)}}async function Ph(e){var n;fe("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(typeof window<"u"&&t in window)return fe("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=FE({clientId:e.clientId,environment:e.environment,...e.api});return tO&&(e.awaitAllServices?await Th(e):Th(e)),r}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Ph(t)}catch(t){console.error("Failed to parse config",t)}}return Fe.init=Ph,Object.defineProperty(Fe,Symbol.toStringTag,{value:"Module"}),Fe}({});
|
package/dist/sesamy-js.mjs
CHANGED
|
@@ -5880,10 +5880,13 @@ async function Cl(e) {
|
|
|
5880
5880
|
}
|
|
5881
5881
|
}
|
|
5882
5882
|
async function iO(e) {
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
const t =
|
|
5886
|
-
|
|
5883
|
+
var n;
|
|
5884
|
+
he("Initializing Sesamy");
|
|
5885
|
+
const t = ((n = e.api) == null ? void 0 : n.namespace) || "sesamy";
|
|
5886
|
+
if (typeof window < "u" && t in window)
|
|
5887
|
+
return he("Sesamy already initialized. This is likely due to a duplicate import"), window[t];
|
|
5888
|
+
const r = HE({ clientId: e.clientId, environment: e.environment, ...e.api });
|
|
5889
|
+
return aO && (e.awaitAllServices ? await Cl(e) : Cl(e)), r;
|
|
5887
5890
|
}
|
|
5888
5891
|
if (typeof document < "u") {
|
|
5889
5892
|
const e = document.getElementById("sesamy-js");
|