@wf-financing/ui-sdk 0.1.2 → 0.1.3

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.
@@ -1 +1 @@
1
- export declare const UI_PACKAGE_URL = "https://unpkg.com/@wf-financing/ui@1/dist/index.es.js";
1
+ export declare const UI_PACKAGE_URL = "https://cdn.jsdelivr.net/npm/@wf-financing/ui@1/dist/index.es.js";
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(i=>(i.NO_CTA="no_cta",i.CONTINUE_APPLICATION="continue_application",i.GENERIC_NEW_APPLICATION="generic_new_application",i.INDICATIVE_NEW_APPLICATION="indicative_new_application",i))(l||{});const c="wayflyer-ui-package",w="https://unpkg.com/@wf-financing/ui@1/dist/index.es.js",s=(i,e,a,n,o)=>{if(!window.WayflyerUiCtaSdk)throw new Error("Failed to load WayflyerUiCtaSdk from the script.");const t=window.WayflyerUiCtaSdk;return new t(i,e,a,n,o)},d=(i,e,a,n,o,t)=>new Promise((r,y)=>{i.onload=()=>{try{r(s(e,a,n,o,t))}catch(S){y(S)}}}),f=async(i,e,a,n,o)=>{try{const t=document.getElementById(c);if(window.WayflyerUiCtaSdk)return s(i,e,a,n,o);if(t)return d(t,i,e,a,n,o);const r=document.createElement("script");return r.src=w,r.type="module",r.id=c,r.async=!0,document.head.appendChild(r),d(r,i,e,a,n,o)}catch(t){throw console.error("Error in loading headless SDK:",t),new Error("Failed to load script")}};class u{static async loadSdk(e,a,n,o,t){return await f(e,a,n,o,t)}}exports.SdkScenarios=l;exports.WayflyerUiSdk=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(i=>(i.NO_CTA="no_cta",i.CONTINUE_APPLICATION="continue_application",i.GENERIC_NEW_APPLICATION="generic_new_application",i.INDICATIVE_NEW_APPLICATION="indicative_new_application",i))(l||{});const d="wayflyer-ui-package",w="https://cdn.jsdelivr.net/npm/@wf-financing/ui@1/dist/index.es.js",s=(i,r,n,a,o)=>{if(!window.WayflyerUiCtaSdk)throw new Error("Failed to load WayflyerUiCtaSdk from the script.");const t=window.WayflyerUiCtaSdk;return new t(i,r,n,a,o)},c=(i,r,n,a,o,t)=>new Promise((e,y)=>{i.onload=()=>{try{e(s(r,n,a,o,t))}catch(S){y(S)}}}),f=async(i,r,n,a,o)=>{try{const t=document.getElementById(d);if(window.WayflyerUiCtaSdk)return s(i,r,n,a,o);if(t)return c(t,i,r,n,a,o);const e=document.createElement("script");return e.src=w,e.type="module",e.id=d,e.async=!0,document.head.appendChild(e),c(e,i,r,n,a,o)}catch(t){throw console.error("Error in loading headless SDK:",t),new Error("Failed to load script")}};class u{static async loadSdk(r,n,a,o,t){return await f(r,n,a,o,t)}}exports.SdkScenarios=l;exports.WayflyerUiSdk=u;
package/dist/index.es.js CHANGED
@@ -1,40 +1,40 @@
1
1
  var w = /* @__PURE__ */ ((i) => (i.NO_CTA = "no_cta", i.CONTINUE_APPLICATION = "continue_application", i.GENERIC_NEW_APPLICATION = "generic_new_application", i.INDICATIVE_NEW_APPLICATION = "indicative_new_application", i))(w || {});
2
- const c = "wayflyer-ui-package", S = "https://unpkg.com/@wf-financing/ui@1/dist/index.es.js", s = (i, e, a, n, o) => {
2
+ const c = "wayflyer-ui-package", S = "https://cdn.jsdelivr.net/npm/@wf-financing/ui@1/dist/index.es.js", s = (i, e, n, a, o) => {
3
3
  if (!window.WayflyerUiCtaSdk)
4
4
  throw new Error("Failed to load WayflyerUiCtaSdk from the script.");
5
5
  const t = window.WayflyerUiCtaSdk;
6
- return new t(i, e, a, n, o);
7
- }, d = (i, e, a, n, o, t) => new Promise((r, l) => {
6
+ return new t(i, e, n, a, o);
7
+ }, d = (i, e, n, a, o, t) => new Promise((r, l) => {
8
8
  i.onload = () => {
9
9
  try {
10
- r(s(e, a, n, o, t));
10
+ r(s(e, n, a, o, t));
11
11
  } catch (y) {
12
12
  l(y);
13
13
  }
14
14
  };
15
- }), f = async (i, e, a, n, o) => {
15
+ }), f = async (i, e, n, a, o) => {
16
16
  try {
17
17
  const t = document.getElementById(c);
18
18
  if (window.WayflyerUiCtaSdk)
19
- return s(i, e, a, n, o);
19
+ return s(i, e, n, a, o);
20
20
  if (t)
21
21
  return d(
22
22
  t,
23
23
  i,
24
24
  e,
25
- a,
26
25
  n,
26
+ a,
27
27
  o
28
28
  );
29
29
  const r = document.createElement("script");
30
- return r.src = S, r.type = "module", r.id = c, r.async = !0, document.head.appendChild(r), d(r, i, e, a, n, o);
30
+ return r.src = S, r.type = "module", r.id = c, r.async = !0, document.head.appendChild(r), d(r, i, e, n, a, o);
31
31
  } catch (t) {
32
32
  throw console.error("Error in loading headless SDK:", t), new Error("Failed to load script");
33
33
  }
34
34
  };
35
35
  class C {
36
- static async loadSdk(e, a, n, o, t) {
37
- return await f(e, a, n, o, t);
36
+ static async loadSdk(e, n, a, o, t) {
37
+ return await f(e, n, a, o, t);
38
38
  }
39
39
  }
40
40
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wf-financing/ui-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",